AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
autopas::utils::EnergySensor Class Reference

Measure the energy consumption of a simulation on multiple hardwares. More...

#include <EnergySensor.h>

Public Member Functions

 EnergySensor (EnergySensorOption sensor)
 Constructor for energy sensor.
 
bool init (bool tuningMetricIsEnergy)
 Initializes the EnergySenor.
 
bool startMeasurement ()
 Start measurements.
 
bool endMeasurement ()
 Ending measurement.
 
double getJoules () const
 Get the energy consumed in Joules between the start and the end state.
 
double getWatts () const
 Get the average power consumed in Watts between the start and the end state.
 
double getEnergyDeltaT () const
 Get seconds between current start and end state.
 
const EnergySensorOption getOption () const
 Getter for used sensor option.
 
long getNanoJoules () const
 Method to convert consumed energy in Joules to nanoJoules.
 

Detailed Description

Measure the energy consumption of a simulation on multiple hardwares.

Simulation needs to run on an Linux system to use Power measurement toolkit

Constructor & Destructor Documentation

◆ EnergySensor()

autopas::utils::EnergySensor::EnergySensor ( EnergySensorOption  sensor)

Constructor for energy sensor.

Takes

Parameters
sensoras possible energy sensors to use. Causes a runtime error if the specified sensor is not available with pmt module used in AutoPas. Currently, pmt in AutoPas can only be compiled with rapl and likwid. Rapl sensor is the default sensor option. And it is currently forced to be compiled always.

Member Function Documentation

◆ endMeasurement()

bool autopas::utils::EnergySensor::endMeasurement ( )

Ending measurement.

Sets _end

Returns
returns true if _sensor available. Otherwise false.

◆ getEnergyDeltaT()

double autopas::utils::EnergySensor::getEnergyDeltaT ( ) const

Get seconds between current start and end state.

Returns
double for seconds between time stamps for energy measurements. Returns -1 when AutoPas in compiled without energy measurements enabled.

◆ getJoules()

double autopas::utils::EnergySensor::getJoules ( ) const

Get the energy consumed in Joules between the start and the end state.

Returns
double for energy consumed in Joules. Returns -1 when AutoPas in compiled without energy measurements enabled.

◆ getNanoJoules()

long autopas::utils::EnergySensor::getNanoJoules ( ) const

Method to convert consumed energy in Joules to nanoJoules.

This is used for tuning.

Returns
Energy consumed in nanoJoules. Returns -1 when AutoPas in compiled without energy measurements enabled.

◆ getOption()

const EnergySensorOption autopas::utils::EnergySensor::getOption ( ) const

Getter for used sensor option.

Returns
EnergySensorOption displaying which energy sensor is used. Returns -1 when AutoPas in compiled without energy measurements enabled.

◆ getWatts()

double autopas::utils::EnergySensor::getWatts ( ) const

Get the average power consumed in Watts between the start and the end state.

Returns
double for average power consumed in Watts. Returns -1 when AutoPas in compiled without energy measurements enabled.

◆ init()

bool autopas::utils::EnergySensor::init ( bool  tuningMetricIsEnergy)

Initializes the EnergySenor.

Parameters
tuningMetricIsEnergywhether energy is selected as the tuning metric.
Returns
Bool whether energy measurement is turned on.

◆ startMeasurement()

bool autopas::utils::EnergySensor::startMeasurement ( )

Start measurements.

Sets _start

Returns
returns true if _sensor available. Otherwise false

The documentation for this class was generated from the following files: