From aaa70a4e410281b60c6566cc54066a1dfadc449d Mon Sep 17 00:00:00 2001 From: alegrand Date: Fri, 21 Apr 2006 07:55:21 +0000 Subject: [PATCH] Fix the weight problem raised by Kayo and confirmed by Loris. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2164 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/surf/network.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/surf/network.c b/src/surf/network.c index 771b7cdd0f..738a096980 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -377,6 +377,9 @@ static void update_resource_state(void *id, else lmm_update_variable_bound(maxmin_system, action->variable, min(action->rate,SG_TCP_CTE_GAMMA / (2.0 * action->lat_current))); + if(!(action->suspended)) + lmm_update_variable_weight(maxmin_system, action->variable, + action->lat_current); } } else if (event_type == nw_link->state_event) { if (value > 0) @@ -464,7 +467,8 @@ static void action_suspend(surf_action_t action) static void action_resume(surf_action_t action) { lmm_update_variable_weight(maxmin_system, - ((surf_action_network_CM02_t) action)->variable, 1.0); + ((surf_action_network_CM02_t) action)->variable, + action->lat_current); ((surf_action_network_CM02_t) action)->suspended = 0; } -- 2.20.1