AutoPas  3.0.0
Loading...
Searching...
No Matches
EnergySensor.h
Go to the documentation of this file.
1
7#pragma once
9#ifdef AUTOPAS_ENABLE_ENERGY_MEASUREMENTS
10#include "pmt.h"
11#endif
12
13namespace autopas::utils {
14
21 public:
29
35 bool init(bool tuningMetricIsEnergy);
36
41 bool startMeasurement();
42
47 bool endMeasurement();
48
54 double getJoules() const;
55
61 double getWatts() const;
62
68 double getEnergyDeltaT() const;
69
75 const EnergySensorOption getOption() const;
76
82 long getNanoJoules() const;
83
84 private:
85#ifdef AUTOPAS_ENABLE_ENERGY_MEASUREMENTS
89 std::unique_ptr<pmt::PMT> _sensor;
93 pmt::State _start;
97 pmt::State _end;
98#endif
102 EnergySensorOption _option;
103};
104
105} // namespace autopas::utils
Class representing the different energy sensor options.
Definition: EnergySensorOption.h:19
Measure the energy consumption of a simulation on multiple hardwares.
Definition: EnergySensor.h:20
double getEnergyDeltaT() const
Get seconds between current start and end state.
Definition: EnergySensor.cpp:67
double getJoules() const
Get the energy consumed in Joules between the start and the end state.
Definition: EnergySensor.cpp:51
bool init(bool tuningMetricIsEnergy)
Initializes the EnergySenor.
Definition: EnergySensor.cpp:19
double getWatts() const
Get the average power consumed in Watts between the start and the end state.
Definition: EnergySensor.cpp:59
bool endMeasurement()
Ending measurement.
Definition: EnergySensor.cpp:42
long getNanoJoules() const
Method to convert consumed energy in Joules to nanoJoules.
Definition: EnergySensor.cpp:75
const EnergySensorOption getOption() const
Getter for used sensor option.
Definition: EnergySensor.cpp:40
bool startMeasurement()
Start measurements.
Definition: EnergySensor.cpp:31
In this namespace some helper classes and functions can be found used inside of AutoPas.
Definition: namespaces.h:44