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. */
13 #include "src/surf/HostImpl.hpp"
15 #ifndef ENERGY_CALLBACK_HPP_
16 #define ENERGY_CALLBACK_HPP_
21 class XBT_PRIVATE HostEnergy;
25 static simgrid::xbt::Extension<simgrid::s4u::Host, HostEnergy> EXTENSION_ID;
26 typedef std::pair<double,double> power_range;
28 HostEnergy(simgrid::s4u::Host *ptr);
31 double getCurrentWattsValue(double cpu_load);
32 double getConsumedEnergy();
33 double getWattMinAt(int pstate);
34 double getWattMaxAt(int pstate);
38 void initWattsRangeList();
39 simgrid::s4u::Host *host = nullptr;
40 std::vector<power_range> power_range_watts_list; /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
42 double watts_off = 0.0; /*< Consumption when the machine is turned off (shutdown) */
43 double total_energy = 0.0; /*< Total energy consumed by the host */
44 double last_updated; /*< Timestamp of the last energy update event*/
50 #endif /* ENERGY_CALLBACK_HPP_ */