|
|
@ -591,6 +591,8 @@ contains
|
|
|
|
integer(psb_ipk_) :: nlev, ilev, sweeps
|
|
|
|
integer(psb_ipk_) :: nlev, ilev, sweeps
|
|
|
|
logical :: pre, post
|
|
|
|
logical :: pre, post
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
|
|
|
|
logical, parameter :: do_timings=.true.
|
|
|
|
|
|
|
|
integer(psb_ipk_), save :: ml_mlt_smth=-1, ml_mlt_rp=-1, ml_mlt_rsd=-1
|
|
|
|
|
|
|
|
|
|
|
|
name = 'inner_inner_mult'
|
|
|
|
name = 'inner_inner_mult'
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
@ -608,6 +610,12 @@ contains
|
|
|
|
if(debug_level > 1) then
|
|
|
|
if(debug_level > 1) then
|
|
|
|
write(debug_unit,*) me,' inner_mult at level ',level
|
|
|
|
write(debug_unit,*) me,' inner_mult at level ',level
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if ((do_timings).and.(ml_mlt_smth==-1)) &
|
|
|
|
|
|
|
|
& ml_mlt_smth = psb_get_timer_idx("ML-MLT: smoother ")
|
|
|
|
|
|
|
|
if ((do_timings).and.(ml_mlt_rp==-1)) &
|
|
|
|
|
|
|
|
& ml_mlt_rp = psb_get_timer_idx("ML-MLT: RestProl")
|
|
|
|
|
|
|
|
if ((do_timings).and.(ml_mlt_rsd==-1)) &
|
|
|
|
|
|
|
|
& ml_mlt_rsd = psb_get_timer_idx("ML-MLT: Residual")
|
|
|
|
|
|
|
|
|
|
|
|
sweeps_post = p%precv(level)%parms%sweeps_post
|
|
|
|
sweeps_post = p%precv(level)%parms%sweeps_post
|
|
|
|
sweeps_pre = p%precv(level)%parms%sweeps_pre
|
|
|
|
sweeps_pre = p%precv(level)%parms%sweeps_pre
|
|
|
@ -623,7 +631,7 @@ contains
|
|
|
|
! Apply the first smoother
|
|
|
|
! Apply the first smoother
|
|
|
|
! The residual has been prepared before the recursive call.
|
|
|
|
! The residual has been prepared before the recursive call.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_smth)
|
|
|
|
if (pre) then
|
|
|
|
if (pre) then
|
|
|
|
if (me >=0) then
|
|
|
|
if (me >=0) then
|
|
|
|
!!$ write(0,*) me,'Applying smoother pre ', level
|
|
|
|
!!$ write(0,*) me,'Applying smoother pre ', level
|
|
|
@ -646,10 +654,13 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_smth)
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Compute the residual for next level and call recursively
|
|
|
|
! Compute the residual for next level and call recursively
|
|
|
|
!
|
|
|
|
!
|
|
|
|
if (pre) then
|
|
|
|
if (pre) then
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rsd)
|
|
|
|
call psb_geaxpby(done,vx2l,&
|
|
|
|
call psb_geaxpby(done,vx2l,&
|
|
|
|
& dzero,vty,&
|
|
|
|
& dzero,vty,&
|
|
|
|
& base_desc,info)
|
|
|
|
& base_desc,info)
|
|
|
@ -657,6 +668,9 @@ contains
|
|
|
|
if (info == psb_success_) call psb_spmm(-done,base_a,&
|
|
|
|
if (info == psb_success_) call psb_spmm(-done,base_a,&
|
|
|
|
& vy2l,done,vty,&
|
|
|
|
& vy2l,done,vty,&
|
|
|
|
& base_desc,info,work=work,trans=trans)
|
|
|
|
& base_desc,info,work=work,trans=trans)
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rsd)
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rp)
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
& a_err='Error during residue')
|
|
|
|
& a_err='Error during residue')
|
|
|
@ -671,7 +685,9 @@ contains
|
|
|
|
& a_err='Error during restriction')
|
|
|
|
& a_err='Error during restriction')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rp)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rp)
|
|
|
|
! Shortcut: just transfer x2l.
|
|
|
|
! Shortcut: just transfer x2l.
|
|
|
|
call p%precv(level+1)%map_rstr(done,vx2l,&
|
|
|
|
call p%precv(level+1)%map_rstr(done,vx2l,&
|
|
|
|
& dzero,p%precv(level+1)%wrk%vx2l,&
|
|
|
|
& dzero,p%precv(level+1)%wrk%vx2l,&
|
|
|
@ -682,6 +698,7 @@ contains
|
|
|
|
& a_err='Error during restriction')
|
|
|
|
& a_err='Error during restriction')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rp)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
call inner_ml_aply(level+1,p,trans,work,info)
|
|
|
|
call inner_ml_aply(level+1,p,trans,work,info)
|
|
|
@ -689,10 +706,12 @@ contains
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Apply the prolongator
|
|
|
|
! Apply the prolongator
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rp)
|
|
|
|
call p%precv(level+1)%map_prol(done,&
|
|
|
|
call p%precv(level+1)%map_prol(done,&
|
|
|
|
& p%precv(level+1)%wrk%vy2l,done,vy2l,&
|
|
|
|
& p%precv(level+1)%wrk%vy2l,done,vy2l,&
|
|
|
|
& info,work=work,&
|
|
|
|
& info,work=work,&
|
|
|
|
& vtx=p%precv(level+1)%wrk%wv(1),vty=wv(1))
|
|
|
|
& vtx=p%precv(level+1)%wrk%wv(1),vty=wv(1))
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rp)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
& a_err='Error during prolongation')
|
|
|
|
& a_err='Error during prolongation')
|
|
|
@ -700,7 +719,7 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (p%precv(level)%parms%ml_cycle == amg_wcycle_ml_) then
|
|
|
|
if (p%precv(level)%parms%ml_cycle == amg_wcycle_ml_) then
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rsd)
|
|
|
|
if (me >=0) then
|
|
|
|
if (me >=0) then
|
|
|
|
call psb_geaxpby(done,vx2l, dzero,vty,&
|
|
|
|
call psb_geaxpby(done,vx2l, dzero,vty,&
|
|
|
|
& base_desc,info)
|
|
|
|
& base_desc,info)
|
|
|
@ -708,10 +727,13 @@ contains
|
|
|
|
& vy2l,done,vty,&
|
|
|
|
& vy2l,done,vty,&
|
|
|
|
& base_desc,info,work=work,trans=trans)
|
|
|
|
& base_desc,info,work=work,trans=trans)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rsd)
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rp)
|
|
|
|
if (info == psb_success_) &
|
|
|
|
if (info == psb_success_) &
|
|
|
|
& call p%precv(level+1)%map_rstr(done,vty,&
|
|
|
|
& call p%precv(level+1)%map_rstr(done,vty,&
|
|
|
|
& dzero,p%precv(level+1)%wrk%vx2l,info,work=work,&
|
|
|
|
& dzero,p%precv(level+1)%wrk%vx2l,info,work=work,&
|
|
|
|
& vtx=wv(1),vty=p%precv(level+1)%wrk%wv(1))
|
|
|
|
& vtx=wv(1),vty=p%precv(level+1)%wrk%wv(1))
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rp)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
& a_err='Error during W-cycle restriction')
|
|
|
|
& a_err='Error during W-cycle restriction')
|
|
|
@ -720,10 +742,12 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
call inner_ml_aply(level+1,p,trans,work,info)
|
|
|
|
call inner_ml_aply(level+1,p,trans,work,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rp)
|
|
|
|
if (info == psb_success_) call p%precv(level+1)%map_prol(done, &
|
|
|
|
if (info == psb_success_) call p%precv(level+1)%map_prol(done, &
|
|
|
|
& p%precv(level+1)%wrk%vy2l,done,vy2l,&
|
|
|
|
& p%precv(level+1)%wrk%vy2l,done,vy2l,&
|
|
|
|
& info,work=work,&
|
|
|
|
& info,work=work,&
|
|
|
|
& vtx=p%precv(level+1)%wrk%wv(1),vty=wv(1))
|
|
|
|
& vtx=p%precv(level+1)%wrk%wv(1),vty=wv(1))
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rp)
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
@ -736,6 +760,7 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
if (post) then
|
|
|
|
if (post) then
|
|
|
|
if (me >=0) then
|
|
|
|
if (me >=0) then
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_rsd)
|
|
|
|
call psb_geaxpby(done,vx2l,&
|
|
|
|
call psb_geaxpby(done,vx2l,&
|
|
|
|
& dzero,vty,&
|
|
|
|
& dzero,vty,&
|
|
|
|
& base_desc,info)
|
|
|
|
& base_desc,info)
|
|
|
@ -747,7 +772,9 @@ contains
|
|
|
|
& a_err='Error during residue')
|
|
|
|
& a_err='Error during residue')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_rsd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_smth)
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Apply the second smoother
|
|
|
|
! Apply the second smoother
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -762,6 +789,7 @@ contains
|
|
|
|
& vty,done,vy2l, base_desc, trans,&
|
|
|
|
& vty,done,vy2l, base_desc, trans,&
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_smth)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
@ -774,12 +802,14 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
else if (level == nlev) then
|
|
|
|
else if (level == nlev) then
|
|
|
|
!!$ write(0,*) me,'Applying smoother at top level ',psb_errstatus_fatal()
|
|
|
|
!!$ write(0,*) me,'Applying smoother at top level ',psb_errstatus_fatal()
|
|
|
|
|
|
|
|
if (do_timings) call psb_tic(ml_mlt_smth)
|
|
|
|
if (me >=0) then
|
|
|
|
if (me >=0) then
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(done,&
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(done,&
|
|
|
|
& vx2l,dzero,vy2l,base_desc, trans,&
|
|
|
|
& vx2l,dzero,vy2l,base_desc, trans,&
|
|
|
|
& sweeps,work,wv,info)
|
|
|
|
& sweeps,work,wv,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (do_timings) call psb_toc(ml_mlt_smth)
|
|
|
|
!!$ write(0,*) me,' Done applying smoother at top level ',psb_errstatus_fatal()
|
|
|
|
!!$ write(0,*) me,' Done applying smoother at top level ',psb_errstatus_fatal()
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|