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:

- Conversion from SuperLUMatrix to PMatrix.
- Preparation of communicators and preprocessing.
- Parallel selected inversion.
- Conversion from PMatrix back to DistSparseMatrix format.

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.

A thin interface for passing parameters to set the PSelInv options.

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 contains the main data structure and computational routines for parallel selected inversion.

Converts a compressed row format SuperLUMatrix into a PMatrix object, using the compressed column format used by PSelInv.

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.

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.

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.

SelInv preforms the actual parallel selected inversion. SelInv_P2p is called by default.

- Note
- SelInv assumes that PreSelInv has been executed.

Converts the PMatrix back to the original DistSparseMatrix format.

#include "ppexsi.hpp"

{

...;

// Construct AMat

DistSparseMatrix<Complex> AMat;

...;

/****** NUMERICAL FACTORIZATION ******/

// Setup SuperLU

SuperLUGrid<Complex> g( comm, nprow, npcol );

SuperLUOptions luOpt;

luOpt.ColPerm = "MMD_AT_PLUS_A";

luOpt.Symmetric = 1;

SuperLUMatrix<Complex> luMat( g );

// Matrix conversion

luMat.DistSparseMatrixToSuperMatrixNRloc( AMat, luOpt );

// Symbolic factorization

luMat.SymbolicFactorize();

// Numerical factorization

luMat.NumericalFactorize();

/****** SELECTED INVERSION ******/

PSelInvOptions selinvOpt;

GridType gPM( comm, nprow, npcol );

SuperNodeType super;

luMat.SymbolicToSuperNode( super );

PMatrix<Complex> * PMloc = PMatrix<Complex>::Create(&gPM, &super, &selinvOpt, &luOpt);

// Conversion to PMatrix

luMat.LUstructToPMatrix( *PMloc );

//Create the communication pattern

PMloc->ConstructCommunicationPattern();

//Prepare for parallel selected inversion

PMloc->PreSelInv();

//Perform the parallel selected inversion

PMloc->SelInv();

//Get the result back in DistSparseMatrix format

DistSparseMatrix<Scalar> Ainv;

PMloc->PMatrixToDistSparseMatrix( Ainv );

...;

delete PMloc;

}

Generated on Wed Mar 16 2016 13:35:04 for PEXSI by 1.8.6