prec/psb_d_bjacprec.f03

Fixed new preconditioner interface, seems to be working.
psblas3-type-indexed
Salvatore Filippone 15 years ago
parent 390cbda059
commit f3fd67a2ee

@ -115,23 +115,22 @@ contains
select case(trans_) select case(trans_)
case('N') case('N')
call psb_spsm(done,prec%av(psb_l_pr_),x,dzero,ww,desc_data,info,& call psb_spsm(done,prec%av(psb_l_pr_),x,dzero,ww,desc_data,info,&
& trans=trans_,scale='L',diag=prec%d,choice=psb_none_,work=aux) & trans=trans_,scale='L',diag=prec%d,choice=psb_none_,work=aux)
if(info /=0) goto 9999 if(info ==0) call psb_spsm(alpha,prec%av(psb_u_pr_),ww,beta,y,desc_data,info,&
call psb_spsm(alpha,prec%av(psb_u_pr_),ww,beta,y,desc_data,info,&
& trans=trans_,scale='U',choice=psb_none_, work=aux) & trans=trans_,scale='U',choice=psb_none_, work=aux)
if(info /=0) goto 9999
case('T','C') case('T','C')
call psb_spsm(done,prec%av(psb_u_pr_),x,dzero,ww,desc_data,info,& call psb_spsm(done,prec%av(psb_u_pr_),x,dzero,ww,desc_data,info,&
& trans=trans_,scale='L',diag=prec%d,choice=psb_none_, work=aux) & trans=trans_,scale='L',diag=prec%d,choice=psb_none_, work=aux)
if(info /=0) goto 9999 if(info ==0) call psb_spsm(alpha,prec%av(psb_l_pr_),ww,beta,y,desc_data,info,&
call psb_spsm(alpha,prec%av(psb_l_pr_),ww,beta,y,desc_data,info,&
& trans=trans_,scale='U',choice=psb_none_,work=aux) & trans=trans_,scale='U',choice=psb_none_,work=aux)
if(info /=0) goto 9999
end select end select
if (info /=0) then
ch_err="psb_spsm"
goto 9999
end if
case default case default
@ -218,7 +217,7 @@ contains
integer, intent(out) :: info integer, intent(out) :: info
character, intent(in), optional :: upd character, intent(in), optional :: upd
! .. Local Scalars .. ! .. Local Scalars ..
integer :: i, m integer :: i, m
integer :: int_err(5) integer :: int_err(5)
character :: trans, unitd character :: trans, unitd
@ -230,118 +229,124 @@ contains
character(len=20) :: ch_err character(len=20) :: ch_err
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
info = 0 info = 0
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ictxt=psb_cd_get_context(desc_a) ictxt=psb_cd_get_context(desc_a)
call psb_info(ictxt, me, np) call psb_info(ictxt, me, np)
m = a%get_nrows() m = a%get_nrows()
if (m < 0) then if (m < 0) then
info = 10 info = 10
int_err(1) = 1 int_err(1) = 1
int_err(2) = m int_err(2) = m
call psb_errpush(info,name,i_err=int_err) call psb_errpush(info,name,i_err=int_err)
goto 9999 goto 9999
endif endif
trans = 'N' trans = 'N'
unitd = 'U' unitd = 'U'
select case(prec%iprcparm(psb_f_type_)) select case(prec%iprcparm(psb_f_type_))
case(psb_f_ilu_n_) case(psb_f_ilu_n_)
if (allocated(prec%av)) then if (allocated(prec%av)) then
if (size(prec%av) < psb_bp_ilu_avsz) then if (size(prec%av) < psb_bp_ilu_avsz) then
do i=1,size(prec%av) do i=1,size(prec%av)
call prec%av(i)%free() call prec%av(i)%free()
enddo enddo
deallocate(prec%av,stat=info) deallocate(prec%av,stat=info)
endif endif
end if
if (.not.allocated(prec%av)) then
allocate(prec%av(psb_max_avsz),stat=info)
if (info /= 0) then
call psb_errpush(4000,name)
goto 9999
end if end if
endif if (.not.allocated(prec%av)) then
allocate(prec%av(psb_max_avsz),stat=info)
if (info /= 0) then
call psb_errpush(4000,name)
goto 9999
end if
endif
nrow_a = psb_cd_get_local_rows(desc_a) nrow_a = psb_cd_get_local_rows(desc_a)
nztota = a%get_nzeros() nztota = a%get_nzeros()
n_col = psb_cd_get_local_cols(desc_a) n_col = psb_cd_get_local_cols(desc_a)
nhalo = n_col-nrow_a nhalo = n_col-nrow_a
n_row = nrow_a n_row = nrow_a
allocate(lf,uf,stat=info) allocate(lf,uf,stat=info)
if (info == 0) call lf%allocate(n_row,n_row,nztota) if (info == 0) call lf%allocate(n_row,n_row,nztota)
if (info == 0) call uf%allocate(n_row,n_row,nztota) if (info == 0) call uf%allocate(n_row,n_row,nztota)
if(info/=0) then if(info/=0) then
info=4010 info=4010
ch_err='psb_sp_all' ch_err='psb_sp_all'
call psb_errpush(info,name,a_err=ch_err) call psb_errpush(info,name,a_err=ch_err)
goto 9999 goto 9999
end if end if
if (allocated(prec%d)) then if (allocated(prec%d)) then
if (size(prec%d) < n_row) then if (size(prec%d) < n_row) then
deallocate(prec%d) deallocate(prec%d)
endif
endif endif
endif if (.not.allocated(prec%d)) then
if (.not.allocated(prec%d)) then allocate(prec%d(n_row),stat=info)
allocate(prec%d(n_row),stat=info) if (info /= 0) then
if (info /= 0) then call psb_errpush(4010,name,a_err='Allocate')
call psb_errpush(4010,name,a_err='Allocate') goto 9999
end if
endif
t3 = psb_wtime()
! This is where we have no renumbering, thus no need
call psb_ilu_fct(a,lf,uf,prec%d,info)
if(info==0) then
call prec%av(psb_l_pr_)%mv_from(lf)
call prec%av(psb_u_pr_)%mv_from(uf)
call prec%av(psb_l_pr_)%set_asb()
call prec%av(psb_u_pr_)%set_asb()
call prec%av(psb_l_pr_)%trim()
call prec%av(psb_u_pr_)%trim()
else
info=4010
ch_err='psb_ilu_fct'
call psb_errpush(info,name,a_err=ch_err)
goto 9999 goto 9999
end if end if
endif !!$ call prec%av(psb_l_pr_)%print(30+me)
t3 = psb_wtime() !!$ call prec%av(psb_u_pr_)%print(40+me)
! This is where we have no renumbering, thus no need !!$ do i=1,n_row
call psb_ilu_fct(a,lf,uf,prec%d,info) !!$ write(50+me,*) i,prec%d(i)
!!$ end do
if(info==0) then
call prec%av(psb_l_pr_)%mv_from(lf) case(psb_f_none_)
call prec%av(psb_u_pr_)%mv_from(uf)
call prec%av(psb_l_pr_)%set_asb()
call prec%av(psb_u_pr_)%set_asb()
call prec%av(psb_l_pr_)%trim()
call prec%av(psb_u_pr_)%trim()
else
info=4010 info=4010
ch_err='psb_ilu_fct' ch_err='Inconsistent prec psb_f_none_'
call psb_errpush(info,name,a_err=ch_err) call psb_errpush(info,name,a_err=ch_err)
goto 9999 goto 9999
end if
case(psb_f_none_) case default
info=4010 info=4010
ch_err='Inconsistent prec psb_f_none_' ch_err='Unknown psb_f_type_'
call psb_errpush(info,name,a_err=ch_err) call psb_errpush(info,name,a_err=ch_err)
goto 9999 goto 9999
end select
case default
info=4010
ch_err='Unknown psb_f_type_'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end select
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
9999 continue 9999 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then if (err_act == psb_act_abort_) then
call psb_error() call psb_error()
return
end if
return return
end if
return
end subroutine d_bjac_precbld end subroutine d_bjac_precbld

Loading…
Cancel
Save