1 /* energy.hpp: internal interface to the energy plugin */
3 /* Copyright (c) 2014-2016. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "src/surf/host_interface.hpp"
14 #ifndef ENERGY_CALLBACK_HPP_
15 #define ENERGY_CALLBACK_HPP_
20 class XBT_PRIVATE HostEnergy;
24 static simgrid::xbt::Extension<simgrid::s4u::Host, HostEnergy> EXTENSION_ID;
25 typedef std::pair<double,double> power_range;
27 HostEnergy(simgrid::s4u::Host *ptr);
30 double getCurrentWattsValue(double cpu_load);
31 double getConsumedEnergy();
32 double getWattMinAt(int pstate);
33 double getWattMaxAt(int pstate);
37 void initWattsRangeList();
38 simgrid::s4u::Host *host = nullptr;
39 std::vector<power_range> power_range_watts_list; /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
41 double watts_off = 0.0; /*< Consumption when the machine is turned off (shutdown) */
42 double total_energy = 0.0; /*< Total energy consumed by the host */
43 double last_updated; /*< Timestamp of the last energy update event*/
49 #endif /* ENERGY_CALLBACK_HPP_ */