DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
|
A class template to store the communication pattern (i.e., which entries/nodes to receive from which processor and which entries/nodes to send to which processor). More...
#include <MPIPatternP2P.h>
Public Types | |
using | SizeTypeVector = utils::MemoryStorage<size_type, memorySpace> |
using | GlobalSizeTypeVector |
Public Member Functions | |
virtual | ~MPIPatternP2P ()=default |
MPIPatternP2P (const std::pair< global_size_type, global_size_type > &locallyOwnedRange, const std::vector< dftfe::global_size_type > &ghostIndices, const MPI_Comm &mpiComm) | |
Constructor. This constructor is the typical way of creation of an MPI pattern. | |
MPIPatternP2P (const size_type size) | |
Constructor. This constructor is to create an MPI Pattern for a serial case. This is provided so that one can seamlessly use has to be used even for a serial case. In this case, all the indices are owned by the current processor. | |
std::pair< global_size_type, global_size_type > | getLocallyOwnedRange () const |
size_type | localOwnedSize () const |
size_type | localGhostSize () const |
bool | inLocallyOwnedRange (const global_size_type globalId) const |
bool | isGhostEntry (const global_size_type globalId) const |
size_type | globalToLocal (const global_size_type globalId) const |
global_size_type | localToGlobal (const size_type localId) const |
const std::vector< global_size_type > & | getGhostIndices () const |
const std::vector< size_type > & | getGhostProcIds () const |
const std::vector< size_type > & | getNumGhostIndicesInProcs () const |
size_type | getNumGhostIndicesInProc (const size_type procId) const |
SizeTypeVector | getGhostLocalIndices (const size_type procId) const |
const std::vector< size_type > & | getGhostLocalIndicesRanges () const |
const std::vector< size_type > & | getTargetProcIds () const |
const std::vector< size_type > & | getNumOwnedIndicesForTargetProcs () const |
size_type | getNumOwnedIndicesForTargetProc (const size_type procId) const |
const SizeTypeVector & | getOwnedLocalIndicesForTargetProcs () const |
SizeTypeVector | getOwnedLocalIndices (const size_type procId) const |
size_type | nmpiProcesses () const |
size_type | thisProcessId () const |
global_size_type | nGlobalIndices () const |
const MPI_Comm & | mpiCommunicator () const |
bool | isCompatible (const MPIPatternP2P< memorySpace > &rhs) const |
Private Attributes | |
std::pair< global_size_type, global_size_type > | d_locallyOwnedRange |
std::vector< global_size_type > | d_allOwnedRanges |
size_type | d_numLocallyOwnedIndices |
size_type | d_numGhostIndices |
std::vector< global_size_type > | d_ghostIndices |
std::set< global_size_type > | d_ghostIndicesSetSTL |
OptimizedIndexSet< global_size_type > | d_ghostIndicesOptimizedIndexSet |
size_type | d_numGhostProcs |
std::vector< size_type > | d_ghostProcIds |
std::vector< size_type > | d_numGhostIndicesInGhostProcs |
SizeTypeVector | d_flattenedLocalGhostIndices |
std::vector< size_type > | d_localGhostIndicesRanges |
A vector of size 2 times the number of ghost processors to store the range of local ghost indices that are owned by the ghost processors. In other words, it stores the list ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
size_type | d_numTargetProcs |
std::vector< size_type > | d_targetProcIds |
std::vector< size_type > | d_numOwnedIndicesForTargetProcs |
SizeTypeVector | d_flattenedLocalTargetIndices |
int | d_nprocs |
Number of processors in the MPI Communicator. | |
int | d_myRank |
Rank of the current processor. | |
global_size_type | d_nGlobalIndices |
MPI_Comm | d_mpiComm |
MPI Communicator object. | |
A class template to store the communication pattern (i.e., which entries/nodes to receive from which processor and which entries/nodes to send to which processor).
memorySpace | Defines the MemorySpace (i.e., HOST or DEVICE) in which the various data members of this object must reside. |
using dftfe::utils::mpi::MPIPatternP2P< memorySpace >::GlobalSizeTypeVector |
using dftfe::utils::mpi::MPIPatternP2P< memorySpace >::SizeTypeVector = utils::MemoryStorage<size_type, memorySpace> |
typedefs
|
virtualdefault |
dftfe::utils::mpi::MPIPatternP2P< memorySpace >::MPIPatternP2P | ( | const std::pair< global_size_type, global_size_type > & | locallyOwnedRange, |
const std::vector< dftfe::global_size_type > & | ghostIndices, | ||
const MPI_Comm & | mpiComm ) |
Constructor. This constructor is the typical way of creation of an MPI pattern.
[in] | locallyOwnedRange | A pair of non-negtive integers ![]() |
[in] | ghostIndices | An ordered set of non-negtive indices specifyin the ghost indices for the current processor. |
[in] | mpiComm | The MPI communicator object which defines the set of processors for which the MPI pattern needs to be created. |
Throws | exception if mpiComm is in an invalid state, if the locallyOwnedRange across all the processors are not disjoint, if ghostIndices are not ordered (if it is not strictly increasing), or if some sanity checks with respect to MPI sends and receives fail. |
Constructor with MPI
dftfe::utils::mpi::MPIPatternP2P< memorySpace >::MPIPatternP2P | ( | const size_type | size | ) |
Constructor. This constructor is to create an MPI Pattern for a serial case. This is provided so that one can seamlessly use has to be used even for a serial case. In this case, all the indices are owned by the current processor.
[in] | size | Total number of indices. |
Constructor for a serial case
const std::vector< global_size_type > & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getGhostIndices | ( | ) | const |
MPIPatternP2P< memorySpace >::SizeTypeVector dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getGhostLocalIndices | ( | const size_type | procId | ) | const |
const std::vector< size_type > & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getGhostLocalIndicesRanges | ( | ) | const |
const std::vector< size_type > & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getGhostProcIds | ( | ) | const |
std::pair< global_size_type, global_size_type > dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getLocallyOwnedRange | ( | ) | const |
size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getNumGhostIndicesInProc | ( | const size_type | procId | ) | const |
const std::vector< size_type > & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getNumGhostIndicesInProcs | ( | ) | const |
size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getNumOwnedIndicesForTargetProc | ( | const size_type | procId | ) | const |
const std::vector< size_type > & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getNumOwnedIndicesForTargetProcs | ( | ) | const |
MPIPatternP2P< memorySpace >::SizeTypeVector dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getOwnedLocalIndices | ( | const size_type | procId | ) | const |
const MPIPatternP2P< memorySpace >::SizeTypeVector & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getOwnedLocalIndicesForTargetProcs | ( | ) | const |
const std::vector< size_type > & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::getTargetProcIds | ( | ) | const |
size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::globalToLocal | ( | const global_size_type | globalId | ) | const |
bool dftfe::utils::mpi::MPIPatternP2P< memorySpace >::inLocallyOwnedRange | ( | const global_size_type | globalId | ) | const |
bool dftfe::utils::mpi::MPIPatternP2P< memorySpace >::isCompatible | ( | const MPIPatternP2P< memorySpace > & | rhs | ) | const |
bool dftfe::utils::mpi::MPIPatternP2P< memorySpace >::isGhostEntry | ( | const global_size_type | globalId | ) | const |
size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::localGhostSize | ( | ) | const |
size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::localOwnedSize | ( | ) | const |
global_size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::localToGlobal | ( | const size_type | localId | ) | const |
const MPI_Comm & dftfe::utils::mpi::MPIPatternP2P< memorySpace >::mpiCommunicator | ( | ) | const |
global_size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::nGlobalIndices | ( | ) | const |
size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::nmpiProcesses | ( | ) | const |
size_type dftfe::utils::mpi::MPIPatternP2P< memorySpace >::thisProcessId | ( | ) | const |
|
private |
A vector of size 2 times number of processors to store the locallyOwnedRange of each processor. That is it store the list
|
private |
A flattened vector of size number of ghosts containing the ghost indices ordered as per the list of ghost processor Ids in d_ghostProcIds In other words it stores a concatentaion of the lists
|
private |
Vector of size
|
private |
Vector to store an ordered set of ghost indices (ordered in increasing order and non-repeating)
|
private |
An OptimizedIndexSet object to store the ghost indices for efficient operations. The OptimizedIndexSet internally creates contiguous sub-ranges within the set of indices and hence can optimize the finding of an index
|
private |
A copy of the above d_ghostIndices stored as an STL set
|
private |
Vector to store the ghost processor Ids. A ghost processor is one which owns at least one of the ghost indices of this processor.
|
private |
A vector of size 2 times the number of ghost processors to store the range of local ghost indices that are owned by the ghost processors. In other words, it stores the list
|
private |
A pair
|
private |
MPI Communicator object.
|
private |
Rank of the current processor.
|
private |
Total number of unique indices across all processors
|
private |
Number of processors in the MPI Communicator.
|
private |
Number of ghost indices in the current processor
|
private |
Vector of size number of ghost processors to store how many ghost indices of this current processor are owned by a ghost processor.
|
private |
Number of ghost processors for the current processor. A ghost processor is one which owns at least one of the ghost indices of this processor.
|
private |
Number of locally owned indices in the current processor
|
private |
Vector of size number of target processors to store how many locally owned indices of this current processor are need ghost in each of the target processors.
|
private |
Number of target processors for the current processor. A target processor is one which owns at least one of the locally owned indices of this processor as its ghost index.
|
private |
Vector to store the target processor Ids. A target processor is one which contains at least one of the locally owned indices of this processor as its ghost index.