mld2p4-2:

mlprec/impl/mld_c_extprol_bld.f90
 mlprec/impl/mld_c_hierarchy_bld.f90
 mlprec/impl/mld_ccprecset.F90
 mlprec/impl/mld_cprecinit.F90
 mlprec/impl/mld_cprecset.F90
 mlprec/impl/mld_d_extprol_bld.f90
 mlprec/impl/mld_d_hierarchy_bld.f90
 mlprec/impl/mld_dcprecset.F90
 mlprec/impl/mld_dprecinit.F90
 mlprec/impl/mld_dprecset.F90
 mlprec/impl/mld_s_extprol_bld.f90
 mlprec/impl/mld_s_hierarchy_bld.f90
 mlprec/impl/mld_scprecset.F90
 mlprec/impl/mld_sprecinit.F90
 mlprec/impl/mld_sprecset.F90
 mlprec/impl/mld_z_extprol_bld.f90
 mlprec/impl/mld_z_hierarchy_bld.f90
 mlprec/impl/mld_zcprecset.F90
 mlprec/impl/mld_zprecinit.F90
 mlprec/impl/mld_zprecset.F90
 mlprec/mld_c_prec_type.f90
 mlprec/mld_d_prec_type.f90
 mlprec/mld_s_prec_type.f90
 mlprec/mld_z_prec_type.f90
 tests/fileread/mld_cf_sample.f90
 tests/fileread/mld_df_sample.f90
 tests/fileread/mld_sf_sample.f90
 tests/fileread/mld_zf_sample.f90
 tests/pdegen/mld_d_pde2d.f90
 tests/pdegen/mld_d_pde3d.f90
 tests/pdegen/mld_s_pde2d.f90
 tests/pdegen/mld_s_pde3d.f90
 tests/pdegen/runs/mld_pde2d.inp
 tests/pdegen/runs/mld_pde3d.inp

Take out n_prec_levs, leaving only max_prec_levs
stopcriterion
Salvatore Filippone 8 years ago
parent 0e856510d6
commit 22dd11efb5

