Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::DistributionMapping Class Reference

Calculates the distribution of FABs to MPI processes. More...

#include <AMReX_DistributionMapping.H>

Classes

struct  Ref
 
struct  RefID
 Lightweight identity handle wrapping a pointer to the underlying Ref. More...
 

Public Types

enum  Strategy {
  UNDEFINED = -1 , ROUNDROBIN , KNAPSACK , SFC ,
  RRSFC
}
 The distribution strategies. More...
 

Public Member Functions

 DistributionMapping () noexcept
 The default constructor.
 
 DistributionMapping (const DistributionMapping &rhs)=default
 The copy constructor.
 
DistributionMappingoperator= (const DistributionMapping &rhs)=default
 The copy assignment operator.
 
 DistributionMapping (DistributionMapping &&rhs) noexcept=default
 The move constructor.
 
DistributionMappingoperator= (DistributionMapping &&rhs) noexcept=default
 The move assignment operator.
 
 ~DistributionMapping () noexcept=default
 The destructor.
 
 DistributionMapping (const Vector< int > &pmap)
 Create an object with an explicit processor map.
 
 DistributionMapping (Vector< int > &&pmap) noexcept
 Create an object with an explicit processor map (rvalue overload).
 
 DistributionMapping (const BoxArray &boxes, int nprocs=ParallelDescriptor::NProcs())
 Build a mapping from a BoxArray using the current strategy.
 
 DistributionMapping (std::shared_ptr< Ref > a_ref)
 Construct from an existing shared Ref handle a_ref (advanced use).
 
 DistributionMapping (const DistributionMapping &d1, const DistributionMapping &d2)
 Construct by concatenating the processor maps from two existing mappings.
 
void define (const BoxArray &boxes, int nprocs=ParallelDescriptor::NProcs())
 Build a mapping from a BoxArray using the current strategy.
 
void define (const Vector< int > &pmap)
 Build mapping out of a Vector of ints.
 
void define (Vector< int > &&pmap) noexcept
 Build mapping out of a Vector of ints (rvalue overload).
 
const Vector< int > & ProcessorMap () const noexcept
 Returns a constant reference to the mapping of boxes in the underlying BoxArray to the CPU that holds the FAB on that Box.
 
Long size () const noexcept
 Length of the underlying processor map.
 
Long capacity () const noexcept
 Reserved capacity of the underlying processor map.
 
bool empty () const noexcept
 Return true if the processor map is empty.
 
Long linkCount () const noexcept
 Number of references to this DistributionMapping.
 
int operator[] (int index) const noexcept
 Equivalent to ProcessorMap()[index].
 
std::istream & readFrom (std::istream &is)
 Read the distribution mapping from formatted text stream is.
 
std::ostream & writeOn (std::ostream &os) const
 Write the distribution mapping to formatted text stream os.
 
bool operator== (const DistributionMapping &rhs) const noexcept
 Are the distributions equal?
 
bool operator!= (const DistributionMapping &rhs) const noexcept
 Are the distributions different?
 
void SFCProcessorMap (const BoxArray &boxes, const std::vector< Long > &wgts, int nprocs, bool sort=true)
 Build an SFC-ordered map for boxes with per-box weights wgts.
 
void SFCProcessorMap (const BoxArray &boxes, const std::vector< Long > &wgts, int nprocs, Real &efficiency, bool sort=true)
 Build an SFC-ordered map and report the resulting efficiency.
 
void KnapSackProcessorMap (const std::vector< Long > &wgts, int nprocs, Real *efficiency=nullptr, bool do_full_knapsack=true, int nmax=std::numeric_limits< int >::max(), bool sort=true)
 Build a knapsack map from a weight vector.
 
void KnapSackProcessorMap (const DistributionMapping &olddm, const std::vector< Long > &wgts, Real keep_ratio, Real &old_efficiency, Real &new_efficiency, int nmax=std::numeric_limits< int >::max())
 Incrementally re-balance using the knapsack algorithm, retaining boxes on their original ranks up to a fraction keep_ratio of the average per-rank weight before redistributing the remainder.
 
