Some of the options for ILU preconditioner are
ierr = PCILUSetLevels(PC pc,int levels); ierr = PCILUSetReuseOrdering(PC pc,PetscTruth flag); ierr = PCILUSetUseDropTolerance(PC pc,double dt,int dtcount); ierr = PCILUSetReuseFill(PC pc,PetscTruth flag); ierr = PCILUSetUseInPlace(PC pc); ierr = PCILUSetAllowDiagonalFill(PC pc);
When repeatedly solving linear systems with the same SLES
context, one can reuse some information computed
during the first linear solve.
In particular, PCILUSetReuseOrdering() causes the ordering (for example, set with
-mat_order order) computed in the first factorization to be reused
for later factorizations.
The PCILUSetReuseFill() causes the
fill computed during the first drop tolerance factorization to be reused
in later factorizations. PCILUSetUseInPlace() is often used with
PCASM or PCBJACOBI when zero fill is used, since it reuses the
matrix space to store the incomplete factorization it saves memory and
copying time. Note that in-place factorization is not appropriate with
any ordering besides natural and cannot be used with the drop tolerance
factorization. These options may be set in the database with
-pc_ilu_levels <levels> -pc_ilu_reuse_ordering -pc_ilu_use_drop_tolerance <dt>,<dtcount> -pc_ilu_reuse_fill -pc_ilu_in_place -pc_ilu_nonzeros_along_diagonal -pc_ilu_diagonal_fill
See Section Sparse Matrix Factorization for information on preallocation of memory for anticipated fill during factorization. By alleviating the considerable overhead for dynamic memory allocation, such tuning can significantly enhance performance.
PETSc supports incomplete factorization preconditioners for several matrix types for the uniprocessor case. In addition, for the parallel case we provide an interface to the ILU and ICC preconditioners of BlockSolve95 [13]. PETSc enables users to employ the preconditioners within BlockSolve95 by using the BlockSolve95 matrix format MATMPIROWBS and invoking either the PCILU or PCICC method within the linear solvers. Since PETSc automatically handles matrix assembly, preconditioner setup, profiling, etc., users who employ BlockSolve95 through the PETSc interface need not concern themselves with many details provided within the BlockSolve95 users manual. Consult the file docs/installation.html for details on installing PETSc to allow the use of BlockSolve95.
One can create a matrix that is compatible with BlockSolve95 by using
MatCreate() with the option -mat_mpirowbs, or by directly
calling
ierr = MatCreateMPIRowbs(MPI_Comm comm,int m,int M,int nz,int *nnz,void *proci,Mat *A)A is the newly created matrix, while the arguments m and M indicate the number of local and global rows, respectively. Either the local or global parameter can be replaced with PETSC_DECIDE, so that PETSc will determine it. The matrix is stored with a fixed number of rows on each processor, given by m, or determined by PETSc if m is PETSC_DECIDE. The arguments nz and nnz can be used to preallocate storage space, as discussed in Section Creating and Assembling Matrices for increasing the efficiency of matrix assembly; one sets nz=0 and nnz=PETSC_NULL for PETSc to control all matrix memory allocation. The argument proci is an optional BlockSolve95 BSprocinfo context; most users should set this parameter to PETSC_NULL, so that PETSc will create and initialize this context.
If the matrix is symmetric, one may call
ierr = MatSetOption(Mat mat,MAT_SYMMETRIC);to improve efficiency, but in this case one cannot use the ILU preconditioner, only ICC.
Internally, PETSc inserts zero elements into matrices of the MATMPIROWBS format if necessary, so that nonsymmetric matrices are considered to be symmetric in terms of their sparsity structure; this format is required for use of the parallel communication routines within BlockSolve95. In particular, if the matrix element A[i,j] exists, then PETSc will internally allocate a 0 value for the element A[j,i] during MatAssemblyEnd() if the user has not already set a value for the matrix element A[j,i] .
When manipulating a preconditioning matrix, A, BlockSolve95
internally works with a scaled and permuted matrix,
where D is the diagonal of A, and P is a
permutation matrix determined by a graph coloring for efficient
parallel computation. Thus, when solving a linear system, Ax=b,
using ILU/ICC preconditioning and the matrix format MATMPIROWBS
for both the linear system matrix and the preconditioning
matrix, one actually solves the scaled and permuted system
, where
and
. PETSc handles the internal scaling and permutation of
x and b , so the user does not deal with these conversions,
but instead always works with the original linear system. In
this case, by default the scaled residual norm is monitored; one must use the
option -ksp_truemonitor to print both the
scaled and unscaled residual norms. Note: If one is using ILU/ICC via
BlockSolve95 and the MATMPIROWBS matrix format for the
preconditioner matrix, but using a different format for a different
linear system matrix, then this scaling and permuting is done only
internally during the application of the preconditioner.