xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, nw_link);
-
return nw_link;
}
{
if(link->policy == SURF_LINK_FULLDUPLEX)
{
- im_net_create_resource(bprintf("%s_UP",link->id), link->bandwidth, link->bandwidth_trace,
+ char *name = bprintf("%s_UP",link->id);
+ im_net_create_resource(name, link->bandwidth, link->bandwidth_trace,
link->latency, link->latency_trace, link->state, link->state_trace,
link->policy, link->properties);
- im_net_create_resource(bprintf("%s_DOWN",link->id), link->bandwidth, link->bandwidth_trace,
+ xbt_free(name);
+ name = bprintf("%s_DOWN",link->id);
+ im_net_create_resource(name, link->bandwidth, link->bandwidth_trace,
link->latency, link->latency_trace, link->state, link->state_trace,
link->policy, NULL); // FIXME: We need to deep copy the properties or we won't be able to free it
+ xbt_free(name);
}
else
{
- im_net_create_resource(xbt_strdup(link->id), link->bandwidth, link->bandwidth_trace,
+ im_net_create_resource(link->id, link->bandwidth, link->bandwidth_trace,
link->latency, link->latency_trace, link->state, link->state_trace,
link->policy, link->properties);
}
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);
+ // I need to have the forward and backward routes at the same time, so allocate "route". That way, the routing wont clean it up
+ xbt_dynar_t route=xbt_dynar_new(global_routing->size_of_link,NULL);
+ routing_get_route_and_latency(src_name, dst_name,&route,NULL);
if (sg_network_fullduplex == 1) {
- back_route = global_routing->get_route(dst_name, src_name);
+ routing_get_route_and_latency(dst_name, src_name, &back_route, NULL);
}
/* LARGE PLATFORMS HACK:
(link->lmm_resource.power.peak * link->lmm_resource.power.scale);
if (bandwidth_bound < 0.0)
bandwidth_bound =
- (*im_bandwidth_factor_callback) (size) *
+ im_bandwidth_factor_callback(size) *
(link->lmm_resource.power.peak * link->lmm_resource.power.scale);
else
bandwidth_bound =
min(bandwidth_bound,
- (*im_bandwidth_factor_callback) (size) *
+ im_bandwidth_factor_callback(size) *
(link->lmm_resource.power.peak *
link->lmm_resource.power.scale));
}
/* LARGE PLATFORMS HACK:
Add src->link and dst->link latencies */
action->lat_current = action->latency;
- action->latency *= (*im_latency_factor_callback) (size);
+ action->latency *= im_latency_factor_callback(size);
action->rate =
- (*im_bandwidth_constraint_callback) (action->rate, bandwidth_bound,
+ im_bandwidth_constraint_callback(action->rate, bandwidth_bound,
size);
/* LARGE PLATFORMS HACK:
static xbt_dynar_t im_net_get_route(const char *src, const char *dst)
{
- return global_routing->get_route(src, dst);
+ xbt_dynar_t route=NULL;
+ routing_get_route_and_latency(src, dst,&route,NULL);
+ return route;
}
static double im_net_get_link_bandwidth(const void *link)
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_create_resource(xbt_strdup("__loopback__"),
+ im_net_create_resource("__loopback__",
498000000, NULL, 0.000015, NULL,
SURF_RESOURCE_ON, NULL,
SURF_LINK_FATPIPE, NULL));