@ -155,7 +155,6 @@ subroutine mld_c_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
@ -164,7 +163,6 @@ subroutine mld_c_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
nrestrv = size(restrv) nrestrv = size(restrv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
call psb_bcast(ictxt,nprolv) call psb_bcast(ictxt,nprolv)
@ -174,11 +172,6 @@ subroutine mld_c_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -228,12 +221,12 @@ subroutine mld_c_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
nplevs = nrestrv + 1 nplevs = nrestrv + 1
p%n_prec_levs = nplevs p%max_prec_levs = nplevs
! !
! Fixed number of levels. ! Fixed number of levels.
! !
nplevs = max(itwo,min(nplevs,mxplevs)) nplevs = max(itwo,mxplevs)
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -139,14 +139,12 @@ subroutine mld_c_hierarchy_bld(a,desc_a,p,info)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
iszv = size(p%precv) iszv = size(p%precv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
if (casize /= p%coarse_aggr_size) then if (casize /= p%coarse_aggr_size) then
@ -154,11 +152,6 @@ subroutine mld_c_hierarchy_bld(a,desc_a,p,info)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -202,29 +195,23 @@ subroutine mld_c_hierarchy_bld(a,desc_a,p,info)
! size of the array; ! size of the array;
! 2. If the user did not specify anything, then a default coarse size ! 2. If the user did not specify anything, then a default coarse size
! is generated, and the number of levels is set to the maximum; ! is generated, and the number of levels is set to the maximum;
! 3. If the number of levels has been specified, make sure it's capped ! 3. If the size of the array is different from target number of levels,
! at the maximum;
! 4. If the size of the array is different from target number of levels,
! reallocate; ! reallocate;
! 5. Build the matrix hierarchy, stopping early if either the target ! 4. Build the matrix hierarchy, stopping early if either the target
! coarse size is hit, or the gain falls below the min_aggr_ratio ! coarse size is hit, or the gain falls below the min_aggr_ratio
! threshold. ! threshold.
! !
if (nplevs <= 0) then if (casize <=0) then
if (casize <=0) then !
! ! Default to the cubic root of the size at base level.
! Default to the cubic root of the size at base level. !
! casize = desc_a%get_global_rows()
casize = desc_a%get_global_rows() casize = int((sone*casize)**(sone/(sone*3)),psb_ipk_)
casize = int((sone*casize)**(sone/(sone*3)),psb_ipk_) casize = max(casize,ione)
casize = max(casize,ione) casize = casize*40_psb_ipk_
casize = casize*40_psb_ipk_
end if
nplevs = mxplevs
end if end if
nplevs = max(itwo,mxplevs)
nplevs = max(itwo,min(nplevs,mxplevs))
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -138,9 +138,6 @@ subroutine mld_ccprecseti(p,what,val,info,ilev,ilmax,pos)
case ('COARSE_AGGR_SIZE') case ('COARSE_AGGR_SIZE')
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case ('N_PREC_LEVS')
p%n_prec_levs = max(val,1)
return
case('MAX_PREC_LEVS') case('MAX_PREC_LEVS')
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -167,10 +167,9 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
p%n_prec_levs = nlev_ p%max_prec_levs = nlev_
else else
nlev_ = p%max_prec_levs nlev_ = p%max_prec_levs
p%n_prec_levs = -ione
end if end if
ilev_ = 1 ilev_ = 1
allocate(p%precv(nlev_),stat=info) allocate(p%precv(nlev_),stat=info)

@ -137,9 +137,6 @@ subroutine mld_cprecseti(p,what,val,info,ilev,ilmax,pos)
case (mld_coarse_aggr_size_) case (mld_coarse_aggr_size_)
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case (mld_n_prec_levs_)
p%n_prec_levs = max(val,1)
return
case(mld_max_prec_levs_) case(mld_max_prec_levs_)
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -155,7 +155,6 @@ subroutine mld_d_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
@ -164,7 +163,6 @@ subroutine mld_d_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
nrestrv = size(restrv) nrestrv = size(restrv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
call psb_bcast(ictxt,nprolv) call psb_bcast(ictxt,nprolv)
@ -174,11 +172,6 @@ subroutine mld_d_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -228,12 +221,12 @@ subroutine mld_d_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
nplevs = nrestrv + 1 nplevs = nrestrv + 1
p%n_prec_levs = nplevs p%max_prec_levs = nplevs
! !
! Fixed number of levels. ! Fixed number of levels.
! !
nplevs = max(itwo,min(nplevs,mxplevs)) nplevs = max(itwo,mxplevs)
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -139,14 +139,12 @@ subroutine mld_d_hierarchy_bld(a,desc_a,p,info)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
iszv = size(p%precv) iszv = size(p%precv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
if (casize /= p%coarse_aggr_size) then if (casize /= p%coarse_aggr_size) then
@ -154,11 +152,6 @@ subroutine mld_d_hierarchy_bld(a,desc_a,p,info)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -202,29 +195,23 @@ subroutine mld_d_hierarchy_bld(a,desc_a,p,info)
! size of the array; ! size of the array;
! 2. If the user did not specify anything, then a default coarse size ! 2. If the user did not specify anything, then a default coarse size
! is generated, and the number of levels is set to the maximum; ! is generated, and the number of levels is set to the maximum;
! 3. If the number of levels has been specified, make sure it's capped ! 3. If the size of the array is different from target number of levels,
! at the maximum;
! 4. If the size of the array is different from target number of levels,
! reallocate; ! reallocate;
! 5. Build the matrix hierarchy, stopping early if either the target ! 4. Build the matrix hierarchy, stopping early if either the target
! coarse size is hit, or the gain falls below the min_aggr_ratio ! coarse size is hit, or the gain falls below the min_aggr_ratio
! threshold. ! threshold.
! !
if (nplevs <= 0) then if (casize <=0) then
if (casize <=0) then !
! ! Default to the cubic root of the size at base level.
! Default to the cubic root of the size at base level. !
! casize = desc_a%get_global_rows()
casize = desc_a%get_global_rows() casize = int((done*casize)**(done/(done*3)),psb_ipk_)
casize = int((done*casize)**(done/(done*3)),psb_ipk_) casize = max(casize,ione)
casize = max(casize,ione) casize = casize*40_psb_ipk_
casize = casize*40_psb_ipk_
end if
nplevs = mxplevs
end if end if
nplevs = max(itwo,mxplevs)
nplevs = max(itwo,min(nplevs,mxplevs))
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -144,9 +144,6 @@ subroutine mld_dcprecseti(p,what,val,info,ilev,ilmax,pos)
case ('COARSE_AGGR_SIZE') case ('COARSE_AGGR_SIZE')
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case ('N_PREC_LEVS')
p%n_prec_levs = max(val,1)
return
case('MAX_PREC_LEVS') case('MAX_PREC_LEVS')
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -170,10 +170,9 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
p%n_prec_levs = nlev_ p%max_prec_levs = nlev_
else else
nlev_ = p%max_prec_levs nlev_ = p%max_prec_levs
p%n_prec_levs = -ione
end if end if
ilev_ = 1 ilev_ = 1
allocate(p%precv(nlev_),stat=info) allocate(p%precv(nlev_),stat=info)

@ -143,9 +143,6 @@ subroutine mld_dprecseti(p,what,val,info,ilev,ilmax,pos)
case (mld_coarse_aggr_size_) case (mld_coarse_aggr_size_)
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case (mld_n_prec_levs_)
p%n_prec_levs = max(val,1)
return
case(mld_max_prec_levs_) case(mld_max_prec_levs_)
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -155,7 +155,6 @@ subroutine mld_s_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
@ -164,7 +163,6 @@ subroutine mld_s_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
nrestrv = size(restrv) nrestrv = size(restrv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
call psb_bcast(ictxt,nprolv) call psb_bcast(ictxt,nprolv)
@ -174,11 +172,6 @@ subroutine mld_s_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -228,12 +221,12 @@ subroutine mld_s_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
nplevs = nrestrv + 1 nplevs = nrestrv + 1
p%n_prec_levs = nplevs p%max_prec_levs = nplevs
! !
! Fixed number of levels. ! Fixed number of levels.
! !
nplevs = max(itwo,min(nplevs,mxplevs)) nplevs = max(itwo,mxplevs)
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -139,14 +139,12 @@ subroutine mld_s_hierarchy_bld(a,desc_a,p,info)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
iszv = size(p%precv) iszv = size(p%precv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
if (casize /= p%coarse_aggr_size) then if (casize /= p%coarse_aggr_size) then
@ -154,11 +152,6 @@ subroutine mld_s_hierarchy_bld(a,desc_a,p,info)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -202,29 +195,23 @@ subroutine mld_s_hierarchy_bld(a,desc_a,p,info)
! size of the array; ! size of the array;
! 2. If the user did not specify anything, then a default coarse size ! 2. If the user did not specify anything, then a default coarse size
! is generated, and the number of levels is set to the maximum; ! is generated, and the number of levels is set to the maximum;
! 3. If the number of levels has been specified, make sure it's capped ! 3. If the size of the array is different from target number of levels,
! at the maximum;
! 4. If the size of the array is different from target number of levels,
! reallocate; ! reallocate;
! 5. Build the matrix hierarchy, stopping early if either the target ! 4. Build the matrix hierarchy, stopping early if either the target
! coarse size is hit, or the gain falls below the min_aggr_ratio ! coarse size is hit, or the gain falls below the min_aggr_ratio
! threshold. ! threshold.
! !
if (nplevs <= 0) then if (casize <=0) then
if (casize <=0) then !
! ! Default to the cubic root of the size at base level.
! Default to the cubic root of the size at base level. !
! casize = desc_a%get_global_rows()
casize = desc_a%get_global_rows() casize = int((sone*casize)**(sone/(sone*3)),psb_ipk_)
casize = int((sone*casize)**(sone/(sone*3)),psb_ipk_) casize = max(casize,ione)
casize = max(casize,ione) casize = casize*40_psb_ipk_
casize = casize*40_psb_ipk_
end if
nplevs = mxplevs
end if end if
nplevs = max(itwo,mxplevs)
nplevs = max(itwo,min(nplevs,mxplevs))
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -138,9 +138,6 @@ subroutine mld_scprecseti(p,what,val,info,ilev,ilmax,pos)
case ('COARSE_AGGR_SIZE') case ('COARSE_AGGR_SIZE')
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case ('N_PREC_LEVS')
p%n_prec_levs = max(val,1)
return
case('MAX_PREC_LEVS') case('MAX_PREC_LEVS')
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -167,10 +167,9 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
p%n_prec_levs = nlev_ p%max_prec_levs = nlev_
else else
nlev_ = p%max_prec_levs nlev_ = p%max_prec_levs
p%n_prec_levs = -ione
end if end if
ilev_ = 1 ilev_ = 1
allocate(p%precv(nlev_),stat=info) allocate(p%precv(nlev_),stat=info)

@ -137,9 +137,6 @@ subroutine mld_sprecseti(p,what,val,info,ilev,ilmax,pos)
case (mld_coarse_aggr_size_) case (mld_coarse_aggr_size_)
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case (mld_n_prec_levs_)
p%n_prec_levs = max(val,1)
return
case(mld_max_prec_levs_) case(mld_max_prec_levs_)
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -155,7 +155,6 @@ subroutine mld_z_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
@ -164,7 +163,6 @@ subroutine mld_z_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
nrestrv = size(restrv) nrestrv = size(restrv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
call psb_bcast(ictxt,nprolv) call psb_bcast(ictxt,nprolv)
@ -174,11 +172,6 @@ subroutine mld_z_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -228,12 +221,12 @@ subroutine mld_z_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
! !
nplevs = nrestrv + 1 nplevs = nrestrv + 1
p%n_prec_levs = nplevs p%max_prec_levs = nplevs
! !
! Fixed number of levels. ! Fixed number of levels.
! !
nplevs = max(itwo,min(nplevs,mxplevs)) nplevs = max(itwo,mxplevs)
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -139,14 +139,12 @@ subroutine mld_z_hierarchy_bld(a,desc_a,p,info)
! !
newsz = -1 newsz = -1
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
nplevs = p%n_prec_levs
mxplevs = p%max_prec_levs mxplevs = p%max_prec_levs
mnaggratio = p%min_aggr_ratio mnaggratio = p%min_aggr_ratio
casize = p%coarse_aggr_size casize = p%coarse_aggr_size
iszv = size(p%precv) iszv = size(p%precv)
call psb_bcast(ictxt,iszv) call psb_bcast(ictxt,iszv)
call psb_bcast(ictxt,casize) call psb_bcast(ictxt,casize)
call psb_bcast(ictxt,nplevs)
call psb_bcast(ictxt,mxplevs) call psb_bcast(ictxt,mxplevs)
call psb_bcast(ictxt,mnaggratio) call psb_bcast(ictxt,mnaggratio)
if (casize /= p%coarse_aggr_size) then if (casize /= p%coarse_aggr_size) then
@ -154,11 +152,6 @@ subroutine mld_z_hierarchy_bld(a,desc_a,p,info)
call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size') call psb_errpush(info,name,a_err='Inconsistent coarse_aggr_size')
goto 9999 goto 9999
end if end if
if (nplevs /= p%n_prec_levs) then
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent n_prec_levs')
goto 9999
end if
if (mxplevs /= p%max_prec_levs) then if (mxplevs /= p%max_prec_levs) then
info=psb_err_internal_error_ info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Inconsistent max_prec_levs') call psb_errpush(info,name,a_err='Inconsistent max_prec_levs')
@ -202,29 +195,23 @@ subroutine mld_z_hierarchy_bld(a,desc_a,p,info)
! size of the array; ! size of the array;
! 2. If the user did not specify anything, then a default coarse size ! 2. If the user did not specify anything, then a default coarse size
! is generated, and the number of levels is set to the maximum; ! is generated, and the number of levels is set to the maximum;
! 3. If the number of levels has been specified, make sure it's capped ! 3. If the size of the array is different from target number of levels,
! at the maximum;
! 4. If the size of the array is different from target number of levels,
! reallocate; ! reallocate;
! 5. Build the matrix hierarchy, stopping early if either the target ! 4. Build the matrix hierarchy, stopping early if either the target
! coarse size is hit, or the gain falls below the min_aggr_ratio ! coarse size is hit, or the gain falls below the min_aggr_ratio
! threshold. ! threshold.
! !
if (nplevs <= 0) then if (casize <=0) then
if (casize <=0) then !
! ! Default to the cubic root of the size at base level.
! Default to the cubic root of the size at base level. !
! casize = desc_a%get_global_rows()
casize = desc_a%get_global_rows() casize = int((done*casize)**(done/(done*3)),psb_ipk_)
casize = int((done*casize)**(done/(done*3)),psb_ipk_) casize = max(casize,ione)
casize = max(casize,ione) casize = casize*40_psb_ipk_
casize = casize*40_psb_ipk_
end if
nplevs = mxplevs
end if end if
nplevs = max(itwo,mxplevs)
nplevs = max(itwo,min(nplevs,mxplevs))
coarseparms = p%precv(iszv)%parms coarseparms = p%precv(iszv)%parms
baseparms = p%precv(1)%parms baseparms = p%precv(1)%parms

@ -144,9 +144,6 @@ subroutine mld_zcprecseti(p,what,val,info,ilev,ilmax,pos)
case ('COARSE_AGGR_SIZE') case ('COARSE_AGGR_SIZE')
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case ('N_PREC_LEVS')
p%n_prec_levs = max(val,1)
return
case('MAX_PREC_LEVS') case('MAX_PREC_LEVS')
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -170,10 +170,9 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
p%n_prec_levs = nlev_ p%max_prec_levs = nlev_
else else
nlev_ = p%max_prec_levs nlev_ = p%max_prec_levs
p%n_prec_levs = -ione
end if end if
ilev_ = 1 ilev_ = 1
allocate(p%precv(nlev_),stat=info) allocate(p%precv(nlev_),stat=info)

@ -143,9 +143,6 @@ subroutine mld_zprecseti(p,what,val,info,ilev,ilmax,pos)
case (mld_coarse_aggr_size_) case (mld_coarse_aggr_size_)
p%coarse_aggr_size = max(val,-1) p%coarse_aggr_size = max(val,-1)
return return
case (mld_n_prec_levs_)
p%n_prec_levs = max(val,1)
return
case(mld_max_prec_levs_) case(mld_max_prec_levs_)
p%max_prec_levs = max(val,1) p%max_prec_levs = max(val,1)
return return

@ -90,11 +90,9 @@ module mld_c_prec_type
! !
! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.) ! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.)
integer(psb_ipk_) :: coarse_aggr_size = izero integer(psb_ipk_) :: coarse_aggr_size = izero
! 2. n_prec_levs = -1 Use aggregate size to stop ! 2. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: n_prec_levs = -ione
! 3. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_ integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_
! 4. min_aggr_ratio = 1.5 ! 3. min_aggr_ratio = 1.5
real(psb_spk_) :: min_aggr_ratio = 1.5_psb_spk_ real(psb_spk_) :: min_aggr_ratio = 1.5_psb_spk_
real(psb_spk_) :: op_complexity=szero real(psb_spk_) :: op_complexity=szero
! !
@ -816,7 +814,6 @@ contains
class is (mld_cprec_type) class is (mld_cprec_type)
pout%ictxt = prec%ictxt pout%ictxt = prec%ictxt
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%n_prec_levs = prec%n_prec_levs
pout%max_prec_levs = prec%max_prec_levs pout%max_prec_levs = prec%max_prec_levs
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%outer_sweeps = prec%outer_sweeps pout%outer_sweeps = prec%outer_sweeps

@ -84,18 +84,15 @@ module mld_d_prec_type
! !
type, extends(psb_dprec_type) :: mld_dprec_type type, extends(psb_dprec_type) :: mld_dprec_type
integer(psb_ipk_) :: state
integer(psb_ipk_) :: ictxt integer(psb_ipk_) :: ictxt
! !
! Aggregation defaults: ! Aggregation defaults:
! !
! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.) ! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.)
integer(psb_ipk_) :: coarse_aggr_size = izero integer(psb_ipk_) :: coarse_aggr_size = izero
! 2. n_prec_levs = -1 Use aggregate size to stop ! 2. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: n_prec_levs = -ione
! 3. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_ integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_
! 4. min_aggr_ratio = 1.5 ! 3. min_aggr_ratio = 1.5
real(psb_dpk_) :: min_aggr_ratio = 1.5_psb_dpk_ real(psb_dpk_) :: min_aggr_ratio = 1.5_psb_dpk_
real(psb_dpk_) :: op_complexity=dzero real(psb_dpk_) :: op_complexity=dzero
! !
@ -817,7 +814,6 @@ contains
class is (mld_dprec_type) class is (mld_dprec_type)
pout%ictxt = prec%ictxt pout%ictxt = prec%ictxt
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%n_prec_levs = prec%n_prec_levs
pout%max_prec_levs = prec%max_prec_levs pout%max_prec_levs = prec%max_prec_levs
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%outer_sweeps = prec%outer_sweeps pout%outer_sweeps = prec%outer_sweeps

@ -90,11 +90,9 @@ module mld_s_prec_type
! !
! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.) ! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.)
integer(psb_ipk_) :: coarse_aggr_size = izero integer(psb_ipk_) :: coarse_aggr_size = izero
! 2. n_prec_levs = -1 Use aggregate size to stop ! 2. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: n_prec_levs = -ione
! 3. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_ integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_
! 4. min_aggr_ratio = 1.5 ! 3. min_aggr_ratio = 1.5
real(psb_spk_) :: min_aggr_ratio = 1.5_psb_spk_ real(psb_spk_) :: min_aggr_ratio = 1.5_psb_spk_
real(psb_spk_) :: op_complexity=szero real(psb_spk_) :: op_complexity=szero
! !
@ -816,7 +814,6 @@ contains
class is (mld_sprec_type) class is (mld_sprec_type)
pout%ictxt = prec%ictxt pout%ictxt = prec%ictxt
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%n_prec_levs = prec%n_prec_levs
pout%max_prec_levs = prec%max_prec_levs pout%max_prec_levs = prec%max_prec_levs
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%outer_sweeps = prec%outer_sweeps pout%outer_sweeps = prec%outer_sweeps

@ -90,11 +90,9 @@ module mld_z_prec_type
! !
! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.) ! 1. coarse_aggr_size = 0 Default target size will be computed as 40*(N_fine)**(1./3.)
integer(psb_ipk_) :: coarse_aggr_size = izero integer(psb_ipk_) :: coarse_aggr_size = izero
! 2. n_prec_levs = -1 Use aggregate size to stop ! 2. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: n_prec_levs = -ione
! 3. maximum number of levels. Defaults to 20
integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_ integer(psb_ipk_) :: max_prec_levs = 20_psb_ipk_
! 4. min_aggr_ratio = 1.5 ! 3. min_aggr_ratio = 1.5
real(psb_dpk_) :: min_aggr_ratio = 1.5_psb_dpk_ real(psb_dpk_) :: min_aggr_ratio = 1.5_psb_dpk_
real(psb_dpk_) :: op_complexity=dzero real(psb_dpk_) :: op_complexity=dzero
! !
@ -816,7 +814,6 @@ contains
class is (mld_zprec_type) class is (mld_zprec_type)
pout%ictxt = prec%ictxt pout%ictxt = prec%ictxt
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%n_prec_levs = prec%n_prec_levs
pout%max_prec_levs = prec%max_prec_levs pout%max_prec_levs = prec%max_prec_levs
pout%coarse_aggr_size = prec%coarse_aggr_size pout%coarse_aggr_size = prec%coarse_aggr_size
pout%outer_sweeps = prec%outer_sweeps pout%outer_sweeps = prec%outer_sweeps

