Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove completely the energy concern from the core
[simgrid.git] / src / surf / plugins / energy.hpp
index a50a6f6..389abd9 100644 (file)
@@ -1,4 +1,6 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* energy.hpp: internal interface to the energy plugin                      */
+
+/* Copyright (c) 2014-2016. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,19 +8,22 @@
 
 #include <xbt/base.h>
 
-#include "../host_interface.hpp"
+#include "src/surf/host_interface.hpp"
 #include <map>
 
 #ifndef ENERGY_CALLBACK_HPP_
 #define ENERGY_CALLBACK_HPP_
 
+namespace simgrid {
+namespace energy {
+
 class XBT_PRIVATE HostEnergy;
 
-extern XBT_PRIVATE std::map<Host*, HostEnergy*> *surf_energy;
+extern XBT_PRIVATE std::map<simgrid::surf::Host*, HostEnergy*> *surf_energy;
 
 class HostEnergy {
 public:
-  HostEnergy(Host *ptr);
+  HostEnergy(simgrid::surf::Host *ptr);
   ~HostEnergy();
 
   double getCurrentWattsValue(double cpu_load);
@@ -31,11 +36,19 @@ public:
   double watts_off;                      /*< Consumption when the machine is turned off (shutdown) */
   double total_energy;                                 /*< Total energy consumed by the host */
   double last_updated;                                 /*< Timestamp of the last energy update event*/
-  Host *host;
+  simgrid::surf::Host *host;
 
   void unref() {if (--refcount == 0) delete this;}
   void ref() {refcount++;}
   int refcount = 1;
 };
 
+XBT_PUBLIC(double) surf_host_get_wattmin_at(sg_host_t resource, int pstate);
+XBT_PUBLIC(double) surf_host_get_wattmax_at(sg_host_t resource, int pstate);
+XBT_PUBLIC(double) surf_host_get_consumed_energy(sg_host_t host);
+}
+}
+
+
+
 #endif /* ENERGY_CALLBACK_HPP_ */