Added GS/FBGS for precs. Fixed 1-level application of twosided.

This commit is contained in:
Salvatore Filippone
2017-09-20 11:47:19 +01:00
parent 339d1e4a33
commit b5e116dc08
26 changed files with 746 additions and 178 deletions
+10 -5
View File
@@ -160,9 +160,10 @@ program mld_d_pde2d
character(len=40) :: descr ! verbose description of the prec
character(len=10) :: ptype ! preconditioner type
integer(psb_ipk_) :: outer_sweeps ! number of outer sweeps: sweeps for 1-level,
! AMG cycles for ML
! general AMG data
character(len=16) :: mlcycle ! AMG cycle type
integer(psb_ipk_) :: otr_sweeps ! number of AMG cycles
integer(psb_ipk_) :: maxlevs ! maximum number of levels in AMG preconditioner
! AMG aggregation
@@ -268,8 +269,12 @@ program mld_d_pde2d
!
call prec%init(p_choice%ptype,info)
select case(trim(psb_toupper(p_choice%ptype)))
case ('NONE','NOPREC','JACOBI')
case ('NONE','NOPREC')
! Do nothing, keep defaults
case ('JACOBI','GS','FWGS','FBGS')
! 1-level sweeps from "outer_sweeps"
call prec%set('smoother_sweeps', p_choice%outer_sweeps, info)
case ('BJAC')
call prec%set('smoother_sweeps', p_choice%jsweeps, info)
@@ -290,7 +295,7 @@ program mld_d_pde2d
! multilevel preconditioner
call prec%set('ml_cycle', p_choice%mlcycle, info)
call prec%set('outer_sweeps', p_choice%otr_sweeps,info)
call prec%set('outer_sweeps', p_choice%outer_sweeps,info)
if (p_choice%csize>0)&
& call prec%set('min_coarse_size', p_choice%csize, info)
if (p_choice%mncrratio>1)&
@@ -489,9 +494,9 @@ contains
! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps
! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type
call read_data(prec%otr_sweeps,psb_inp_unit) ! number of AMG cycles
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat
! aggregation
@@ -562,7 +567,7 @@ contains
if (psb_toupper(prec%ptype) == 'ML') then
call psb_bcast(icontxt,prec%mlcycle)
call psb_bcast(icontxt,prec%otr_sweeps)
call psb_bcast(icontxt,prec%outer_sweeps)
call psb_bcast(icontxt,prec%maxlevs)
call psb_bcast(icontxt,prec%smther2)
+10 -5
View File
@@ -172,9 +172,10 @@ program mld_d_pde3d
character(len=40) :: descr ! verbose description of the prec
character(len=10) :: ptype ! preconditioner type
integer(psb_ipk_) :: outer_sweeps ! number of outer sweeps: sweeps for 1-level,
! AMG cycles for ML
! general AMG data
character(len=16) :: mlcycle ! AMG cycle type
integer(psb_ipk_) :: otr_sweeps ! number of AMG cycles
integer(psb_ipk_) :: maxlevs ! maximum number of levels in AMG preconditioner
! AMG aggregation
@@ -281,8 +282,12 @@ program mld_d_pde3d
!
call prec%init(p_choice%ptype,info)
select case(trim(psb_toupper(p_choice%ptype)))
case ('NONE','NOPREC','JACOBI')
case ('NONE','NOPREC')
! Do nothing, keep defaults
case ('JACOBI','GS','FWGS','FBGS')
! 1-level sweeps from "outer_sweeps"
call prec%set('smoother_sweeps', p_choice%outer_sweeps, info)
case ('BJAC')
call prec%set('smoother_sweeps', p_choice%jsweeps, info)
@@ -303,7 +308,7 @@ program mld_d_pde3d
! multilevel preconditioner
call prec%set('ml_cycle', p_choice%mlcycle, info)
call prec%set('outer_sweeps', p_choice%otr_sweeps,info)
call prec%set('outer_sweeps', p_choice%outer_sweeps,info)
if (p_choice%csize>0)&
& call prec%set('min_coarse_size', p_choice%csize, info)
if (p_choice%mncrratio>1)&
@@ -502,9 +507,9 @@ contains
! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps
! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type
call read_data(prec%otr_sweeps,psb_inp_unit) ! number of AMG cycles
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat
! aggregation
@@ -575,7 +580,7 @@ contains
if (psb_toupper(prec%ptype) == 'ML') then
call psb_bcast(icontxt,prec%mlcycle)
call psb_bcast(icontxt,prec%otr_sweeps)
call psb_bcast(icontxt,prec%outer_sweeps)
call psb_bcast(icontxt,prec%maxlevs)
call psb_bcast(icontxt,prec%smther2)
+10 -5
View File
@@ -160,9 +160,10 @@ program mld_s_pde2d
character(len=40) :: descr ! verbose description of the prec
character(len=10) :: ptype ! preconditioner type
integer(psb_ipk_) :: outer_sweeps ! number of outer sweeps: sweeps for 1-level,
! AMG cycles for ML
! general AMG data
character(len=16) :: mlcycle ! AMG cycle type
integer(psb_ipk_) :: otr_sweeps ! number of AMG cycles
integer(psb_ipk_) :: maxlevs ! maximum number of levels in AMG preconditioner
! AMG aggregation
@@ -268,8 +269,12 @@ program mld_s_pde2d
!
call prec%init(p_choice%ptype,info)
select case(trim(psb_toupper(p_choice%ptype)))
case ('NONE','NOPREC','JACOBI')
case ('NONE','NOPREC')
! Do nothing, keep defaults
case ('JACOBI','GS','FWGS','FBGS')
! 1-level sweeps from "outer_sweeps"
call prec%set('smoother_sweeps', p_choice%outer_sweeps, info)
case ('BJAC')
call prec%set('smoother_sweeps', p_choice%jsweeps, info)
@@ -290,7 +295,7 @@ program mld_s_pde2d
! multilevel preconditioner
call prec%set('ml_cycle', p_choice%mlcycle, info)
call prec%set('outer_sweeps', p_choice%otr_sweeps,info)
call prec%set('outer_sweeps', p_choice%outer_sweeps,info)
if (p_choice%csize>0)&
& call prec%set('min_coarse_size', p_choice%csize, info)
if (p_choice%mncrratio>1)&
@@ -489,9 +494,9 @@ contains
! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps
! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type
call read_data(prec%otr_sweeps,psb_inp_unit) ! number of AMG cycles
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat
! aggregation
@@ -562,7 +567,7 @@ contains
if (psb_toupper(prec%ptype) == 'ML') then
call psb_bcast(icontxt,prec%mlcycle)
call psb_bcast(icontxt,prec%otr_sweeps)
call psb_bcast(icontxt,prec%outer_sweeps)
call psb_bcast(icontxt,prec%maxlevs)
call psb_bcast(icontxt,prec%smther2)
+10 -5
View File
@@ -172,9 +172,10 @@ program mld_s_pde3d
character(len=40) :: descr ! verbose description of the prec
character(len=10) :: ptype ! preconditioner type
integer(psb_ipk_) :: outer_sweeps ! number of outer sweeps: sweeps for 1-level,
! AMG cycles for ML
! general AMG data
character(len=16) :: mlcycle ! AMG cycle type
integer(psb_ipk_) :: otr_sweeps ! number of AMG cycles
integer(psb_ipk_) :: maxlevs ! maximum number of levels in AMG preconditioner
! AMG aggregation
@@ -281,8 +282,12 @@ program mld_s_pde3d
!
call prec%init(p_choice%ptype,info)
select case(trim(psb_toupper(p_choice%ptype)))
case ('NONE','NOPREC','JACOBI')
case ('NONE','NOPREC')
! Do nothing, keep defaults
case ('JACOBI','GS','FWGS','FBGS')
! 1-level sweeps from "outer_sweeps"
call prec%set('smoother_sweeps', p_choice%outer_sweeps, info)
case ('BJAC')
call prec%set('smoother_sweeps', p_choice%jsweeps, info)
@@ -303,7 +308,7 @@ program mld_s_pde3d
! multilevel preconditioner
call prec%set('ml_cycle', p_choice%mlcycle, info)
call prec%set('outer_sweeps', p_choice%otr_sweeps,info)
call prec%set('outer_sweeps', p_choice%outer_sweeps,info)
if (p_choice%csize>0)&
& call prec%set('min_coarse_size', p_choice%csize, info)
if (p_choice%mncrratio>1)&
@@ -502,9 +507,9 @@ contains
! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps
! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type
call read_data(prec%otr_sweeps,psb_inp_unit) ! number of AMG cycles
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat
! aggregation
@@ -575,7 +580,7 @@ contains
if (psb_toupper(prec%ptype) == 'ML') then
call psb_bcast(icontxt,prec%mlcycle)
call psb_bcast(icontxt,prec%otr_sweeps)
call psb_bcast(icontxt,prec%outer_sweeps)
call psb_bcast(icontxt,prec%maxlevs)
call psb_bcast(icontxt,prec%smther2)
+3 -3
View File
@@ -7,9 +7,9 @@ CG ! Iterative method: BiCGSTAB BiCGSTABL BiCG CG CGS F
30 ! IRST (restart for RGMRES and BiCGSTABL)
1.d-6 ! EPS
ML-VCYCLE-FBGS-R-UMF ! Longer descriptive name for preconditioner (up to 20 chars)
ML ! Preconditioner type: NONE JACOBI BJAC AS ML
VCYCLE ! Type of multilevel CYCLE: VCYCLE WCYCLE KCYCLE KCYCLESYM MULT ADD
1 ! Number of outer sweeps
FBGS ! Preconditioner type: NONE JACOBI GS FBGS BJAC AS ML
4 ! Number of sweeps for 1-level, outer sweeps for ML; lines below ignored for non-ML
VCYCLE ! Type of multilevel CYCLE: VCYCLE WCYCLE KCYCLE MULT ADD
-3 ! Max Number of levels in a multilevel preconditioner; if <0, lib default
-3 ! Target coarse matrix size; if <0, lib default
SMOOTHED ! Type of aggregation: SMOOTHED NONSMOOTHED
+3 -3
View File
@@ -7,9 +7,9 @@ CG ! Iterative method: BiCGSTAB BiCGSTABL BiCG CG CGS F
30 ! IRST (restart for RGMRES and BiCGSTABL)
1.d-6 ! EPS
ML-VCYCLE-FBGS-R-UMF ! Longer descriptive name for preconditioner (up to 20 chars)
ML ! Preconditioner type: NONE JACOBI BJAC AS ML
ML ! Preconditioner type: NONE JACOBI GS FBGS BJAC AS ML
4 ! Number of sweeps for 1-level, outer sweeps for ML; lines below ignored for non-ML
VCYCLE ! Type of multilevel CYCLE: VCYCLE WCYCLE KCYCLE MULT ADD
1 ! Number of outer sweeps
-3 ! Max Number of levels in a multilevel preconditioner; if <0, lib default
-3 ! Target coarse matrix size; if <0, lib default
SMOOTHED ! Type of aggregation: SMOOTHED NONSMOOTHED
@@ -21,7 +21,7 @@ NOFILTER ! Filtering of matrix ? FILTER NOFILTER
0.05 0.025 ! Thresholds
0.0100d0 ! Smoothed aggregation threshold: >= 0.0
FBGS ! Smoother type JACOBI FBGS GS BGS BJAC AS; ignored for non-ML
1 ! Number of sweeps for (pre) smoother
2 ! Number of sweeps for (pre) smoother
0 ! Number of overlap layers for AS preconditioner
HALO ! AS restriction operator: NONE HALO
NONE ! AS prolongation operator: NONE SUM AVG