@ -247,7 +247,7 @@ program mld_cf_sample
if (psb_toupper(prec_choice%prec) == 'ML') then if (psb_toupper(prec_choice%prec) == 'ML') then
call mld_precinit(prec,prec_choice%prec, info) call mld_precinit(prec,prec_choice%prec, info)
if (prec_choice%nlev > 0) & if (prec_choice%nlev > 0) &
& call mld_precset(prec,'n_prec_levs', prec_choice%nlev, info) & call mld_precset(prec,'max_prec_levs', prec_choice%nlev, info)
call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info) call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info)
call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info) call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info)
call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info) call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info)

@ -247,7 +247,7 @@ program mld_df_sample
if (psb_toupper(prec_choice%prec) == 'ML') then if (psb_toupper(prec_choice%prec) == 'ML') then
call mld_precinit(prec,prec_choice%prec, info) call mld_precinit(prec,prec_choice%prec, info)
if (prec_choice%nlev > 0) & if (prec_choice%nlev > 0) &
& call mld_precset(prec,'n_prec_levs', prec_choice%nlev, info) & call mld_precset(prec,'max_prec_levs', prec_choice%nlev, info)
call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info) call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info)
call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info) call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info)
call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info) call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info)

@ -247,7 +247,7 @@ program mld_sf_sample
if (psb_toupper(prec_choice%prec) == 'ML') then if (psb_toupper(prec_choice%prec) == 'ML') then
call mld_precinit(prec,prec_choice%prec, info) call mld_precinit(prec,prec_choice%prec, info)
if (prec_choice%nlev > 0) & if (prec_choice%nlev > 0) &
& call mld_precset(prec,'n_prec_levs', prec_choice%nlev, info) & call mld_precset(prec,'max_prec_levs', prec_choice%nlev, info)
call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info) call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info)
call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info) call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info)
call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info) call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info)

