updating examples/gpu and doc

savebcmatch
pasquadambra 4 years ago
parent 9b9dfbd198
commit 10e9c53e54

Binary file not shown.

@ -584,15 +584,18 @@ Krylov method. At the end of the code, we close the GPU environment
\caption{setup of a GPU-enabled test program part three.\label{fig:gpu-ex3}} \caption{setup of a GPU-enabled test program part three.\label{fig:gpu-ex3}}
\end{listing} \end{listing}
It is very important to employ solvers that are suited It is very important to employ smoothers and coarsest solvers that are suited
to the GPU, i.e. solvers that do NOT employ triangular to the GPU, i.e. methods that do NOT employ triangular
system solve kernels. Solvers that satisfy this constraint include: system solve kernels. Methods that satisfy this constraint include:
\begin{itemize} \begin{itemize}
\item \verb|JACOBI| \item \verb|JACOBI|
\item \verb|BJAC| with the following methods on the local blocks:
\begin{itemize}
\item \verb|INVK| \item \verb|INVK|
\item \verb|INVT| \item \verb|INVT|
\item \verb|AINV| \item \verb|AINV|
\end{itemize} \end{itemize}
\end{itemize}
and their $\ell_1$ variants. and their $\ell_1$ variants.
%%% Local Variables: %%% Local Variables:

@ -39,23 +39,18 @@
! !
! This sample program solves a linear system obtained by discretizing a ! This sample program solves a linear system obtained by discretizing a
! PDE with Dirichlet BCs. The solver is CG, coupled with one of the ! PDE with Dirichlet BCs. The solver is CG, coupled with one of the
! following multi-level preconditioner, as explained in Section 4.1 of ! following multi-level preconditioner, as explained in Section 4.2 of
! the AMG4PSBLAS User's and Reference Guide: ! the AMG4PSBLAS User's and Reference Guide:
! !
! - choice = 1, the default multi-level preconditioner solver, i.e., ! - choice = 1, a V-cycle with decoupled smoothed aggregation, 4 Jacobi
! V-cycle with decoupled smoothed aggregation, 1 hybrid forward/backward ! sweeps as pre/post-smoother and 8 Jacobi sweeps as coarsest-level
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level ! solver with replicated coarsest matrix
! solver (Sec. 4.1, Listing 1)
! !
! - choice = 2, a V-cycle preconditioner with 1 block-Jacobi sweep ! - choice = 2, a W-cycle based on the coupled aggregation relying on matching,
! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi ! with maximum size of aggregates equal to 8 and smoothed prolongators,
! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2) ! 2 sweeps of Block-Jacobi ipre/post-smoother using approximate inverse INVK and
! ! 4 sweeps of Block-Jacobi with INVK as coarsest-level solver on distributed
! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying ! coarsest matrix
! 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
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver
! (Sec. 4.1, Listing 3)
! !
! 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
! unit rhs is set). ! unit rhs is set).
@ -183,8 +178,9 @@ program amg_dexample_gpu
case(1) case(1)
! initialize a V-cycle preconditioner with 4 Jacobi sweep ! initialize a V-cycle preconditioner, relying on decoupled smoothed aggregation
! and 8 Jacobi sweeps as coarsest-level solver ! with 4 Jacobi sweeps as pre/post-smoother
! and 8 Jacobi sweeps as coarsest-level solver on replicated coarsest matrix
call P%init(ctxt,'ML',info) call P%init(ctxt,'ML',info)
call P%set('SMOOTHER_TYPE','JACOBI',info) call P%set('SMOOTHER_TYPE','JACOBI',info)
@ -195,19 +191,22 @@ program amg_dexample_gpu
case(2) case(2)
! initialize a V-cycle preconditioner based on the coupled aggregation relying on matching, ! initialize a W-cycle preconditioner based on the coupled aggregation relying on matching,
! with maximum size of aggregates equal to 8 and smoothed prolongators, ! with maximum size of aggregates equal to 8 and smoothed prolongators,
! Block-Jacobi smoother using approximate inverse INVK and ! 2 sweeps of Block-Jacobi pre/post-smoother using approximate inverse INVK and
! and 4 sweeps of INVK on he coarsest level ! 4 sweeps of Block-Jacobi with INVK on the coarsest level distributed matrix
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)
call P%set('AGGR_TYPE','MATCHBOXP',info) call P%set('AGGR_TYPE','MATCHBOXP',info)
call P%set('AGGR_SIZE',8,info) call P%set('AGGR_SIZE',8,info)
call P%set('ML_CYCLE','WCYCLE',info) call P%set('ML_CYCLE','WCYCLE',info)
call P%set('SMOOTHER_TYPE','BJAC',info)
call P%set('SMOOTHER_SWEEPS',2,info) call P%set('SMOOTHER_SWEEPS',2,info)
call P%set('SUB_SOLVE','INVK',info) call P%set('SUB_SOLVE','INVK',info)
call P%set('COARSE_SOLVE','INVK',info) call P%set('COARSE_SOLVE','BJAC',info)
call P%set('COARSE_SUBSOLVE','INVK',info)
call P%set('COARSE_SWEEPS',4,info)
call P%set('COARSE_MAT','DIST',info) call P%set('COARSE_MAT','DIST',info)
kmethod = 'CG' kmethod = 'CG'

Loading…
Cancel
Save