Procedure for Selected Inversion
After factorizing a SuperLUMatrix luMat (See the factorization page for information on how to perform factorization), the parallel selected inversion can be computed.
- Note
- To provide a layer of abstraction from the matrix format used during the factorization, the PMatrix class is used during the selected inversion.
-
All major operations of PMatrix, including the selected inversion, are defined directly as member functions of PMatrix.
The basic steps for selected inversion are:
Related structures and subroutines
GridType
A thin interface for the mpi grid strucutre in PSelInv. GridType should be consistent with the grid used by SuperLU.
- Note
- It is the user's responsibility to enforce the coherence between SuperLUGrid and GridType.
PMatrix
PMatrix contains the main data structure and computational routines for parallel selected inversion.
SuperLUMatrix::LUstructToPMatrix;
Converts a compressed row format SuperLUMatrix into a PMatrix object, using the compressed column format used by PSelInv.
- Note
- Although LU factorization is used, the routine assumes that the matrix is strictly symmetric, and therefore the compressed sparse row (CSR) format, used by SuperLU_DIST, gives exactly the same matrix as formed by the compresed sparse column format (CSC).
PMatrix::ConstructCommunicationPattern
This routine creates the MPI_Communicators and communication pattern used later by both PreSelInv and SelInv routines. The supernodal elimination tree is exploited to add an additional level of parallelism between supernodes. ConstructCommunicationPattern_P2p is called by default.
PMatrix::PreSelInv
PreSelInv prepares the structure in L and U so that SelInv only involves matrix-matrix multiplication.
- Note
- PreSelInv assumes that PEXSI::PMatrix::ConstructCommunicationPattern has been executed.
PMatrix::SelInv
SelInv preforms the actual parallel selected inversion. SelInv_P2p is called by default.
- Note
- SelInv assumes that PreSelInv has been executed.
PMatrix::PMatrixToDistSparseMatrix
Converts the PMatrix back to the original DistSparseMatrix format.
Example
{
...;
DistSparseMatrix<Complex> AMat;
...;
SuperLUGrid<Complex> g( comm, nprow, npcol );
SuperLUOptions luOpt;
luOpt.ColPerm = "MMD_AT_PLUS_A";
SuperLUMatrix<Complex> luMat( g );
luMat.DistSparseMatrixToSuperMatrixNRloc( AMat );
luMat.SymbolicFactorize();
luMat.NumericalFactorize();
PMatrix<Complex> PMloc;
luMat.LUstructToPMatrix( PMloc );
PMloc.ConstructCommunicationPattern();
PMloc.PreSelInv();
PMloc.SelInv();
DistSparseMatrix<Scalar> Ainv;
PMloc.PMatrixToDistSparseMatrix( Ainv );
...;
}