Changed option setting to integrate approximate inverses

implement-ainv
Cirdans-Home 6 years ago
parent 086d93dd28
commit 68007052d5

@ -86,6 +86,9 @@ subroutine amg_ccprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use amg_c_ilu_solver use amg_c_ilu_solver
use amg_c_id_solver use amg_c_id_solver
use amg_c_gs_solver use amg_c_gs_solver
use amg_c_ainv_solver
use amg_c_invk_solver
use amg_c_invt_solver
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
use amg_c_slu_solver use amg_c_slu_solver
#endif #endif
@ -163,125 +166,12 @@ subroutine amg_ccprecseti(p,what,val,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE','SMOOTHER_SWEEPS',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',&
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',&
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', &
& 'SUB_OVR','SUB_FILLIN',&
& 'COARSE_MAT')
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos) call p%precv(il)%set(what,val,info,pos=pos)
end do end do
case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set('SUB_SOLVE',val,info,pos=pos)
case('COARSE_SOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -313,125 +203,12 @@ subroutine amg_ccprecseti(p,what,val,info,ilev,ilmax,pos,idx)
! levels ! levels
! !
select case(psb_toupper(trim(what))) select case(psb_toupper(trim(what)))
case('SUB_SOLVE','SUB_RESTR','SUB_PROL',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'SUB_OVR','SUB_FILLIN',&
& 'SMOOTHER_SWEEPS','SMOOTHER_TYPE')
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos) call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return if (info /= 0) return
end do end do
case('ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD','AGGR_PROL','AGGR_TYPE',&
& 'AGGR_OMEGA_ALG','AGGR_EIG','AGGR_FILTER')
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case('COARSE_MAT')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_MAT',val,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SUBSOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
@ -504,6 +281,9 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use amg_c_ilu_solver use amg_c_ilu_solver
use amg_c_id_solver use amg_c_id_solver
use amg_c_gs_solver use amg_c_gs_solver
use amg_c_ainv_solver
use amg_c_invk_solver
use amg_c_invt_solver
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
use amg_c_slu_solver use amg_c_slu_solver
#endif #endif
@ -569,15 +349,62 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE',& case('SMOOTHER_TYPE')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',& ! Select the type of smoother between the one implemented in the library
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',& ! every new smoother should be added here
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', & select case(psb_toupper(string))
& 'COARSE_MAT') case ('BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
end do
case ('L1-BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
end do
case('GS','FWGS','FBGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case('L1-GS','L1-FWGS','L1-FBGS')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case ('BWGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
end do
case('JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
end do
case('L1-JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
end do
end select
case('SUB_SOLVE','ML_CYCLE','PAR_AGGR_ALG','AGGR_TYPE','SUB_RESTR'&
& ,'SUB_PROL')
! These are handled elsewhere
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos) call p%precv(nlev_)%set(what,string,info,pos=pos)
end do end do
case('COARSE_MAT')
! Select if the coarsest matrix is handled in a distributed way, few
! rows per rank, or if it is replicated completely on every rank
select case(psb_toupper(string))
case('DISTR')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_distr_mat_,info,pos=pos)
end do
case('REPL')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos)
end do
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -594,99 +421,110 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return return
end if end if
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) select case (psb_toupper(string))
select case (psb_toupper(trim(string))) case('BJAC')
case('BJAC', 'L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','dist',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU','MILU','ILUT') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','bjac',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI') case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','FWGS','FBGS') case('GS','FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-GS','L1-FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif end if
end select
case default case default
do il=ilev_, ilmax_ do il=ilev_, ilmax_
@ -695,6 +533,8 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
end select end select
else if (.not.present(ilev)) then else if (.not.present(ilev)) then
! !
! ilev not specified: set preconditioner parameters at all the appropriate ! ilev not specified: set preconditioner parameters at all the appropriate
@ -724,95 +564,106 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string))) select case (psb_toupper(trim(string)))
case('BJAC', 'L1-BJAC') case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','DIST',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU', 'ILUT','MILU') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
case('GS','FWGS','FBGS') call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('GS','FBGS')
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-FBGS','L1-GS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif endif
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (nlev_ > 1) then if (nlev_ > 1) then
@ -967,5 +818,3 @@ subroutine amg_ccprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
endif endif
end subroutine amg_ccprecsetr end subroutine amg_ccprecsetr

