Krylov methods.

Fixed header for convergence tracing messages.
psblas3-type-indexed
Salvatore Filippone 17 years ago
parent 7dea81e732
commit 4facb7505f

@ -215,7 +215,7 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
itx = 0 itx = 0
call psb_init_conv(istop_,itrace_,a,b,eps,desc_a,stopdat,info) call psb_init_conv(methdname,istop_,itrace_,a,b,eps,desc_a,stopdat,info)
if (info /= 0) Then if (info /= 0) Then
call psb_errpush(4011,name) call psb_errpush(4011,name)
goto 9999 goto 9999

@ -202,7 +202,7 @@ subroutine psb_dcg(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
rho = dzero rho = dzero
call psb_init_conv(istop_,itrace_,a,b,eps,desc_a,stopdat,info) call psb_init_conv(methdname,istop_,itrace_,a,b,eps,desc_a,stopdat,info)
if (info /= 0) Then if (info /= 0) Then
call psb_errpush(4011,name) call psb_errpush(4011,name)
goto 9999 goto 9999

@ -193,7 +193,7 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
itx = 0 itx = 0
call psb_init_conv(istop_,itrace_,a,b,eps,desc_a,stopdat,info) call psb_init_conv(methdname,istop_,itrace_,a,b,eps,desc_a,stopdat,info)
if (info /= 0) Then if (info /= 0) Then
call psb_errpush(4011,name) call psb_errpush(4011,name)
goto 9999 goto 9999

@ -223,7 +223,7 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
call psb_set_coher(ictxt,isvch) call psb_set_coher(ictxt,isvch)
itx = 0 itx = 0
call psb_init_conv(istop_,itrace_,a,b,eps,desc_a,stopdat,info) call psb_init_conv(methdname,istop_,itrace_,a,b,eps,desc_a,stopdat,info)
if (info /= 0) Then if (info /= 0) Then
call psb_errpush(4011,name) call psb_errpush(4011,name)
goto 9999 goto 9999

@ -488,9 +488,10 @@ contains
subroutine psb_d_init_conv(stopc,trace,a,b,eps,desc_a,stopdat,info) subroutine psb_d_init_conv(methdname,stopc,trace,a,b,eps,desc_a,stopdat,info)
use psb_base_mod use psb_base_mod
implicit none implicit none
character(len=*), intent(in) :: methdname
integer, intent(in) :: stopc, trace integer, intent(in) :: stopc, trace
type(psb_dspmat_type), intent(in) :: a type(psb_dspmat_type), intent(in) :: a
real(kind(1.d0)), intent(in) :: b(:), eps real(kind(1.d0)), intent(in) :: b(:), eps
@ -499,6 +500,10 @@ contains
integer, intent(out) :: info integer, intent(out) :: info
integer :: ictxt, me, np, err_act integer :: ictxt, me, np, err_act
character(len=*), parameter :: fmt='(a18,1x,A4,3(2x,A10))'
integer, parameter :: outlen=18
character(len=len(methdname)) :: mname
character(len=outlen) :: outname
character(len=20) :: name character(len=20) :: name
info = 0 info = 0
@ -538,7 +543,13 @@ contains
stopdat%values(errnum_) = dzero stopdat%values(errnum_) = dzero
stopdat%values(errden_) = done stopdat%values(errden_) = done
if (stopdat%controls(trace_) > 0) then
if (me == 0) then
mname = adjustl(trim(methdname))
write(outname,'(a)') mname(1:min(len_trim(mname),outlen-1))//':'
write(*,fmt) adjustl(outname),'Iter','Conv. Ind.','Epsilon'
endif
end if
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
@ -551,9 +562,10 @@ contains
end subroutine psb_d_init_conv end subroutine psb_d_init_conv
subroutine psb_z_init_conv(stopc,trace,a,b,eps,desc_a,stopdat,info) subroutine psb_z_init_conv(methdname,stopc,trace,a,b,eps,desc_a,stopdat,info)
use psb_base_mod use psb_base_mod
implicit none implicit none
character(len=*), intent(in) :: methdname
integer, intent(in) :: stopc, trace integer, intent(in) :: stopc, trace
type(psb_zspmat_type), intent(in) :: a type(psb_zspmat_type), intent(in) :: a
complex(kind(1.d0)), intent(in) :: b(:) complex(kind(1.d0)), intent(in) :: b(:)
@ -563,6 +575,10 @@ contains
integer, intent(out) :: info integer, intent(out) :: info
integer :: ictxt, me, np, err_act integer :: ictxt, me, np, err_act
character(len=*), parameter :: fmt='(a18,1x,A4,3(2x,A10))'
integer, parameter :: outlen=18
character(len=len(methdname)) :: mname
character(len=outlen) :: outname
character(len=20) :: name character(len=20) :: name
info = 0 info = 0
@ -603,6 +619,13 @@ contains
stopdat%values(errden_) = done stopdat%values(errden_) = done
if (stopdat%controls(trace_) > 0) then
if (me == 0) then
mname = adjustl(trim(methdname))
write(outname,'(a)') mname(1:min(len_trim(mname),outlen-1))//':'
write(*,fmt) adjustl(outname),'Iter','Conv. Ind.','Epsilon'
endif
end if
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
@ -629,7 +652,10 @@ contains
integer :: ictxt, me, np, err_act integer :: ictxt, me, np, err_act
real(kind(1.d0)) :: errnum, errden real(kind(1.d0)) :: errnum, errden
character(len=*), parameter :: fmt='(a,i4,3(2x,es10.4))' character(len=*), parameter :: fmt='(a18,1x,i4,3(2x,es10.4))'
integer, parameter :: outlen=18
character(len=len(methdname)) :: mname
character(len=outlen) :: outname
character(len=20) :: name character(len=20) :: name
info = 0 info = 0
@ -673,11 +699,13 @@ contains
if (((stopdat%controls(trace_) > 0).and.(mod(it,stopdat%controls(trace_))==0))& if (((stopdat%controls(trace_) > 0).and.(mod(it,stopdat%controls(trace_))==0))&
& .or.psb_d_check_conv) then & .or.psb_d_check_conv) then
if (me == 0) then if (me == 0) then
mname = adjustl(trim(methdname))
write(outname,'(a)') mname(1:min(len_trim(mname),outlen-1))//':'
if (stopdat%values(errden_) > dzero ) then if (stopdat%values(errden_) > dzero ) then
write(*,fmt) trim(methdname)//': ',it,& write(*,fmt) adjustl(outname),it,&
& stopdat%values(errnum_)/stopdat%values(errden_),stopdat%values(eps_) & stopdat%values(errnum_)/stopdat%values(errden_),stopdat%values(eps_)
else else
write(*,fmt) trim(methdname)//': ',it,& write(*,fmt) adjustl(outname),it,&
& stopdat%values(errnum_),stopdat%values(eps_) & stopdat%values(errnum_),stopdat%values(eps_)
end if end if
Endif Endif
@ -710,7 +738,10 @@ contains
integer :: ictxt, me, np, err_act integer :: ictxt, me, np, err_act
real(kind(1.d0)) :: errnum, errden real(kind(1.d0)) :: errnum, errden
character(len=*), parameter :: fmt='(a,i4,3(2x,es10.4))' character(len=*), parameter :: fmt='(a18,1x,i4,3(2x,es10.4))'
integer, parameter :: outlen=18
character(len=len(methdname)) :: mname
character(len=outlen) :: outname
character(len=20) :: name character(len=20) :: name
info = 0 info = 0
@ -754,11 +785,13 @@ contains
if (((stopdat%controls(trace_) > 0).and.(mod(it,stopdat%controls(trace_))==0))& if (((stopdat%controls(trace_) > 0).and.(mod(it,stopdat%controls(trace_))==0))&
& .or.psb_z_check_conv) then & .or.psb_z_check_conv) then
if (me == 0) then if (me == 0) then
mname = adjustl(trim(methdname))
write(outname,'(a)') mname(1:min(len_trim(mname),outlen-1))//':'
if (stopdat%values(errden_) > dzero ) then if (stopdat%values(errden_) > dzero ) then
write(*,fmt) trim(methdname)//': ',it,& write(*,fmt) adjustl(outname),it,&
& stopdat%values(errnum_)/stopdat%values(errden_),stopdat%values(eps_) & stopdat%values(errnum_)/stopdat%values(errden_),stopdat%values(eps_)
else else
write(*,fmt) trim(methdname)//': ',it,& write(*,fmt) adjustl(outname),it,&
& stopdat%values(errnum_),stopdat%values(eps_) & stopdat%values(errnum_),stopdat%values(eps_)
end if end if
Endif Endif
@ -812,7 +845,7 @@ contains
if (errnum > eps) then if (errnum > eps) then
if (me==0) then if (me==0) then
write(*,fmt) methdname//' failed to converge to ',eps,& write(*,fmt) trim(methdname)//' failed to converge to ',eps,&
& ' in ',it,' iterations. ' & ' in ',it,' iterations. '
write(*,fmt1) 'Last iteration convergence indicator: ',& write(*,fmt1) 'Last iteration convergence indicator: ',&
& errnum & errnum
@ -823,7 +856,7 @@ contains
if (errnum > eps) then if (errnum > eps) then
if (me==0) then if (me==0) then
write(*,fmt) methdname//' failed to converge to ',eps,& write(*,fmt) trim(methdname)//' failed to converge to ',eps,&
& ' in ',it,' iterations. ' & ' in ',it,' iterations. '
write(*,fmt1) 'Last iteration convergence indicator: ',& write(*,fmt1) 'Last iteration convergence indicator: ',&
& errnum/errden & errnum/errden

@ -191,7 +191,7 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
itx = 0 itx = 0
call psb_init_conv(istop_,itrace_,a,b,eps,desc_a,stopdat,info) call psb_init_conv(methdname,istop_,itrace_,a,b,eps,desc_a,stopdat,info)
if (info /= 0) Then if (info /= 0) Then
call psb_errpush(4011,name) call psb_errpush(4011,name)
goto 9999 goto 9999

@ -194,7 +194,7 @@ subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
itx = 0 itx = 0
call psb_init_conv(istop_,itrace_,a,b,eps,desc_a,stopdat,info) call psb_init_conv(methdname,istop_,itrace_,a,b,eps,desc_a,stopdat,info)
if (info /= 0) Then if (info /= 0) Then
call psb_errpush(4011,name) call psb_errpush(4011,name)
goto 9999 goto 9999

Loading…
Cancel
Save