void RoundRobinProcessorMap (int nboxes, int nprocs, bool sort=true)
 Build a round-robin map for nboxes boxes.
 
void RoundRobinProcessorMap (const std::vector< Long > &wgts, int nprocs, bool sort=true)
 Build a round-robin map from a weight vector.
 
std::weak_ptr< RefgetWeakRef () const
 Return a weak pointer to the underlying Ref (for low-level identity tracking).
 
RefID getRefID () const noexcept
 This gives a unique ID of the reference, which is different from dmID above.
 

Static Public Member Functions

static void strategy (Strategy how)
 Set the default DistributionMapping strategy used by the constructors.
 
static Strategy strategy ()
 Return the current default DistributionMapping strategy.
 
static void SFC_Threshold (int n)
 Set the SFC threshold n (clamped to >= 1); SFC ordering is used only when boxes.size() >= n*nprocs.
 
static int SFC_Threshold ()
 Return the SFC threshold; the SFC constructors fall back to knapsack when boxes.size() < threshold*nprocs.
 
static void Initialize ()
 Initializes distribution strategy from ParmParse.
 
static void Finalize ()
 Finalize the DistributionMapping subsystem.
 
static bool SameRefs (const DistributionMapping &lhs, const DistributionMapping &rhs)
 Return true if lhs and rhs share the same underlying Ref.
 
static DistributionMapping makeKnapSack (const MultiFab &weight, int nmax=std::numeric_limits< int >::max())
 Build a knapsack mapping weighted by the sum of component 0 over each valid box of weight.
 
static DistributionMapping makeKnapSack (const MultiFab &weight, Real &eff, int nmax=std::numeric_limits< int >::max())
 Build a knapsack mapping weighted by the sum of component 0 over each valid box of weight and report efficiency.
 
static DistributionMapping makeKnapSack (const Vector< Real > &rcost, int nmax=std::numeric_limits< int >::max())
 Build a knapsack mapping from an explicit cost vector.
 
static DistributionMapping makeKnapSack (const Vector< Real > &rcost, Real &eff, int nmax=std::numeric_limits< int >::max(), bool sort=true)
 Build a knapsack mapping from rcost and report efficiency.
 
static DistributionMapping makeKnapSack (const LayoutData< Real > &rcost_local, Real &currentEfficiency, Real &proposedEfficiency, int nmax=std::numeric_limits< int >::max(), bool broadcastToAll=true, int root=ParallelDescriptor::IOProcessorNumber(), Real keep_ratio=Real(0.0))
 Computes a new distribution mapping by distributing input costs according to the knapsack algorithm.
 
static DistributionMapping makeRoundRobin (const MultiFab &weight)
 Build a round-robin map weighted by the sum of component 0 over each valid box of weight.
 
static DistributionMapping makeSFC (const MultiFab &weight, bool sort=true)
 Build an SFC map weighted by the sum of component 0 over each valid box of weight; sort enables load-aware ordering.
 
static DistributionMapping makeSFC (const MultiFab &weight, Real &eff, bool sort=true)
 Build an SFC map weighted by the sum of component 0 over each valid box of weight, write efficiency to eff, and optionally use load-aware ordering.
 
static DistributionMapping makeSFC (const Vector< Real > &rcost, const BoxArray &ba, bool sort=true)
 Build an SFC map from rcost and ba; sort enables load-aware bucket and rank/team ordering.
 
static DistributionMapping makeSFC (const Vector< Real > &rcost, const BoxArray &ba, Real &eff, bool sort=true)
 Build an SFC map from rcost and ba, write efficiency to eff, and optionally use load-aware ordering.
 
