&im_constant_bandwidth_constraint;
-static link_CM02_im_t im_net_link_new(char *name,
+static void* im_net_create_resource(char *name,
double bw_initial,
tmgr_trace_t bw_trace,
double lat_initial,
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)
if(policy_initial_link == SURF_LINK_FULLDUPLEX)
{
- im_net_link_new(bprintf("%s_UP",name_link), bw_initial, bw_trace,
+ im_net_create_resource(bprintf("%s_UP",name_link), bw_initial, bw_trace,
lat_initial, lat_trace, state_initial_link, state_trace,
policy_initial_link, xbt_dict_new());
- im_net_link_new(bprintf("%s_DOWN",name_link), bw_initial, bw_trace,
+ im_net_create_resource(bprintf("%s_DOWN",name_link), bw_initial, bw_trace,
lat_initial, lat_trace, state_initial_link, state_trace,
policy_initial_link, xbt_dict_new());
}
else
{
- im_net_link_new(name_link, bw_initial, bw_trace,
+ im_net_create_resource(name_link, bw_initial, bw_trace,
lat_initial, lat_trace, state_initial_link, state_trace,
policy_initial_link, xbt_dict_new());
}
}
-static void im_net_create_resource(char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- e_surf_resource_state_t
- state_initial,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy,
- xbt_dict_t properties)
-{
- im_net_link_new(name, bw_initial, bw_trace,
- lat_initial, lat_trace, state_initial, state_trace,
- policy, xbt_dict_new());
-}
-
static void im_net_add_traces(void)
{
xbt_dict_cursor_t cursor = NULL;
link_CM02_im_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_im_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_im_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);
XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
/* LARGE PLATFORMS HACK:
assert on total_route_size */
- xbt_assert2(xbt_dynar_length(route),
+ xbt_assert(xbt_dynar_length(route),
"You're trying to send data from %s to %s but there is no connection 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);
static void im_surf_network_model_init_internal(void)
{
s_surf_action_network_CM02_im_t comm;
- XBT_INFO("You are using the UNSAFE lazy management optimization, I hope you know what you are doing.");
- XBT_INFO("====> For now this optimization is only available for LV08_im network model.");
surf_network_model = surf_model_init();
xbt_heap_set_update_callback(im_net_action_heap, im_net_action_update_index_heap);
- routing_model_create(sizeof(link_CM02_im_t), im_net_link_new(xbt_strdup("__loopback__"),
- 498000000, NULL, 0.000015, NULL,
- SURF_RESOURCE_ON, NULL,
- SURF_LINK_FATPIPE, NULL),
- im_net_get_link_latency);
+ routing_model_create(sizeof(link_CM02_im_t),
+ im_net_create_resource(xbt_strdup("__loopback__"),
+ 498000000, NULL, 0.000015, NULL,
+ SURF_RESOURCE_ON, NULL,
+ SURF_LINK_FATPIPE, NULL),
+ im_net_get_link_latency);
im_net_modified_set =
xbt_swag_new(xbt_swag_offset(comm, action_list_hookup));
keep_track = im_net_modified_set;
xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
update_model_description(surf_network_model_description,
- "LV08_im", surf_network_model);
+ "LV08", surf_network_model);
}