Modified precset to warn about overriding COARSE_MAT

fixmatch
Salvatore Filippone 2 years ago
parent bccde3a8b0
commit 92e0fd7f19

@ -94,6 +94,7 @@ module amg_base_prec_type
integer(psb_ipk_) :: aggr_omega_alg, aggr_eig, aggr_filter
integer(psb_ipk_) :: coarse_mat, coarse_solve
contains
procedure, pass(pm) :: get_coarse_mat => ml_parms_get_coarse_mat
procedure, pass(pm) :: get_coarse => ml_parms_get_coarse
procedure, pass(pm) :: clone => ml_parms_clone
procedure, pass(pm) :: descr => ml_parms_descr
@ -577,6 +578,33 @@ contains
end select
end function amg_stringval
function amg_get_coarse_mat_name(val) result(res)
character(len=15) :: res
integer :: val
select case(val)
case (0,1)
res = matrix_names(val)
case default
res = 'Unknown '
end select
end function amg_get_coarse_mat_name
subroutine amg_warn_coarse_mat(val,expected)
integer(psb_ipk_) :: val, expected
if (val /= expected) then
write(0,*) 'Warning: resetting COARSE_MAT on an existing hierarchy from ',&
& amg_get_coarse_mat_name(val), ' to ',amg_get_coarse_mat_name(expected)
end if
end subroutine amg_warn_coarse_mat
function ml_parms_get_coarse_mat(pm) result(res)
implicit none
class(amg_ml_parms), intent(in) :: pm
integer(psb_ipk_) :: res
res = pm%coarse_mat
end function ml_parms_get_coarse_mat
subroutine ml_parms_get_coarse(pm,pmin)
implicit none
class(amg_ml_parms), intent(inout) :: pm

@ -336,7 +336,8 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='amg_precsetc'
logical :: hier_asb
info = psb_success_
if (.not.allocated(p%precv)) then
@ -459,6 +460,7 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return
end if
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
select case (psb_toupper(string))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
@ -469,7 +471,11 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
@ -479,55 +485,91 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -535,42 +577,69 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_c_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select
@ -610,11 +679,16 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
case('COARSE_MAT')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_stringval(string))
call p%precv(nlev_)%set('COARSE_MAT',string,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string)))
case('BJAC')
@ -626,6 +700,9 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
@ -636,55 +713,91 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -692,42 +805,69 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-FBGS','L1-GS')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_c_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select

@ -237,7 +237,6 @@ subroutine amg_cprecinit(ctxt,prec,ptype,info)
#else
call prec%set('COARSE_SOLVE','ILU',info)
#endif
case default
write(psb_err_unit,*) name,&
&': Warning: Unknown preconditioner type request "',ptype,'"'

@ -348,7 +348,8 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='amg_precsetc'
logical :: hier_asb
info = psb_success_
if (.not.allocated(p%precv)) then
@ -471,6 +472,7 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return
end if
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
select case (psb_toupper(string))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
@ -483,7 +485,11 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
@ -495,59 +501,98 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -555,50 +600,83 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_d_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select
@ -638,11 +716,16 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
case('COARSE_MAT')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_stringval(string))
call p%precv(nlev_)%set('COARSE_MAT',string,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string)))
case('BJAC')
@ -656,6 +739,9 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
@ -668,59 +754,98 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -728,50 +853,83 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-FBGS','L1-GS')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_d_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select

@ -242,7 +242,6 @@ subroutine amg_dprecinit(ctxt,prec,ptype,info)
#else
call prec%set('COARSE_SOLVE','ILU',info)
#endif
case default
write(psb_err_unit,*) name,&
&': Warning: Unknown preconditioner type request "',ptype,'"'

@ -336,7 +336,8 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='amg_precsetc'
logical :: hier_asb
info = psb_success_
if (.not.allocated(p%precv)) then
@ -459,6 +460,7 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return
end if
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
select case (psb_toupper(string))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
@ -469,7 +471,11 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
@ -479,55 +485,91 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -535,42 +577,69 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_s_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select
@ -610,11 +679,16 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
case('COARSE_MAT')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_stringval(string))
call p%precv(nlev_)%set('COARSE_MAT',string,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string)))
case('BJAC')
@ -626,6 +700,9 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
@ -636,55 +713,91 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -692,42 +805,69 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-FBGS','L1-GS')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_s_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select

@ -237,7 +237,6 @@ subroutine amg_sprecinit(ctxt,prec,ptype,info)
#else
call prec%set('COARSE_SOLVE','ILU',info)
#endif
case default
write(psb_err_unit,*) name,&
&': Warning: Unknown preconditioner type request "',ptype,'"'

@ -348,7 +348,8 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='amg_precsetc'
logical :: hier_asb
info = psb_success_
if (.not.allocated(p%precv)) then
@ -471,6 +472,7 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
return
end if
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
select case (psb_toupper(string))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
@ -483,7 +485,11 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
@ -495,59 +501,98 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -555,50 +600,83 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_z_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select
@ -638,11 +716,16 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
case('COARSE_MAT')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_stringval(string))
call p%precv(nlev_)%set('COARSE_MAT',string,info,pos=pos)
end if
case('COARSE_SOLVE')
if (nlev_ > 1) then
hier_asb = p%precv(nlev_)%ac%is_asb()
call p%precv(nlev_)%set('COARSE_SOLVE',string,info,pos=pos)
select case (psb_toupper(trim(string)))
case('BJAC')
@ -656,6 +739,9 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
@ -668,59 +754,98 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#else
call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos)
#endif
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('ILU')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if 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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
@ -728,50 +853,83 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-JACOBI','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('GS','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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('L1-FBGS','L1-GS')
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)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
case('KRM')
block
type(amg_z_krm_solver_type) :: krm_slv
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
call p%precv(nlev_)%set(krm_slv,info)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
end block
end select

@ -242,7 +242,6 @@ subroutine amg_zprecinit(ctxt,prec,ptype,info)
#else
call prec%set('COARSE_SOLVE','ILU',info)
#endif
case default
write(psb_err_unit,*) name,&
&': Warning: Unknown preconditioner type request "',ptype,'"'

Loading…
Cancel
Save