Fixed check for restart in GMRES. Changed opt arg passing in KRYLOV.

psblas3-type-indexed
Salvatore Filippone 18 years ago
parent dd3732bdf7
commit 035aa4dfdb

@ -164,7 +164,14 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
nl = 10 nl = 10
If (debug) Write(0,*) 'not present: irst: ',irst,nl If (debug) Write(0,*) 'not present: irst: ',irst,nl
Endif Endif
if (nl <=0 ) then
write(0,*) 'psb_dgmres: invalid irst ',nl
info=5001
int_err(1)=nl
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
naux=4*n_col naux=4*n_col
Allocate(aux(naux),h(nl+1,nl+1),& Allocate(aux(naux),h(nl+1,nl+1),&
@ -290,6 +297,7 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
endif endif
if (rerr < eps ) then if (rerr < eps ) then
if (debug) write(0,*) 'GMRES TRSM',i,size(h,1),nl
call dtrsm('l','u','n','n',i,1,done,h,size(h,1),rs,nl) call dtrsm('l','u','n','n',i,1,done,h,size(h,1),rs,nl)
if (debug) write(0,*) 'Rebuild x-> RS:',rs(21:nl) if (debug) write(0,*) 'Rebuild x-> RS:',rs(21:nl)
do k=1, i do k=1, i
@ -303,7 +311,7 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
end If end If
end Do inner end Do inner
if (debug) write(0,*) 'Before DTRSM :',rs(1:nl) if (debug) write(0,*) 'Before DTRSM :',rs(1:nl),i,size(h,1),nl
call dtrsm('l','u','n','n',nl,1,done,h,size(h,1),rs,nl) call dtrsm('l','u','n','n',nl,1,done,h,size(h,1),rs,nl)
if (debug) write(0,*) 'Rebuild x-> RS:',rs(21:nl) if (debug) write(0,*) 'Rebuild x-> RS:',rs(21:nl)
do k=1, nl do k=1, nl

@ -196,66 +196,30 @@ contains
Integer, Optional, Intent(out) :: iter Integer, Optional, Intent(out) :: iter
Real(Kind(1.d0)), Optional, Intent(out) :: err Real(Kind(1.d0)), Optional, Intent(out) :: err
integer :: itmax_, itrace_, irst_, istop_, iter_
real(kind(1.d0)) :: err_
if (present(itmax)) then
itmax_ = itmax
else
itmax_ = 1000
end if
if (present(itrace)) then
itrace_ = itrace
else
itrace_ = -1
end if
if (present(irst)) then
irst_ = irst
else
irst_ = 1
end if
if (present(istop)) then
istop_ = istop
else
istop_ = 1
end if
select case(toupper(method)) select case(toupper(method))
case('CG') case('CG')
call psb_cg(a,prec,b,x,eps,desc_a,info,& call psb_cg(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
case('CGS') case('CGS')
call psb_cgs(a,prec,b,x,eps,desc_a,info,& call psb_cgs(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
case('BICG') case('BICG')
call psb_bicg(a,prec,b,x,eps,desc_a,info,& call psb_bicg(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
case('BICGSTAB') case('BICGSTAB')
call psb_bicgstab(a,prec,b,x,eps,desc_a,info,& call psb_bicgstab(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
case('RGMRES') case('RGMRES')
call psb_rgmres(a,prec,b,x,eps,desc_a,info,& call psb_rgmres(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,irst_,istop_) &itmax,iter,err,itrace,irst,istop)
case('BICGSTABL') case('BICGSTABL')
call psb_bicgstabl(a,prec,b,x,eps,desc_a,info,& call psb_bicgstabl(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,irst_,istop_) &itmax,iter,err,itrace,irst,istop)
case default case default
call psb_bicgstab(a,prec,b,x,eps,desc_a,info,& call psb_bicgstab(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
end select end select
if (present(err)) then
err = err_
endif
if (present(iter)) then
iter = iter_
endif
end subroutine psb_dkrylov end subroutine psb_dkrylov
@ -275,66 +239,31 @@ contains
Integer, Optional, Intent(out) :: iter Integer, Optional, Intent(out) :: iter
Real(Kind(1.d0)), Optional, Intent(out) :: err Real(Kind(1.d0)), Optional, Intent(out) :: err
integer :: itmax_, itrace_, irst_, istop_, iter_
real(kind(1.d0)) :: err_
if (present(itmax)) then
itmax_ = itmax
else
itmax_ = 1000
end if
if (present(itrace)) then
itrace_ = itrace
else
itrace_ = -1
end if
if (present(irst)) then
irst_ = irst
else
irst_ = 1
end if
if (present(istop)) then
istop_ = istop
else
istop_ = 1
end if
select case(toupper(method)) select case(toupper(method))
!!$ case('CG') !!$ case('CG')
!!$ call psb_cg(a,prec,b,x,eps,desc_a,info,& !!$ call psb_cg(a,prec,b,x,eps,desc_a,info,&
!!$ &itmax_,iter_,err_,itrace_,istop_) !!$ &itmax,iter,err,itrace,istop)
case('CGS') case('CGS')
call psb_cgs(a,prec,b,x,eps,desc_a,info,& call psb_cgs(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
!!$ case('BICG') !!$ case('BICG')
!!$ call psb_bicg(a,prec,b,x,eps,desc_a,info,& !!$ call psb_bicg(a,prec,b,x,eps,desc_a,info,&
!!$ &itmax_,iter_,err_,itrace_,istop_) !!$ &itmax,iter,err,itrace,istop)
case('BICGSTAB') case('BICGSTAB')
call psb_bicgstab(a,prec,b,x,eps,desc_a,info,& call psb_bicgstab(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
!!$ case('RGMRES') !!$ case('RGMRES')
!!$ call psb_rgmres(a,prec,b,x,eps,desc_a,info,& !!$ call psb_rgmres(a,prec,b,x,eps,desc_a,info,&
!!$ &itmax_,iter_,err_,itrace_,irst_,istop_) !!$ &itmax,iter,err,itrace,irst,istop)
!!$ case('BICGSTABL') !!$ case('BICGSTABL')
!!$ call psb_bicgstabl(a,prec,b,x,eps,desc_a,info,& !!$ call psb_bicgstabl(a,prec,b,x,eps,desc_a,info,&
!!$ &itmax_,iter_,err_,itrace_,irst_,istop_) !!$ &itmax,iter,err,itrace,irst,istop)
case default case default
call psb_bicgstab(a,prec,b,x,eps,desc_a,info,& call psb_bicgstab(a,prec,b,x,eps,desc_a,info,&
&itmax_,iter_,err_,itrace_,istop_) &itmax,iter,err,itrace,istop)
end select end select
if (present(err)) then
err = err_
endif
if (present(iter)) then
iter = iter_
endif
end subroutine psb_zkrylov end subroutine psb_zkrylov

Loading…
Cancel
Save