static DistributionMapping makeSFC (const LayoutData< Real > &rcost_local, Real &currentEfficiency, Real &proposedEfficiency, bool broadcastToAll=true, int root=ParallelDescriptor::IOProcessorNumber())
 Computes a new distribution mapping by distributing input costs according to a space filling curve (SFC) algorithm.
 
static std::vector< std::vector< int > > makeSFC (const BoxArray &ba, bool use_box_vol=true, int nprocs=ParallelContext::NProcsSub())
 
template<typename T >
static void ComputeDistributionMappingEfficiency (const DistributionMapping &dm, const std::vector< T > &cost, Real *efficiency)
 Computes the average cost per MPI rank given a distribution mapping global cost vector.
 
static Vector< LongConvertCostRealToLong (const Vector< Real > &rcost)
 

Friends

template<typename T >
class FabArray
 
class FabArrayBase
 

Detailed Description

Calculates the distribution of FABs to MPI processes.

This class calculates the distribution of FABs to MPI processes in a FabArray in a multi-processor environment. By distribution is meant what MPI process in the multi-processor environment owns what FAB. Only the BoxArray on which the FabArray is built is used in determining the distribution. The four distribution strategies are round-robin, knapsack, SFC, and RRSFC. In the round-robin distribution, boxes are ordered from largest to smallest and assigned cyclically to ranks or teams, starting with those using the least FAB memory. In the knapsack distribution the FABs are partitioned across CPUs such that the total volume of the Boxes in the underlying BoxArray are as equal across CPUs as is possible. The SFC distribution is based on a space filling curve. The RRSFC distribution orders boxes using an SFC and then assigns them in round-robin order to CPUs ordered from least to most FAB memory use.

Member Enumeration Documentation

◆ Strategy

The distribution strategies.

Enumerator
UNDEFINED 
ROUNDROBIN 
KNAPSACK 
SFC 
RRSFC 

Constructor & Destructor Documentation

◆ DistributionMapping() [1/8]

amrex::DistributionMapping::DistributionMapping ( )
noexcept

The default constructor.

◆ DistributionMapping() [2/8]

amrex::DistributionMapping::DistributionMapping ( const DistributionMapping rhs)
default

The copy constructor.

◆ DistributionMapping() [3/8]

amrex::DistributionMapping::DistributionMapping ( DistributionMapping &&  rhs)
defaultnoexcept

The move constructor.

◆ ~DistributionMapping()

amrex::DistributionMapping::~DistributionMapping ( )
defaultnoexcept

The destructor.

◆ DistributionMapping() [4/8]

amrex::DistributionMapping::DistributionMapping ( const Vector< int > &  pmap)
explicit

Create an object with an explicit processor map.

Parameters
pmapProcessor id for each box in the underlying BoxArray.

◆ DistributionMapping() [5/8]

amrex::DistributionMapping::DistributionMapping ( Vector< int > &&  pmap)
explicitnoexcept

Create an object with an explicit processor map (rvalue overload).

Parameters
pmapProcessor id for each box in the underlying BoxArray.

◆ DistributionMapping() [6/8]

amrex::DistributionMapping::DistributionMapping ( const BoxArray boxes,
int  nprocs = ParallelDescriptor::NProcs() 
)
explicit

Build a mapping from a BoxArray using the current strategy.

Parameters
boxesBoxes to distribute.
nprocsNumber of processes requested for the mapping.

◆ DistributionMapping() [7/8]

amrex::DistributionMapping::DistributionMapping ( std::shared_ptr< Ref a_ref)
explicit

Construct from an existing shared Ref handle a_ref (advanced use).

◆ DistributionMapping() [8/8]

amrex::DistributionMapping::DistributionMapping ( const DistributionMapping d1,
const DistributionMapping d2 
)

Construct by concatenating the processor maps from two existing mappings.

This is a very specialized constructor. The resulting map is only valid for a FabArray whose BoxArray is the corresponding concatenation of those of d1 and d2.

