Fix examples

remap-coarse
Salvatore Filippone 3 years ago
parent b387308455
commit 1270498170

@ -37,7 +37,7 @@
! !
! File: amg_cexample_ml.f90 ! File: amg_cexample_ml.f90
! !
! This sample program solves a linear system by using CG coupled with ! This sample program solves a linear system by using FCG coupled with
! one of the following multi-level preconditioner, as explained in Section 4.1 ! one of the following multi-level preconditioner, as explained in Section 4.1
! of the AMG4PSBLAS User's and Reference Guide: ! of the AMG4PSBLAS User's and Reference Guide:
! !
@ -50,8 +50,8 @@
! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi ! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi
! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2) ! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2)
! !
! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying on matching, ! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! on matching, with maximum size of aggregates equal to 8 and smoothed prolongators,
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver
! (Sec. 4.1, Listing 3) ! (Sec. 4.1, Listing 3)
@ -103,7 +103,8 @@ program amg_cexample_ml
integer :: ierr, ircode integer :: ierr, ircode
real(psb_spk_) :: resmx, resmxp real(psb_spk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name, kmethod character(len=20) :: name
character(len=20), parameter :: kmethod='FCG'
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -216,7 +217,6 @@ program amg_cexample_ml
! solver ! solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
kmethod = 'CG'
case(2) case(2)
@ -227,15 +227,16 @@ program amg_cexample_ml
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('SMOOTHER_TYPE','BJAC',info) call P%set('SMOOTHER_TYPE','BJAC',info)
call P%set('COARSE_SOLVE','BJAC',info) call P%set('COARSE_SOLVE','BJAC',info)
call P%set('COARSE_SUBSOLVE','ILU',info)
call P%set('COARSE_SWEEPS',8,info) call P%set('COARSE_SWEEPS',8,info)
kmethod = 'CG'
case(3) case(3)
! initialize a W-cycle preconditioner based on the coupled aggregation relying on matching, ! initialize a W-cycle preconditioner based on the coupled aggregation
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! relying on matching, with maximum size of aggregates equal to 8
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! and smoothed prolongators, 2 hybrid forward/backward GS sweeps
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! as pre/post-smoother, a distributed coarsest matrix,
! and preconditioned Flexible Conjugate Gradient as coarsest-level solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('PAR_AGGR_ALG','COUPLED',info) call P%set('PAR_AGGR_ALG','COUPLED',info)
@ -244,10 +245,10 @@ program amg_cexample_ml
call P%set('ML_CYCLE','WCYCLE',info) call P%set('ML_CYCLE','WCYCLE',info)
call P%set('SMOOTHER_SWEEPS',2,info) call P%set('SMOOTHER_SWEEPS',2,info)
call P%set('COARSE_SOLVE','KRM',info) call P%set('COARSE_SOLVE','KRM',info)
kmethod = 'CG' call P%set('COARSE_MAT','DIST',info)
end select call P%set('KRM_METHOD','FCG',info)
! build the preconditioner end select
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()
@ -269,7 +270,7 @@ program amg_cexample_ml
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned CG ! solve Ax=b with preconditioned Krylov method
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()

@ -37,7 +37,7 @@
! !
! File: amg_dexample_ml.f90 ! File: amg_dexample_ml.f90
! !
! This sample program solves a linear system by using CG coupled with ! This sample program solves a linear system by using FCG coupled with
! one of the following multi-level preconditioner, as explained in Section 4.1 ! one of the following multi-level preconditioner, as explained in Section 4.1
! of the AMG4PSBLAS User's and Reference Guide: ! of the AMG4PSBLAS User's and Reference Guide:
! !
@ -50,8 +50,8 @@
! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi ! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi
! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2) ! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2)
! !
! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying on matching, ! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! on matching, with maximum size of aggregates equal to 8 and smoothed prolongators,
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver
! (Sec. 4.1, Listing 3) ! (Sec. 4.1, Listing 3)
@ -103,7 +103,8 @@ program amg_dexample_ml
integer :: ierr, ircode integer :: ierr, ircode
real(psb_dpk_) :: resmx, resmxp real(psb_dpk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name, kmethod character(len=20) :: name
character(len=20), parameter :: kmethod='FCG'
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -216,7 +217,6 @@ program amg_dexample_ml
! solver ! solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
kmethod = 'CG'
case(2) case(2)
@ -227,15 +227,16 @@ program amg_dexample_ml
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('SMOOTHER_TYPE','BJAC',info) call P%set('SMOOTHER_TYPE','BJAC',info)
call P%set('COARSE_SOLVE','BJAC',info) call P%set('COARSE_SOLVE','BJAC',info)
call P%set('COARSE_SUBSOLVE','ILU',info)
call P%set('COARSE_SWEEPS',8,info) call P%set('COARSE_SWEEPS',8,info)
kmethod = 'CG'
case(3) case(3)
! initialize a W-cycle preconditioner based on the coupled aggregation relying on matching, ! initialize a W-cycle preconditioner based on the coupled aggregation
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! relying on matching, with maximum size of aggregates equal to 8
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! and smoothed prolongators, 2 hybrid forward/backward GS sweeps
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! as pre/post-smoother, a distributed coarsest matrix,
! and preconditioned Flexible Conjugate Gradient as coarsest-level solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('PAR_AGGR_ALG','COUPLED',info) call P%set('PAR_AGGR_ALG','COUPLED',info)
@ -244,10 +245,10 @@ program amg_dexample_ml
call P%set('ML_CYCLE','WCYCLE',info) call P%set('ML_CYCLE','WCYCLE',info)
call P%set('SMOOTHER_SWEEPS',2,info) call P%set('SMOOTHER_SWEEPS',2,info)
call P%set('COARSE_SOLVE','KRM',info) call P%set('COARSE_SOLVE','KRM',info)
kmethod = 'CG' call P%set('COARSE_MAT','DIST',info)
end select call P%set('KRM_METHOD','FCG',info)
! build the preconditioner end select
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()
@ -269,7 +270,7 @@ program amg_dexample_ml
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned CG ! solve Ax=b with preconditioned Krylov method
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()

@ -37,7 +37,7 @@
! !
! File: amg_sexample_ml.f90 ! File: amg_sexample_ml.f90
! !
! This sample program solves a linear system by using CG coupled with ! This sample program solves a linear system by using FCG coupled with
! one of the following multi-level preconditioner, as explained in Section 4.1 ! one of the following multi-level preconditioner, as explained in Section 4.1
! of the AMG4PSBLAS User's and Reference Guide: ! of the AMG4PSBLAS User's and Reference Guide:
! !
@ -50,8 +50,8 @@
! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi ! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi
! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2) ! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2)
! !
! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying on matching, ! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! on matching, with maximum size of aggregates equal to 8 and smoothed prolongators,
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver
! (Sec. 4.1, Listing 3) ! (Sec. 4.1, Listing 3)
@ -103,7 +103,8 @@ program amg_sexample_ml
integer :: ierr, ircode integer :: ierr, ircode
real(psb_spk_) :: resmx, resmxp real(psb_spk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name, kmethod character(len=20) :: name
character(len=20), parameter :: kmethod='FCG'
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -216,7 +217,6 @@ program amg_sexample_ml
! solver ! solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
kmethod = 'CG'
case(2) case(2)
@ -227,15 +227,16 @@ program amg_sexample_ml
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('SMOOTHER_TYPE','BJAC',info) call P%set('SMOOTHER_TYPE','BJAC',info)
call P%set('COARSE_SOLVE','BJAC',info) call P%set('COARSE_SOLVE','BJAC',info)
call P%set('COARSE_SUBSOLVE','ILU',info)
call P%set('COARSE_SWEEPS',8,info) call P%set('COARSE_SWEEPS',8,info)
kmethod = 'CG'
case(3) case(3)
! initialize a W-cycle preconditioner based on the coupled aggregation relying on matching, ! initialize a W-cycle preconditioner based on the coupled aggregation
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! relying on matching, with maximum size of aggregates equal to 8
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! and smoothed prolongators, 2 hybrid forward/backward GS sweeps
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! as pre/post-smoother, a distributed coarsest matrix,
! and preconditioned Flexible Conjugate Gradient as coarsest-level solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('PAR_AGGR_ALG','COUPLED',info) call P%set('PAR_AGGR_ALG','COUPLED',info)
@ -244,10 +245,10 @@ program amg_sexample_ml
call P%set('ML_CYCLE','WCYCLE',info) call P%set('ML_CYCLE','WCYCLE',info)
call P%set('SMOOTHER_SWEEPS',2,info) call P%set('SMOOTHER_SWEEPS',2,info)
call P%set('COARSE_SOLVE','KRM',info) call P%set('COARSE_SOLVE','KRM',info)
kmethod = 'CG' call P%set('COARSE_MAT','DIST',info)
end select call P%set('KRM_METHOD','FCG',info)
! build the preconditioner end select
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()
@ -269,7 +270,7 @@ program amg_sexample_ml
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned CG ! solve Ax=b with preconditioned Krylov method
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()

@ -37,7 +37,7 @@
! !
! File: amg_zexample_ml.f90 ! File: amg_zexample_ml.f90
! !
! This sample program solves a linear system by using CG coupled with ! This sample program solves a linear system by using FCG coupled with
! one of the following multi-level preconditioner, as explained in Section 4.1 ! one of the following multi-level preconditioner, as explained in Section 4.1
! of the AMG4PSBLAS User's and Reference Guide: ! of the AMG4PSBLAS User's and Reference Guide:
! !
@ -50,8 +50,8 @@
! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi ! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi
! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2) ! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2)
! !
! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying on matching, ! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! on matching, with maximum size of aggregates equal to 8 and smoothed prolongators,
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver
! (Sec. 4.1, Listing 3) ! (Sec. 4.1, Listing 3)
@ -103,7 +103,8 @@ program amg_zexample_ml
integer :: ierr, ircode integer :: ierr, ircode
real(psb_dpk_) :: resmx, resmxp real(psb_dpk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name, kmethod character(len=20) :: name
character(len=20), parameter :: kmethod='FCG'
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -216,7 +217,6 @@ program amg_zexample_ml
! solver ! solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
kmethod = 'CG'
case(2) case(2)
@ -227,15 +227,16 @@ program amg_zexample_ml
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('SMOOTHER_TYPE','BJAC',info) call P%set('SMOOTHER_TYPE','BJAC',info)
call P%set('COARSE_SOLVE','BJAC',info) call P%set('COARSE_SOLVE','BJAC',info)
call P%set('COARSE_SUBSOLVE','ILU',info)
call P%set('COARSE_SWEEPS',8,info) call P%set('COARSE_SWEEPS',8,info)
kmethod = 'CG'
case(3) case(3)
! initialize a W-cycle preconditioner based on the coupled aggregation relying on matching, ! initialize a W-cycle preconditioner based on the coupled aggregation
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! relying on matching, with maximum size of aggregates equal to 8
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest ! and smoothed prolongators, 2 hybrid forward/backward GS sweeps
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver ! as pre/post-smoother, a distributed coarsest matrix,
! and preconditioned Flexible Conjugate Gradient as coarsest-level solver
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('PAR_AGGR_ALG','COUPLED',info) call P%set('PAR_AGGR_ALG','COUPLED',info)
@ -244,10 +245,10 @@ program amg_zexample_ml
call P%set('ML_CYCLE','WCYCLE',info) call P%set('ML_CYCLE','WCYCLE',info)
call P%set('SMOOTHER_SWEEPS',2,info) call P%set('SMOOTHER_SWEEPS',2,info)
call P%set('COARSE_SOLVE','KRM',info) call P%set('COARSE_SOLVE','KRM',info)
kmethod = 'CG' call P%set('COARSE_MAT','DIST',info)
end select call P%set('KRM_METHOD','FCG',info)
! build the preconditioner end select
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()
@ -269,7 +270,7 @@ program amg_zexample_ml
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned CG ! solve Ax=b with preconditioned Krylov method
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()

@ -173,7 +173,7 @@ program amg_dexample_ml
case(1) case(1)
! initialize the default multi-level preconditioner, i.e. V-cycle ! initialize the default multi-level preconditioner, i.e. V-cycle
! with basic smoothed aggregation, 1 hybrid forward/backward ! with decoupled smoothed aggregation, 1 hybrid forward/backward
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level ! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
! solver ! solver

@ -173,7 +173,7 @@ program amg_sexample_ml
case(1) case(1)
! initialize the default multi-level preconditioner, i.e. V-cycle ! initialize the default multi-level preconditioner, i.e. V-cycle
! with basic smoothed aggregation, 1 hybrid forward/backward ! with decoupled smoothed aggregation, 1 hybrid forward/backward
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level ! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
! solver ! solver

Loading…
Cancel
Save