From f5488e0f7d312cbb53b46b6babf46f2dba2fc28c Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 14 Jul 2016 15:11:03 +0000 Subject: [PATCH] mld2p4-2: mlprec/impl/mld_cmlprec_aply.f90 mlprec/impl/mld_dmlprec_aply.f90 mlprec/impl/mld_smlprec_aply.f90 mlprec/impl/mld_zmlprec_aply.f90 Always INIT='Z' with the current formulation. --- mlprec/impl/mld_cmlprec_aply.f90 | 12 +++++------- mlprec/impl/mld_dmlprec_aply.f90 | 12 +++++------- mlprec/impl/mld_smlprec_aply.f90 | 12 +++++------- mlprec/impl/mld_zmlprec_aply.f90 | 12 +++++------- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/mlprec/impl/mld_cmlprec_aply.f90 b/mlprec/impl/mld_cmlprec_aply.f90 index 4825997f..adb13f6e 100644 --- a/mlprec/impl/mld_cmlprec_aply.f90 +++ b/mlprec/impl/mld_cmlprec_aply.f90 @@ -712,13 +712,13 @@ contains if (info == psb_success_) call p%precv(level)%sm%apply(cone,& & mlprec_wrk(level)%vx2l,czero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') else sweeps = p%precv(level)%parms%sweeps_post if (info == psb_success_) call p%precv(level)%sm2%apply(cone,& & mlprec_wrk(level)%vx2l,czero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') end if if (info /= psb_success_) then @@ -763,8 +763,7 @@ contains goto 9999 end if endif - ! First guess is zero - call mlprec_wrk(level+1)%vy2l%zero() + call inner_ml_aply(level+1,p,mlprec_wrk,trans,work,info) ! @@ -780,11 +779,10 @@ contains end if if (p%precv(level)%parms%ml_type == mld_wcycle_ml_) then - ! On second call will use output y2l as initial guess + call psb_geaxpby(cone,mlprec_wrk(level)%vx2l,& & czero,mlprec_wrk(level)%vty,& - & p%precv(level)%base_desc,info) - + & p%precv(level)%base_desc,info) if (info == psb_success_) call psb_spmm(-cone,p%precv(level)%base_a,& & mlprec_wrk(level)%vy2l,cone,mlprec_wrk(level)%vty,& & p%precv(level)%base_desc,info,work=work,trans=trans) diff --git a/mlprec/impl/mld_dmlprec_aply.f90 b/mlprec/impl/mld_dmlprec_aply.f90 index a1a15480..482b0421 100644 --- a/mlprec/impl/mld_dmlprec_aply.f90 +++ b/mlprec/impl/mld_dmlprec_aply.f90 @@ -712,13 +712,13 @@ contains if (info == psb_success_) call p%precv(level)%sm%apply(done,& & mlprec_wrk(level)%vx2l,dzero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') else sweeps = p%precv(level)%parms%sweeps_post if (info == psb_success_) call p%precv(level)%sm2%apply(done,& & mlprec_wrk(level)%vx2l,dzero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') end if if (info /= psb_success_) then @@ -763,8 +763,7 @@ contains goto 9999 end if endif - ! First guess is zero - call mlprec_wrk(level+1)%vy2l%zero() + call inner_ml_aply(level+1,p,mlprec_wrk,trans,work,info) ! @@ -780,11 +779,10 @@ contains end if if (p%precv(level)%parms%ml_type == mld_wcycle_ml_) then - ! On second call will use output y2l as initial guess + call psb_geaxpby(done,mlprec_wrk(level)%vx2l,& & dzero,mlprec_wrk(level)%vty,& - & p%precv(level)%base_desc,info) - + & p%precv(level)%base_desc,info) if (info == psb_success_) call psb_spmm(-done,p%precv(level)%base_a,& & mlprec_wrk(level)%vy2l,done,mlprec_wrk(level)%vty,& & p%precv(level)%base_desc,info,work=work,trans=trans) diff --git a/mlprec/impl/mld_smlprec_aply.f90 b/mlprec/impl/mld_smlprec_aply.f90 index 98afa860..15143deb 100644 --- a/mlprec/impl/mld_smlprec_aply.f90 +++ b/mlprec/impl/mld_smlprec_aply.f90 @@ -712,13 +712,13 @@ contains if (info == psb_success_) call p%precv(level)%sm%apply(sone,& & mlprec_wrk(level)%vx2l,szero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') else sweeps = p%precv(level)%parms%sweeps_post if (info == psb_success_) call p%precv(level)%sm2%apply(sone,& & mlprec_wrk(level)%vx2l,szero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') end if if (info /= psb_success_) then @@ -763,8 +763,7 @@ contains goto 9999 end if endif - ! First guess is zero - call mlprec_wrk(level+1)%vy2l%zero() + call inner_ml_aply(level+1,p,mlprec_wrk,trans,work,info) ! @@ -780,11 +779,10 @@ contains end if if (p%precv(level)%parms%ml_type == mld_wcycle_ml_) then - ! On second call will use output y2l as initial guess + call psb_geaxpby(sone,mlprec_wrk(level)%vx2l,& & szero,mlprec_wrk(level)%vty,& - & p%precv(level)%base_desc,info) - + & p%precv(level)%base_desc,info) if (info == psb_success_) call psb_spmm(-sone,p%precv(level)%base_a,& & mlprec_wrk(level)%vy2l,sone,mlprec_wrk(level)%vty,& & p%precv(level)%base_desc,info,work=work,trans=trans) diff --git a/mlprec/impl/mld_zmlprec_aply.f90 b/mlprec/impl/mld_zmlprec_aply.f90 index 50c50d68..e6cb99e0 100644 --- a/mlprec/impl/mld_zmlprec_aply.f90 +++ b/mlprec/impl/mld_zmlprec_aply.f90 @@ -712,13 +712,13 @@ contains if (info == psb_success_) call p%precv(level)%sm%apply(zone,& & mlprec_wrk(level)%vx2l,zzero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') else sweeps = p%precv(level)%parms%sweeps_post if (info == psb_success_) call p%precv(level)%sm2%apply(zone,& & mlprec_wrk(level)%vx2l,zzero,mlprec_wrk(level)%vy2l,& & p%precv(level)%base_desc, trans,& - & sweeps,work,info,init='Y') + & sweeps,work,info,init='Z') end if if (info /= psb_success_) then @@ -763,8 +763,7 @@ contains goto 9999 end if endif - ! First guess is zero - call mlprec_wrk(level+1)%vy2l%zero() + call inner_ml_aply(level+1,p,mlprec_wrk,trans,work,info) ! @@ -780,11 +779,10 @@ contains end if if (p%precv(level)%parms%ml_type == mld_wcycle_ml_) then - ! On second call will use output y2l as initial guess + call psb_geaxpby(zone,mlprec_wrk(level)%vx2l,& & zzero,mlprec_wrk(level)%vty,& - & p%precv(level)%base_desc,info) - + & p%precv(level)%base_desc,info) if (info == psb_success_) call psb_spmm(-zone,p%precv(level)%base_a,& & mlprec_wrk(level)%vy2l,zone,mlprec_wrk(level)%vty,& & p%precv(level)%base_desc,info,work=work,trans=trans)