Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move all plugins to their new home directory
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 26 May 2018 15:07:54 +0000 (17:07 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 26 May 2018 15:07:54 +0000 (17:07 +0200)
src/plugins/dirty_page_tracking.cpp [moved from src/surf/plugins/dirty_page_tracking.cpp with 99% similarity]
src/plugins/host_dvfs.cpp [moved from src/surf/plugins/host_dvfs.cpp with 96% similarity]
src/plugins/host_energy.cpp [moved from src/surf/plugins/host_energy.cpp with 98% similarity]
src/plugins/host_load.cpp [moved from src/surf/plugins/host_load.cpp with 96% similarity]
src/plugins/link_energy.cpp [moved from src/surf/plugins/link_energy.cpp with 98% similarity]
tools/cmake/DefinePackages.cmake

similarity index 99%
rename from src/surf/plugins/dirty_page_tracking.cpp
rename to src/plugins/dirty_page_tracking.cpp
index 95a3869..33b784c 100644 (file)
@@ -63,8 +63,8 @@ double VmDirtyPageTrackingExt::computed_flops_lookup()
 
   return total;
 }
 
   return total;
 }
-}
-}
+} // namespace vm
+} // namespace simgrid
 
 static void onVirtualMachineCreation(simgrid::vm::VirtualMachineImpl* vm)
 {
 
 static void onVirtualMachineCreation(simgrid::vm::VirtualMachineImpl* vm)
 {
similarity index 96%
rename from src/surf/plugins/host_dvfs.cpp
rename to src/plugins/host_dvfs.cpp
index e23921f..3aeef42 100644 (file)
@@ -167,19 +167,20 @@ public:
     if (load > freq_up_threshold) {
       if (pstate != 0) {
         get_host()->set_pstate(pstate - 1);
     if (load > freq_up_threshold) {
       if (pstate != 0) {
         get_host()->set_pstate(pstate - 1);
-        XBT_INFO("Load: %f > threshold: %f -> increasing performance to pstate %d", load, freq_up_threshold, pstate - 1);
-      }
-      else {
-        XBT_DEBUG("Load: %f > threshold: %f -> but cannot speed up even more, already in highest pstate %d", load, freq_up_threshold, pstate);
+        XBT_INFO("Load: %f > threshold: %f -> increasing performance to pstate %d", load, freq_up_threshold,
+                 pstate - 1);
+      } else {
+        XBT_DEBUG("Load: %f > threshold: %f -> but cannot speed up even more, already in highest pstate %d", load,
+                  freq_up_threshold, pstate);
       }
     } else if (load < freq_down_threshold) {
       int max_pstate = get_host()->get_pstate_count() - 1;
       if (pstate != max_pstate) { // Are we in the slowest pstate already?
         get_host()->set_pstate(pstate + 1);
         XBT_INFO("Load: %f < threshold: %f -> slowing down to pstate %d", load, freq_down_threshold, pstate + 1);
       }
     } else if (load < freq_down_threshold) {
       int max_pstate = get_host()->get_pstate_count() - 1;
       if (pstate != max_pstate) { // Are we in the slowest pstate already?
         get_host()->set_pstate(pstate + 1);
         XBT_INFO("Load: %f < threshold: %f -> slowing down to pstate %d", load, freq_down_threshold, pstate + 1);
-      }
-      else {
-        XBT_DEBUG("Load: %f < threshold: %f -> cannot slow down even more, already in slowest pstate %d", load, freq_down_threshold, pstate);
+      } else {
+        XBT_DEBUG("Load: %f < threshold: %f -> cannot slow down even more, already in slowest pstate %d", load,
+                  freq_down_threshold, pstate);
       }
     }
   }
       }
     }
   }
@@ -216,9 +217,9 @@ simgrid::xbt::Extension<simgrid::s4u::Host, HostDvfs> HostDvfs::EXTENSION_ID;
 HostDvfs::HostDvfs(simgrid::s4u::Host* ptr) {}
 
 HostDvfs::~HostDvfs() = default;
 HostDvfs::HostDvfs(simgrid::s4u::Host* ptr) {}
 
 HostDvfs::~HostDvfs() = default;
