mld2p4-2:

mlprec/mld_c_jac_smoother.f03
 mlprec/mld_d_jac_smoother.f03
 mlprec/mld_dprecset.F90
 mlprec/mld_s_jac_smoother.f03
 mlprec/mld_sprecset.F90
 mlprec/mld_z_jac_smoother.f03

Check in Jacobi smoother for empty non-diagonal part, and force 1
sweep in that case.
stopcriterion
Salvatore Filippone 14 years ago
parent 5b56247697
commit 3f334d4887

@ -52,6 +52,7 @@ module mld_c_jac_smoother
! class(mld_c_base_solver_type), allocatable :: sv ! class(mld_c_base_solver_type), allocatable :: sv
! !
type(psb_cspmat_type) :: nd type(psb_cspmat_type) :: nd
integer :: nnz_nd_tot
contains contains
procedure, pass(sm) :: build => c_jac_smoother_bld procedure, pass(sm) :: build => c_jac_smoother_bld
procedure, pass(sm) :: apply => c_jac_smoother_apply procedure, pass(sm) :: apply => c_jac_smoother_apply
@ -136,7 +137,7 @@ contains
end if end if
endif endif
if (sweeps == 1) then if ((sweeps == 1).or.(sm%nnz_nd_tot==0)) then
call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info) call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info)
@ -239,7 +240,7 @@ contains
character, intent(in) :: upd character, intent(in) :: upd
integer, intent(out) :: info integer, intent(out) :: info
! Local variables ! Local variables
integer :: n_row,n_col, nrow_a, nztota integer :: n_row,n_col, nrow_a, nztota, nzeros
complex(psb_spk_), pointer :: ww(:), aux(:), tx(:),ty(:) complex(psb_spk_), pointer :: ww(:), aux(:), tx(:),ty(:)
integer :: ictxt,np,me,i, err_act, debug_unit, debug_level integer :: ictxt,np,me,i, err_act, debug_unit, debug_level
character(len=20) :: name='d_jac_smoother_bld', ch_err character(len=20) :: name='d_jac_smoother_bld', ch_err
@ -273,7 +274,9 @@ contains
call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4') call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4')
goto 9999 goto 9999
end if end if
nzeros = sm%nd%get_nzeros()
call psb_sum(ictxt,nzeros)
sm%nnz_nd_tot = nzeros
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' end' & write(debug_unit,*) me,' ',trim(name),' end'

@ -52,6 +52,7 @@ module mld_d_jac_smoother
! class(mld_d_base_solver_type), allocatable :: sv ! class(mld_d_base_solver_type), allocatable :: sv
! !
type(psb_dspmat_type) :: nd type(psb_dspmat_type) :: nd
integer :: nnz_nd_tot
contains contains
procedure, pass(sm) :: build => d_jac_smoother_bld procedure, pass(sm) :: build => d_jac_smoother_bld
procedure, pass(sm) :: apply => d_jac_smoother_apply procedure, pass(sm) :: apply => d_jac_smoother_apply
@ -136,7 +137,7 @@ contains
end if end if
endif endif
if (sweeps == 1) then if ((sweeps == 1).or.(sm%nnz_nd_tot==0)) then
call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info) call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info)
@ -239,7 +240,7 @@ contains
character, intent(in) :: upd character, intent(in) :: upd
integer, intent(out) :: info integer, intent(out) :: info
! Local variables ! Local variables
integer :: n_row,n_col, nrow_a, nztota integer :: n_row,n_col, nrow_a, nztota, nzeros
real(psb_dpk_), pointer :: ww(:), aux(:), tx(:),ty(:) real(psb_dpk_), pointer :: ww(:), aux(:), tx(:),ty(:)
integer :: ictxt,np,me,i, err_act, debug_unit, debug_level integer :: ictxt,np,me,i, err_act, debug_unit, debug_level
character(len=20) :: name='d_jac_smoother_bld', ch_err character(len=20) :: name='d_jac_smoother_bld', ch_err
@ -273,7 +274,9 @@ contains
call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4') call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4')
goto 9999 goto 9999
end if end if
nzeros = sm%nd%get_nzeros()
call psb_sum(ictxt,nzeros)
sm%nnz_nd_tot = nzeros
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' end' & write(debug_unit,*) me,' ',trim(name),' end'