@ -247,7 +247,7 @@ program mld_zf_sample
if (psb_toupper(prec_choice%prec) == 'ML') then if (psb_toupper(prec_choice%prec) == 'ML') then
call mld_precinit(prec,prec_choice%prec, info) call mld_precinit(prec,prec_choice%prec, info)
if (prec_choice%nlev > 0) & if (prec_choice%nlev > 0) &
& call mld_precset(prec,'n_prec_levs', prec_choice%nlev, info) & call mld_precset(prec,'max_prec_levs', prec_choice%nlev, info)
call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info) call mld_precset(prec,'aggr_kind', prec_choice%aggrkind,info)
call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info) call mld_precset(prec,'aggr_alg', prec_choice%aggr_alg,info)
call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info) call mld_precset(prec,'aggr_ord', prec_choice%aggr_ord,info)

@ -156,7 +156,6 @@ program mld_d_pde2d
integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS
real(psb_dpk_) :: thr1 ! Threshold for fact. 1 ILU(T) real(psb_dpk_) :: thr1 ! Threshold for fact. 1 ILU(T)
character(len=16) :: smther ! Smoother character(len=16) :: smther ! Smoother
integer(psb_ipk_) :: nlevs ! Number of levels in multilevel prec.
integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec. integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec.
character(len=16) :: aggrkind ! smoothed/raw aggregatin character(len=16) :: aggrkind ! smoothed/raw aggregatin
character(len=16) :: aggr_alg ! local or global aggregation character(len=16) :: aggr_alg ! local or global aggregation
@ -235,17 +234,12 @@ program mld_d_pde2d
! !
if (psb_toupper(prectype%prec) == 'ML') then if (psb_toupper(prectype%prec) == 'ML') then
call mld_precinit(prec,prectype%prec, info) call mld_precinit(prec,prectype%prec, info)
if (prectype%nlevs > 0) then if (prectype%csize>0)&
! Force number of levels, so disregard the other related arguments. & call mld_precset(prec,'coarse_aggr_size', prectype%csize, info)
call mld_precset(prec,'n_prec_levs', prectype%nlevs, info) if (prectype%maxlevs>0)&
else & call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
if (prectype%csize>0)& if (prectype%mnaggratio>0)&
& call mld_precset(prec,'coarse_aggr_size', prectype%csize, info)
if (prectype%maxlevs>0)&
& call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
if (prectype%mnaggratio>0)&
& call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info) & call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info)
end if
if (prectype%athres >= dzero) & if (prectype%athres >= dzero) &
& call mld_precset(prec,'aggr_thresh', prectype%athres, info) & call mld_precset(prec,'aggr_thresh', prectype%athres, info)
call mld_precset(prec,'aggr_kind', prectype%aggrkind,info) call mld_precset(prec,'aggr_kind', prectype%aggrkind,info)
@ -430,7 +424,6 @@ contains
call read_data(dump_prefix,psb_inp_unit) call read_data(dump_prefix,psb_inp_unit)
call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prectype%prec,psb_inp_unit) ! overall prectype call read_data(prectype%prec,psb_inp_unit) ! overall prectype
call read_data(prectype%nlevs,psb_inp_unit) ! Prescribed number of levels
call read_data(prectype%csize,psb_inp_unit) ! coarse size call read_data(prectype%csize,psb_inp_unit) ! coarse size
call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio
call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh
@ -471,7 +464,6 @@ contains
call psb_bcast(ictxt,dump_prefix) call psb_bcast(ictxt,dump_prefix)
call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec
call psb_bcast(ictxt,prectype%prec) ! overall prectype call psb_bcast(ictxt,prectype%prec) ! overall prectype
call psb_bcast(ictxt,prectype%nlevs) ! Prescribed number of levels
call psb_bcast(ictxt,prectype%csize) ! coarse size call psb_bcast(ictxt,prectype%csize) ! coarse size
call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio
call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh

