return total;
}
-}
-}
+} // namespace vm
+} // namespace simgrid
static void onVirtualMachineCreation(simgrid::vm::VirtualMachineImpl* vm)
{
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);
}
}
}
HostDvfs::HostDvfs(simgrid::s4u::Host* ptr) {}
HostDvfs::~HostDvfs() = default;
-}
-}
-}
+} // namespace dvfs
+} // namespace plugin
+} // namespace simgrid
using simgrid::plugin::dvfs::HostDvfs;
#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 <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
/* 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:
i++;
}
}
-}
-}
+} // namespace plugin
+} // namespace simgrid
using simgrid::plugin::HostEnergy;
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;
}
}
- 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 *************************** */
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;
}
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);
}
/**
/**
* Return idle time since last reset
*/
-double HostLoad::getIdleTime() {
+double HostLoad::getIdleTime()
+{
return idle_time;
}
current_speed = host->getSpeed();
was_prev_idle = (current_flops == 0);
}
-}
-}
+} // namespace plugin
+} // namespace simgrid
using simgrid::plugin::HostLoad;
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;
simgrid::simix::simcall(std::bind(&LinkEnergy::update, this));
return this->totalEnergy_;
}
-}
-}
+} // namespace plugin
+} // namespace simgrid
using simgrid::plugin::LinkEnergy;
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
)
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