PEXSI
Using plans and generating log files

PEXSI is written in C++, and the subroutines cannot directly interface with other programming languages such as C or FORTRAN. To solve this problem, the PEXSI internal data structure is handled using a datatype PPEXSIPlan. The idea and the usage of PPEXSIPlan is similar to fftw_plan in the FFTW package.

In PEXSI, a matrix is generally referred to as a "pole". The factorization and selected inversion procedure for a pole is computed in parallel using numProcRow * numProcCol processors.

When only selected inversion (PSelInv) is used, it is recommended to set the mpisize of the communicator comm to be just numProcRow * numProcCol.

When PEXSI is used to evaluate a large number of inverse matrices such as in the electronic structure calculation, mpisize should be numPole*numProcRow*numProcCol, where numPole inverse matrices can be processed in parallel.

The output information is controlled by the outputFileIndex variable. For instance, if this index is 1, then the corresponding processor will output to the file logPEXSI1. If outputFileIndex is negative, then this processor does NOT output logPEXSI files.

Note

• Each processor must output to a different file if outputFileIndex is non-negative.
• When many processors are used, it is not recommended for all processors to output the log files. This is because the IO takes time and can be the bottleneck on many architecture. A good practice is to let the master processor output information (generating logPEXSI0) or to let the master processor of each pole to output the information.
...
{
PPEXSIPlan plan;
comm,
numProcRow,
numProcCol,
outputFileIndex,
&info );
/* ... Computation using plan ... */
plan,
&info );
}