@ -167,7 +167,6 @@ program mld_d_pde3d
integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS
real(psb_dpk_) :: thr1 ! Threshold for fact. 1 ILU(T) real(psb_dpk_) :: thr1 ! Threshold for fact. 1 ILU(T)
character(len=16) :: smther ! Smoother character(len=16) :: smther ! Smoother
integer(psb_ipk_) :: nlevs ! Number of levels in multilevel prec.
integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec. integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec.
character(len=16) :: aggrkind ! smoothed/raw aggregatin character(len=16) :: aggrkind ! smoothed/raw aggregatin
character(len=16) :: aggr_alg ! local or global aggregation character(len=16) :: aggr_alg ! local or global aggregation
@ -247,24 +246,19 @@ program mld_d_pde3d
! !
if (psb_toupper(prectype%prec) == 'ML') then if (psb_toupper(prectype%prec) == 'ML') then
call mld_precinit(prec,prectype%prec, info) call mld_precinit(prec,prectype%prec, info)
if (prectype%nlevs > 0) then
! Force number of levels, so disregard the other related arguments. if (prectype%csize>0)&
call mld_precset(prec,'n_prec_levs', prectype%nlevs, info) & call mld_precset(prec,'coarse_aggr_size', prectype%csize, info)
else if (prectype%maxlevs>0)&
if (prectype%csize>0)& & call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
& call mld_precset(prec,'coarse_aggr_size', prectype%csize, info) if (prectype%mnaggratio>0)&
if (prectype%maxlevs>0)& & call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info)
& call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
if (prectype%mnaggratio>0)&
& call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info)
end if
if (prectype%athres >= dzero) & if (prectype%athres >= dzero) &
& call mld_precset(prec,'aggr_thresh', prectype%athres, info) & call mld_precset(prec,'aggr_thresh', prectype%athres, info)
call mld_precset(prec,'aggr_kind', prectype%aggrkind,info) call mld_precset(prec,'aggr_kind', prectype%aggrkind,info)
call mld_precset(prec,'aggr_alg', prectype%aggr_alg,info) call mld_precset(prec,'aggr_alg', prectype%aggr_alg,info)
call mld_precset(prec,'aggr_ord', prectype%aggr_ord,info) call mld_precset(prec,'aggr_ord', prectype%aggr_ord,info)
call mld_precset(prec,'aggr_filter', prectype%aggr_filter, info) call mld_precset(prec,'aggr_filter', prectype%aggr_filter, info)
call mld_precset(prec,'coarse_mat', prectype%cmat, info)
call psb_barrier(ictxt) call psb_barrier(ictxt)
t1 = psb_wtime() t1 = psb_wtime()
@ -283,8 +277,7 @@ program mld_d_pde3d
call mld_precset(prec,'sub_ovr', prectype%novr, info) call mld_precset(prec,'sub_ovr', prectype%novr, info)
call mld_precset(prec,'sub_restr', prectype%restr, info) call mld_precset(prec,'sub_restr', prectype%restr, info)
call mld_precset(prec,'sub_prol', prectype%prol, info) call mld_precset(prec,'sub_prol', prectype%prol, info)
if (psb_tolower(prectype%smther) /= 'fbgs') & call mld_precset(prec,'sub_solve', prectype%solve, info)
& call mld_precset(prec,'sub_solve', prectype%solve, info)
call mld_precset(prec,'sub_fillin', prectype%fill1, info) call mld_precset(prec,'sub_fillin', prectype%fill1, info)
call mld_precset(prec,'solver_sweeps', prectype%svsweeps, info) call mld_precset(prec,'solver_sweeps', prectype%svsweeps, info)
call mld_precset(prec,'sub_iluthrs', prectype%thr1, info) call mld_precset(prec,'sub_iluthrs', prectype%thr1, info)
@ -292,6 +285,7 @@ program mld_d_pde3d
call mld_precset(prec,'smoother_pos', prectype%smthpos, info) call mld_precset(prec,'smoother_pos', prectype%smthpos, info)
call mld_precset(prec,'coarse_solve', prectype%csolve, info) call mld_precset(prec,'coarse_solve', prectype%csolve, info)
call mld_precset(prec,'coarse_subsolve', prectype%csbsolve,info) call mld_precset(prec,'coarse_subsolve', prectype%csbsolve,info)
call mld_precset(prec,'coarse_mat', prectype%cmat, info)
call mld_precset(prec,'coarse_fillin', prectype%cfill, info) call mld_precset(prec,'coarse_fillin', prectype%cfill, info)
call mld_precset(prec,'coarse_iluthrs', prectype%cthres, info) call mld_precset(prec,'coarse_iluthrs', prectype%cthres, info)
call mld_precset(prec,'coarse_sweeps', prectype%cjswp, info) call mld_precset(prec,'coarse_sweeps', prectype%cjswp, info)
@ -443,7 +437,6 @@ contains
call read_data(dump_prefix,psb_inp_unit) call read_data(dump_prefix,psb_inp_unit)
call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prectype%prec,psb_inp_unit) ! overall prectype call read_data(prectype%prec,psb_inp_unit) ! overall prectype
call read_data(prectype%nlevs,psb_inp_unit) ! Prescribed number of levels
call read_data(prectype%csize,psb_inp_unit) ! coarse size call read_data(prectype%csize,psb_inp_unit) ! coarse size
call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio
call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh
@ -484,7 +477,6 @@ contains
call psb_bcast(ictxt,dump_prefix) call psb_bcast(ictxt,dump_prefix)
call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec
call psb_bcast(ictxt,prectype%prec) ! overall prectype call psb_bcast(ictxt,prectype%prec) ! overall prectype
call psb_bcast(ictxt,prectype%nlevs) ! Prescribed number of levels
call psb_bcast(ictxt,prectype%csize) ! coarse size call psb_bcast(ictxt,prectype%csize) ! coarse size
call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio
call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh

