Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / surf / plugins / energy.hpp
1 /* Copyright (c) 2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "../cpu_interface.hpp"
8 #include <map>
9
10 #ifndef CALLBACK_HPP_
11 #define CALLBACK_HPP_
12
13 class CpuEnergy;
14 typedef CpuEnergy *CpuEnergyPtr;
15
16 extern std::map<CpuPtr, CpuEnergyPtr> *surf_energy;
17
18 class CpuEnergy {
19 public:
20   CpuEnergy(CpuPtr ptr);
21   ~CpuEnergy();
22
23   double getCurrentWattsValue(double cpu_load);
24   double getConsumedEnergy();
25   double getWattMinAt(int pstate);
26   double getWattMaxAt(int pstate);
27
28   xbt_dynar_t getWattsRangeList();
29   xbt_dynar_t power_range_watts_list;   /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
30   double watts_off;                      /*< Consumption when the machine is turned off (shutdown) */
31   double total_energy;                                  /*< Total energy consumed by the host */
32   double last_updated;                                  /*< Timestamp of the last energy update event*/
33   CpuPtr cpu;
34 };
35
36 #endif /* CALLBACK_HPP_ */