Peano
Loading...
Searching...
No Matches
CostMetrics.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5namespace toolbox {
6 namespace loadbalancing {
7 class CostMetrics;
8 }
9}
10
11
12
13#include "tarch/mpi/mpi.h"
14#include "tarch/logging/Log.h"
15#include <string>
16
17
33 public:
35 virtual ~CostMetrics() = default;
36
40 virtual std::string toString() const = 0;
41
42 std::string toString(const std::string& metricName) const;
43
53 virtual void waitForGlobalDataExchange();
54
59 virtual void updateGlobalView();
60
72 virtual double getCostOfLocalTree(int spacetreeNumber) const = 0;
73
78 virtual double getCostOfLocalRank() const;
79
80 virtual double getGlobalCost() const;
81
82 virtual int getLightestRank() const;
83
84 virtual double getMinimumOfMaximumRankWeights() const;
85
86 protected:
92 double _weight;
93 int _rank;
94 };
95
105
109
110 #ifdef Parallel
117 #endif
118
121
124
127 private:
129};
Log Device.
Definition Log.h:516
virtual double getMinimumOfMaximumRankWeights() const
double _localRankWeight
Weight of local rank.
static tarch::logging::Log _log
virtual double getCostOfLocalRank() const
Wrapper around getCostOfLocalTree().
MPI_Request * _globalWeightRequest
Replicate compared to stats.
virtual void updateGlobalView()
Please overwrite in subclass and set the value of _localRankWeight.
virtual void waitForGlobalDataExchange()
Typically called by.
virtual double getCostOfLocalTree(int spacetreeNumber) const =0
Query cost of one tree.
virtual std::string toString() const =0
Feel free to invoke the variant below if you want.
MPI_Request * _minimumOfMaximumOfRankWeightsRequest
virtual double getGlobalCost() const
It is totally annoying, but it seems that MPI's maxloc and reduction are broken in some MPI implement...
Definition CostMetrics.h:91