Parameters
d1Mapping whose processor ids are inserted first.
d2Mapping whose processor ids are appended to the result.

Member Function Documentation

◆ capacity()

Long amrex::DistributionMapping::capacity ( ) const
inlinenoexcept

Reserved capacity of the underlying processor map.

◆ ComputeDistributionMappingEfficiency()

template<typename T >
void amrex::DistributionMapping::ComputeDistributionMappingEfficiency ( const DistributionMapping dm,
const std::vector< T > &  cost,
Real efficiency 
)
static

Computes the average cost per MPI rank given a distribution mapping global cost vector.

Parameters
[in]dmdistribution mapping (mapping from FAB to MPI processes)
[in]costvector giving mapping from FAB to the corresponding cost
[in,out]efficiencyaverage cost per MPI process, as computed from the given distribution mapping and cost

◆ ConvertCostRealToLong()

Vector< Long > amrex::DistributionMapping::ConvertCostRealToLong ( const Vector< Real > &  rcost)
static

Convert cost vector from Real to Long. Other than convenience, this also provides a consistent way for the conversion.

◆ define() [1/3]

void amrex::DistributionMapping::define ( const BoxArray boxes,
int  nprocs = ParallelDescriptor::NProcs() 
)

Build a mapping from a BoxArray using the current strategy.

This overload can be used to initialize a default-constructed DistributionMapping.

Parameters
boxesBoxes to distribute.
nprocsNumber of processes requested for the mapping.

◆ define() [2/3]

void amrex::DistributionMapping::define ( const Vector< int > &  pmap)

Build mapping out of a Vector of ints.

This overload can be used to initialize a default-constructed DistributionMapping.

◆ define() [3/3]

void amrex::DistributionMapping::define ( Vector< int > &&  pmap)
noexcept

Build mapping out of a Vector of ints (rvalue overload).

This overload can be used to initialize a default-constructed DistributionMapping.

◆ empty()

bool amrex::DistributionMapping::empty ( ) const
inlinenoexcept

Return true if the processor map is empty.

◆ Finalize()

void amrex::DistributionMapping::Finalize ( )
static

Finalize the DistributionMapping subsystem.

◆ getRefID()

RefID amrex::DistributionMapping::getRefID ( ) const
inlinenoexcept

This gives a unique ID of the reference, which is different from dmID above.

◆ getWeakRef()

std::weak_ptr< DMRef > amrex::DistributionMapping::getWeakRef ( ) const

Return a weak pointer to the underlying Ref (for low-level identity tracking).

◆ Initialize()

void amrex::DistributionMapping::Initialize ( )
static

Initializes distribution strategy from ParmParse.

ParmParse options are:

DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK DistributionMapping.strategy = SFC # the default DistributionMapping.strategy = RRSFC

◆ KnapSackProcessorMap() [1/2]

void amrex::DistributionMapping::KnapSackProcessorMap ( const DistributionMapping olddm,
const std::vector< Long > &  wgts,
Real  keep_ratio,
Real old_efficiency,
Real new_efficiency,
int  nmax = std::numeric_limits<int>::max() 
)

Incrementally re-balance using the knapsack algorithm, retaining boxes on their original ranks up to a fraction keep_ratio of the average per-rank weight before redistributing the remainder.

Parameters
olddmOriginal mapping.
wgtsPer-box weights.
keep_ratioFraction of the average per-rank weight to retain on each original rank.
old_efficiencyOutput efficiency of the old mapping.
new_efficiencyOutput efficiency of the new mapping.
nmaxMaximum boxes per rank.

◆ KnapSackProcessorMap() [2/2]

void amrex::DistributionMapping::KnapSackProcessorMap ( const std::vector< Long > &  wgts,
int  nprocs,
Real efficiency = nullptr,
bool  do_full_knapsack = true,
int  nmax = std::numeric_limits<int>::max(),
bool  sort = true 
)

Build a knapsack map from a weight vector.