@ -86,6 +86,9 @@ subroutine amg_dcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use amg_d_ilu_solver use amg_d_ilu_solver
use amg_d_id_solver use amg_d_id_solver
use amg_d_gs_solver use amg_d_gs_solver
use amg_d_ainv_solver
use amg_d_invk_solver
use amg_d_invt_solver
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
use amg_d_umf_solver use amg_d_umf_solver
#endif #endif
@ -169,139 +172,12 @@ subroutine amg_dcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE','SMOOTHER_SWEEPS',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',&
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',&
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', &
& 'SUB_OVR','SUB_FILLIN',&
& 'COARSE_MAT')
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos) call p%precv(il)%set(what,val,info,pos=pos)
end do end do
case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set('SUB_SOLVE',val,info,pos=pos)
case('COARSE_SOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -333,139 +209,12 @@ subroutine amg_dcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
! levels ! levels
! !
select case(psb_toupper(trim(what))) select case(psb_toupper(trim(what)))
case('SUB_SOLVE','SUB_RESTR','SUB_PROL',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'SUB_OVR','SUB_FILLIN',&
& 'SMOOTHER_SWEEPS','SMOOTHER_TYPE')
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos) call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return if (info /= 0) return
end do end do
case('ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD','AGGR_PROL','AGGR_TYPE',&
& 'AGGR_OMEGA_ALG','AGGR_EIG','AGGR_FILTER')
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case('COARSE_MAT')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_MAT',val,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SUBSOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
@ -538,6 +287,9 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use amg_d_ilu_solver use amg_d_ilu_solver
use amg_d_id_solver use amg_d_id_solver
use amg_d_gs_solver use amg_d_gs_solver
use amg_d_ainv_solver
use amg_d_invk_solver
use amg_d_invt_solver
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
use amg_d_umf_solver use amg_d_umf_solver
#endif #endif
@ -609,15 +361,62 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE',& case('SMOOTHER_TYPE')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',& ! Select the type of smoother between the one implemented in the library
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',& ! every new smoother should be added here
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', & select case(psb_toupper(string))
& 'COARSE_MAT') case ('BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
end do
case ('L1-BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
end do
case('GS','FWGS','FBGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case('L1-GS','L1-FWGS','L1-FBGS')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case ('BWGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
end do
case('JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
end do
case('L1-JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
end do
end select
case('SUB_SOLVE','ML_CYCLE','PAR_AGGR_ALG','AGGR_TYPE','SUB_RESTR'&
& ,'SUB_PROL')
! These are handled elsewhere
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos) call p%precv(nlev_)%set(what,string,info,pos=pos)
end do end do
case('COARSE_MAT')
! Select if the coarsest matrix is handled in a distributed way, few
! rows per rank, or if it is replicated completely on every rank
select case(psb_toupper(string))
case('DISTR')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_distr_mat_,info,pos=pos)
end do
case('REPL')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos)
end do
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -634,112 +433,124 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return return
end if end if
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) select case (psb_toupper(string))
select case (psb_toupper(trim(string))) case('BJAC')
case('BJAC', 'L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','dist',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU','MILU','ILUT') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','bjac',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLUDIST_) #if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_) #elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI') case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','FWGS','FBGS') case('GS','FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-GS','L1-FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif end if
end select
case default case default
do il=ilev_, ilmax_ do il=ilev_, ilmax_
@ -748,6 +559,8 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
end select end select
else if (.not.present(ilev)) then else if (.not.present(ilev)) then
! !
! ilev not specified: set preconditioner parameters at all the appropriate ! ilev not specified: set preconditioner parameters at all the appropriate
@ -777,109 +590,120 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string))) select case (psb_toupper(trim(string)))
case('BJAC', 'L1-BJAC') case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','DIST',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU', 'ILUT','MILU') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLUDIST_) #if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_) #elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
case('GS','FWGS','FBGS') call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('GS','FBGS')
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-FBGS','L1-GS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif endif
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (nlev_ > 1) then if (nlev_ > 1) then
@ -1034,5 +858,3 @@ subroutine amg_dcprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
endif endif
end subroutine amg_dcprecsetr end subroutine amg_dcprecsetr

