Peano
Loading...
Searching...
No Matches
toolbox::loadbalancing::Blacklist Class Reference

Blacklisting. More...

#include <Blacklist.h>

Collaboration diagram for toolbox::loadbalancing::Blacklist:

Data Structures

struct  BlacklistData
 

Public Member Functions

 Blacklist ()
 
void update ()
 Update blacklist at end of traversal.
 
void triggeredSplit (int newParent)
 Inform blacklist that the load balancing has just triggered a split.
 
std::string toString () const
 
bool isBlacklisted (int treeNumber) const
 

Private Attributes

std::map< int, BlacklistData_blacklist
 Map of trees numbers onto blacklist entries.
 

Static Private Attributes

static tarch::logging::Log _log
 

Detailed Description

Blacklisting.

The recursive subdivision works with one tree at a time: It always identifies the one tree with the biggest load and subdivides this one further. A tree however requires two traversals to split. If a tree is identified as split candidate, the code hence will tell it to split, but will try to split exactly the same tree again in the subsequent iteration.

The tree's stats (how many cells does it own) at this point are skewed, as the tree has not yet successfully given away cells. Indeed, a tree needs at least three iterations to 'recover'. The first one initialises the split. The second traversal conducts the split and eventually moves around data, but the ownership in this traversal still is with the master. Therefore, the master still has all the local cells. After the third split, the master has actually given away its cells.

Therefore, we work with a blacklist map: Whenever we have identified a tree that is to be split, we memorise it and give it an internal weight of 3. Memorise means it is stored in a map. As long as a rank is on the blacklist map, it may not be selected as potential split tree. After each iteration, we reduce the weight of the blacklisted trees by one. If a weight becomes zero, we eventually remove it from the blacklist.

Definition at line 45 of file Blacklist.h.

Constructor & Destructor Documentation

◆ Blacklist()

toolbox::loadbalancing::Blacklist::Blacklist ( )

Definition at line 18 of file Blacklist.cpp.

Member Function Documentation

◆ isBlacklisted()

bool toolbox::loadbalancing::Blacklist::isBlacklisted ( int treeNumber) const

Definition at line 51 of file Blacklist.cpp.

References _blacklist.

◆ toString()

std::string toolbox::loadbalancing::Blacklist::toString ( ) const

Definition at line 22 of file Blacklist.cpp.

References _blacklist.

◆ triggeredSplit()

void toolbox::loadbalancing::Blacklist::triggeredSplit ( int newParent)

Inform blacklist that the load balancing has just triggered a split.

newParent is the number of the tree which has triggered this split.

Definition at line 84 of file Blacklist.cpp.

References _blacklist, and logDebug.

◆ update()

void toolbox::loadbalancing::Blacklist::update ( )

Update blacklist at end of traversal.

  • If a tree has unsuccessfully tried to merge its children, then we increase its blacklist lifetime, so it at least does not start to fork further.
  • If a tree is on the blacklist but has not yet changed its number of local cells, it means that this tree has forked before (so was added to the blacklist) but then was not able to split some cells off. So it should remain on the blacklist to ensure that we are not trying to split this tree over and over again.

Definition at line 57 of file Blacklist.cpp.

References _blacklist, peano4::parallel::SpacetreeSet::getGridStatistics(), peano4::parallel::SpacetreeSet::getInstance(), peano4::grid::GridStatistics::getNumberOfLocalUnrefinedCells(), peano4::grid::GridStatistics::getRemovedEmptySubtree(), and logInfo.

Here is the call graph for this function:

Field Documentation

◆ _blacklist

std::map< int, BlacklistData> toolbox::loadbalancing::Blacklist::_blacklist
private

Map of trees numbers onto blacklist entries.

Being in that map does not necessarily mean a tree is blacklisted. For this, we have to study its lifetime counter.

See also
BlacklistData

Definition at line 111 of file Blacklist.h.

Referenced by isBlacklisted(), toString(), triggeredSplit(), and update().

◆ _log

tarch::logging::Log toolbox::loadbalancing::Blacklist::_log
staticprivate

Definition at line 102 of file Blacklist.h.


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