From: Martin Quinson Date: Sat, 26 May 2018 15:07:54 +0000 (+0200) Subject: move all plugins to their new home directory X-Git-Tag: v3.20~191 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6e69697a9af6a3491da415b4f8f73f962ed14124?ds=sidebyside move all plugins to their new home directory --- diff --git a/src/surf/plugins/dirty_page_tracking.cpp b/src/plugins/dirty_page_tracking.cpp similarity index 99% rename from src/surf/plugins/dirty_page_tracking.cpp rename to src/plugins/dirty_page_tracking.cpp index 95a38690c6..33b784cf66 100644 --- a/src/surf/plugins/dirty_page_tracking.cpp +++ b/src/plugins/dirty_page_tracking.cpp @@ -63,8 +63,8 @@ double VmDirtyPageTrackingExt::computed_flops_lookup() return total; } -} -} +} // namespace vm +} // namespace simgrid static void onVirtualMachineCreation(simgrid::vm::VirtualMachineImpl* vm) { diff --git a/src/surf/plugins/host_dvfs.cpp b/src/plugins/host_dvfs.cpp similarity index 96% rename from src/surf/plugins/host_dvfs.cpp rename to src/plugins/host_dvfs.cpp index e23921f78c..3aeef424ec 100644 --- a/src/surf/plugins/host_dvfs.cpp +++ b/src/plugins/host_dvfs.cpp @@ -167,19 +167,20 @@ public: 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 { - 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 HostDvfs::EXTENSION_ID; HostDvfs::HostDvfs(simgrid::s4u::Host* ptr) {} HostDvfs::~HostDvfs() = default; -} -} -} +} // namespace dvfs +} // namespace plugin +} // namespace simgrid using simgrid::plugin::dvfs::HostDvfs; diff --git a/src/surf/plugins/host_energy.cpp b/src/plugins/host_energy.cpp similarity index 98% rename from src/surf/plugins/host_energy.cpp rename to src/plugins/host_energy.cpp index f0e7c9bc7f..42c9f8e4e5 100644 --- a/src/surf/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -5,9 +5,9 @@ #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 "simgrid/s4u/Engine.hpp" #include #include @@ -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!) */ - int pstate = 0; + int pstate = 0; const int pstate_off = -1; public: @@ -365,8 +365,8 @@ void HostEnergy::initWattsRangeList() i++; } } -} -} +} // namespace plugin +} // namespace simgrid 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()->getConsumedEnergy(); - total_energy += energy; + total_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 *************************** */ diff --git a/src/surf/plugins/host_load.cpp b/src/plugins/host_load.cpp similarity index 96% rename from src/surf/plugins/host_load.cpp rename to src/plugins/host_load.cpp index a728f25c33..0ca6a98f18 100644 --- a/src/surf/plugins/host_load.cpp +++ b/src/plugins/host_load.cpp @@ -40,7 +40,7 @@ private: 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 HostLoad::EXTENSION_ID; @@ -74,9 +74,9 @@ void HostLoad::update() } 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 */ -double HostLoad::getIdleTime() { +double HostLoad::getIdleTime() +{ return idle_time; } @@ -131,8 +132,8 @@ void HostLoad::reset() current_speed = host->getSpeed(); was_prev_idle = (current_flops == 0); } -} -} +} // namespace plugin +} // namespace simgrid using simgrid::plugin::HostLoad; diff --git a/src/surf/plugins/link_energy.cpp b/src/plugins/link_energy.cpp similarity index 98% rename from src/surf/plugins/link_energy.cpp rename to src/plugins/link_energy.cpp index 3f28eb864e..17aa277f90 100644 --- a/src/surf/plugins/link_energy.cpp +++ b/src/plugins/link_energy.cpp @@ -67,9 +67,7 @@ private: simgrid::xbt::Extension 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; @@ -138,8 +136,8 @@ double LinkEnergy::getConsumedEnergy() simgrid::simix::simcall(std::bind(&LinkEnergy::update, this)); return this->totalEnergy_; } -} -} +} // namespace plugin +} // namespace simgrid using simgrid::plugin::LinkEnergy; diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 0aa0645565..337e7412ad 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -330,11 +330,6 @@ set(SURF_SRC 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 @@ -353,6 +348,11 @@ set(SURF_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