Parameters
wgtsPer-box weights (e.g., cell counts).
nprocsNumber of processes requested for the mapping.
efficiencyOptional load-balance efficiency output (nullptr to skip).
do_full_knapsackWhen false, use the cheaper approximate solver.
nmaxMaximum boxes owned by a single rank.
sortWhen true, sort the knapsack buckets by weight and map them onto the least-used ranks or teams.

◆ linkCount()

Long amrex::DistributionMapping::linkCount ( ) const
inlinenoexcept

Number of references to this DistributionMapping.

◆ makeKnapSack() [1/5]

DistributionMapping amrex::DistributionMapping::makeKnapSack ( const LayoutData< Real > &  rcost_local,
Real currentEfficiency,
Real proposedEfficiency,
int  nmax = std::numeric_limits<int>::max(),
bool  broadcastToAll = true,
int  root = ParallelDescriptor::IOProcessorNumber(),
Real  keep_ratio = Real(0.0) 
)
static

Computes a new distribution mapping by distributing input costs according to the knapsack algorithm.

Parameters
[in]rcost_localLayoutData of costs; contains, e.g., costs for the local boxes in the FAB array, corresponding indices in the global indices in the FAB array, and the distribution mapping
[in,out]currentEfficiencyOn the root process, this is the efficiency (i.e., mean cost over all MPI ranks, normalized to the max cost) given the current distribution mapping
[in,out]proposedEfficiencyOn the root process, this is the efficiency for the proposed distribution mapping
[in]nmaxthe maximum number of boxes that can be assigned to any MPI rank by the knapsack algorithm
[in]broadcastToAllcontrols whether to transmit the proposed distribution mapping to all other processes; setting this to false allows to, e.g., test whether the proposed distribution mapping is an improvement relative to the current distribution mapping, before deciding to broadcast the proposed distribution mapping
[in]rootwhich process to collect the local costs from others and compute the proposed distribution mapping
[in]keep_ratiocontrols the fraction of load that should be kept on the original process.
Returns
the proposed load-balanced distribution mapping

◆ makeKnapSack() [2/5]

DistributionMapping amrex::DistributionMapping::makeKnapSack ( const MultiFab weight,
int  nmax = std::numeric_limits<int>::max() 
)
static

Build a knapsack mapping weighted by the sum of component 0 over each valid box of weight.

Parameters
weightMultiFab supplying per-box costs through the sum of component 0 over each valid box.
nmaxMaximum boxes per rank.

◆ makeKnapSack() [3/5]

DistributionMapping amrex::DistributionMapping::makeKnapSack ( const MultiFab weight,
Real eff,
int  nmax = std::numeric_limits<int>::max() 
)
static

Build a knapsack mapping weighted by the sum of component 0 over each valid box of weight and report efficiency.

Parameters
weightMultiFab supplying per-box costs through the sum of component 0 over each valid box.
effOutput load-balance efficiency.
nmaxMaximum boxes per rank.

◆ makeKnapSack() [4/5]

DistributionMapping amrex::DistributionMapping::makeKnapSack ( const Vector< Real > &  rcost,
int  nmax = std::numeric_limits<int>::max() 
)
static

Build a knapsack mapping from an explicit cost vector.

Parameters
rcostPer-box costs.
nmaxMaximum boxes per rank.

◆ makeKnapSack() [5/5]

DistributionMapping amrex::DistributionMapping::makeKnapSack ( const Vector< Real > &  rcost,
Real eff,
int  nmax = std::numeric_limits<int>::max(),
bool  sort = true 
)
static

Build a knapsack mapping from rcost and report efficiency.

Parameters
rcostPer-box costs.
effOutput load-balance efficiency.
nmaxMaximum boxes per rank.
sortWhen true, sort the knapsack buckets by weight and map them onto the least-used ranks or teams.

◆ makeRoundRobin()

