10 Preconditioner routines

The base PSBLAS library contains the implementation of two simple preconditioning techniques:

The supporting data type and subroutine interfaces are defined in the module psb_prec_mod. The old interfaces psb_precinit and psb_precbld are still supported for backward compatibility

10.1 init — Initialize a preconditioner

call prec%init(icontxt,ptype, info)

Type:

Asynchronous.

On Entry

icontxt

the communication context.
Scope:global.
Type:required.
Intent: in.
Specified as: an integer value.

ptype

the type of preconditioner. Scope: global
Type: required
Intent: in.
Specified as: a character string, see usage notes.

On Exit

prec

Scope: local
Type: required
Intent: inout.
Specified as: a preconditioner data structure psb_prec_type.

info

Scope: global
Type: required
Intent: out.
Error code: if no error, 0 is returned.

Notes Legal inputs to this subroutine are interpreted depending on the ptype string as follows4 :

NONE

No preconditioning, i.e. the preconditioner is just a copy operator.

DIAG

Diagonal scaling; each entry of the input vector is multiplied by the reciprocal of the sum of the absolute values of the coefficients in the corresponding row of matrix A;

BJAC

Precondition by a factorization of the block-diagonal of matrix A, where block boundaries are determined by the data allocation boundaries for each process; requires no communication. Only the incomplete factorization ILU(0) is currently implemented.

10.2 Set — set preconditioner parameters

call p%set(what,val,info)

This method sets the parameters defining the subdomain solver when the preconditioner type is BJAC. More precisely, the parameter identified by what is assigned the value contained in val.

Arguments

what

character(len=*).

The parameter to be set. It can be specified through its name; the string is case-insensitive. See Tables ??-22.

val

integer or character(len=*) or real(psb_spk_) or real(psb_dpk_), intent(in).

The value of the parameter to be set. The list of allowed values and the corresponding data types is given in Tables ??-22. When the value is of type character(len=*), it is also treated as case insensitive.

info

integer, intent(out).

Error code. If no error, 0 is returned. See Section ?? for details.

A number of subdomain solvers can be chosen with this method; a list of the parameters that can be set, along with their allowed and default values, is given in Tables ??-22.







what

data type

val

default

comments






SUB_SOLVE

character(len=*)

ILU

ILUT

INVT

INVK

AINV

The local solver to be used with the smoother or one-level preconditioner ILU(p), ILU(p, t), Approximate Inverses INVK(p, q), INVT(p1, p2, t1, t2) and AINV(t); note that approximate inverses are specifically suited for GPUs since they do not employ triangular system solve kernels, see [?].












Table 21: Parameters defining the solver or the details of the one-level preconditioner.







what

data type

val

default

comments






SUB_FILLIN

integer

Any integer

number 0

0

Fill-in level p of the incomplete LU factorizations.






SUB_ILUTHRS

real(kind_parameter)

Any real number 0

0

Drop tolerance t in the ILU(p, t) factorization.












Table 22: Parameters defining the smoother or the details of the one-level preconditioner (continued).

10.3 build — Builds a preconditioner

call prec%build(a, desc_a, info[,amold,vmold,imold])

Type:

Synchronous.

On Entry

a

the system sparse matrix. Scope: local
Type: required
Intent: in, target.
Specified as: a sparse matrix data structure psb_Tspmat_type.

prec

the preconditioner.
Scope: local
Type: required
Intent: inout.
Specified as: an already initialized precondtioner data structure psb_prec_type

desc_a

the problem communication descriptor. Scope: local
Type: required
Intent: in, target.
Specified as: a communication descriptor data structure psb_desc_type.

amold

The desired dynamic type for the internal matrix storage.
Scope: local.
Type: optional.
Intent: in.
Specified as: an object of a class derived from psb_T_base_sparse_mat.

vmold

The desired dynamic type for the internal vector storage.
Scope: local.
Type: optional.
Intent: in.
Specified as: an object of a class derived from psb_T_base_vect_type.

imold

The desired dynamic type for the internal integer vector storage.
Scope: local.
Type: optional.
Intent: in.
Specified as: an object of a class derived from (integer) psb_T_base_vect_type.

On Return

prec

the preconditioner.
Scope: local
Type: required
Intent: inout.
Specified as: a precondtioner data structure psb_prec_type

info

Error code.
Scope: local
Type: required
Intent: out.
An integer value; 0 means no error has been detected.

The amold, vmold and imold arguments may be employed to interface with special devices, such as GPUs and other accelerators.

10.4 apply — Preconditioner application routine

call prec%apply(x,y,desc_a,info,trans,work)
call prec%apply(x,desc_a,info,trans)

Type:

Synchronous.

On Entry

prec

the preconditioner. Scope: local
Type: required
Intent: in.
Specified as: a preconditioner data structure psb_prec_type.

x

the source vector. Scope: local
Type: required
Intent: inout.
Specified as: a rank one array or an object of type psb_T_vect_type.

desc_a

the problem communication descriptor. Scope: local
Type: required
Intent: in.
Specified as: a communication data structure psb_desc_type.

trans

Scope:
Type: optional
Intent: in.
Specified as: a character.

work

an optional work space Scope: local
Type: optional
Intent: inout.
Specified as: a double precision array.

On Return

y

the destination vector. Scope: local
Type: required
Intent: inout.
Specified as: a rank one array or an object of type psb_T_vect_type.

info

Error code.
Scope: local
Type: required
Intent: out.
An integer value; 0 means no error has been detected.

10.5 descr — Prints a description of current preconditioner

call prec%descr(info)
call prec%descr(info,iout, root)

Type:

Asynchronous.

On Entry

prec

the preconditioner. Scope: local
Type: required
Intent: in.
Specified as: a preconditioner data structure psb_prec_type.

iout

output unit. Scope: local
Type: optional
Intent: in.
Specified as: an integer number. Default: default output unit.

root

Process from which to print Scope: local
Type: optional
Intent: in.
Specified as: an integer number between 0 and np- 1, in which case the specified process will print the description, or -1, in which case all processes will print. Default: 0.

On Return

info

Error code.
Scope: local
Type: required
Intent: out.
An integer value; 0 means no error has been detected.

10.6 clone — clone current preconditioner

call  prec%clone(precout,info)

Type:

Asynchronous.

On Entry

prec

the preconditioner.
Scope: local.

On Return

precout

A copy of the input object.

info

Return code.

10.7 free — Free a preconditioner

call prec%free(info)

Type:

Asynchronous.

On Entry

prec

the preconditioner.
Scope: local.
Type: required
Intent: inout.
Specified as: a preconditioner data structure psb_prec_type.

On Exit

prec

Scope: local
Type: required
Intent: inout.
Specified as: a preconditioner data structure psb_prec_type.

info

Scope: global
Type: required
Intent: out.
Error code: if no error, 0 is returned.

Notes Releases all internal storage.