Peano 4
Loading...
Searching...
No Matches
toolbox::loadbalancing::strategies::Hardcoded Class Reference

Hardcoded domain decomposition strategy. More...

#include <Hardcoded.h>

Inheritance diagram for toolbox::loadbalancing::strategies::Hardcoded:
Collaboration diagram for toolbox::loadbalancing::strategies::Hardcoded:

Data Structures

struct  Split
 

Public Member Functions

 Hardcoded (std::initializer_list< int > timeStamps, std::initializer_list< int > splittingTrees, std::initializer_list< int > numberOfCells, std::initializer_list< int > destinationRanks, bool handOutOnePartitionPerCore)
 
virtual void finishStep () override
 Finish the step.
 
virtual void finishSimulation () override
 
- Public Member Functions inherited from toolbox::loadbalancing::AbstractLoadBalancing
 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.
 
void setConfigurationAndMetricsNullWithoutDelete ()
 This is only used when you concatenate balancing rules and you want to disable any deletion.
 

Private Attributes

std::queue< Split_splits
 
int _currentTimeStamp
 Time stamp might be the slightly wrong wording.
 
const bool _handOutOnePartitionPerCore
 

Static Private Attributes

static tarch::logging::Log _log
 

Additional Inherited Members

- Static Public Attributes inherited from toolbox::loadbalancing::AbstractLoadBalancing
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.
 
- Protected Member Functions inherited from toolbox::loadbalancing::AbstractLoadBalancing
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.
 
- Protected Attributes inherited from toolbox::loadbalancing::AbstractLoadBalancing
Blacklist _blacklist
 
Statistics _statistics
 
Configuration_configuration
 
CostMetrics_costMetrics
 
State _state
 Ensure that you invoke.
 
- Static Protected Attributes inherited from toolbox::loadbalancing::AbstractLoadBalancing
static tarch::logging::Log _log
 

Detailed Description

Hardcoded domain decomposition strategy.

Hardcoded lb is useful if you know exactly which domain decomposition you want to build up at which time, or if you have to debug a particular (deterministic) setup.

Definition at line 31 of file Hardcoded.h.

Constructor & Destructor Documentation

◆ Hardcoded()

toolbox::loadbalancing::strategies::Hardcoded::Hardcoded ( std::initializer_list< int > timeStamps,
std::initializer_list< int > splittingTrees,
std::initializer_list< int > numberOfCells,
std::initializer_list< int > destinationRanks,
bool handOutOnePartitionPerCore )
   @todo I'd like to have support for a file here later on which contains
   entries alike
 10: tree 15 splits into 4 cells to rank 4
 25: tree 16 splits into 5 cells to rank 2

The splits that are to be triggered are passed here as three initialiser lists. So if you pass

 {4,5,8}, {2,2,2}, {11,12,13}, {22,23,24} 

then tree 2 will split in the grid sweeps 4, 5 and eight. It will try to deploy 11, 12 or 13 cells to the ranks 22, 23 or 24, respectively.

Definition at line 15 of file Hardcoded.cpp.

References _splits, and assertionEquals4.

Member Function Documentation

◆ finishSimulation()

void toolbox::loadbalancing::strategies::Hardcoded::finishSimulation ( )
overridevirtual

Reimplemented from toolbox::loadbalancing::AbstractLoadBalancing.

Definition at line 106 of file Hardcoded.cpp.

◆ finishStep()

Field Documentation

◆ _currentTimeStamp

int toolbox::loadbalancing::strategies::Hardcoded::_currentTimeStamp
private

Time stamp might be the slightly wrong wording.

It is actually grid iteration or finishStep() calls.

Definition at line 74 of file Hardcoded.h.

Referenced by finishStep().

◆ _handOutOnePartitionPerCore

const bool toolbox::loadbalancing::strategies::Hardcoded::_handOutOnePartitionPerCore
private

Definition at line 76 of file Hardcoded.h.

Referenced by finishStep().

◆ _log

tarch::logging::Log toolbox::loadbalancing::strategies::Hardcoded::_log
staticprivate

Definition at line 57 of file Hardcoded.h.

◆ _splits

std::queue< Split > toolbox::loadbalancing::strategies::Hardcoded::_splits
private

Definition at line 68 of file Hardcoded.h.

Referenced by finishStep(), and Hardcoded().


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