DistributionMapping amrex::DistributionMapping::makeRoundRobin ( const MultiFab weight)
static

Build a round-robin map weighted by the sum of component 0 over each valid box of weight.

◆ makeSFC() [1/6]

std::vector< std::vector< int > > amrex::DistributionMapping::makeSFC ( const BoxArray ba,
bool  use_box_vol = true,
int  nprocs = ParallelContext::NProcsSub() 
)
static

if use_box_vol is true, weight boxes by their volume in Distribute otherwise, all boxes will be treated with equal weight

◆ makeSFC() [2/6]

DistributionMapping amrex::DistributionMapping::makeSFC ( const LayoutData< Real > &  rcost_local,
Real currentEfficiency,
Real proposedEfficiency,
bool  broadcastToAll = true,
int  root = ParallelDescriptor::IOProcessorNumber() 
)
static

Computes a new distribution mapping by distributing input costs according to a space filling curve (SFC) algorithm.

Parameters
[in]rcost_localLayoutData of costs; contains, e.g., costs for the local boxes in the FAB array, corresponding indices in the global indices in the FAB array, and the distribution mapping
[in,out]currentEfficiencyOn the root process, this is the efficiency (i.e., mean cost over all MPI ranks, normalized to the max cost) given the current distribution mapping
[in,out]proposedEfficiencyOn the root process, this is the efficiency for the proposed distribution mapping
[in]broadcastToAllcontrols whether to transmit the proposed distribution mapping to all other processes; setting this to false allows to, e.g., test whether the proposed distribution mapping is an improvement relative to the current distribution mapping, before deciding to broadcast the proposed distribution mapping
[in]rootwhich process to collect the local costs from others and compute the proposed distribution mapping
Returns
the proposed load-balanced distribution mapping

◆ makeSFC() [3/6]

DistributionMapping amrex::DistributionMapping::makeSFC ( const MultiFab weight,
bool  sort = true 
)
static

Build an SFC map weighted by the sum of component 0 over each valid box of weight; sort enables load-aware ordering.

◆ makeSFC() [4/6]

DistributionMapping amrex::DistributionMapping::makeSFC ( const MultiFab weight,
Real eff,
bool  sort = true 
)
static

Build an SFC map weighted by the sum of component 0 over each valid box of weight, write efficiency to eff, and optionally use load-aware ordering.

◆ makeSFC() [5/6]

DistributionMapping amrex::DistributionMapping::makeSFC ( const Vector< Real > &  rcost,
const BoxArray ba,
bool  sort = true 
)
static

Build an SFC map from rcost and ba; sort enables load-aware bucket and rank/team ordering.

◆ makeSFC() [6/6]

DistributionMapping amrex::DistributionMapping::makeSFC ( const Vector< Real > &  rcost,
const BoxArray ba,
Real eff,
bool  sort = true 
)
static

Build an SFC map from rcost and ba, write efficiency to eff, and optionally use load-aware ordering.

◆ operator!=()

bool amrex::DistributionMapping::operator!= ( const DistributionMapping rhs) const
noexcept

Are the distributions different?

◆ operator=() [1/2]

DistributionMapping & amrex::DistributionMapping::operator= ( const DistributionMapping rhs)
default

The copy assignment operator.

◆ operator=() [2/2]

DistributionMapping & amrex::DistributionMapping::operator= ( DistributionMapping &&  rhs)
defaultnoexcept

The move assignment operator.

◆ operator==()

bool amrex::DistributionMapping::operator== ( const DistributionMapping rhs) const
noexcept

Are the distributions equal?

◆ operator[]()

int amrex::DistributionMapping::operator[] ( int  index) const
inlinenoexcept

Equivalent to ProcessorMap()[index].

◆ ProcessorMap()

const Vector< int > & amrex::DistributionMapping::ProcessorMap ( ) const
noexcept

Returns a constant reference to the mapping of boxes in the underlying BoxArray to the CPU that holds the FAB on that Box.

