This subroutine computes a preconditioner for the global general sparse matrix A that should be passed unchanged to the PDSPGIS subroutine. The preconditioners include diagonal scaling or an incomplete LU factorization.
Fortran | CALL PDSPGPR (iprec, as, ia1, ia2, infoa, prcs, lprcs, desc_a, info) |
C and C++ | pdspgpr (iprec, as, ia1, ia2, infoa, prcs, lprcs, desc_a, info); |
If iprec = 0, which is referred to as none, indicates the local part of the submatrix A is not preconditioned. PDSPGIS may 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
Specified as: a fullword integer, where: iprec = 0, 1, or 2.
Scope: local
Specified as: a one-dimensional array of (at least) length INFOA(1), containing long-precision real numbers.
Scope: local
Specified as: a one-dimensional array of (at least) length INFOA(2), containing fullword integers.
Scope: local
Specified as: a one-dimensional array of (at least) length INFOA(3), containing fullword integers.
Specified as: an array of length 30, containing fullword integers.
Scope: local
Specified as: fullword integer, where:
nnz is the number of non-zero elements (without duplicate coefficients) in the local part of the global general sparse matrix A.
Specified as: an array of length DLEN, containing fullword integers.
Scope: local
Returned as: a one-dimensional array of (at least) length lprcs, containing long-precision real numbers.
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
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 the discretization of difficult physical problems require preconditioning to have any convergence at all.