@ -156,7 +156,6 @@ program mld_s_pde2d
integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS
real(psb_spk_) :: thr1 ! Threshold for fact. 1 ILU(T) real(psb_spk_) :: thr1 ! Threshold for fact. 1 ILU(T)
character(len=16) :: smther ! Smoother character(len=16) :: smther ! Smoother
integer(psb_ipk_) :: nlevs ! Number of levels in multilevel prec.
integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec. integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec.
character(len=16) :: aggrkind ! smoothed/raw aggregatin character(len=16) :: aggrkind ! smoothed/raw aggregatin
character(len=16) :: aggr_alg ! local or global aggregation character(len=16) :: aggr_alg ! local or global aggregation
@ -235,17 +234,12 @@ program mld_s_pde2d
! !
if (psb_toupper(prectype%prec) == 'ML') then if (psb_toupper(prectype%prec) == 'ML') then
call mld_precinit(prec,prectype%prec, info) call mld_precinit(prec,prectype%prec, info)
if (prectype%nlevs > 0) then if (prectype%csize>0)&
! Force number of levels, so disregard the other related arguments. & call mld_precset(prec,'coarse_aggr_size', prectype%csize, info)
call mld_precset(prec,'n_prec_levs', prectype%nlevs, info) if (prectype%maxlevs>0)&
else & call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
if (prectype%csize>0)& if (prectype%mnaggratio>0)&
& call mld_precset(prec,'coarse_aggr_size', prectype%csize, info)
if (prectype%maxlevs>0)&
& call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
if (prectype%mnaggratio>0)&
& call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info) & call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info)
end if
if (prectype%athres >= szero) & if (prectype%athres >= szero) &
& call mld_precset(prec,'aggr_thresh', prectype%athres, info) & call mld_precset(prec,'aggr_thresh', prectype%athres, info)
call mld_precset(prec,'aggr_kind', prectype%aggrkind,info) call mld_precset(prec,'aggr_kind', prectype%aggrkind,info)
@ -430,7 +424,6 @@ contains
call read_data(dump_prefix,psb_inp_unit) call read_data(dump_prefix,psb_inp_unit)
call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prectype%prec,psb_inp_unit) ! overall prectype call read_data(prectype%prec,psb_inp_unit) ! overall prectype
call read_data(prectype%nlevs,psb_inp_unit) ! Prescribed number of levels
call read_data(prectype%csize,psb_inp_unit) ! coarse size call read_data(prectype%csize,psb_inp_unit) ! coarse size
call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio
call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh
@ -471,7 +464,6 @@ contains
call psb_bcast(ictxt,dump_prefix) call psb_bcast(ictxt,dump_prefix)
call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec
call psb_bcast(ictxt,prectype%prec) ! overall prectype call psb_bcast(ictxt,prectype%prec) ! overall prectype
call psb_bcast(ictxt,prectype%nlevs) ! Prescribed number of levels
call psb_bcast(ictxt,prectype%csize) ! coarse size call psb_bcast(ictxt,prectype%csize) ! coarse size
call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio
call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh

