![]() |
Peano
|
Hardcoded domain decomposition strategy. More...
#include <Hardcoded.h>
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, std::initializer_list< peano4::SplitInstruction::Mode > modes, bool handOutOnePartitionPerCore) | |
virtual void | finishStep () override |
Finish the step. | |
virtual void | finishSimulation () override |
![]() | |
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 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 |
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.
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, | ||
std::initializer_list< peano4::SplitInstruction::Mode > | modes, | ||
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.
|
overridevirtual |
Reimplemented from toolbox::loadbalancing::AbstractLoadBalancing.
Definition at line 118 of file Hardcoded.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 72 of file Hardcoded.cpp.
References _currentTimeStamp, _handOutOnePartitionPerCore, _splits, toolbox::loadbalancing::AbstractLoadBalancing::_state, toolbox::loadbalancing::strategies::Hardcoded::Split::destinationRank, toolbox::loadbalancing::dumpStatistics(), peano4::parallel::SpacetreeSet::getInstance(), tarch::mpi::Rank::getInstance(), tarch::multicore::Core::getInstance(), peano4::parallel::SpacetreeSet::getLocalSpacetrees(), tarch::multicore::Core::getNumberOfThreads(), tarch::mpi::Rank::getRank(), logError, logWarning, toolbox::loadbalancing::strategies::Hardcoded::Split::numberOfCells, toolbox::loadbalancing::strategies::Hardcoded::Split::splittingTree, and toolbox::loadbalancing::SwitchedOff.
|
private |
Time stamp might be the slightly wrong wording.
It is actually grid iteration or finishStep() calls.
Definition at line 82 of file Hardcoded.h.
Referenced by finishStep().
|
private |
Definition at line 84 of file Hardcoded.h.
Referenced by finishStep().
|
staticprivate |
Definition at line 64 of file Hardcoded.h.
|
private |
Definition at line 76 of file Hardcoded.h.
Referenced by finishStep(), and Hardcoded().