Namespaces | |
| namespace | detail |
Typedefs | |
| using | MPIRank = int |
Functions | |
| std::vector< MPI_Comm > | build_level_comms (MPI_Comm root_comm, const std::vector< int > &factors) |
| Build a nested ladder of sub-communicators for hierarchical agglomeration. | |
| MPIRank | agglomerate_rank (MPIRank parent_rank, int factor) |
| Translate a parent-comm rank into its agglomerated sub-comm rank. | |
| void | free_level_comms (std::vector< MPI_Comm > &level_comms) |
| Free a level-comm ladder. Call once at MG teardown. | |
| MPIRank | rank () |
| MPIRank | rank (MPI_Comm comm) |
| int | num_processes () |
| int | num_processes (MPI_Comm comm) |
| void | barrier () |
| std::string | mpi_error_string (int err) |
| template<typename T > | |
| MPI_Datatype | mpi_datatype () |
| template<> | |
| MPI_Datatype | mpi_datatype< char > () |
| template<> | |
| MPI_Datatype | mpi_datatype< signed char > () |
| template<> | |
| MPI_Datatype | mpi_datatype< unsigned char > () |
| template<> | |
| MPI_Datatype | mpi_datatype< int > () |
| template<> | |
| MPI_Datatype | mpi_datatype< unsigned int > () |
| template<> | |
| MPI_Datatype | mpi_datatype< short > () |
| template<> | |
| MPI_Datatype | mpi_datatype< unsigned short > () |
| template<> | |
| MPI_Datatype | mpi_datatype< long > () |
| template<> | |
| MPI_Datatype | mpi_datatype< unsigned long > () |
| template<> | |
| MPI_Datatype | mpi_datatype< long long > () |
| template<> | |
| MPI_Datatype | mpi_datatype< unsigned long long > () |
| template<> | |
| MPI_Datatype | mpi_datatype< float > () |
| template<> | |
| MPI_Datatype | mpi_datatype< double > () |
| template<> | |
| MPI_Datatype | mpi_datatype< long double > () |
| template<> | |
| MPI_Datatype | mpi_datatype< bool > () |
| using terra::mpi::MPIRank = typedef int |
Translate a parent-comm rank into its agglomerated sub-comm rank.
Inverse of the color/key rule in build_level_comms: if agglomeration groups every factor consecutive parent ranks into a single sub-comm rank, then parent rank r maps to sub-comm rank r / factor.
Useful when remapping a subdomain_to_rank function to the coarser comm.
| parent_rank | Rank on the parent comm. |
| factor | Agglomeration factor at this descent step. |
|
inline |
|
inline |
Build a nested ladder of sub-communicators for hierarchical agglomeration.
Given a parent communicator (typically MPI_COMM_WORLD) and per-level agglomeration factors, constructs a sequence of communicators where each successor is a subset of the preceding one. Used by multigrid to run coarse levels on fewer ranks so collectives cost less at the bottom of the V-cycle.
Factor semantics: at descent step i, ranks whose index on the parent comm is divisible by factors[i] are kept, the rest drop out and get MPI_COMM_NULL at that and every deeper level.
The result has size factors.size() + 1: index 0 is the finest (= root), the rest are progressively smaller. The sizes on surviving ranks are {N, N/factors[0], N/(factors[0]*factors[1]), ...}.
| root_comm | The finest-level communicator. |
| factors | Per-descent agglomeration factors. Must all be >= 1 and evenly divide the preceding level size. |
|
inline |
Free a level-comm ladder. Call once at MG teardown.
MPI_Comm_free is collective on the comm, so every rank that got a non-null handle must call it. Ranks that got MPI_COMM_NULL at a level must skip. The root comm (index 0) is not freed here — caller owns it.
| MPI_Datatype terra::mpi::mpi_datatype | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |