return rate;
}
-/**********************/
-/* SMPI callbacks */
-/**********************/
-static double smpi_latency_factor(double size)
+/**
+ *------------------ <copy/paste C code snippet in surf/network.c> ----------------------
+ *
+ * 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;
- }
+/**
+ *------------------ </copy/paste C code snippet in surf/network.c> ---------------------
+ **/
- /* 64 KiB <= size <= 4 MiB */
- return 0.9359;
-}
static double smpi_bandwidth_constraint(double rate, double bound,
double size)
state_initial, state_trace,
bw_initial, bw_trace);
- xbt_assert1(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);
surf_parse_get_double(&lat_initial, A_surfxml_link_latency);
lat_trace = tmgr_trace_new(A_surfxml_link_latency_file);
- xbt_assert0((A_surfxml_link_state == A_surfxml_link_state_ON)
+ xbt_assert((A_surfxml_link_state == A_surfxml_link_state_ON)
|| (A_surfxml_link_state ==
A_surfxml_link_state_OFF), "Invalid state");
if (A_surfxml_link_state == A_surfxml_link_state_ON)
link_CM02_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
link_CM02_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
link_CM02_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
action->weight);
}
#ifdef HAVE_TRACING
- xbt_dynar_t route =
- global_routing->get_route(action->src_name, action->dst_name);
- link_CM02_t link;
- unsigned int i;
- xbt_dynar_foreach(route, i, link) {
- TRACE_surf_link_set_utilization(link->lmm_resource.generic_resource.name,
- action->generic_action.data,
- (surf_action_t) action,
- lmm_variable_getvalue
- (action->variable), now - delta,
- delta);
+ if (TRACE_is_enabled()) {
+ xbt_dynar_t route = global_routing->get_route(action->src_name,
+ action->dst_name);
+ link_CM02_t link;
+ unsigned int i;
+ xbt_dynar_foreach(route, i, link) {
+ TRACE_surf_link_set_utilization(link->lmm_resource.generic_resource.name,
+ action->generic_action.data,
+ (surf_action_t) action,
+ lmm_variable_getvalue
+ (action->variable), now - delta,
+ delta);
+ }
}
#endif
if(!lmm_get_number_of_cnst_from_var(network_maxmin_system, action->variable)) {
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);
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_assert2(xbt_dynar_length(route) || latency,
+ 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);
/* 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);