Peano
Loading...
Searching...
No Matches
toolbox::loadbalancing::metrics::CellCount Class Reference

Cost metrics based solely on cell counts. More...

#include <CellCount.h>

Inheritance diagram for toolbox::loadbalancing::metrics::CellCount:
Collaboration diagram for toolbox::loadbalancing::metrics::CellCount:

Public Member Functions

 CellCount ()
 
virtual ~CellCount ()=default
 
virtual std::string toString () const override
 Feel free to invoke the variant below if you want.
 
virtual void updateGlobalView () override
 Please overwrite in subclass and set the value of _localRankWeight.
 
virtual double getCostOfLocalTree (int spacetreeNumber) const override
 Query cost of one tree.
 
- Public Member Functions inherited from toolbox::loadbalancing::CostMetrics
 CostMetrics ()
 
virtual ~CostMetrics ()=default
 
std::string toString (const std::string &metricName) const
 
virtual void waitForGlobalDataExchange ()
 Typically called by.
 
virtual double getCostOfLocalRank () const
 Wrapper around getCostOfLocalTree().
 
virtual double getGlobalCost () const
 
virtual int getLightestRank () const
 
virtual double getMinimumOfMaximumRankWeights () const
 

Additional Inherited Members

- Protected Attributes inherited from toolbox::loadbalancing::CostMetrics
double _localRankWeight
 Weight of local rank.
 
double _globalWeight
 
ReductionBuffer _lightestRank
 
double _minimumOfMaximumOfRankWeights
 
MPI_Request * _globalWeightRequest
 Replicate compared to stats.
 
MPI_Request * _lightestRankRequest
 
MPI_Request * _minimumOfMaximumOfRankWeightsRequest
 
double _globalWeightIn
 
double _globalWeightOut
 
ReductionBuffer _lightestRankIn
 
ReductionBuffer _lightestRankOut
 
double _minimumOfMaximumOfRankWeightsIn
 
double _minimumOfMaximumOfRankWeightsOut
 

Detailed Description

Cost metrics based solely on cell counts.

This is a very simple implementations which basically is based upon the mesh statistics that we have anyway. So the metrics do not require further user input.

Definition at line 23 of file CellCount.h.

Constructor & Destructor Documentation

◆ CellCount()

toolbox::loadbalancing::metrics::CellCount::CellCount ( )

Definition at line 7 of file CellCount.cpp.

◆ ~CellCount()

virtual toolbox::loadbalancing::metrics::CellCount::~CellCount ( )
virtualdefault

Member Function Documentation

◆ getCostOfLocalTree()

double toolbox::loadbalancing::metrics::CellCount::getCostOfLocalTree ( int spacetreeNumber) const
overridevirtual

Query cost of one tree.

This routine is only called by the rank which owns the tree spacetreeNumber. That is, you don't need global knowledge of the tree weight distribution.

The routine is used in multiple places, but the most important one is toolbox::loadbalancing::AbstractLoadBalancing::getIdOfHeaviestLocalSpacetree(), which analyses the whole tree cost distribution on a rank.

Implements toolbox::loadbalancing::CostMetrics.

Definition at line 22 of file CellCount.cpp.

References peano4::parallel::SpacetreeSet::getGridStatistics(), peano4::parallel::SpacetreeSet::getInstance(), and peano4::grid::GridStatistics::getNumberOfLocalUnrefinedCells().

Here is the call graph for this function:

◆ toString()

std::string toolbox::loadbalancing::metrics::CellCount::toString ( ) const
overridevirtual

Feel free to invoke the variant below if you want.

Or add additional info.

Implements toolbox::loadbalancing::CostMetrics.

Definition at line 12 of file CellCount.cpp.

References toolbox::loadbalancing::CostMetrics::toString().

Here is the call graph for this function:

◆ updateGlobalView()

void toolbox::loadbalancing::metrics::CellCount::updateGlobalView ( )
overridevirtual

Please overwrite in subclass and set the value of _localRankWeight.

Afterwards, call this superclass routine

Reimplemented from toolbox::loadbalancing::CostMetrics.

Definition at line 17 of file CellCount.cpp.

References peano4::parallel::SpacetreeSet::getGridStatistics(), peano4::parallel::SpacetreeSet::getInstance(), peano4::grid::GridStatistics::getNumberOfLocalUnrefinedCells(), and toolbox::loadbalancing::CostMetrics::updateGlobalView().

Here is the call graph for this function:

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