|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
Table mapping rank-local row indices to the global index space. More...
#include <IndexMapping.hpp>
Public Member Functions | |
| t_IndexVec & | RLengths () |
Per-rank lengths vector (size == nRanks). | |
| t_IndexVec & | ROffsets () |
Prefix-sum offsets vector (size == nRanks + 1, last element == globalSize). | |
| index | globalSize () const |
| Total number of rows across all ranks. | |
| void | setMPIAlignBcast (const MPIInfo &mpi, index myLength) |
| Broadcast each rank's length, then compute the global prefix sums. | |
| index | operator() (MPI_int rank, index val) const |
| Convert a (rank, local) pair to a global index. | |
| bool | search (index globalQuery, MPI_int &rank, index &val) const |
Convert a global index to (rank, local). Returns false if out of range. | |
| std::tuple< bool, MPI_int, index > | search (index globalQuery) const |
Table mapping rank-local row indices to the global index space.
Every rank owns a contiguous chunk in the global index space:
After setMPIAlignBcast, every rank holds an identical copy of the table (it is globally replicated), so both local-to-global (operator()) and global-to-local (search) queries are purely local. Used by ParArraycreateGlobalMapping and friends.
Definition at line 44 of file IndexMapping.hpp.
|
inline |
Total number of rows across all ranks.
Definition at line 58 of file IndexMapping.hpp.
Convert a (rank, local) pair to a global index.
Equivalent to RankOffsets[rank] + val, with asserts.
Definition at line 95 of file IndexMapping.hpp.
|
inline |
Per-rank lengths vector (size == nRanks).
Definition at line 53 of file IndexMapping.hpp.
|
inline |
Prefix-sum offsets vector (size == nRanks + 1, last element == globalSize).
Definition at line 55 of file IndexMapping.hpp.
|
inline |
Convert a global index to (rank, local). Returns false if out of range.
Uses std::lower_bound on the offsets table (O(log nRanks)).
| globalQuery | Global index. | |
| [out] | rank | Owning rank on success. |
| [out] | val | Local offset within the owner. |
globalQuery lies within [0, globalSize()). Definition at line 114 of file IndexMapping.hpp.
Broadcast each rank's length, then compute the global prefix sums.
Collective call. After it returns, every rank holds the full RLengths / ROffsets tables. Called by ParArray::createGlobalMapping during mesh/array setup.
| mpi | MPI context. |
| myLength | Number of rows owned by the calling rank. |
Definition at line 72 of file IndexMapping.hpp.