@ -167,7 +167,6 @@ program mld_s_pde3d
integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS
real(psb_spk_) :: thr1 ! Threshold for fact. 1 ILU(T) real(psb_spk_) :: thr1 ! Threshold for fact. 1 ILU(T)
character(len=16) :: smther ! Smoother character(len=16) :: smther ! Smoother
integer(psb_ipk_) :: nlevs ! Number of levels in multilevel prec.
integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec. integer(psb_ipk_) :: maxlevs ! Maximum number of levels in multilevel prec.
character(len=16) :: aggrkind ! smoothed/raw aggregatin character(len=16) :: aggrkind ! smoothed/raw aggregatin
character(len=16) :: aggr_alg ! local or global aggregation character(len=16) :: aggr_alg ! local or global aggregation
@ -247,17 +246,13 @@ program mld_s_pde3d
! !
if (psb_toupper(prectype%prec) == 'ML') then if (psb_toupper(prectype%prec) == 'ML') then
call mld_precinit(prec,prectype%prec, info) call mld_precinit(prec,prectype%prec, info)
if (prectype%nlevs > 0) then
! Force number of levels, so disregard the other related arguments. if (prectype%csize>0)&
call mld_precset(prec,'n_prec_levs', prectype%nlevs, info) & call mld_precset(prec,'coarse_aggr_size', prectype%csize, info)
else if (prectype%maxlevs>0)&
if (prectype%csize>0)& & call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
& call mld_precset(prec,'coarse_aggr_size', prectype%csize, info) if (prectype%mnaggratio>0)&
if (prectype%maxlevs>0)& & call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info)
& call mld_precset(prec,'max_prec_levs', prectype%maxlevs, info)
if (prectype%mnaggratio>0)&
& call mld_precset(prec,'min_aggr_ratio', prectype%mnaggratio, info)
end if
if (prectype%athres >= szero) & if (prectype%athres >= szero) &
& call mld_precset(prec,'aggr_thresh', prectype%athres, info) & call mld_precset(prec,'aggr_thresh', prectype%athres, info)
call mld_precset(prec,'aggr_kind', prectype%aggrkind,info) call mld_precset(prec,'aggr_kind', prectype%aggrkind,info)
@ -442,7 +437,6 @@ contains
call read_data(dump_prefix,psb_inp_unit) call read_data(dump_prefix,psb_inp_unit)
call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prectype%prec,psb_inp_unit) ! overall prectype call read_data(prectype%prec,psb_inp_unit) ! overall prectype
call read_data(prectype%nlevs,psb_inp_unit) ! Prescribed number of levels
call read_data(prectype%csize,psb_inp_unit) ! coarse size call read_data(prectype%csize,psb_inp_unit) ! coarse size
call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio call read_data(prectype%mnaggratio,psb_inp_unit) ! Minimum aggregation ratio
call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh
@ -483,7 +477,6 @@ contains
call psb_bcast(ictxt,dump_prefix) call psb_bcast(ictxt,dump_prefix)
call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec call psb_bcast(ictxt,prectype%descr) ! verbose description of the prec
call psb_bcast(ictxt,prectype%prec) ! overall prectype call psb_bcast(ictxt,prectype%prec) ! overall prectype
call psb_bcast(ictxt,prectype%nlevs) ! Prescribed number of levels
call psb_bcast(ictxt,prectype%csize) ! coarse size call psb_bcast(ictxt,prectype%csize) ! coarse size
call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio call psb_bcast(ictxt,prectype%mnaggratio) ! Minimum aggregation ratio
call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh call psb_bcast(ictxt,prectype%athres) ! smoother aggr thresh

