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.
PSelInvOptions
A thin interface for passing parameters to set the PSelInv options.
SuperNodeType
A data structure containing the supernodal partitioning of the matrix.
- Note
- It is the user's responsibility to initialize this data structure after SuperLUMatrix::SymbolicFactorize has been called. This is done using the [SuperLUMatrix::SymbolicToSuperNode](PEXSI::SuperLUMatrix::SymbolicToSuperNode] utility routine.
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.
PMatrix::Create
This static factory routine instantiates the correct PMatrix object type depending on matrix structure. The matrix structure is specified by the SuperLUOptions::Symmetric attribute of the SuperLUOptions data structure.
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";
luOpt.Symmetric = 1;
SuperLUMatrix<Complex> luMat( g );
luMat.DistSparseMatrixToSuperMatrixNRloc( AMat, luOpt );
luMat.SymbolicFactorize();
luMat.NumericalFactorize();
PSelInvOptions selinvOpt;
GridType gPM( comm, nprow, npcol );
SuperNodeType super;
luMat.SymbolicToSuperNode( super );
luMat.LUstructToPMatrix( *PMloc );
PMloc->ConstructCommunicationPattern();
PMloc->PreSelInv();
PMloc->SelInv();
DistSparseMatrix<Scalar> Ainv;
PMloc->PMatrixToDistSparseMatrix( Ainv );
...;
delete PMloc;
}