Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more explicit header inclusion guard
[simgrid.git] / src / surf / plugins / energy.hpp
1 /* Copyright (c) 2014-2015. 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 <xbt/base.h>
8
9 #include "../cpu_interface.hpp"
10 #include <map>
11
12 #ifndef ENERGY_CALLBACK_HPP_
13 #define ENERGY_CALLBACK_HPP_
14
15 class XBT_PRIVATE CpuEnergy;
16
17 extern XBT_PRIVATE std::map<Cpu*, CpuEnergy*> *surf_energy;
18
19 class CpuEnergy {
20 public:
21   CpuEnergy(Cpu *ptr);
22   ~CpuEnergy();
23
24   double getCurrentWattsValue(double cpu_load);
25   double getConsumedEnergy();
26   double getWattMinAt(int pstate);
27   double getWattMaxAt(int pstate);
28
29   xbt_dynar_t getWattsRangeList();
30   xbt_dynar_t power_range_watts_list;   /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
31   double watts_off;                      /*< Consumption when the machine is turned off (shutdown) */
32   double total_energy;                                  /*< Total energy consumed by the host */
33   double last_updated;                                  /*< Timestamp of the last energy update event*/
34   Cpu *cpu;
35 };
36
37 #endif /* ENERGY_CALLBACK_HPP_ */