|
Peano
|
Spread out. More...
#include <SpreadOut.h>


Public Member Functions | |
| SpreadOut (Configuration *configuration=new DefaultConfiguration(), CostMetrics *costMetrics=new toolbox::loadbalancing::metrics::CellCount()) | |
| virtual | ~SpreadOut () |
| virtual void | finishStep () override |
| Finish the step. | |
Public Member Functions inherited from toolbox::loadbalancing::AbstractLoadBalancing | |
| AbstractLoadBalancing (Configuration *configuration, CostMetrics *costMetrics) | |
| Constructor. | |
| virtual | ~AbstractLoadBalancing () |
| Destructor. | |
| virtual std::string | toString () const |
| Create a string representation of load balancing object. | |
| virtual void | enable (bool) |
| Switch on/off. | |
| virtual bool | hasSplitRecently () const |
| Has mesh split recently. | |
| bool | isEnabled (bool globally) const |
| Is load balancing 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. | |
Private Member Functions | |
| int | getNumberOfTreesPerRank () const |
| Return 0 if the load balancing should not split (yet) and otherwise return number of splits required. | |
| void | updateLoadBalancing () |
| void | triggerSplit (int numberOfCells, int targetRank) |
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. | |
| static constexpr int | NumberOfMeshSweepsAfterSplitToMakeMeshConsistentAgain = 3 |
| Number of mesh sweeps a split needs until the mesh is consistent again. | |
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 |
Spread out.
Try to give each thread on each rank one tree in one big decomposition rush. 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 44 of file SpreadOut.h.
| toolbox::loadbalancing::strategies::SpreadOut::SpreadOut | ( | Configuration * | configuration = new DefaultConfiguration(), |
| CostMetrics * | costMetrics = new toolbox::loadbalancing::metrics::CellCount() |
||
| ) |
|
virtual |
|
overridevirtual |
Finish the step.
No matter what you do here, you have to invoke
_statistics.updateGlobalView();
_blacklist.update();
in this routine.
If you use the actionset toolbox.laodbalancing.api.LoadBalancing, then the unprepareTraversal() invokes the finishStep() for you. This in turn means, as per contract, that the statistics have an updated global view.
Implements toolbox::loadbalancing::AbstractLoadBalancing.
|
private |
Return 0 if the load balancing should not split (yet) and otherwise return number of splits required.
There are two reasons to split:
|
private |
|
private |
|
staticprivate |
Definition at line 55 of file SpreadOut.h.