@ -86,6 +86,9 @@ subroutine amg_scprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use amg_s_ilu_solver use amg_s_ilu_solver
use amg_s_id_solver use amg_s_id_solver
use amg_s_gs_solver use amg_s_gs_solver
use amg_s_ainv_solver
use amg_s_invk_solver
use amg_s_invt_solver
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
use amg_s_slu_solver use amg_s_slu_solver
#endif #endif
@ -163,125 +166,12 @@ subroutine amg_scprecseti(p,what,val,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE','SMOOTHER_SWEEPS',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',&
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',&
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', &
& 'SUB_OVR','SUB_FILLIN',&
& 'COARSE_MAT')
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos) call p%precv(il)%set(what,val,info,pos=pos)
end do end do
case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set('SUB_SOLVE',val,info,pos=pos)
case('COARSE_SOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -313,125 +203,12 @@ subroutine amg_scprecseti(p,what,val,info,ilev,ilmax,pos,idx)
! levels ! levels
! !
select case(psb_toupper(trim(what))) select case(psb_toupper(trim(what)))
case('SUB_SOLVE','SUB_RESTR','SUB_PROL',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'SUB_OVR','SUB_FILLIN',&
& 'SMOOTHER_SWEEPS','SMOOTHER_TYPE')
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos) call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return if (info /= 0) return
end do end do
case('ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD','AGGR_PROL','AGGR_TYPE',&
& 'AGGR_OMEGA_ALG','AGGR_EIG','AGGR_FILTER')
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case('COARSE_MAT')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_MAT',val,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SUBSOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
@ -504,6 +281,9 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use amg_s_ilu_solver use amg_s_ilu_solver
use amg_s_id_solver use amg_s_id_solver
use amg_s_gs_solver use amg_s_gs_solver
use amg_s_ainv_solver
use amg_s_invk_solver
use amg_s_invt_solver
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
use amg_s_slu_solver use amg_s_slu_solver
#endif #endif
@ -569,15 +349,62 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE',& case('SMOOTHER_TYPE')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',& ! Select the type of smoother between the one implemented in the library
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',& ! every new smoother should be added here
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', & select case(psb_toupper(string))
& 'COARSE_MAT') case ('BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
end do
case ('L1-BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
end do
case('GS','FWGS','FBGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case('L1-GS','L1-FWGS','L1-FBGS')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case ('BWGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
end do
case('JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
end do
case('L1-JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
end do
end select
case('SUB_SOLVE','ML_CYCLE','PAR_AGGR_ALG','AGGR_TYPE','SUB_RESTR'&
& ,'SUB_PROL')
! These are handled elsewhere
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos) call p%precv(nlev_)%set(what,string,info,pos=pos)
end do end do
case('COARSE_MAT')
! Select if the coarsest matrix is handled in a distributed way, few
! rows per rank, or if it is replicated completely on every rank
select case(psb_toupper(string))
case('DISTR')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_distr_mat_,info,pos=pos)
end do
case('REPL')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos)
end do
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -594,99 +421,110 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return return
end if end if
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) select case (psb_toupper(string))
select case (psb_toupper(trim(string))) case('BJAC')
case('BJAC', 'L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','dist',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU','MILU','ILUT') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','bjac',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI') case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','FWGS','FBGS') case('GS','FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-GS','L1-FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif end if
end select
case default case default
do il=ilev_, ilmax_ do il=ilev_, ilmax_
@ -695,6 +533,8 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
end select end select
else if (.not.present(ilev)) then else if (.not.present(ilev)) then
! !
! ilev not specified: set preconditioner parameters at all the appropriate ! ilev not specified: set preconditioner parameters at all the appropriate
@ -724,95 +564,106 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string))) select case (psb_toupper(trim(string)))
case('BJAC', 'L1-BJAC') case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','DIST',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU', 'ILUT','MILU') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
case('GS','FWGS','FBGS') call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('GS','FBGS')
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-FBGS','L1-GS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif endif
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (nlev_ > 1) then if (nlev_ > 1) then
@ -967,5 +818,3 @@ subroutine amg_scprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
endif endif
end subroutine amg_scprecsetr end subroutine amg_scprecsetr

