X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/152117af2fbcf4c99d0da5d10a6813aac7eee007..b784c77ac5599c578f0ff00d6102222b286b0833:/src/surf/surf_action.c diff --git a/src/surf/surf_action.c b/src/surf/surf_action.c index 4ae277441c..891a70e2bf 100644 --- a/src/surf/surf_action.c +++ b/src/surf/surf_action.c @@ -1,4 +1,4 @@ -/* 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 @@ -382,8 +382,10 @@ void update_resource_energy(surf_model_t model, surf_action_lmm_t action) (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); + } } }