![]() |
Peano
|
Spread out hiearchically. More...
#include <SpreadOutHierarchically.h>
Public Types | |
enum class | Action { Unspecified , None , SpreadEquallyOverAllRanks , SpreadEquallyOverAllThreads } |
Public Member Functions | |
SpreadOutHierarchically (Configuration *configuration=new DefaultConfiguration(), CostMetrics *costMetrics=new toolbox::loadbalancing::metrics::CellCount()) | |
virtual | ~SpreadOutHierarchically () |
virtual void | finishStep () override |
Finish the step. | |
![]() | |
AbstractLoadBalancing (Configuration *configuration, CostMetrics *costMetrics) | |
Constructor. | |
virtual | ~AbstractLoadBalancing () |
Destructor. | |
virtual std::string | toString () const |
Generic string serialisation. | |
virtual void | enable (bool) |
Switch on/off. | |
virtual bool | hasSplitRecently () const |
bool | isEnabled (bool globally) const |
Clarifies whether load balancing is, in principle, enabled. | |
virtual int | getGlobalNumberOfTrees () const |
Delegate to stats. | |
virtual bool | hasStagnated () const |
A load balancing can either be stagnating or be switched off for this predicate to hold. | |
virtual void | finishSimulation () |
void | setConfigurationAndMetricsNullWithoutDelete () |
This is only used when you concatenate balancing rules and you want to disable any deletion. | |
Static Public Member Functions | |
static std::string | toString (Action action) |
Private Member Functions | |
void | updateState () |
void | updateLoadBalancing () |
void | triggerSplit (int numberOfCells, int targetRank) |
Action | getAction () const |
int | getNumberOfSplitsOnLocalRank () const |
Private Attributes | |
int | _stepsToWaitForNextLoadBalancingDecision |
Static Private Attributes | |
static tarch::logging::Log | _log |
Additional Inherited Members | |
![]() | |
static constexpr int | NoHeaviestTreeAvailable = -1 |
Is used by tree identification and either indicates that there are no trees at all or means that the heaviest tree is on the blacklist. | |
![]() | |
bool | fitsIntoMemory (State state) const |
Ensure enough memory is left-over. | |
bool | isInterRankBalancingBad () const |
Is the balancing between the ranks ok. | |
bool | isIntraRankBalancingBad () const |
Is the balancing on the rank ok. | |
bool | areRanksUnemployed () const |
double | getWeightOfHeaviestLocalSpacetree () const |
int | getIdOfHeaviestLocalSpacetree () const |
Determines the maximum spacetree size a tree should have in the optimal case. | |
int | getIdOfHeaviestLocalSpacetree (double tolerance) const |
Similar to getIdOfHeaviestLocalSpacetree() but you might get one of the trees back that is close to the heaviest one up to tolerance. | |
![]() | |
Blacklist | _blacklist |
Statistics | _statistics |
Configuration * | _configuration |
CostMetrics * | _costMetrics |
State | _state |
Ensure that you invoke. | |
![]() | |
static tarch::logging::Log | _log |
Spread out hiearchically.
First try to give each rank one tree and then make each rank fork out once more such that each thread gets one tree. After that, switch into stagnation.
The routine tries to get as many cores/ranks in as possible. Therefore, we employ a bottom-up splitting strategy which prioritises fair fine grid splits over an "efficient" tree decomposition. Consult a discussion of splitting variants and constraints in peano4::grid::Spacetree::isCellTopDownSplitCandidate() and peano4::grid::Spacetree::isCellBottomUpSplitCandidate(), peano4::grid::Spacetree::splitOrJoinCell() and notably the general domain decomposition overview for the rationale.
Definition at line 42 of file SpreadOutHierarchically.h.
|
strong |
Enumerator | |
---|---|
Unspecified | Required for the strategy. |
None | |
SpreadEquallyOverAllRanks | |
SpreadEquallyOverAllThreads |
Definition at line 47 of file SpreadOutHierarchically.h.
toolbox::loadbalancing::strategies::SpreadOutHierarchically::SpreadOutHierarchically | ( | Configuration * | configuration = new DefaultConfiguration(), |
CostMetrics * | costMetrics = new toolbox::loadbalancing::metrics::CellCount() ) |
Definition at line 28 of file SpreadOutHierarchically.cpp.
References toolbox::loadbalancing::AbstractLoadBalancing::_state, toolbox::loadbalancing::AbstractLoadBalancing::_statistics, assertion, toolbox::loadbalancing::InterRankDistribution, and toolbox::loadbalancing::Statistics::notifyOfStateChange().
|
virtual |
Definition at line 37 of file SpreadOutHierarchically.cpp.
|
overridevirtual |
Finish the step.
No matter what you do here, you have to invoke
_statistics.updateGlobalView(); _blacklist.update();
in this routine.
Implements toolbox::loadbalancing::AbstractLoadBalancing.
Definition at line 247 of file SpreadOutHierarchically.cpp.
References _state(), toolbox::loadbalancing::dumpStatistics(), and logInfo.
|
private |
Definition at line 73 of file SpreadOutHierarchically.cpp.
References _state(), tarch::mpi::Rank::getInstance(), tarch::multicore::Core::getInstance(), tarch::mpi::Rank::getNumberOfRanks(), tarch::multicore::Core::getNumberOfThreads(), toolbox::loadbalancing::InterRankDistribution, toolbox::loadbalancing::IntraRankDistribution, logDebug, and logInfo.
|
private |
Definition at line 133 of file SpreadOutHierarchically.cpp.
References _state(), assertionEquals, tarch::getFreeMemory(), peano4::parallel::SpacetreeSet::getInstance(), tarch::multicore::Core::getInstance(), tarch::getMemoryUsage(), tarch::multicore::Core::getNumberOfThreads(), toolbox::loadbalancing::getWeightOfHeaviestLocalSpacetree(), logInfo, and tarch::MByte.
|
static |
Definition at line 13 of file SpreadOutHierarchically.cpp.
References None, SpreadEquallyOverAllRanks, SpreadEquallyOverAllThreads, and Unspecified.
|
private |
Definition at line 269 of file SpreadOutHierarchically.cpp.
References _state(), assertionEquals, peano4::parallel::SpacetreeSet::getInstance(), peano4::parallel::SpacetreeSet::getLocalSpacetrees(), logInfo, and peano4::parallel::SpacetreeSet::split().
|
private |
Definition at line 185 of file SpreadOutHierarchically.cpp.
References _state(), tarch::mpi::Rank::getInstance(), tarch::multicore::Core::getInstance(), tarch::mpi::Rank::getNumberOfRanks(), toolbox::loadbalancing::getWeightOfHeaviestLocalSpacetree(), logInfo, toolbox::loadbalancing::AbstractLoadBalancing::toString(), and toString().
|
private |
Definition at line 41 of file SpreadOutHierarchically.cpp.
References _state(), peano4::parallel::SpacetreeSet::getInstance(), tarch::mpi::Rank::getInstance(), tarch::multicore::Core::getInstance(), tarch::mpi::Rank::getNumberOfRanks(), toolbox::loadbalancing::InterRankDistribution, toolbox::loadbalancing::IntraRankDistribution, logDebug, toolbox::loadbalancing::Stagnation, and toString().
|
staticprivate |
Definition at line 65 of file SpreadOutHierarchically.h.
|
private |
Definition at line 67 of file SpreadOutHierarchically.h.