@ -86,6 +86,9 @@ subroutine amg_zcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use amg_z_ilu_solver use amg_z_ilu_solver
use amg_z_id_solver use amg_z_id_solver
use amg_z_gs_solver use amg_z_gs_solver
use amg_z_ainv_solver
use amg_z_invk_solver
use amg_z_invt_solver
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
use amg_z_umf_solver use amg_z_umf_solver
#endif #endif
@ -169,139 +172,12 @@ subroutine amg_zcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE','SMOOTHER_SWEEPS',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',&
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',&
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', &
& 'SUB_OVR','SUB_FILLIN',&
& 'COARSE_MAT')
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos) call p%precv(il)%set(what,val,info,pos=pos)
end do end do
case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set('SUB_SOLVE',val,info,pos=pos)
case('COARSE_SOLVE')
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -333,139 +209,12 @@ subroutine amg_zcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
! levels ! levels
! !
select case(psb_toupper(trim(what))) select case(psb_toupper(trim(what)))
case('SUB_SOLVE','SUB_RESTR','SUB_PROL',& case('SUB_OVR','SUB_FILLIN','SMOOTHER_SWEEPS')
& 'SUB_OVR','SUB_FILLIN',&
& 'SMOOTHER_SWEEPS','SMOOTHER_TYPE')
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos) call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return if (info /= 0) return
end do end do
case('ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD','AGGR_PROL','AGGR_TYPE',&
& 'AGGR_OMEGA_ALG','AGGR_EIG','AGGR_FILTER')
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case('COARSE_MAT')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_MAT',val,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(amg_bjac_,amg_l1_bjac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',val,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case(amg_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(psb_ilu_n_, psb_ilu_t_,psb_milu_n_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case(amg_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case(amg_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_jac_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_gs_,amg_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_bwgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case(amg_l1_gs_,amg_l1_fbgs_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select
endif
case('COARSE_SUBSOLVE')
if (nlev_ > 1) then
call p%precv(nlev_)%set('SUB_SOLVE',val,info,pos=pos)
endif
case('COARSE_SWEEPS') case('COARSE_SWEEPS')
@ -538,6 +287,9 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use amg_z_ilu_solver use amg_z_ilu_solver
use amg_z_id_solver use amg_z_id_solver
use amg_z_gs_solver use amg_z_gs_solver
use amg_z_ainv_solver
use amg_z_invk_solver
use amg_z_invt_solver
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
use amg_z_umf_solver use amg_z_umf_solver
#endif #endif
@ -609,15 +361,62 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (present(ilev)) then if (present(ilev)) then
select case(psb_toupper(what)) select case(psb_toupper(what))
case('SMOOTHER_TYPE','SUB_SOLVE',& case('SMOOTHER_TYPE')
& 'ML_CYCLE','PAR_AGGR_ALG','AGGR_ORD',& ! Select the type of smoother between the one implemented in the library
& 'AGGR_TYPE','AGGR_PROL','AGGR_OMEGA_ALG',& ! every new smoother should be added here
& 'AGGR_EIG','SUB_RESTR','SUB_PROL', & select case(psb_toupper(string))
& 'COARSE_MAT') case ('BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
end do
case ('L1-BJAC')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
end do
case('GS','FWGS','FBGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case('L1-GS','L1-FWGS','L1-FBGS')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
end do
case ('BWGS')
do il=ilev_, ilmax_
call p%precv(il)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(il)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
end do
case('JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
end do
case('L1-JACOBI')
do il=ilev_, ilmax_
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
end do
end select
case('SUB_SOLVE','ML_CYCLE','PAR_AGGR_ALG','AGGR_TYPE','SUB_RESTR'&
& ,'SUB_PROL')
! These are handled elsewhere
do il=ilev_, ilmax_ do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos) call p%precv(nlev_)%set(what,string,info,pos=pos)
end do end do
case('COARSE_MAT')
! Select if the coarsest matrix is handled in a distributed way, few
! rows per rank, or if it is replicated completely on every rank
select case(psb_toupper(string))
case('DISTR')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_distr_mat_,info,pos=pos)
end do
case('REPL')
do il=ilev_, ilmax_
call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos)
end do
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (ilev_ /= nlev_) then if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,& write(psb_err_unit,*) name,&
@ -634,112 +433,124 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return return
end if end if
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) select case (psb_toupper(string))
select case (psb_toupper(trim(string))) case('BJAC')
case('BJAC', 'L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','dist',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU','MILU','ILUT') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','bjac',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLUDIST_) #if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_) #elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI') case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','FWGS','FBGS') case('GS','FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-GS','L1-FBGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif end if
end select
case default case default
do il=ilev_, ilmax_ do il=ilev_, ilmax_
@ -748,6 +559,8 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
end select end select
else if (.not.present(ilev)) then else if (.not.present(ilev)) then
! !
! ilev not specified: set preconditioner parameters at all the appropriate ! ilev not specified: set preconditioner parameters at all the appropriate
@ -777,109 +590,120 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
if (nlev_ > 1) then if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string))) select case (psb_toupper(trim(string)))
case('BJAC', 'L1-BJAC') case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',psb_toupper(trim(string)),info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif #endif
call p%precv(nlev_)%set('COARSE_MAT','DIST',info) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU') case('SLU')
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('ILU', 'ILUT','MILU') case('ILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('ILUT')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_t_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MILU')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',psb_milu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS') case('MUMPS')
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('UMF') case('UMF')
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('SLUDIST') case('SLUDIST')
#if defined(HAVE_SLUDIST_) #if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_) #elif defined(HAVE_UMF_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','UMF',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_) #elif defined(HAVE_SLU_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','SLU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','REPL',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_) #elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','MUMPS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#else #else
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','ILU',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif #endif
case('JAC','JACOBI') case('JACOBI','JAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','DIAG',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('L1-JACOBI','L1-JAC')
call p%precv(nlev_)%set('SUB_SOLVE','L1-DIAG',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_l1_diag_scale_,info,pos=pos)
case('GS','FWGS','FBGS') call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) case('GS','FBGS')
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('BWGS') case('BWGS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','BWGS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_bwgs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS') case('L1-FBGS','L1-GS')
call p%precv(nlev_)%set('SMOOTHER_TYPE','L1-BJAC',info,pos=pos) call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE','GS',info,pos=pos) call p%precv(nlev_)%set('SUB_SOLVE',amg_gs_,info,pos=pos)
call p%precv(nlev_)%set('COARSE_MAT','DIST',info,pos=pos) call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end select end select
endif endif
case('COARSE_SUBSOLVE') case('COARSE_SUBSOLVE')
if (nlev_ > 1) then if (nlev_ > 1) then
@ -1034,5 +858,3 @@ subroutine amg_zcprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
endif endif
end subroutine amg_zcprecsetr end subroutine amg_zcprecsetr

