-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
(model->model_private->maxmin_system,
action->variable, 0));
- double load = lmm_constraint_get_usage(cpu_model->constraint) / cpu_model->power_peak;
- cpu_update_energy(cpu_model, load);
+ if( cpu_model->energy->last_updated < surf_get_clock()) {
+ double load = lmm_constraint_get_usage(cpu_model->constraint) / cpu_model->power_peak;
+ cpu_update_energy(cpu_model, load);
+ }
}
}