|
| IndexMap (MPI_Comm comm, std::int32_t local_size) |
| Create an non-overlapping index map.
|
|
| IndexMap (MPI_Comm comm, std::int32_t local_size, std::span< const std::int64_t > ghosts, std::span< const int > owners) |
| Create an overlapping (ghosted) index map.
|
|
| IndexMap (MPI_Comm comm, std::int32_t local_size, const std::array< std::vector< int >, 2 > &src_dest, std::span< const std::int64_t > ghosts, std::span< const int > owners) |
| Create an overlapping (ghosted) index map.
|
|
| IndexMap (const IndexMap &map)=delete |
|
| IndexMap (IndexMap &&map)=default |
| Move constructor.
|
|
| ~IndexMap ()=default |
| Destructor.
|
|
IndexMap & | operator= (IndexMap &&map)=default |
| Move assignment.
|
|
IndexMap & | operator= (const IndexMap &map)=delete |
|
std::array< std::int64_t, 2 > | local_range () const noexcept |
| Range of indices (global) owned by this process.
|
|
std::int32_t | num_ghosts () const noexcept |
| Number of ghost indices on this process.
|
|
std::int32_t | size_local () const noexcept |
| Number of indices owned by this process.
|
|
std::int64_t | size_global () const noexcept |
| Number indices across communicator.
|
|
std::span< const std::int64_t > | ghosts () const noexcept |
|
MPI_Comm | comm () const |
| Return the MPI communicator that the map is defined on.
|
|
void | local_to_global (std::span< const std::int32_t > local, std::span< std::int64_t > global) const |
| Compute global indices for array of local indices.
|
|
void | global_to_local (std::span< const std::int64_t > global, std::span< std::int32_t > local) const |
| Compute local indices for array of global indices.
|
|
std::vector< std::int64_t > | global_indices () const |
| Build list of indices with global indexing.
|
|
std::span< const int > | owners () const |
| The ranks that own each ghost index.
|
|
graph::AdjacencyList< int > | index_to_dest_ranks () const |
| Compute map from each local (owned) index to the set of ranks that have the index as a ghost.
|
|
std::vector< std::int32_t > | shared_indices () const |
| Build a list of owned indices that are ghosted by another rank.
|
|
std::span< const int > | src () const noexcept |
| Ordered set of MPI ranks that own caller's ghost indices.
|
|
std::span< const int > | dest () const noexcept |
| Ordered set of MPI ranks that ghost indices owned by caller.
|
|
std::array< double, 2 > | imbalance () const |
| Returns the imbalance of the current IndexMap.
|
|
This class represents the distribution index arrays across processes. An index array is a contiguous collection of N+1
indices [0, 1, . . ., N]
that are distributed across M
processes. On a given process, the IndexMap stores a portion of the index set using local indices [0, 1, . . . , n]
, and a map from the local indices to a unique global index.
std::array< double, 2 > imbalance |
( |
| ) |
const |
Returns the imbalance of the current IndexMap.
The imbalance is a measure of load balancing across all processes, defined as the maximum number of indices on any process divided by the average number of indices per process. This function calculates the imbalance separately for owned indices and ghost indices and returns them as a std::array<double, 2>. If the total number of owned or ghost indices is zero, the respective entry in the array is set to -1.
- Note
- This is a collective operation and must be called by all processes in the communicator associated with the IndexMap.
- Returns
- An array containing the imbalance in owned indices (first element) and the imbalance in ghost indices (second element).