@ -49,6 +49,9 @@ subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_c_ilu_solver use amg_c_ilu_solver
use amg_c_id_solver use amg_c_id_solver
use amg_c_gs_solver use amg_c_gs_solver
use amg_c_ainv_solver
use amg_c_invk_solver
use amg_c_invt_solver
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
use amg_c_slu_solver use amg_c_slu_solver
#endif #endif
@ -79,6 +82,9 @@ subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
type(amg_c_id_solver_type) :: amg_c_id_solver_mold type(amg_c_id_solver_type) :: amg_c_id_solver_mold
type(amg_c_gs_solver_type) :: amg_c_gs_solver_mold type(amg_c_gs_solver_type) :: amg_c_gs_solver_mold
type(amg_c_bwgs_solver_type) :: amg_c_bwgs_solver_mold type(amg_c_bwgs_solver_type) :: amg_c_bwgs_solver_mold
type(amg_c_ainv_solver_type) :: amg_c_ainv_solver_mold
type(amg_c_invk_solver_type) :: amg_c_invk_solver_mold
type(amg_c_invt_solver_type) :: amg_c_invt_solver_mold
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
type(amg_c_slu_solver_type) :: amg_c_slu_solver_mold type(amg_c_slu_solver_type) :: amg_c_slu_solver_mold
#endif #endif
@ -191,6 +197,12 @@ subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
case ('BGS','BWGS') case ('BGS','BWGS')
call lv%set(amg_c_bwgs_solver_mold,info,pos=pos) call lv%set(amg_c_bwgs_solver_mold,info,pos=pos)
case ('AINV')
call lv%set(amg_c_ainv_solver_mold,info,pos=pos)
case ('INVK')
call lv%set(amg_c_invk_solver_mold,info,pos=pos)
case ('INVT')
call lv%set(amg_c_invt_solver_mold,info,pos=pos)
case ('ILU','ILUT','MILU') case ('ILU','ILUT','MILU')
call lv%set(amg_c_ilu_solver_mold,info,pos=pos) call lv%set(amg_c_ilu_solver_mold,info,pos=pos)
if (info == 0) then if (info == 0) then