ProcessorMap()[i] is an integer in the interval [0, NCPU) where NCPU is the number of CPUs being used.

◆ readFrom()

std::istream & amrex::DistributionMapping::readFrom ( std::istream &  is)

Read the distribution mapping from formatted text stream is.

◆ RoundRobinProcessorMap() [1/2]

void amrex::DistributionMapping::RoundRobinProcessorMap ( const std::vector< Long > &  wgts,
int  nprocs,
bool  sort = true 
)

Build a round-robin map from a weight vector.

Parameters
wgtsPer-box weights; the vector length defines nboxes.
nprocsNumber of processes requested for the mapping.
sortWhen true, assign boxes to ranks or teams ordered by increasing existing memory use. Boxes are always ordered by decreasing weight.

◆ RoundRobinProcessorMap() [2/2]

void amrex::DistributionMapping::RoundRobinProcessorMap ( int  nboxes,
int  nprocs,
bool  sort = true 
)

Build a round-robin map for nboxes boxes.

Parameters
nboxesNumber of boxes.
nprocsNumber of processes requested for the mapping.
sortWhen true, assign boxes to ranks or teams ordered by increasing existing memory use. Box indices remain in input order.

◆ SameRefs()

static bool amrex::DistributionMapping::SameRefs ( const DistributionMapping lhs,
const DistributionMapping rhs 
)
inlinestatic

Return true if lhs and rhs share the same underlying Ref.

◆ SFC_Threshold() [1/2]

int amrex::DistributionMapping::SFC_Threshold ( )
static

Return the SFC threshold; the SFC constructors fall back to knapsack when boxes.size() < threshold*nprocs.

◆ SFC_Threshold() [2/2]

void amrex::DistributionMapping::SFC_Threshold ( int  n)
static

Set the SFC threshold n (clamped to >= 1); SFC ordering is used only when boxes.size() >= n*nprocs.

◆ SFCProcessorMap() [1/2]

void amrex::DistributionMapping::SFCProcessorMap ( const BoxArray boxes,
const std::vector< Long > &  wgts,
int  nprocs,
bool  sort = true 
)

Build an SFC-ordered map for boxes with per-box weights wgts.

Parameters
boxesBoxes to distribute.
wgtsPer-box weights (e.g., cell counts).
nprocsNumber of processes requested for the mapping.
sortWhen true, assign heavier SFC buckets to less-used ranks or teams. Boxes are ordered along the SFC regardless of this flag.

◆ SFCProcessorMap() [2/2]

void amrex::DistributionMapping::SFCProcessorMap ( const BoxArray boxes,
const std::vector< Long > &  wgts,
int  nprocs,
Real efficiency,
bool  sort = true 
)

Build an SFC-ordered map and report the resulting efficiency.

Parameters
boxesBoxes to distribute.
wgtsPer-box weights (e.g., cell counts).
nprocsNumber of processes requested for the mapping.
efficiencyOutput load-balance efficiency in [0,1].
sortWhen true, assign heavier SFC buckets to less-used ranks or teams. Boxes are ordered along the SFC regardless of this flag.

◆ size()

Long amrex::DistributionMapping::size ( ) const
inlinenoexcept

Length of the underlying processor map.

◆ strategy() [1/2]

DistributionMapping::Strategy amrex::DistributionMapping::strategy ( )
static

Return the current default DistributionMapping strategy.

◆ strategy() [2/2]

void amrex::DistributionMapping::strategy ( DistributionMapping::Strategy  how)
static

Set the default DistributionMapping strategy used by the constructors.

◆ writeOn()

std::ostream & amrex::DistributionMapping::writeOn ( std::ostream &  os) const

Write the distribution mapping to formatted text stream os.

Friends And Related Symbol Documentation

◆ FabArray

template<typename T >
friend class FabArray
friend

◆ FabArrayBase

friend class FabArrayBase
friend

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