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 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

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 ( )

◆ ~CellCount()

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

Member Function Documentation

◆ getCostOfLocalTree()

virtual 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.

◆ toString()

virtual 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.

◆ updateGlobalView()

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

Please overwrite in subclass and set the value of _localRankWeight.

Afterwards, call this superclass routine

The superclass routine all-reduces the global weight, the lightest rank and the minimum of the rank weights over all ranks through tarch::mpi::Rank::allReduce(). The reduction is blocking, i.e. all ranks hold the same values once the routine has terminated. The routine hence has to be called by all ranks at the same time, and only by one thread per rank.

Reimplemented from toolbox::loadbalancing::CostMetrics.


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