X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7bc340a73928fe73a57a9664aeba0cf5a92b654c..67bdf5427542ebb33da6978c6ae422a763ea0ab3:/src/surf/plugins/host_load.cpp diff --git a/src/surf/plugins/host_load.cpp b/src/surf/plugins/host_load.cpp index 71e8bf0e09..ebe41f4317 100644 --- a/src/surf/plugins/host_load.cpp +++ b/src/surf/plugins/host_load.cpp @@ -76,7 +76,7 @@ void HostLoad::update() double HostLoad::getCurrentLoad() { - return current_flops / (host->getSpeed() * host->getCoreCount()); + return current_flops / static_cast(host->getSpeed() * host->getCoreCount()); } double HostLoad::getAverageLoad() @@ -122,6 +122,9 @@ static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf: for (simgrid::surf::Cpu* const& cpu : action->cpus()) { simgrid::s4u::Host* host = cpu->getHost(); + if (dynamic_cast(host)) // Ignore virtual machines + return; + if (host != nullptr) { // Get the host_load extension for the relevant host HostLoad* host_load = host->extension();