double sg_tcp_gamma = 0.0;
-static void link_free(void *nw_link)
-{
- xbt_dict_free(&(((link_CM02_t) nw_link)->properties));
- surf_resource_free(nw_link);
-}
static link_CM02_t link_new(char *name,
double bw_initial,
nw_link->generic_resource.model = surf_network_model;
nw_link->generic_resource.name = name;
+ current_property_set = nw_link->generic_resource.properties = properties;
nw_link->bw_current = bw_initial;
if (bw_trace)
nw_link->bw_event =
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(nw_link->constraint);
- nw_link->properties = properties;
-
- current_property_set = properties;
-
- xbt_dict_set(surf_network_model->resource_set, name, nw_link, link_free);
+ xbt_dict_set(surf_network_model->resource_set, name, nw_link, surf_resource_free);
return nw_link;
}
"You're trying to send data from %s to %s but there is no connection between these two hosts.",
src_name, dst_name);
- action = xbt_new0(s_surf_action_network_CM02_t, 1);
-
- action->generic_action.refcount = 1;
- action->generic_action.cost = size;
- action->generic_action.remains = size;
- action->generic_action.max_duration = NO_MAX_DURATION;
- action->generic_action.start = surf_get_clock();
- action->generic_action.finish = -1.0;
- action->generic_action.model_type = surf_network_model;
- action->suspended = 0; /* Should be useless because of the
- calloc but it seems to help valgrind... */
- action->generic_action.state_set =
- surf_network_model->states.running_action_set;
-
link_CM02_t link;
+ int failed=0;
xbt_dynar_foreach(route,i,link) {
if (link->state_current == SURF_LINK_OFF) {
- action->generic_action.state_set =
- surf_network_model->states.failed_action_set;
+ failed = 1;
break;
}
}
+ action = surf_action_new(sizeof(s_surf_action_network_CM02_t),size,surf_network_model,failed);
xbt_swag_insert(action, action->generic_action.state_set);
action->rate = rate;
return lmm_constraint_is_shared(((link_CM02_t) link)->constraint);
}
-static xbt_dict_t get_properties(void *link)
-{
- return ((link_CM02_t) link)->properties;
-}
-
static void action_suspend(surf_action_t action)
{
((surf_action_network_CM02_t) action)->suspended = 1;
surf_network_model->extension.network.get_link_latency = get_link_latency;
surf_network_model->extension.network.link_shared = link_shared;
- surf_network_model->get_properties = get_properties;
-
if (!network_maxmin_system)
network_maxmin_system = lmm_system_new();
- routing_model_full_create(sizeof(link_CM02_t),
+ routing_model_create(sizeof(link_CM02_t),
link_new(xbt_strdup("__loopback__"),
498000000, NULL, 0.000015, NULL,
SURF_LINK_ON, NULL, SURF_LINK_FATPIPE, NULL));