mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-07 07:04:59 +00:00
Add GPU references and example to docs: first round.
This commit is contained in:
+101
-99
@@ -3,8 +3,8 @@
|
||||
<html >
|
||||
<head><title>Examples</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)">
|
||||
<meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)">
|
||||
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)">
|
||||
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)">
|
||||
<!-- html,3 -->
|
||||
<meta name="src" content="userhtml.tex">
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
@@ -12,6 +12,9 @@
|
||||
>
|
||||
<!--l. 114--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu7.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
class="cmr-12">] [</span><a
|
||||
href="#tailuserhtmlsu6.html"><span
|
||||
class="cmr-12">tail</span></a><span
|
||||
class="cmr-12">] [</span><a
|
||||
@@ -97,15 +100,15 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span>
|
||||
<!--l. 138--><p class="indent" > <span
|
||||
class="cmr-12">The setup and application of the default multilevel preconditioner for the real single</span>
|
||||
<span
|
||||
class="cmr-12">precision and the complex, single and double precision, versions are obtained</span>
|
||||
|
||||
|
||||
|
||||
<span
|
||||
class="cmr-12">precision and the complex, single and double precision, versions are obtained</span>
|
||||
<span
|
||||
class="cmr-12">with straightforward modifications of the previous example (see Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse5.html#x16-150005"><span
|
||||
href="userhtmlse5.html#x17-160005"><span
|
||||
class="cmr-12">5</span><!--tex4ht:ref: sec:userinterface --></a> <span
|
||||
class="cmr-12">for</span>
|
||||
<span
|
||||
@@ -128,59 +131,58 @@ class="cmr-12">.</span>
|
||||
|
||||
|
||||
|
||||
<div class="minipage"><div class="verbatim" id="verbatim-6">
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-6">
|
||||
  use psb_base_mod
|
||||
 <br />  use amg_prec_mod
|
||||
 <br />  use psb_krylov_mod
|
||||
 <br />... ...
|
||||
 <br />!
|
||||
 <br />! sparse matrix
|
||||
 <br />  type(psb_dspmat_type) :: A
|
||||
 <br />! sparse matrix descriptor
|
||||
 <br />  type(psb_desc_type)   :: desc_A
|
||||
 <br />! preconditioner
|
||||
 <br />  type(amg_dprec_type)  :: P
|
||||
 <br />! right-hand side and solution vectors
|
||||
 <br />  type(psb_d_vect_type) :: b, x
|
||||
 <br />... ...
|
||||
 <br />!
|
||||
 <br />! initialize the parallel environment
|
||||
 <br />  call psb_init(ctxt)
|
||||
 <br />  call psb_info(ctxt,iam,np)
|
||||
 <br />... ...
|
||||
 <br />!
|
||||
 <br />! read and assemble the spd matrix A and the right-hand side b
|
||||
 <br />! using PSBLAS routines for sparse matrix / vector management
|
||||
 <br />... ...
|
||||
 <br />!
|
||||
 <br />! initialize the default multilevel preconditioner, i.e. V-cycle
|
||||
 <br />! with basic smoothed aggregation, 1 hybrid forward/backward
|
||||
 <br />! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
|
||||
 <br />! solver
|
||||
 <br />  call P%init(’ML’,info)
|
||||
 <br />!
|
||||
 <br />! build the preconditioner
|
||||
 <br />  call P%hierarchy_build(A,desc_A,info)
|
||||
 <br />  call P%smoothers_build(A,desc_A,info)
|
||||
 <br />
|
||||
 <br />!
|
||||
 <br />! set the solver parameters and the initial guess
|
||||
 <br />  ... ...
|
||||
 <br />!
|
||||
 <br />! solve Ax=b with preconditioned CG
|
||||
 <br />  call psb_krylov(’CG’,A,P,b,x,tol,desc_A,info)
|
||||
 <br />  ... ...
|
||||
 <br />!
|
||||
 <br />! deallocate the preconditioner
|
||||
 <br />  call P%free(info)
|
||||
 <br />!
|
||||
 <br />! deallocate other data structures
|
||||
 <br />  ... ...
|
||||
 <br />!
|
||||
 <br />! exit the parallel environment
|
||||
 <br />  call psb_exit(ctxt)
|
||||
 <br />  stop
|
||||
</div>
|
||||
  use amg_prec_mod
|
||||
  use psb_krylov_mod
|
||||
... ...
|
||||
!
|
||||
! sparse matrix
|
||||
  type(psb_dspmat_type) :: A
|
||||
! sparse matrix descriptor
|
||||
  type(psb_desc_type)   :: desc_A
|
||||
! preconditioner
|
||||
  type(amg_dprec_type)  :: P
|
||||
! right-hand side and solution vectors
|
||||
  type(psb_d_vect_type) :: b, x
|
||||
... ...
|
||||
!
|
||||
! initialize the parallel environment
|
||||
  call psb_init(ctxt)
|
||||
  call psb_info(ctxt,iam,np)
|
||||
... ...
|
||||
!
|
||||
! read and assemble the spd matrix A and the right-hand side b
|
||||
! using PSBLAS routines for sparse matrix / vector management
|
||||
... ...
|
||||
!
|
||||
! initialize the default multilevel preconditioner, i.e. V-cycle
|
||||
! with basic smoothed aggregation, 1 hybrid forward/backward
|
||||
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
|
||||
! solver
|
||||
  call P%init(’ML’,info)
|
||||
!
|
||||
! build the preconditioner
|
||||
  call P%hierarchy_build(A,desc_A,info)
|
||||
  call P%smoothers_build(A,desc_A,info)
|
||||
!
|
||||
! set the solver parameters and the initial guess
|
||||
  ... ...
|
||||
!
|
||||
! solve Ax=b with preconditioned CG
|
||||
  call psb_krylov(’CG’,A,P,b,x,tol,desc_A,info)
|
||||
  ... ...
|
||||
!
|
||||
! deallocate the preconditioner
|
||||
  call P%free(info)
|
||||
!
|
||||
! deallocate other data structures
|
||||
  ... ...
|
||||
!
|
||||
! exit the parallel environment
|
||||
  call psb_exit(ctxt)
|
||||
  stop
|
||||
</pre>
|
||||
<!--l. 255--><p class="nopar" >
|
||||
|
||||
|
||||
@@ -289,19 +291,19 @@ class="cmr-12">.</span>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 318--><p class="noindent" >
|
||||
<div class="minipage"><div class="verbatim" id="verbatim-7">
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-7">
|
||||
... ...
|
||||
 <br />! build a V-cycle preconditioner with 1 block-Jacobi sweep (with
|
||||
 <br />! ILU(0) on the blocks) as pre- and post-smoother, and 8  block-Jacobi
|
||||
 <br />! sweeps (with ILU(0) on the blocks) as coarsest-level solver
|
||||
 <br />  call P%init(’ML’,info)
|
||||
 <br />  call P%set(’SMOOTHER_TYPE’,’BJAC’,info)
|
||||
 <br />  call P%set(’COARSE_SOLVE’,’BJAC’,info)
|
||||
 <br />  call P%set(’COARSE_SWEEPS’,8,info)
|
||||
 <br />  call P%hierarchy_build(A,desc_A,info)
|
||||
 <br />  call P%smoothers_build(A,desc_A,info)
|
||||
 <br />... ...
|
||||
</div>
|
||||
! build a V-cycle preconditioner with 1 block-Jacobi sweep (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
|
||||
  call P%init(’ML’,info)
|
||||
  call P%set(’SMOOTHER_TYPE’,’BJAC’,info)
|
||||
  call P%set(’COARSE_SOLVE’,’BJAC’,info)
|
||||
  call P%set(’COARSE_SWEEPS’,8,info)
|
||||
  call P%hierarchy_build(A,desc_A,info)
|
||||
  call P%smoothers_build(A,desc_A,info)
|
||||
... ...
|
||||
</pre>
|
||||
<!--l. 333--><p class="nopar" ></div></div>
|
||||
<br /><div class="caption"
|
||||
><span class="id">Listing 2: </span><span
|
||||
@@ -322,23 +324,23 @@ class="content">setup of a multilevel preconditioner based on the default decoup
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 360--><p class="noindent" >
|
||||
<div class="minipage"><div class="verbatim" id="verbatim-8">
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-8">
|
||||
... ...
|
||||
 <br />! build a W-cycle preconditioner with 2 hybrid Gauss-Seidel sweeps
|
||||
 <br />! as pre- and post-smoother, a distributed coarsest
|
||||
 <br />! matrix, and MUMPS as coarsest-level solver
|
||||
 <br />  call P%init(’ML’,info)
|
||||
 <br />  call P%set(’PAR_AGGR_ALG’,’COUPLED’,info)
|
||||
 <br />call P%set(’AGGR_TYPE’,’MATCHBOXP’,info)
|
||||
 <br />call P%set(’AGGR_SIZE’,8,info)
|
||||
 <br />  call P%set(’ML_CYCLE’,’WCYCLE’,info)
|
||||
 <br />  call P%set(’SMOOTHER_TYPE’,’FBGS’,info)
|
||||
 <br />  call P%set(’SMOOTHER_SWEEPS’,2,info)
|
||||
 <br />  call P%set(’COARSE_SOLVE’,’KRM’,info)
|
||||
 <br />  call P%hierarchy_build(A,desc_A,info)
|
||||
 <br />  call P%smoothers_build(A,desc_A,info)
|
||||
 <br />... ...
|
||||
</div>
|
||||
! 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(’PAR_AGGR_ALG’,’COUPLED’,info)
|
||||
call P%set(’AGGR_TYPE’,’MATCHBOXP’,info)
|
||||
call P%set(’AGGR_SIZE’,8,info)
|
||||
  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’,’KRM’,info)
|
||||
  call P%hierarchy_build(A,desc_A,info)
|
||||
  call P%smoothers_build(A,desc_A,info)
|
||||
... ...
|
||||
</pre>
|
||||
<!--l. 379--><p class="nopar" ></div></div>
|
||||
<br /> <div class="caption"
|
||||
><span class="id">Listing 3: </span><span
|
||||
@@ -360,16 +362,16 @@ weighted matching</span></div><!--tex4ht:label?: x15-14003r3 -->
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 398--><p class="noindent" >
|
||||
<div class="minipage"><div class="verbatim" id="verbatim-9">
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-9">
|
||||
... ...
|
||||
 <br />! set RAS with overlap 2 and ILU(0) on the local blocks
|
||||
 <br />  call P%init(’AS’,info)
|
||||
 <br />  call P%set(’SUB_OVR’,2,info)
|
||||
 <br />  call P%bld(A,desc_A,info)
|
||||
 <br />... ...
|
||||
 <br />! solve Ax=b with preconditioned BiCGSTAB
|
||||
 <br />  call psb_krylov(’BICGSTAB’,A,P,b,x,tol,desc_A,info)
|
||||
</div>
|
||||
! set RAS with overlap 2 and ILU(0) on the local blocks
|
||||
  call P%init(’AS’,info)
|
||||
  call P%set(’SUB_OVR’,2,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)
|
||||
</pre>
|
||||
<!--l. 410--><p class="nopar" ></div></div>
|
||||
<br /> <div class="caption"
|
||||
><span class="id">Listing 4: </span><span
|
||||
@@ -381,17 +383,17 @@ class="content">setup of a one-level Schwarz preconditioner.</span></div><!--tex
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--l. 1--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 420--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu7.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
class="cmr-12">] [</span><a
|
||||
href="userhtmlsu6.html" ><span
|
||||
class="cmr-12">front</span></a><span
|
||||
class="cmr-12">] [</span><a
|
||||
href="userhtmlse4.html#userhtmlsu6.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 1--><p class="indent" > <a
|
||||
<!--l. 420--><p class="indent" > <a
|
||||
id="tailuserhtmlsu6.html"></a>
|
||||
</body></html>
|
||||
|
||||
Reference in New Issue
Block a user