X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aaf7f97eaedf1548f3d42497d410f77e273c4423..ea4eb2d3ae5dd567ff62f88b7e61605a94ebff0e:/src/surf/plugins/host_load.cpp diff --git a/src/surf/plugins/host_load.cpp b/src/surf/plugins/host_load.cpp index 8e3dd94986..82668bd172 100644 --- a/src/surf/plugins/host_load.cpp +++ b/src/surf/plugins/host_load.cpp @@ -72,13 +72,21 @@ void HostLoad::update() { double now = surf_get_clock(); if (last_updated < now) { + /* flops == pstate_speed * cores_being_currently_used */ + computed_flops += (now - last_updated) * current_flops; + /* Current flop per second computed by the cpu; current_flops = k * pstate_speed_in_flops, k \in {0, 1, ..., cores} * number of active cores */ current_flops = host->pimpl_cpu->constraint()->get_usage(); - /* flops == pstate_speed * cores_being_currently_used */ - computed_flops += (now - last_updated) * current_flops; - last_updated = now; + if (was_prev_idle) { + idle_time += (now - last_updated); + } + + theor_max_flops += current_speed * host->getCoreCount() * (now - last_updated); + current_speed = host->getSpeed(); + last_updated = now; + was_prev_idle = (current_flops == 0); } }