@ -10,7 +10,6 @@ F ! Dump preconditioner on file T F
test-ml-unsm-our ! File prefix for preconditioner dump test-ml-unsm-our ! File prefix for preconditioner dump
ML-MUL-RAS-ILU ! Descriptive name for preconditioner (up to 40 chars) ML-MUL-RAS-ILU ! Descriptive name for preconditioner (up to 40 chars)
ML ! Preconditioner NONE JACOBI BJAC AS ML ML ! Preconditioner NONE JACOBI BJAC AS ML
-4 ! If ML: Prescribed number of levels; if <0, ignore it and use coarse size.
-8000 ! If ML: Target coarse size. If <0, then use library default -8000 ! If ML: Target coarse size. If <0, then use library default
-1.5d0 ! If ML: Minimum aggregation ratio; if <0 use library default -1.5d0 ! If ML: Minimum aggregation ratio; if <0 use library default
-0.08d0 ! If ML: Smoother Aggregation Threshold: >= 0.0 default if <0 -0.08d0 ! If ML: Smoother Aggregation Threshold: >= 0.0 default if <0

@ -10,7 +10,6 @@ F ! Dump preconditioner on file T F
test-ml-unsm-our ! File prefix for preconditioner dump test-ml-unsm-our ! File prefix for preconditioner dump
ML-MUL-RAS-ILU ! Descriptive name for preconditioner (up to 40 chars) ML-MUL-RAS-ILU ! Descriptive name for preconditioner (up to 40 chars)
ML ! Preconditioner NONE JACOBI BJAC AS ML ML ! Preconditioner NONE JACOBI BJAC AS ML
-4 ! If ML: Prescribed number of levels; if <0, ignore it and use coarse size.
-8000 ! If ML: Target coarse size. If <0, then use library default -8000 ! If ML: Target coarse size. If <0, then use library default
-1.5d0 ! If ML: Minimum aggregation ratio; if <0 use library default -1.5d0 ! If ML: Minimum aggregation ratio; if <0 use library default
-0.10d0 ! If ML: Smoother Aggregation Threshold: >= 0.0 default if <0 -0.10d0 ! If ML: Smoother Aggregation Threshold: >= 0.0 default if <0
@ -26,7 +25,7 @@ FBGS ! Smoother type JACOBI BJAC AS; ignored for non-ML
0 ! Number of overlap layers for AS preconditioner (at finest level) 0 ! Number of overlap layers for AS preconditioner (at finest level)
HALO ! AS Restriction operator NONE HALO HALO ! AS Restriction operator NONE HALO
NONE ! AS Prolongation operator NONE SUM AVG NONE ! AS Prolongation operator NONE SUM AVG
ILU ! Subdomain solver DSCALE ILU MILU ILUT FWGS BWGS MUMPS UMF SLU FWGS ! Subdomain solver DSCALE ILU MILU ILUT FWGS BWGS MUMPS UMF SLU
1 ! Solver sweeps for GS 1 ! Solver sweeps for GS
0 ! Level-set N for ILU(N), and P for ILUT 0 ! Level-set N for ILU(N), and P for ILUT
1.d-4 ! Threshold T for ILU(T,P) 1.d-4 ! Threshold T for ILU(T,P)

Loading…
Cancel
Save