From: velho Date: Thu, 16 Oct 2008 14:32:14 +0000 (+0000) Subject: Add a new weight field to actions so that we do not confuse it anymore with the late_... X-Git-Tag: v3.3~124 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/07930b7886980658833dea585b12935bb31de8de?ds=sidebyside Add a new weight field to actions so that we do not confuse it anymore with the late_current field. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5997 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/network.c b/src/surf/network.c index 7f207d0d23..e5f8a1f5e5 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -21,7 +21,6 @@ xbt_dict_t network_card_set = NULL; double latency_factor = 1.0; /* default value */ double bandwidth_factor = 1.0; /* default value */ - int card_number = 0; int host_number = 0; link_CM02_t **routing_table = NULL; @@ -404,7 +403,7 @@ static void update_actions_state(double now, double delta) } if ((action->latency == 0.0) && !(action->suspended)) lmm_update_variable_weight(network_maxmin_system, action->variable, - action->lat_current); + action->weight); } double_update(&(action->generic_action.remains), lmm_variable_getvalue(action->variable) * deltap); @@ -449,6 +448,7 @@ static void update_resource_state(void *id, (network_maxmin_system, nw_link->constraint, &elem))) { action = lmm_variable_id(var); action->lat_current += delta; + action->weight += delta; if (action->rate < 0) lmm_update_variable_bound(network_maxmin_system, action->variable, SG_TCP_CTE_GAMMA / (2.0 * @@ -462,7 +462,7 @@ static void update_resource_state(void *id, lat_current))); if (!(action->suspended)) lmm_update_variable_weight(network_maxmin_system, action->variable, - action->lat_current); + action->weight); } } else if (event_type == nw_link->state_event) { @@ -545,6 +545,7 @@ static surf_action_t communicate(void *src, void *dst, double size, /* LARGE PLATFORMS HACK: Add src->link and dst->link latencies */ action->lat_current = action->latency; + action->weight = action->latency; action->latency *= latency_factor; @@ -645,7 +646,7 @@ static void action_resume(surf_action_t action) ((surf_action_network_CM02_t) action)-> variable, ((surf_action_network_CM02_t) action)-> - lat_current); + weight); ((surf_action_network_CM02_t) action)->suspended = 0; } } diff --git a/src/surf/network_private.h b/src/surf/network_private.h index 2d84d82e2b..b22d08a1fe 100644 --- a/src/surf/network_private.h +++ b/src/surf/network_private.h @@ -38,6 +38,7 @@ typedef struct surf_action_network_CM02 { s_surf_action_t generic_action; double latency; double lat_current; + double weight; lmm_variable_t variable; double rate; int suspended;