@ -49,6 +49,9 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_d_ilu_solver use amg_d_ilu_solver
use amg_d_id_solver use amg_d_id_solver
use amg_d_gs_solver use amg_d_gs_solver
use amg_d_ainv_solver
use amg_d_invk_solver
use amg_d_invt_solver
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
use amg_d_umf_solver use amg_d_umf_solver
#endif #endif
@ -85,6 +88,9 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
type(amg_d_id_solver_type) :: amg_d_id_solver_mold type(amg_d_id_solver_type) :: amg_d_id_solver_mold
type(amg_d_gs_solver_type) :: amg_d_gs_solver_mold type(amg_d_gs_solver_type) :: amg_d_gs_solver_mold
type(amg_d_bwgs_solver_type) :: amg_d_bwgs_solver_mold type(amg_d_bwgs_solver_type) :: amg_d_bwgs_solver_mold
type(amg_d_ainv_solver_type) :: amg_d_ainv_solver_mold
type(amg_d_invk_solver_type) :: amg_d_invk_solver_mold
type(amg_d_invt_solver_type) :: amg_d_invt_solver_mold
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
type(amg_d_umf_solver_type) :: amg_d_umf_solver_mold type(amg_d_umf_solver_type) :: amg_d_umf_solver_mold
#endif #endif
@ -203,6 +209,12 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
case ('BGS','BWGS') case ('BGS','BWGS')
call lv%set(amg_d_bwgs_solver_mold,info,pos=pos) call lv%set(amg_d_bwgs_solver_mold,info,pos=pos)
case ('AINV')
call lv%set(amg_d_ainv_solver_mold,info,pos=pos)
case ('INVK')
call lv%set(amg_d_invk_solver_mold,info,pos=pos)
case ('INVT')
call lv%set(amg_d_invt_solver_mold,info,pos=pos)
case ('ILU','ILUT','MILU') case ('ILU','ILUT','MILU')
call lv%set(amg_d_ilu_solver_mold,info,pos=pos) call lv%set(amg_d_ilu_solver_mold,info,pos=pos)
if (info == 0) then if (info == 0) then

@ -49,6 +49,9 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_s_ilu_solver use amg_s_ilu_solver
use amg_s_id_solver use amg_s_id_solver
use amg_s_gs_solver use amg_s_gs_solver
use amg_s_ainv_solver
use amg_s_invk_solver
use amg_s_invt_solver
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
use amg_s_slu_solver use amg_s_slu_solver
#endif #endif
@ -79,6 +82,9 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
type(amg_s_id_solver_type) :: amg_s_id_solver_mold type(amg_s_id_solver_type) :: amg_s_id_solver_mold
type(amg_s_gs_solver_type) :: amg_s_gs_solver_mold type(amg_s_gs_solver_type) :: amg_s_gs_solver_mold
type(amg_s_bwgs_solver_type) :: amg_s_bwgs_solver_mold type(amg_s_bwgs_solver_type) :: amg_s_bwgs_solver_mold
type(amg_s_ainv_solver_type) :: amg_s_ainv_solver_mold
type(amg_s_invk_solver_type) :: amg_s_invk_solver_mold
type(amg_s_invt_solver_type) :: amg_s_invt_solver_mold
#if defined(HAVE_SLU_) #if defined(HAVE_SLU_)
type(amg_s_slu_solver_type) :: amg_s_slu_solver_mold type(amg_s_slu_solver_type) :: amg_s_slu_solver_mold
#endif #endif
@ -191,6 +197,12 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
case ('BGS','BWGS') case ('BGS','BWGS')
call lv%set(amg_s_bwgs_solver_mold,info,pos=pos) call lv%set(amg_s_bwgs_solver_mold,info,pos=pos)
case ('AINV')
call lv%set(amg_s_ainv_solver_mold,info,pos=pos)
case ('INVK')
call lv%set(amg_s_invk_solver_mold,info,pos=pos)
case ('INVT')
call lv%set(amg_s_invt_solver_mold,info,pos=pos)
case ('ILU','ILUT','MILU') case ('ILU','ILUT','MILU')
call lv%set(amg_s_ilu_solver_mold,info,pos=pos) call lv%set(amg_s_ilu_solver_mold,info,pos=pos)
if (info == 0) then if (info == 0) then

