X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3d94612c68def9c6d9d1fddb5ab69411a189540e..26ac669d68abd5ccb430266a6a57d1d2201827cf:/src/surf/network.c?ds=sidebyside diff --git a/src/surf/network.c b/src/surf/network.c index 5bc5bab36f..db352085f7 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -118,39 +118,42 @@ static double smpi_bandwidth_factor(double size) { if (!smpi_bw_factor) smpi_bw_factor = - parse_factor(xbt_cfg_get_string(_surf_cfg_set, "smpi/bw_factor")); + parse_factor(surf_cfg_get_string("smpi/bw_factor")); 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; } + XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current); - return 1.0; + return current; } static double smpi_latency_factor(double size) { if (!smpi_lat_factor) smpi_lat_factor = - parse_factor(xbt_cfg_get_string(_surf_cfg_set, "smpi/lat_factor")); + parse_factor(surf_cfg_get_string("smpi/lat_factor")); 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; } + XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current); - return 1.0; + return current; } /**--------- -----------*/ @@ -672,8 +675,8 @@ static void smpi_gap_append(double size, const link_CM02_t link, { const char *src = link->lmm_resource.generic_resource.name; xbt_fifo_t fifo; - surf_action_network_CM02_t last_action; - double bw; + //surf_action_network_CM02_t last_action; + //double bw; if (sg_sender_gap > 0.0) { if (!gap_lookup) { @@ -683,16 +686,16 @@ static void smpi_gap_append(double size, const link_CM02_t link, action->sender.gap = 0.0; if (fifo && xbt_fifo_size(fifo) > 0) { /* Compute gap from last send */ - last_action = + /*last_action = (surf_action_network_CM02_t) - xbt_fifo_get_item_content(xbt_fifo_get_last_item(fifo)); - bw = net_get_link_bandwidth(link); - action->sender.gap = - max(sg_sender_gap,last_action->sender.size / bw); + xbt_fifo_get_item_content(xbt_fifo_get_last_item(fifo));*/ + // bw = net_get_link_bandwidth(link); + action->sender.gap = sg_sender_gap; + /* max(sg_sender_gap,last_action->sender.size / bw);*/ action->latency += action->sender.gap; } /* Append action as last send */ - action->sender.link_name = link->lmm_resource.generic_resource.name; + /*action->sender.link_name = link->lmm_resource.generic_resource.name; fifo = (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup, action->sender.link_name); @@ -700,7 +703,7 @@ static void smpi_gap_append(double size, const link_CM02_t link, fifo = xbt_fifo_new(); xbt_dict_set(gap_lookup, action->sender.link_name, fifo, NULL); } - action->sender.fifo_item = xbt_fifo_push(fifo, action); + action->sender.fifo_item = xbt_fifo_push(fifo, action);*/ action->sender.size = size; } }