X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5e472a6023eb14e7396b16fa4eb47c805d8f4acf..556b75727b8870fed020d2d884b54a426be1d388:/src/surf/plugins/host_energy.cpp diff --git a/src/surf/plugins/host_energy.cpp b/src/surf/plugins/host_energy.cpp index bc636d3149..380a8713f1 100644 --- a/src/surf/plugins/host_energy.cpp +++ b/src/surf/plugins/host_energy.cpp @@ -66,7 +66,7 @@ the time, and our model holds. ### What if the host has only one core? In this case, the parameters \b OneCore and \b AllCores are obviously the same. -Actually, SimGrid expect an energetic profile formated as 'Idle:Running' for mono-cores hosts. +Actually, SimGrid expect an energetic profile formatted as 'Idle:Running' for mono-cores hosts. If you insist on passing 3 parameters in this case, then you must have the same value for \b OneCore and \b AllCores. \code{.xml} @@ -200,7 +200,7 @@ void HostEnergy::update() double energy_this_step = instantaneous_consumption * (finish_time - start_time); - // TODO Trace: Trace energy_this_step from start_time to finish_time in host->name() + // TODO Trace: Trace energy_this_step from start_time to finish_time in host->getName() this->total_energy = previous_energy + energy_this_step; this->last_updated = finish_time; @@ -310,7 +310,7 @@ void HostEnergy::initWattsRangeList() XBT_DEBUG("%s: profile: %s, cores: %d", host->getCname(), all_power_values_str, host->getCoreCount()); int i = 0; - for (auto current_power_values_str : all_power_values) { + for (auto const& current_power_values_str : all_power_values) { /* retrieve the power values associated with the current pstate */ std::vector current_power_values; boost::split(current_power_values, current_power_values_str, boost::is_any_of(":")); @@ -325,7 +325,7 @@ void HostEnergy::initWattsRangeList() } else { // size == 3 xbt_assert((current_power_values.at(1)) == (current_power_values.at(2)), "Power properties incorrectly defined for host %s.\n" - "The energy profile of mono-cores should be formated as 'Idle:FullSpeed' only.\n" + "The energy profile of mono-cores should be formatted as 'Idle:FullSpeed' only.\n" "If you go for a 'Idle:OneCore:AllCores' power profile on mono-cores, then OneCore and AllCores " "must be equal.", host->getCname()); @@ -363,14 +363,14 @@ static void onCreation(simgrid::s4u::Host& host) if (dynamic_cast(&host)) // Ignore virtual machines return; - //TODO Trace: set to zero the energy variable associated to host->name() + // TODO Trace: set to zero the energy variable associated to host->getName() host.extension_set(new HostEnergy(&host)); } static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf::Action::State previous) { - for (simgrid::surf::Cpu* cpu : action->cpus()) { + for (simgrid::surf::Cpu* const& cpu : action->cpus()) { simgrid::s4u::Host* host = cpu->getHost(); if (host != nullptr) { @@ -432,7 +432,7 @@ static void onSimulationEnd() } /* **************************** Public interface *************************** */ -SG_BEGIN_DECL() +extern "C" { /** \ingroup plugin_energy * \brief Enable host energy plugin @@ -464,7 +464,7 @@ void sg_host_energy_update_all() simgrid::simix::kernelImmediate([]() { std::vector list; simgrid::s4u::Engine::getInstance()->getHostList(&list); - for (auto host : list) + for (auto const& host : list) if (dynamic_cast(host) == nullptr) // Ignore virtual machines host->extension()->update(); }); @@ -513,5 +513,4 @@ double sg_host_get_current_consumption(sg_host_t host) double cpu_load = lmm_constraint_get_usage(host->pimpl_cpu->constraint()) / host->getSpeed(); return host->extension()->getCurrentWattsValue(cpu_load); } - -SG_END_DECL() +}