@ -49,6 +49,9 @@ subroutine amg_z_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_z_ilu_solver use amg_z_ilu_solver
use amg_z_id_solver use amg_z_id_solver
use amg_z_gs_solver use amg_z_gs_solver
use amg_z_ainv_solver
use amg_z_invk_solver
use amg_z_invt_solver
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
use amg_z_umf_solver use amg_z_umf_solver
#endif #endif
@ -85,6 +88,9 @@ subroutine amg_z_base_onelev_csetc(lv,what,val,info,pos,idx)
type(amg_z_id_solver_type) :: amg_z_id_solver_mold type(amg_z_id_solver_type) :: amg_z_id_solver_mold
type(amg_z_gs_solver_type) :: amg_z_gs_solver_mold type(amg_z_gs_solver_type) :: amg_z_gs_solver_mold
type(amg_z_bwgs_solver_type) :: amg_z_bwgs_solver_mold type(amg_z_bwgs_solver_type) :: amg_z_bwgs_solver_mold
type(amg_z_ainv_solver_type) :: amg_z_ainv_solver_mold
type(amg_z_invk_solver_type) :: amg_z_invk_solver_mold
type(amg_z_invt_solver_type) :: amg_z_invt_solver_mold
#if defined(HAVE_UMF_) #if defined(HAVE_UMF_)
type(amg_z_umf_solver_type) :: amg_z_umf_solver_mold type(amg_z_umf_solver_type) :: amg_z_umf_solver_mold
#endif #endif
@ -203,6 +209,12 @@ subroutine amg_z_base_onelev_csetc(lv,what,val,info,pos,idx)
case ('BGS','BWGS') case ('BGS','BWGS')
call lv%set(amg_z_bwgs_solver_mold,info,pos=pos) call lv%set(amg_z_bwgs_solver_mold,info,pos=pos)
case ('AINV')
call lv%set(amg_z_ainv_solver_mold,info,pos=pos)
case ('INVK')
call lv%set(amg_z_invk_solver_mold,info,pos=pos)
case ('INVT')
call lv%set(amg_z_invt_solver_mold,info,pos=pos)
case ('ILU','ILUT','MILU') case ('ILU','ILUT','MILU')
call lv%set(amg_z_ilu_solver_mold,info,pos=pos) call lv%set(amg_z_ilu_solver_mold,info,pos=pos)
if (info == 0) then if (info == 0) then

@ -112,9 +112,6 @@ program amg_d_pde2d
type(solverdata) :: s_choice type(solverdata) :: s_choice
! preconditioner data ! preconditioner data
type(amg_d_invt_solver_type) :: invtsv
type(amg_d_invk_solver_type) :: invksv
type(amg_d_ainv_solver_type) :: ainvsv
type precdata type precdata
! preconditioner type ! preconditioner type
@ -309,11 +306,11 @@ program amg_d_pde2d
call prec%set('sub_prol', p_choice%prol, info) call prec%set('sub_prol', p_choice%prol, info)
select case(trim(psb_toupper(p_choice%solve))) select case(trim(psb_toupper(p_choice%solve)))
case('INVK') case('INVK')
call prec%set(invksv, info) call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info) call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info) call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant, info) call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve, info) call prec%set('sub_solve', p_choice%solve, info)
@ -336,12 +333,12 @@ program amg_d_pde2d
call prec%set('sub_prol', p_choice%prol2, info,pos='post') call prec%set('sub_prol', p_choice%prol2, info,pos='post')
select case(trim(psb_toupper(p_choice%solve2))) select case(trim(psb_toupper(p_choice%solve2)))
case('INVK') case('INVK')
call prec%set(invksv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant2, info, pos='post') call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve2, info, pos='post') call prec%set('sub_solve', p_choice%solve2, info, pos='post')
end select end select

