DistributionMapping Class ReferenceΒΆ

adc_cpp: pops::DistributionMapping Class Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
pops::DistributionMapping Class Reference

Owning MPI rank of each box, indexed by GLOBAL box index (parallel to a BoxArray). More...

#include <distribution_mapping.hpp>

+ Collaboration diagram for pops::DistributionMapping:

Public Member Functions

 DistributionMapping ()=default
 
 DistributionMapping (int nboxes, int nranks)
 Round-robin: box i -> rank i % nranks (rank 0 if nranks <= 0). Default distribution.
 
 DistributionMapping (std::vector< int > rank)
 EXPLICIT assignment: rank[i] = owning rank of box i (move).
 
int operator[] (int i) const
 Owning rank of the box with global index i.
 
int size () const
 Number of boxes covered (= size of the associated BoxArray).
 
const std::vector< int > & ranks () const
 View on the rank vector (element-by-element equality = same assignment).
 

Detailed Description

Owning MPI rank of each box, indexed by GLOBAL box index (parallel to a BoxArray).

Metadata replicated on every rank.

Constructor & Destructor Documentation

◆ DistributionMapping() [1/3]

pops::DistributionMapping::DistributionMapping ( )
default

◆ DistributionMapping() [2/3]

pops::DistributionMapping::DistributionMapping ( int  nboxes,
int  nranks 
)
inline

Round-robin: box i -> rank i % nranks (rank 0 if nranks <= 0). Default distribution.

◆ DistributionMapping() [3/3]

pops::DistributionMapping::DistributionMapping ( std::vector< int >  rank)
inlineexplicit

EXPLICIT assignment: rank[i] = owning rank of box i (move).

For external balanced strategies (load_balance.hpp).

Member Function Documentation

◆ operator[]()

int pops::DistributionMapping::operator[] ( int  i) const
inline

Owning rank of the box with global index i.

◆ ranks()

const std::vector< int > & pops::DistributionMapping::ranks ( ) const
inline

View on the rank vector (element-by-element equality = same assignment).

+ Here is the caller graph for this function:

◆ size()

int pops::DistributionMapping::size ( ) const
inline

Number of boxes covered (= size of the associated BoxArray).


The documentation for this class was generated from the following file: