next up previous contents
Next: Examples Up: userhtml Previous: Smoothers and coarsest-level solvers   Contents


Getting Started

We describe the basics for building and applying MLD2P4 one-level and multilevel (i.e., AMG) preconditioners with the Krylov solvers included in PSBLAS [13]. The following steps are required:

  1. Declare the preconditioner data structure. It is a derived data type, mld_xprec_ type, where x may be s, d, c or z, according to the basic data type of the sparse matrix (s = real single precision; d = real double precision; c = complex single precision; z = complex double precision). This data structure is accessed by the user only through the MLD2P4 routines, following an object-oriented approach.
  2. Allocate and initialize the preconditioner data structure, according to a preconditioner type chosen by the user. This is performed by the routine init, which also sets defaults for each preconditioner type selected by the user. The preconditioner types and the defaults associated with them are given in Table 1, where the strings used by init to identify the preconditioner types are also given. Note that these strings are valid also if uppercase letters are substituted by corresponding lowercase ones.
  3. Modify the selected preconditioner type, by properly setting preconditioner parameters. This is performed by the routine set. This routine must be called only if the user wants to modify the default values of the parameters associated with the selected preconditioner type, to obtain a variant of that preconditioner. Examples of use of set are given in Section 5.1; a complete list of all the preconditioner parameters and their allowed and default values is provided in Section 6, Tables 2-8.
  4. Build the preconditioner for a given matrix. If the selected preconditioner is multilevel, then two steps must be performed, as specified next.
    4.1
    Build the aggregation hierarchy for a given matrix. This is performed by the routine hierarchy_build.
    4.2
    Build the preconditioner for a given matrix. This is performed by the routine smoothers_build.
    If the selected preconditioner is one-level, it is built in a single step, performed by the routine bld.
  5. Apply the preconditioner at each iteration of a Krylov solver. This is performed by the routine aply. When using the PSBLAS Krylov solvers, this step is completely transparent to the user, since aply is called by the PSBLAS routine implementing the Krylov solver (psb_krylov).
  6. Free the preconditioner data structure. This is performed by the routine free. This step is complementary to step 1 and should be performed when the preconditioner is no more used.

All the previous routines are available as methods of the preconditioner object. A detailed description of them is given in Section 6. Examples showing the basic use of MLD2P4 are reported in Section 5.1.


Table 1: Preconditioner types, corresponding strings and default choices.
TYPE STRING DEFAULT PRECONDITIONER
No preconditioner 'NOPREC' Considered only to use the PSBLAS Krylov solvers with no preconditioner.
Diagonal 'DIAG' or 'JACOBI' Diagonal preconditioner. For any zero diagonal entry of the matrix to be preconditioned, the corresponding entry of the preconditioner is set to 1.
Block Jacobi 'BJAC' Block-Jacobi with ILU(0) on the local blocks.
Additive Schwarz 'AS' Restricted Additive Schwarz (RAS), with overlap 1 and ILU(0) on the local blocks.
Multilevel 'ML' V-cycle with one hybrid forward Gauss-Seidel (GS) sweep as pre-smoother and one hybrid backward GS sweep as post-smoother, basic smoothed aggregation as coarsening algorithm, and LU (plus triangular solve) as coarsest-level solver. See the default values in Tables 2-8 for further details of the preconditioner.


Note that the module mld_prec_mod, containing the definition of the preconditioner data type and the interfaces to the routines of MLD2P4, must be used in any program calling such routines. The modules psb_base_mod, for the sparse matrix and communication descriptor data types, and psb_krylov_mod, for interfacing with the Krylov solvers, must be also used (see Section 5.1).

Remark 1. Coarsest-level solvers based on the LU factorization, such as those implemented in UMFPACK, MUMPS, SuperLU, and SuperLU_Dist, usually lead to smaller numbers of preconditioned Krylov iterations than inexact solvers, when the linear system comes from a standard discretization of basic scalar elliptic PDE problems. However, this does not necessarily correspond to the smallest execution time on parallel computers.



Subsections
next up previous contents
Next: Examples Up: userhtml Previous: Smoothers and coarsest-level solvers   Contents