From d45c198b489877a03c8b8f4eb8825e20ce0a042e Mon Sep 17 00:00:00 2001 From: Pasqua D'Ambra Date: Thu, 20 Jul 2017 20:35:05 +0200 Subject: [PATCH] Changes from Pasqua to example files and docs. --- docs/src/gettingstarted.tex | 20 ++++++++++---------- examples/fileread/mld_cexample_ml.f90 | 15 +++++++-------- examples/fileread/mld_dexample_ml.f90 | 15 +++++++-------- examples/fileread/mld_sexample_ml.f90 | 15 +++++++-------- examples/fileread/mld_zexample_ml.f90 | 15 +++++++-------- examples/fileread/runs/ml.inp | 2 +- examples/pdegen/mld_dexample_ml.f90 | 15 +++++++-------- examples/pdegen/mld_sexample_ml.f90 | 15 +++++++-------- examples/pdegen/runs/1lev.inp | 2 +- examples/pdegen/runs/ml.inp | 2 +- 10 files changed, 55 insertions(+), 61 deletions(-) diff --git a/docs/src/gettingstarted.tex b/docs/src/gettingstarted.tex index 8d0d8c0a..6644ae1a 100644 --- a/docs/src/gettingstarted.tex +++ b/docs/src/gettingstarted.tex @@ -219,14 +219,15 @@ Furthermore, specifying block-Jacobi as coarsest-level solver implies that the coarsest-level matrix is distributed among the processes. Figure~\ref{fig:ex3} shows how to set a W-cycle preconditioner which -applies 2 Gauss-Seidel sweeps as pre- and post-smoother, +applies 2 hybrid Gauss-Seidel sweeps as pre- and post-smoother, and solves the coarsest-level system with the multifrontal LU factorization implemented in MUMPS. It is specified that the coarsest-level matrix is distributed, since MUMPS can be used on both replicated and distributed matrices, and by default -it is used on replicated ones. Note the use of the parameter \verb|pos| -to specify a property only for the pre-smoother or the post-smoother -(see Section~\ref{sec:precset} for more details). +it is used on replicated ones. +%Note the use of the parameter \verb|pos| +%to specify a property only for the pre-smoother or the post-smoother +%(see Section~\ref{sec:precset} for more details). The code fragments shown in Figures~\ref{fig:ex2} and \ref{fig:ex3} are included in the example program file \verb|mld_dexample_ml.f90| too. @@ -281,14 +282,13 @@ boundary conditions are also available in the directory \verb|examples/pdegen|. {\small \begin{verbatim} ... ... -! build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! pre- and post-smoother, a distributed coarsest +! build a W-cycle preconditioner with 2 hybrid Gauss-Seidel sweeps +! as pre- and post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) - call P%set('ML_TYPE','WCYCLE',info) - call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') - call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') + call P%set('ML_CYCLE','WCYCLE',info) + call P%set('SMOOTHER_TYPE','FBGS',info) + call P%set('SMOOTHER_SWEEPS',2,info) call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) call P%hierarchy_build(A,desc_A,info) diff --git a/examples/fileread/mld_cexample_ml.f90 b/examples/fileread/mld_cexample_ml.f90 index 88f61d06..02bdd290 100644 --- a/examples/fileread/mld_cexample_ml.f90 +++ b/examples/fileread/mld_cexample_ml.f90 @@ -52,8 +52,8 @@ ! (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. 5.1, Fig. 3) ! -! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! pre- and post-smoother, a distributed coarsest +! - choice = 3, build a W-cycle preconditioner with 2 hybrid forward/backward +! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! ! The matrix and the rhs are read from files (if an rhs is not available, the @@ -231,15 +231,14 @@ program mld_cexample_ml case(3) - ! initialize a W-cycle preconditioner with 2 Gauss-Seidel sweeps as - ! post-smoother (and no pre-smoother), a distributed coarsest + ! initialize a W-cycle preconditioner with 2 hybrid forward/backward + ! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) - call P%set('ML_TYPE','WCYCLE',info) - call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') - call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') + call P%set('ML_CYCLE','WCYCLE',info) + call P%set('SMOOTHER_TYPE','FBGS',info) + call P%set('SMOOTHER_SWEEPS',2,info) call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) kmethod = 'CG' diff --git a/examples/fileread/mld_dexample_ml.f90 b/examples/fileread/mld_dexample_ml.f90 index b794503e..c2e0e7c1 100644 --- a/examples/fileread/mld_dexample_ml.f90 +++ b/examples/fileread/mld_dexample_ml.f90 @@ -52,8 +52,8 @@ ! (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. 5.1, Fig. 3) ! -! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! pre- and post-smoother, a distributed coarsest +! - choice = 3, build a W-cycle preconditioner with 2 hybrid forward/backward +! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! ! The matrix and the rhs are read from files (if an rhs is not available, the @@ -231,15 +231,14 @@ program mld_dexample_ml case(3) - ! initialize a W-cycle preconditioner with 2 Gauss-Seidel sweeps as - ! post-smoother (and no pre-smoother), a distributed coarsest + ! initialize a W-cycle preconditioner with 2 hybrid forward/backward + ! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) - call P%set('ML_TYPE','WCYCLE',info) - call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') - call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') + call P%set('ML_CYCLE','WCYCLE',info) + call P%set('SMOOTHER_TYPE','FBGS',info) + call P%set('SMOOTHER_SWEEPS',2,info) call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) kmethod = 'CG' diff --git a/examples/fileread/mld_sexample_ml.f90 b/examples/fileread/mld_sexample_ml.f90 index 0b6f8bcf..03a05dac 100644 --- a/examples/fileread/mld_sexample_ml.f90 +++ b/examples/fileread/mld_sexample_ml.f90 @@ -52,8 +52,8 @@ ! (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. 5.1, Fig. 3) ! -! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! pre- and post-smoother, a distributed coarsest +! - choice = 3, build a W-cycle preconditioner with 2 hybrid forward/backward +! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! ! The matrix and the rhs are read from files (if an rhs is not available, the @@ -231,15 +231,14 @@ program mld_sexample_ml case(3) - ! initialize a W-cycle preconditioner with 2 Gauss-Seidel sweeps as - ! post-smoother (and no pre-smoother), a distributed coarsest + ! initialize a W-cycle preconditioner with 2 hybrid forward/backward + ! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) - call P%set('ML_TYPE','WCYCLE',info) - call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') - call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') + call P%set('ML_CYCLE','WCYCLE',info) + call P%set('SMOOTHER_TYPE','FBGS',info) + call P%set('SMOOTHER_SWEEPS',2,info) call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) kmethod = 'CG' diff --git a/examples/fileread/mld_zexample_ml.f90 b/examples/fileread/mld_zexample_ml.f90 index a6aa4288..c559d7c7 100644 --- a/examples/fileread/mld_zexample_ml.f90 +++ b/examples/fileread/mld_zexample_ml.f90 @@ -52,8 +52,8 @@ ! (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. 5.1, Fig. 3) ! -! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! pre- and post-smoother, a distributed coarsest +! - choice = 3, build a W-cycle preconditioner with 2 hybrid forward/backward +! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! ! The matrix and the rhs are read from files (if an rhs is not available, the @@ -231,15 +231,14 @@ program mld_zexample_ml case(3) - ! initialize a W-cycle preconditioner with 2 Gauss-Seidel sweeps as - ! post-smoother (and no pre-smoother), a distributed coarsest + ! initialize a W-cycle preconditioner with 2 hybrid forward/backward + ! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) - call P%set('ML_TYPE','WCYCLE',info) - call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') - call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') + call P%set('ML_CYCLE','WCYCLE',info) + call P%set('SMOOTHER_TYPE','FBGS',info) + call P%set('SMOOTHER_SWEEPS',2,info) call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) kmethod = 'CG' diff --git a/examples/fileread/runs/ml.inp b/examples/fileread/runs/ml.inp index 70bc6267..ee50bdbd 100644 --- a/examples/fileread/runs/ml.inp +++ b/examples/fileread/runs/ml.inp @@ -1,6 +1,6 @@ mld_mat.mtx ! This matrix (and others) from: http://math.nist.gov/MatrixMarket/ or mld_rhs.mtx ! rhs | http://www.cise.ufl.edu/research/sparse/matrices/index.html MM ! File format: MM (Matrix Market) HB (Harwell-Boeing). -1 ! Preconditioner choice +3 ! Preconditioner choice 0100 ! ITMAX 1.d-6 ! EPS diff --git a/examples/pdegen/mld_dexample_ml.f90 b/examples/pdegen/mld_dexample_ml.f90 index bd2fff56..22799481 100644 --- a/examples/pdegen/mld_dexample_ml.f90 +++ b/examples/pdegen/mld_dexample_ml.f90 @@ -53,8 +53,8 @@ ! (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. 5.1, Fig. 3) ! -! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! pre- and post-smoother, a distributed coarsest +! - choice = 3, build a W-cycle preconditioner with 2 hybrid forward/backward +! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! ! The PDE is a general second order equation in 3d @@ -248,15 +248,14 @@ program mld_dexample_ml case(3) - ! initialize a W-cycle preconditioner with 2 Gauss-Seidel sweeps as - ! post-smoother (and no pre-smoother), a distributed coarsest + ! initialize a W-cycle preconditioner with 2 hybrid forward/backward + ! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) - call P%set('ML_TYPE','WCYCLE',info) - call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') - call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') + call P%set('ML_CYCLE','WCYCLE',info) + call P%set('SMOOTHER_TYPE','FBGS',info) + call P%set('SMOOTHER_SWEEPS',2,info) call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) kmethod = 'CG' diff --git a/examples/pdegen/mld_sexample_ml.f90 b/examples/pdegen/mld_sexample_ml.f90 index 310c4356..f61f22ea 100644 --- a/examples/pdegen/mld_sexample_ml.f90 +++ b/examples/pdegen/mld_sexample_ml.f90 @@ -53,8 +53,8 @@ ! (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. 5.1, Fig. 3) ! -! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! pre- and post-smoother, a distributed coarsest +! - choice = 3, build a W-cycle preconditioner with 2 hybrid forward/backward +! GS sweeps pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! ! The PDE is a general second order equation in 3d @@ -248,15 +248,14 @@ program mld_sexample_ml case(3) - ! initialize a W-cycle preconditioner with 2 Gauss-Seidel sweeps as - ! post-smoother (and no pre-smoother), a distributed coarsest + ! initialize a W-cycle preconditioner with 2 hybrid forward/backward + ! GS sweeps as pre/post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) - call P%set('ML_TYPE','WCYCLE',info) - call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') - call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') + call P%set('ML_CYCLE','WCYCLE',info) + call P%set('SMOOTHER_TYPE','FBGS',info) + call P%set('SMOOTHER_SWEEPS',2,info) call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) kmethod = 'CG' diff --git a/examples/pdegen/runs/1lev.inp b/examples/pdegen/runs/1lev.inp index 4e2f5460..80881400 100644 --- a/examples/pdegen/runs/1lev.inp +++ b/examples/pdegen/runs/1lev.inp @@ -1,3 +1,3 @@ 15 ! IDIM; domain size is idim**3 -10 ! ITMAX +100 ! ITMAX 1.d-6 ! EPS diff --git a/examples/pdegen/runs/ml.inp b/examples/pdegen/runs/ml.inp index 44119b9f..8bbbb126 100644 --- a/examples/pdegen/runs/ml.inp +++ b/examples/pdegen/runs/ml.inp @@ -1,4 +1,4 @@ -2 ! Preconditioner choice +3 ! Preconditioner choice 10 ! IDIM; domain size is idim**3 500 ! ITMAX 1.d-6 ! EPS