-/* 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
delta = now - action->last_update;
if (action->generic_action.remains > 0) {
- XBT_DEBUG("Updating action(%p): remains was %lf, last_update was: %lf", action, action->generic_action.remains, action->last_update);
+ XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", action, action->generic_action.remains, action->last_update);
double_update(&(action->generic_action.remains),
action->last_value * delta);
now - action->last_update);
}
#endif
- XBT_DEBUG("Updating action(%p): remains is now %lf", action,
+ XBT_DEBUG("Updating action(%p): remains is now %f", action,
action->generic_action.remains);
}
(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);
+ }
}
}