@ -113,9 +113,6 @@ program amg_d_pde3d
type(solverdata) :: s_choice type(solverdata) :: s_choice
! preconditioner data ! preconditioner data
type(amg_d_invt_solver_type) :: invtsv
type(amg_d_invk_solver_type) :: invksv
type(amg_d_ainv_solver_type) :: ainvsv
type precdata type precdata
! preconditioner type ! preconditioner type
@ -313,11 +310,11 @@ program amg_d_pde3d
call prec%set('sub_prol', p_choice%prol, info) call prec%set('sub_prol', p_choice%prol, info)
select case(trim(psb_toupper(p_choice%solve))) select case(trim(psb_toupper(p_choice%solve)))
case('INVK') case('INVK')
call prec%set(invksv, info) call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info) call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info) call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant, info) call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve, info) call prec%set('sub_solve', p_choice%solve, info)
@ -340,12 +337,12 @@ program amg_d_pde3d
call prec%set('sub_prol', p_choice%prol2, info,pos='post') call prec%set('sub_prol', p_choice%prol2, info,pos='post')
select case(trim(psb_toupper(p_choice%solve2))) select case(trim(psb_toupper(p_choice%solve2)))
case('INVK') case('INVK')
call prec%set(invksv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant2, info, pos='post') call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve2, info, pos='post') call prec%set('sub_solve', p_choice%solve2, info, pos='post')
end select end select

@ -112,9 +112,6 @@ program amg_s_pde2d
type(solverdata) :: s_choice type(solverdata) :: s_choice
! preconditioner data ! preconditioner data
type(amg_s_invt_solver_type) :: invtsv
type(amg_s_invk_solver_type) :: invksv
type(amg_s_ainv_solver_type) :: ainvsv
type precdata type precdata
! preconditioner type ! preconditioner type
@ -309,11 +306,11 @@ program amg_s_pde2d
call prec%set('sub_prol', p_choice%prol, info) call prec%set('sub_prol', p_choice%prol, info)
select case(trim(psb_toupper(p_choice%solve))) select case(trim(psb_toupper(p_choice%solve)))
case('INVK') case('INVK')
call prec%set(invksv, info) call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info) call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info) call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant, info) call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve, info) call prec%set('sub_solve', p_choice%solve, info)
@ -336,12 +333,12 @@ program amg_s_pde2d
call prec%set('sub_prol', p_choice%prol2, info,pos='post') call prec%set('sub_prol', p_choice%prol2, info,pos='post')
select case(trim(psb_toupper(p_choice%solve2))) select case(trim(psb_toupper(p_choice%solve2)))
case('INVK') case('INVK')
call prec%set(invksv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant2, info, pos='post') call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve2, info, pos='post') call prec%set('sub_solve', p_choice%solve2, info, pos='post')
end select end select

@ -113,9 +113,6 @@ program amg_s_pde3d
type(solverdata) :: s_choice type(solverdata) :: s_choice
! preconditioner data ! preconditioner data
type(amg_s_invt_solver_type) :: invtsv
type(amg_s_invk_solver_type) :: invksv
type(amg_s_ainv_solver_type) :: ainvsv
type precdata type precdata
! preconditioner type ! preconditioner type
@ -313,11 +310,11 @@ program amg_s_pde3d
call prec%set('sub_prol', p_choice%prol, info) call prec%set('sub_prol', p_choice%prol, info)
select case(trim(psb_toupper(p_choice%solve))) select case(trim(psb_toupper(p_choice%solve)))
case('INVK') case('INVK')
call prec%set(invksv, info) call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info) call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info) call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant, info) call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve, info) call prec%set('sub_solve', p_choice%solve, info)
@ -340,12 +337,12 @@ program amg_s_pde3d
call prec%set('sub_prol', p_choice%prol2, info,pos='post') call prec%set('sub_prol', p_choice%prol2, info,pos='post')
select case(trim(psb_toupper(p_choice%solve2))) select case(trim(psb_toupper(p_choice%solve2)))
case('INVK') case('INVK')
call prec%set(invksv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('INVT') case('INVT')
call prec%set(invtsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
case('AINV') case('AINV')
call prec%set(ainvsv, info, pos='post') call prec%set('sub_solve', p_choice%solve, info)
call prec%set('ainv_alg', p_choice%variant2, info, pos='post') call prec%set('ainv_alg', p_choice%variant, info)
case default case default
call prec%set('sub_solve', p_choice%solve2, info, pos='post') call prec%set('sub_solve', p_choice%solve2, info, pos='post')
end select end select

Loading…
Cancel
Save