-}
-}
-}
+} // namespace dvfs
+} // namespace plugin
+} // namespace simgrid
 
 using simgrid::plugin::dvfs::HostDvfs;
 
 
 using simgrid::plugin::dvfs::HostDvfs;
 
similarity index 98%
rename from src/surf/plugins/host_energy.cpp
rename to src/plugins/host_energy.cpp
index f0e7c9b..42c9f8e 100644 (file)
@@ -5,9 +5,9 @@
 
 #include "simgrid/plugins/energy.h"
 #include "simgrid/plugins/load.h"
 
 #include "simgrid/plugins/energy.h"
 #include "simgrid/plugins/load.h"
+#include "simgrid/s4u/Engine.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
-#include "simgrid/s4u/Engine.hpp"
 
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
@@ -140,7 +140,7 @@ private:
   /* We need to keep track of what pstate has been used, as we will sometimes be notified only *after* a pstate has been
    * used (but we need to update the energy consumption with the old pstate!)
    */
   /* We need to keep track of what pstate has been used, as we will sometimes be notified only *after* a pstate has been
    * used (but we need to update the energy consumption with the old pstate!)
    */
-  int pstate = 0;
+  int pstate           = 0;
   const int pstate_off = -1;
 
 public:
   const int pstate_off = -1;
 
 public:
@@ -365,8 +365,8 @@ void HostEnergy::initWattsRangeList()
     i++;
   }
 }
     i++;
   }
 }
-}
-}
+} // namespace plugin
+} // namespace simgrid
 
 using simgrid::plugin::HostEnergy;
 
 
 using simgrid::plugin::HostEnergy;
 
@@ -433,13 +433,13 @@ static void onSimulationEnd()
 
       bool host_was_used = (sg_host_get_computed_flops(hosts[i]) != 0);
       double energy      = hosts[i]->extension<HostEnergy>()->getConsumedEnergy();
 
       bool host_was_used = (sg_host_get_computed_flops(hosts[i]) != 0);
       double energy      = hosts[i]->extension<HostEnergy>()->getConsumedEnergy();
-      total_energy      += energy;
+      total_energy += energy;
       if (host_was_used)
         used_hosts_energy += energy;
     }
   }
       if (host_was_used)
         used_hosts_energy += energy;
     }
   }
-  XBT_INFO("Total energy consumption: %f Joules (used hosts: %f Joules; unused/idle hosts: %f)",
-           total_energy, used_hosts_energy, total_energy - used_hosts_energy);
+  XBT_INFO("Total energy consumption: %f Joules (used hosts: %f Joules; unused/idle hosts: %f)", total_energy,
+           used_hosts_energy, total_energy - used_hosts_energy);
 }
 
 /* **************************** Public interface *************************** */
 }
 
 /* **************************** Public interface *************************** */
similarity index 96%
rename from src/surf/plugins/host_load.cpp
rename to src/plugins/host_load.cpp
index a728f25..0ca6a98 100644 (file)
@@ -40,7 +40,7 @@ private:
   double computed_flops    = 0;
   double idle_time         = 0;
   double theor_max_flops   = 0;
   double computed_flops    = 0;
   double idle_time         = 0;
   double theor_max_flops   = 0;
-  bool   was_prev_idle     = true; /* A host is idle at the beginning */
+  bool was_prev_idle       = true; /* A host is idle at the beginning */
 };
 
 simgrid::xbt::Extension<simgrid::s4u::Host, HostLoad> HostLoad::EXTENSION_ID;
 };
 
 simgrid::xbt::Extension<simgrid::s4u::Host, HostLoad> HostLoad::EXTENSION_ID;
@@ -74,9 +74,9 @@ void HostLoad::update()
   }
 
   theor_max_flops += current_speed * host->get_core_count() * (now - last_updated);
   }
 
   theor_max_flops += current_speed * host->get_core_count() * (now - last_updated);
