Fixes from Pasqua

stopcriterion
Salvatore Filippone 8 years ago
parent eae18f1069
commit 7ec9000147

@ -219,7 +219,7 @@ Furthermore, specifying block-Jacobi as coarsest-level
solver implies that the coarsest-level matrix is distributed solver implies that the coarsest-level matrix is distributed
among the processes. among the processes.
Figure~\ref{fig:ex3} shows how to set a W-cycle preconditioner which Figure~\ref{fig:ex3} shows how to set a W-cycle preconditioner which
applies no pre-smoother and 2 Gauss-Seidel sweeps as post-smoother, applies 2 Gauss-Seidel sweeps as pre- and post-smoother,
and solves the coarsest-level system with the multifrontal LU factorization and solves the coarsest-level system with the multifrontal LU factorization
implemented in MUMPS. It is specified that the coarsest-level implemented in MUMPS. It is specified that the coarsest-level
matrix is distributed, since MUMPS can be used on both matrix is distributed, since MUMPS can be used on both
@ -227,14 +227,14 @@ replicated and distributed matrices, and by default
it is used on replicated ones. Note the use of the parameter \verb|pos| 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 to specify a property only for the pre-smoother or the post-smoother
(see Section~\ref{sec:precset} for more details). (see Section~\ref{sec:precset} for more details).
Note also that a Krylov method different from CG must be used to solve
the preconditioned system, since the preconditione in nonsymmetric.
The code fragments shown in Figures~\ref{fig:ex2} and \ref{fig:ex3} are 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. included in the example program file \verb|mld_dexample_ml.f90| too.
Finally, Figure~\ref{fig:ex4} shows the setup of a one-level Finally, Figure~\ref{fig:ex4} shows the setup of a one-level
additive Schwarz preconditioner, i.e., RAS with overlap 2. The additive Schwarz preconditioner, i.e., RAS with overlap 2.
corresponding example program is available in the file Note also that a Krylov method different from CG must be used to solve
the preconditioned system, since the preconditione in nonsymmetric.
The corresponding example program is available in the file
\verb|mld_dexample_1lev.f90|. \verb|mld_dexample_1lev.f90|.
For all the previous preconditioners, example programs where the sparse matrix and For all the previous preconditioners, example programs where the sparse matrix and
@ -282,20 +282,18 @@ boundary conditions are also available in the directory \verb|examples/pdegen|.
\begin{verbatim} \begin{verbatim}
... ... ... ...
! build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as ! build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as
! post-smoother (and no pre-smoother), a distributed coarsest ! pre- and post-smoother, a distributed coarsest
! matrix, and MUMPS as coarsest-level solver ! matrix, and MUMPS as coarsest-level solver
call P%init('ML',info) call P%init('ML',info)
call P%set('ML_TYPE','WCYCLE',info) call P%set('ML_TYPE','WCYCLE',info)
call P%set('SMOOTHER_TYPE','GS',info) call P%set('SMOOTHER_TYPE','GS',info)
call P%set('SMOOTHER_SWEEPS',0,info,pos='PRE') call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE')
call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') call P%set('SMOOTHER_SWEEPS',2,info,pos='POST')
call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_SOLVE','MUMPS',info)
call P%set('COARSE_MAT','DIST',info) call P%set('COARSE_MAT','DIST',info)
call P%hierarchy_build(A,desc_A,info) call P%hierarchy_build(A,desc_A,info)
call P%smoothers_build(A,desc_A,info) call P%smoothers_build(A,desc_A,info)
... ... ... ...
! solve Ax=b with preconditioned BiCGSTAB
call psb_krylov('BICGSTAB',A,P,b,x,tol,desc_A,info)
\end{verbatim} \end{verbatim}
} }
\end{minipage} \end{minipage}
@ -314,6 +312,8 @@ boundary conditions are also available in the directory \verb|examples/pdegen|.
call P%set('SUB_OVR',2,info) call P%set('SUB_OVR',2,info)
call P%bld(A,desc_A,info) call P%bld(A,desc_A,info)
... ... ... ...
! solve Ax=b with preconditioned BiCGSTAB
call psb_krylov('BICGSTAB',A,P,b,x,tol,desc_A,info)
\end{verbatim} \end{verbatim}
} }
\end{minipage} \end{minipage}

@ -53,7 +53,7 @@
! sweeps (with ILU(0) on the blocks) as coarsest-level solver(Sec. 5.1, Fig. 3) ! 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 ! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as
! post-smoother (and no pre-smoother), a distributed coarsest ! pre- and post-smoother, a distributed coarsest
! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! 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 ! The matrix and the rhs are read from files (if an rhs is not available, the
@ -238,11 +238,11 @@ program mld_dexample_ml
call P%init('ML',info) call P%init('ML',info)
call P%set('ML_TYPE','WCYCLE',info) call P%set('ML_TYPE','WCYCLE',info)
call P%set('SMOOTHER_TYPE','GS',info) call P%set('SMOOTHER_TYPE','GS',info)
call P%set('SMOOTHER_SWEEPS',0,info,pos='PRE') call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE')
call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') call P%set('SMOOTHER_SWEEPS',2,info,pos='POST')
call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_SOLVE','MUMPS',info)
call P%set('COARSE_MAT','DIST',info) call P%set('COARSE_MAT','DIST',info)
kmethod = 'BICGSTAB' kmethod = 'CG'
end select end select
! build the preconditioner ! build the preconditioner
@ -267,7 +267,7 @@ program mld_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 BiCGSTAB ! solve Ax=b with preconditioned CG
call psb_barrier(ictxt) call psb_barrier(ictxt)
t1 = psb_wtime() t1 = psb_wtime()

Loading…
Cancel
Save