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
5
namespace
toolbox
{
6
namespace
loadbalancing {
7
class
CostMetrics;
8
}
9
}
10
11
12
13
#include "
tarch/logging/Log.h
"
14
#include <string>
15
16
37
class
toolbox::loadbalancing::CostMetrics
{
38
public
:
39
CostMetrics
();
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
:
92
struct
ReductionBuffer
{
93
double
_weight
;
94
int
_rank
;
95
};
96
107
double
_localRankWeight
;
108
109
double
_globalWeight
;
110
ReductionBuffer
_lightestRank
;
111
double
_minimumOfMaximumOfRankWeights
;
112
113
private
:
114
static
tarch::logging::Log
_log
;
115
};
Log.h
tarch::logging::Log
Log Device.
Definition
Log.h:517
toolbox::loadbalancing::CostMetrics
Abstract cost metric.
Definition
CostMetrics.h:37
toolbox::loadbalancing::CostMetrics::CostMetrics
CostMetrics()
toolbox::loadbalancing::CostMetrics::getCostOfLocalRank
virtual double getCostOfLocalRank() const
Wrapper around getCostOfLocalTree().
toolbox::loadbalancing::CostMetrics::~CostMetrics
virtual ~CostMetrics()=default
toolbox::loadbalancing::CostMetrics::toString
std::string toString(const std::string &metricName) const
toolbox::loadbalancing::CostMetrics::getMinimumOfMaximumRankWeights
virtual double getMinimumOfMaximumRankWeights() const
toolbox::loadbalancing::CostMetrics::_localRankWeight
double _localRankWeight
Weight of local rank.
Definition
CostMetrics.h:107
toolbox::loadbalancing::CostMetrics::_log
static tarch::logging::Log _log
Definition
CostMetrics.h:114
toolbox::loadbalancing::CostMetrics::_minimumOfMaximumOfRankWeights
double _minimumOfMaximumOfRankWeights
Definition
CostMetrics.h:111
toolbox::loadbalancing::CostMetrics::getGlobalCost
virtual double getGlobalCost() const
toolbox::loadbalancing::CostMetrics::_lightestRank
ReductionBuffer _lightestRank
Definition
CostMetrics.h:110
toolbox::loadbalancing::CostMetrics::_globalWeight
double _globalWeight
Definition
CostMetrics.h:109
toolbox::loadbalancing::CostMetrics::getCostOfLocalTree
virtual double getCostOfLocalTree(int spacetreeNumber) const =0
Query cost of one tree.
toolbox::loadbalancing::CostMetrics::getLightestRank
virtual int getLightestRank() const
toolbox::loadbalancing::CostMetrics::toString
virtual std::string toString() const =0
Feel free to invoke the variant below if you want.
toolbox::loadbalancing::CostMetrics::updateGlobalView
virtual void updateGlobalView()
Please overwrite in subclass and set the value of _localRankWeight.
toolbox
Definition
InterpolationRestriction.h:10
toolbox::loadbalancing::CostMetrics::ReductionBuffer
It is totally annoying, but it seems that MPI's maxloc and reduction are broken in some MPI implement...
Definition
CostMetrics.h:92
toolbox::loadbalancing::CostMetrics::ReductionBuffer::_rank
int _rank
Definition
CostMetrics.h:94
toolbox::loadbalancing::CostMetrics::ReductionBuffer::_weight
double _weight
Definition
CostMetrics.h:93
src
toolbox
loadbalancing
CostMetrics.h
Generated on Tue Nov 3 2026 16:05:42 for Peano by
1.9.8