A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[DVFS] Fix the update() method.
[simgrid.git]
/
src
/
surf
/
plugins
/
host_load.cpp
diff --git
a/src/surf/plugins/host_load.cpp
b/src/surf/plugins/host_load.cpp
index
8e3dd94
..
82668bd
100644
(file)
--- 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);
}
}