From: Augustin Degomme Date: Thu, 27 Sep 2012 10:21:42 +0000 (+0200) Subject: yet another correction for those factors, hope this is the last one .. X-Git-Tag: v3_8~146^2~9 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/de828201207665c7bc43eb15c72d21d1fd609d68 yet another correction for those factors, hope this is the last one .. --- diff --git a/src/surf/network.c b/src/surf/network.c index 5bc5bab36f..f6b356c863 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -122,12 +122,13 @@ static double smpi_bandwidth_factor(double size) unsigned int iter = 0; s_smpi_factor_t fact; - + double current=1.0; xbt_dynar_foreach(smpi_bw_factor, iter, fact) { - if (size < fact.factor) { - XBT_DEBUG("%lf < %ld return %f", size, fact.factor, fact.value); - return fact.value; - } + if (size <= fact.factor) { + XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current); + return current; + }else + current=fact.value; } return 1.0; @@ -141,13 +142,13 @@ static double smpi_latency_factor(double size) unsigned int iter = 0; s_smpi_factor_t fact; - + double current=1.0; xbt_dynar_foreach(smpi_lat_factor, iter, fact) { - if (size < fact.factor) { - XBT_DEBUG("%lf < %ld return %f", size, fact.factor, fact.value); - return fact.value; - } - + if (size <= fact.factor) { + XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current); + return current; + }else + current=fact.value; } return 1.0;