30 const int MaxTreesPerRank = std::min(
45 result =
_statistics.getLocalNumberOfInnerUnrefinedCells() / MinTreeSize
48 "getNumberOfTreesPerRank()",
49 "mesh is stable, so create "
50 << result <<
" trees even though we might end up with fewer cells per tree than the lower bound "
53 }
else if (
_statistics.getLocalNumberOfInnerUnrefinedCells() >= MinMeshSizeToAccommodateMaxTotalTrees) {
56 "getNumberOfTreesPerRank()",
58 <<
_statistics.getLocalNumberOfInnerUnrefinedCells() <<
" cells already, so create " << result
82 if (numberOfTreesPerRank > 0) {
85 int cellsPerTree = std::max(
86 static_cast<int>(std::round(
_statistics.getGlobalNumberOfInnerUnrefinedCells() / ranks / numberOfTreesPerRank)), 1
90 "updateLoadBalancing()",
92 << numberOfTreesPerRank <<
" trees per rank with internal state" <<
toString() <<
" to produce " << ranks <<
"x"
93 << numberOfTreesPerRank <<
" trees with approx " << cellsPerTree <<
" cells per tree"
96 int totalSplits = cellsPerTree;
97 for (
int targetRank = 0; targetRank < ranks; targetRank++)
98 for (
int treeNumber = targetRank == 0 ? 1 : 0; treeNumber < numberOfTreesPerRank; treeNumber++) {
99 int thisTreesCells = cellsPerTree;
100 if (
static_cast<int>(
_statistics.getGlobalNumberOfInnerUnrefinedCells()) % (ranks * numberOfTreesPerRank) >= totalSplits) {
110 }
else if (not
_statistics.hasConsistentViewOfWorld()) {
132 "triggerSplit(int,int,int)",
133 "trigger split from tree 0 into new tree on rank " << targetRank <<
" with " << numberOfCells <<
" cell(s)"
139 const int sourceTree = 0;
144 logInfo(
"triggerSplit()",
"wanted to split local rank " << sourceTree <<
" but failed");
#define assertionEquals(lhs, rhs)
#define logInfo(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
bool split(int treeId, const peano4::SplitInstruction &instruction, int targetRank)
Split a local tree.
static SpacetreeSet & getInstance()
int getNumberOfRanks() const
static Rank & getInstance()
This operation returns the singleton instance.
static Core & getInstance()
std::string toString(Filter filter)