-  current_speed    = host->getSpeed();
-  last_updated     = now;
-  was_prev_idle    = (current_flops == 0);
+  current_speed = host->getSpeed();
+  last_updated  = now;
+  was_prev_idle = (current_flops == 0);
 }
 
 /**
 }
 
 /**
@@ -99,7 +99,8 @@ double HostLoad::getCurrentLoad()
 /**
  * Return idle time since last reset
  */
 /**
  * Return idle time since last reset
  */
-double HostLoad::getIdleTime() {
+double HostLoad::getIdleTime()
+{
   return idle_time;
 }
 
   return idle_time;
 }
 
@@ -131,8 +132,8 @@ void HostLoad::reset()
   current_speed   = host->getSpeed();
   was_prev_idle   = (current_flops == 0);
 }
   current_speed   = host->getSpeed();
   was_prev_idle   = (current_flops == 0);
 }
-}
-}
+} // namespace plugin
+} // namespace simgrid
 
 using simgrid::plugin::HostLoad;
 
 
 using simgrid::plugin::HostLoad;
 
similarity index 98%
rename from src/surf/plugins/link_energy.cpp
rename to src/plugins/link_energy.cpp
index 3f28eb8..17aa277 100644 (file)
@@ -67,9 +67,7 @@ private:
 
 simgrid::xbt::Extension<simgrid::s4u::Link, LinkEnergy> LinkEnergy::EXTENSION_ID;
 
 
 simgrid::xbt::Extension<simgrid::s4u::Link, LinkEnergy> LinkEnergy::EXTENSION_ID;
 
-LinkEnergy::LinkEnergy(simgrid::s4u::Link* ptr) : link_(ptr), lastUpdated_(surf_get_clock())
-{
-}
+LinkEnergy::LinkEnergy(simgrid::s4u::Link* ptr) : link_(ptr), lastUpdated_(surf_get_clock()) {}
 
 LinkEnergy::~LinkEnergy() = default;
 
 
 LinkEnergy::~LinkEnergy() = default;
 
@@ -138,8 +136,8 @@ double LinkEnergy::getConsumedEnergy()
     simgrid::simix::simcall(std::bind(&LinkEnergy::update, this));
   return this->totalEnergy_;
 }
     simgrid::simix::simcall(std::bind(&LinkEnergy::update, this));
   return this->totalEnergy_;
 }
-}
-}
+} // namespace plugin
+} // namespace simgrid
 
 using simgrid::plugin::LinkEnergy;
 
 
 using simgrid::plugin::LinkEnergy;
 
index 0aa0645..337e741 100644 (file)
@@ -330,11 +330,6 @@ set(SURF_SRC
   src/surf/network_cm02.cpp
   src/surf/network_constant.cpp
   src/surf/network_interface.cpp
   src/surf/network_cm02.cpp
   src/surf/network_constant.cpp
   src/surf/network_interface.cpp
-  src/surf/plugins/dirty_page_tracking.cpp
-  src/surf/plugins/host_dvfs.cpp
-  src/surf/plugins/host_energy.cpp
-  src/surf/plugins/link_energy.cpp
-  src/surf/plugins/host_load.cpp
   src/surf/PropertyHolder.cpp
   src/surf/sg_platf.cpp
   src/surf/StorageImpl.cpp
   src/surf/PropertyHolder.cpp
   src/surf/sg_platf.cpp
   src/surf/StorageImpl.cpp
@@ -353,6 +348,11 @@ set(SURF_SRC
   )
 
 set(PLUGINS_SRC
   )
 
 set(PLUGINS_SRC
+  src/plugins/dirty_page_tracking.cpp
+  src/plugins/host_dvfs.cpp
+  src/plugins/host_energy.cpp
+  src/plugins/link_energy.cpp
+  src/plugins/host_load.cpp
   src/plugins/file_system/s4u_FileSystem.cpp
   src/plugins/vm/VirtualMachineImpl.hpp
   src/plugins/vm/s4u_VirtualMachine.cpp
   src/plugins/file_system/s4u_FileSystem.cpp
   src/plugins/vm/VirtualMachineImpl.hpp
   src/plugins/vm/s4u_VirtualMachine.cpp