X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/46c7981905414e7342d681be4f10709f8ef4009e..448fecf60f1328e50f3035b738d7b9b3c0dbb0bc:/src/surf/network.c diff --git a/src/surf/network.c b/src/surf/network.c index 5c61ee9157..8c0b232019 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -103,40 +103,61 @@ static double constant_bandwidth_constraint(double rate, double bound, return rate; } -/**********************/ -/* SMPI callbacks */ -/**********************/ -static double smpi_latency_factor(double size) +/** + *------------------ ---------------------- + * + * produced by: ./calibrate_piecewise.py griffon_skampi_pt2pt.ski.dat 2 2.4e-5 1.25e8 1536 65536 + * + *--------------------------------------------------------------------------------------- + **/ +static double smpi_bandwidth_factor(double size) { - /* 1 B <= size <= 1 KiB */ - if (size <= 1024.0) { - return 1.0056; - } - - /* 2 KiB <= size <= 32 KiB */ - if (size <= 32768.0) { - return 1.8805; - } - - /* 64 KiB <= size <= 4 MiB */ - return 22.7111; + /* case 0.0 KiB <= size <= 1.5 KiB */ + if (1 <= size && size <= 1536) + return(0.193137361131); + /* case 2.0 KiB <= size <= 64.0 KiB */ + if (2048 <= size && size <= 65536) + return(0.584680317461); + /* case 65.0 KiB <= size */ + if (66560 <= size) + return(0.933246215769); + + /* ..:: inter-segment corrections ::.. */ + + /* case 1.5 KiB < size < 2.0 KiB */ + if (1536 < size && size < 2048) + return(0.765607476636); + /* case 64.0 KiB < size < 65.0 KiB */ + if (65536 < size && size < 66560) + return(1.24121212121); } -static double smpi_bandwidth_factor(double size) +static double smpi_latency_factor(double size) { - /* 1 B <= size <= 1 KiB */ - if (size <= 1024.0) { - return 0.2758; - } + /* case 0.0 KiB <= size <= 1.5 KiB */ + if (1 <= size && size <= 1536) + return(1.15019564848); + /* case 2.0 KiB <= size <= 64.0 KiB */ + if (2048 <= size && size <= 65536) + return(1.80598448863); + /* case 65.0 KiB <= size <= 8192.0 KiB */ + if (66560 <= size) + return(14.6187359323); + + /* ..:: inter-segment corrections ::.. */ + + /* case 1.5 KiB < size < 2.0 KiB */ + if (1536 < size && size < 2048) + return(2.1375); + /* case 64.0 KiB < size < 65.0 KiB */ + if (65536 < size && size < 66560) + return(14.6375); +} - /* 2 KiB <= size <= 32 KiB */ - if (size <= 32768.0) { - return 0.5477; - } +/** + *------------------ --------------------- + **/ - /* 64 KiB <= size <= 4 MiB */ - return 0.9359; -} static double smpi_bandwidth_constraint(double rate, double bound, double size) @@ -437,7 +458,7 @@ static void net_update_actions_state(double now, double delta) action->weight); } #ifdef HAVE_TRACING - if (TRACE_is_active()) { + if (TRACE_is_enabled()) { xbt_dynar_t route = global_routing->get_route(action->src_name, action->dst_name); link_CM02_t link; @@ -610,9 +631,9 @@ static surf_action_t net_communicate(const char *src_name, xbt_dynar_t back_route = NULL; int constraints_per_variable = 0; - // I will need this route for some time so let's call get_route_no_cleanup - xbt_dynar_t route = global_routing->get_route_no_cleanup(src_name, dst_name); - + xbt_dynar_t route; + // I will need this route for some time so require for no cleanup + global_routing->get_route_latency(src_name, dst_name, &route, &latency, 0); if (sg_network_fullduplex == 1) { back_route = global_routing->get_route(dst_name, src_name); @@ -624,7 +645,6 @@ static surf_action_t net_communicate(const char *src_name, XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate); /* LARGE PLATFORMS HACK: assert on total_route_size */ - latency = global_routing->get_latency(src_name,dst_name); xbt_assert(xbt_dynar_length(route) || latency, "You're trying to send data from %s to %s but there is no connection at all between these two hosts.", src_name, dst_name); @@ -733,9 +753,12 @@ static surf_action_t net_communicate(const char *src_name, /* LARGE PLATFORMS HACK: expand also with src->link and dst->link */ #ifdef HAVE_TRACING - action->src_name = xbt_strdup(src_name); - - action->dst_name = xbt_strdup(dst_name); + if (TRACE_is_enabled()) { + action->src_name = xbt_strdup(src_name); + action->dst_name = xbt_strdup(dst_name); + } else { + action->src_name = action->dst_name = NULL; + } #endif xbt_dynar_free(&route);