X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d5b29830df70e823202e384a7655e4371193ecd7..a4e7a60bca6c13451f237201eb5a7534e5da0838:/src/surf/plugins/host_load.cpp diff --git a/src/surf/plugins/host_load.cpp b/src/surf/plugins/host_load.cpp index 7005e62e6d..f1e039a858 100644 --- a/src/surf/plugins/host_load.cpp +++ b/src/surf/plugins/host_load.cpp @@ -76,12 +76,12 @@ void HostLoad::update() double HostLoad::getCurrentLoad() { - return current_flops / (host->speed() * host->coreCount()); + return current_flops / (host->getSpeed() * host->getCoreCount()); } double HostLoad::getAverageLoad() { - return getComputedFlops() / (host->speed() * host->coreCount() * (surf_get_clock() - last_reset)); + return getComputedFlops() / (host->getSpeed() * host->getCoreCount() * (surf_get_clock() - last_reset)); } double HostLoad::getComputedFlops() @@ -127,7 +127,7 @@ static void onHostChange(simgrid::s4u::Host& host) /* This callback is called when an action (computation, idle, ...) terminates */ 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) { @@ -139,7 +139,7 @@ static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf: } /* **************************** Public interface *************************** */ -SG_BEGIN_DECL() +extern "C" { /** \ingroup plugin_load * \brief Initializes the HostLoad plugin @@ -185,5 +185,4 @@ void sg_host_load_reset(sg_host_t host) host->extension()->reset(); } - -SG_END_DECL() +}