From: Christophe ThiƩry Date: Tue, 29 Nov 2011 13:39:17 +0000 (+0100) Subject: Revert "The latency is constant with the constant network model." X-Git-Tag: exp_20120216~241^2~33 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cac608fff2de795994fa9ca839bca1e1a436dc6a?ds=inline Revert "The latency is constant with the constant network model." Because actually, it's not. This reverts commit 123eb94b4e6a8db258c498d38ac1b21656f0f840. --- diff --git a/src/surf/network_constant.c b/src/surf/network_constant.c index 75f0634cea..4d2fd380e3 100644 --- a/src/surf/network_constant.c +++ b/src/surf/network_constant.c @@ -52,10 +52,21 @@ static void netcste_action_cancel(surf_action_t action) static double netcste_share_resources(double now) { - if (!xbt_swag_size(surf_network_model->states.running_action_set)) { - return -1.0; + surf_action_network_Constant_t action = NULL; + xbt_swag_t running_actions = + surf_network_model->states.running_action_set; + double min = -1.0; + + xbt_swag_foreach(action, running_actions) { + if (action->latency > 0) { + if (min < 0) + min = action->latency; + else if (action->latency < min) + min = action->latency; + } } - return sg_latency_factor; + + return min; } static void netcste_update_actions_state(double now, double delta)