![]() |
Peano
|
Abstract cost metric. More...
#include <CostMetrics.h>
Data Structures | |
struct | ReductionBuffer |
It is totally annoying, but it seems that MPI's maxloc and reduction are broken in some MPI implementations. More... | |
Public Member Functions | |
CostMetrics () | |
virtual | ~CostMetrics ()=default |
virtual std::string | toString () const =0 |
Feel free to invoke the variant below if you want. | |
std::string | toString (const std::string &metricName) const |
virtual void | waitForGlobalDataExchange () |
Typically called by. | |
virtual void | updateGlobalView () |
Please overwrite in subclass and set the value of _localRankWeight. | |
virtual double | getCostOfLocalTree (int spacetreeNumber) const =0 |
Query cost of one tree. | |
virtual double | getCostOfLocalRank () const |
Wrapper around getCostOfLocalTree(). | |
virtual double | getGlobalCost () const |
virtual int | getLightestRank () const |
virtual double | getMinimumOfMaximumRankWeights () const |
Protected Attributes | |
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 |
Static Private Attributes | |
static tarch::logging::Log | _log |
Abstract cost metric.
Base class for any cost metric that you want to use in combination with the generic load balancing strategies. To realise your own cost metric, you have to complete two steps:
Definition at line 32 of file CostMetrics.h.
toolbox::loadbalancing::CostMetrics::CostMetrics | ( | ) |
Definition at line 9 of file CostMetrics.cpp.
References _globalWeightRequest, _lightestRankRequest, and _minimumOfMaximumOfRankWeightsRequest.
|
virtualdefault |
|
virtual |
Wrapper around getCostOfLocalTree().
Loops over all local trees and returns the sum.
Definition at line 39 of file CostMetrics.cpp.
References peano4::parallel::SpacetreeSet::getInstance(), and peano4::parallel::SpacetreeSet::getLocalSpacetrees().
|
pure virtual |
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.
Implemented in toolbox::loadbalancing::metrics::CellCount, and toolbox::loadbalancing::metrics::CustomCellWeight.
|
virtual |
Definition at line 133 of file CostMetrics.cpp.
|
virtual |
Definition at line 138 of file CostMetrics.cpp.
References assertion1, tarch::mpi::Rank::getInstance(), tarch::mpi::Rank::getNumberOfRanks(), and toString().
|
virtual |
Definition at line 145 of file CostMetrics.cpp.
|
pure virtual |
Feel free to invoke the variant below if you want.
Or add additional info.
Implemented in toolbox::loadbalancing::metrics::CellCount, and toolbox::loadbalancing::metrics::CustomCellWeight.
Referenced by toolbox::loadbalancing::metrics::CellCount::toString(), and toolbox::loadbalancing::metrics::CustomCellWeight::toString().
std::string toolbox::loadbalancing::CostMetrics::toString | ( | const std::string & | metricName | ) | const |
Definition at line 25 of file CostMetrics.cpp.
|
virtual |
Please overwrite in subclass and set the value of _localRankWeight.
Afterwards, call this superclass routine
Reimplemented in toolbox::loadbalancing::metrics::CellCount, and toolbox::loadbalancing::metrics::CustomCellWeight.
Definition at line 68 of file CostMetrics.cpp.
References tarch::mpi::Rank::getInstance(), tarch::mpi::Rank::getRank(), and logInfo.
Referenced by toolbox::loadbalancing::metrics::CellCount::updateGlobalView(), and toolbox::loadbalancing::metrics::CustomCellWeight::updateGlobalView().
|
virtual |
Typically called by.
Should wrap up any pending MPI stuff. If you add your own collectives in a subclass, overwrite it, but still invoke the superclass.
Definition at line 49 of file CostMetrics.cpp.
|
protected |
Definition at line 106 of file CostMetrics.h.
|
protected |
Definition at line 119 of file CostMetrics.h.
|
protected |
Definition at line 120 of file CostMetrics.h.
|
protected |
Replicate compared to stats.
Definition at line 114 of file CostMetrics.h.
Referenced by CostMetrics().
|
protected |
Definition at line 107 of file CostMetrics.h.
|
protected |
Definition at line 122 of file CostMetrics.h.
|
protected |
Definition at line 123 of file CostMetrics.h.
|
protected |
Definition at line 115 of file CostMetrics.h.
Referenced by CostMetrics().
|
protected |
Weight of local rank.
Weight of the whole rank. This quantity is the key quantity whenever we actually ask the metrics for information, as it feeds into the total weight, but also helps us to identify underbooked ranks.
Definition at line 104 of file CostMetrics.h.
|
staticprivate |
Definition at line 128 of file CostMetrics.h.
|
protected |
Definition at line 108 of file CostMetrics.h.
|
protected |
Definition at line 125 of file CostMetrics.h.
|
protected |
Definition at line 126 of file CostMetrics.h.
|
protected |
Definition at line 116 of file CostMetrics.h.
Referenced by CostMetrics().