@ -103,7 +103,7 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -117,7 +117,7 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_ write(psb_err_unit,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return return
endif endif
@ -350,6 +350,10 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
endif endif
do ilev_=1, nlev_
write(0,*) 'Check on mld_dprecseti level ',ilev_,' ',allocated(p%precv(ilev_)%sm)
end do
end subroutine mld_dprecseti end subroutine mld_dprecseti
subroutine mld_dprecsetsm(p,what,val,info,ilev) subroutine mld_dprecsetsm(p,what,val,info,ilev)

@ -52,6 +52,7 @@ module mld_s_jac_smoother
! class(mld_s_base_solver_type), allocatable :: sv ! class(mld_s_base_solver_type), allocatable :: sv
! !
type(psb_sspmat_type) :: nd type(psb_sspmat_type) :: nd
integer :: nnz_nd_tot
contains contains
procedure, pass(sm) :: build => s_jac_smoother_bld procedure, pass(sm) :: build => s_jac_smoother_bld
procedure, pass(sm) :: apply => s_jac_smoother_apply procedure, pass(sm) :: apply => s_jac_smoother_apply
@ -136,7 +137,7 @@ contains
end if end if
endif endif
if (sweeps == 1) then if ((sweeps == 1).or.(sm%nnz_nd_tot==0)) then
call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info) call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info)
@ -239,7 +240,7 @@ contains
character, intent(in) :: upd character, intent(in) :: upd
integer, intent(out) :: info integer, intent(out) :: info
! Local variables ! Local variables
integer :: n_row,n_col, nrow_a, nztota integer :: n_row,n_col, nrow_a, nztota, nzeros
real(psb_spk_), pointer :: ww(:), aux(:), tx(:),ty(:) real(psb_spk_), pointer :: ww(:), aux(:), tx(:),ty(:)
integer :: ictxt,np,me,i, err_act, debug_unit, debug_level integer :: ictxt,np,me,i, err_act, debug_unit, debug_level
character(len=20) :: name='d_jac_smoother_bld', ch_err character(len=20) :: name='d_jac_smoother_bld', ch_err
@ -273,7 +274,9 @@ contains
call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4') call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4')
goto 9999 goto 9999
end if end if
nzeros = sm%nd%get_nzeros()
call psb_sum(ictxt,nzeros)
sm%nnz_nd_tot = nzeros
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' end' & write(debug_unit,*) me,' ',trim(name),' end'

@ -350,6 +350,10 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
endif endif
do ilev_=1, nlev_
write(0,*) 'Check on mld_sprecseti level ',ilev_,' ',allocated(p%precv(ilev_)%sm)
end do
end subroutine mld_sprecseti end subroutine mld_sprecseti
subroutine mld_sprecsetsm(p,what,val,info,ilev) subroutine mld_sprecsetsm(p,what,val,info,ilev)

@ -52,6 +52,7 @@ module mld_z_jac_smoother
! class(mld_z_base_solver_type), allocatable :: sv ! class(mld_z_base_solver_type), allocatable :: sv
! !
type(psb_zspmat_type) :: nd type(psb_zspmat_type) :: nd
integer :: nnz_nd_tot
contains contains
procedure, pass(sm) :: build => z_jac_smoother_bld procedure, pass(sm) :: build => z_jac_smoother_bld
procedure, pass(sm) :: apply => z_jac_smoother_apply procedure, pass(sm) :: apply => z_jac_smoother_apply
@ -136,7 +137,7 @@ contains
end if end if
endif endif
if (sweeps == 1) then if ((sweeps == 1).or.(sm%nnz_nd_tot==0)) then
call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info) call sm%sv%apply(alpha,x,beta,y,desc_data,trans_,aux,info)
@ -239,7 +240,7 @@ contains
character, intent(in) :: upd character, intent(in) :: upd
integer, intent(out) :: info integer, intent(out) :: info
! Local variables ! Local variables
integer :: n_row,n_col, nrow_a, nztota integer :: n_row,n_col, nrow_a, nztota, nzeros
complex(psb_dpk_), pointer :: ww(:), aux(:), tx(:),ty(:) complex(psb_dpk_), pointer :: ww(:), aux(:), tx(:),ty(:)
integer :: ictxt,np,me,i, err_act, debug_unit, debug_level integer :: ictxt,np,me,i, err_act, debug_unit, debug_level
character(len=20) :: name='d_jac_smoother_bld', ch_err character(len=20) :: name='d_jac_smoother_bld', ch_err
@ -273,7 +274,9 @@ contains
call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4') call psb_errpush(psb_err_from_subroutine_,name,a_err='clip & psb_spcnv csr 4')
goto 9999 goto 9999
end if end if
nzeros = sm%nd%get_nzeros()
call psb_sum(ictxt,nzeros)
sm%nnz_nd_tot = nzeros
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' end' & write(debug_unit,*) me,' ',trim(name),' end'

Loading…
Cancel
Save