This subroutine computes a preconditioner for a global general sparse matrix A that should be passed unchanged to the PSPGIS subroutine. The preconditioners include diagonal scaling or an incomplete LU factorization.
Fortran | CALL PSPGPR (iprec, a, prcs, desc_a)
CALL PSPGPR (iprec, a, prcs, desc_a, info) |
If iprec = 0, which is referred to as none, indicates the local part of the submatrix A is not preconditioned. PSPGIS will not be effective in this case, unless the coefficient matrix is well conditioned; if your input matrix is not well conditioned, you should consider using iprec = 1 or 2.
If iprec = 1, which is referred to as diagsc, indicates the local part of the submatrix A is preconditioned by a local diagonal submatrix.
If iprec = 2, which is referred to as ilu, indicates the local part of the submatrix A is preconditioned by a local incomplete LU factorization.
It is suggested that you use a preconditioner. For an explanation, see Notes and Coding Rules.
Scope: global
Type: required
Specified as: a fullword integer, where: iprec = 0, 1, or 2.
Scope: local
Type: required
Specified as: the derived data type D_SPMAT.
Type: required
Specified as: the derived data type DESC_TYPE.
Scope: local
Type: required
Returned as: the derived data type D_PRECN.
If info = 0, then no input-argument errors or computational errors occurred. This indicates a normal exit.
If info > 0, the value stored in info indicates the row index in the global general sparse matrix A where the preconditioner failed.
Scope: global
Type: optional
Returned as: a fullword integer; info >= 0.
(M-1)Ax = (M-1)b
is a preconditioned system and M is called a preconditioner. In practice, the new coefficient matrix (M-1)A is almost never formed explicitly, but rather its action is computed during the application of the iterative method. The effectiveness of the preconditioning operation depends on a trade-off between how well M approximates A and how costly it is to compute and invert it; no single preconditioner will give best overall performance under all situations. Note finally that it is quite rare for a linear system to behave well enough so as not to require preconditioning; indeed most linear systems originating from the discretization of difficult physical problems require preconditioning to have any convergence at all.