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/logging/Log.h"
14#include <string>
15
16
38 public:
40 virtual ~CostMetrics() = default;
41
45 virtual std::string toString() const = 0;
46
47 std::string toString(const std::string& metricName) const;
48
60 virtual void updateGlobalView();
61
73 virtual double getCostOfLocalTree(int spacetreeNumber) const = 0;
74
79 virtual double getCostOfLocalRank() const;
80
81 virtual double getGlobalCost() const;
82
83 virtual int getLightestRank() const;
84
85 virtual double getMinimumOfMaximumRankWeights() const;
86
87 protected:
93 double _weight;
94 int _rank;
95 };
96
108
112
113 private:
115};
Log Device.
Definition Log.h:517
virtual double getCostOfLocalRank() const
Wrapper around getCostOfLocalTree().
std::string toString(const std::string &metricName) const
virtual double getMinimumOfMaximumRankWeights() const
double _localRankWeight
Weight of local rank.
static tarch::logging::Log _log
virtual double getGlobalCost() const
virtual double getCostOfLocalTree(int spacetreeNumber) const =0
Query cost of one tree.
virtual int getLightestRank() const
virtual std::string toString() const =0
Feel free to invoke the variant below if you want.
virtual void updateGlobalView()
Please overwrite in subclass and set the value of _localRankWeight.
It is totally annoying, but it seems that MPI's maxloc and reduction are broken in some MPI implement...
Definition CostMetrics.h:92