xbt_dynar_push(model_list, &surf_network_model);
xbt_cfg_set_string(_surf_cfg_set, "routing", "none");
- routing_model_create(sizeof(double), NULL, netcste_get_link_latency);
+ routing_model_create(sizeof(double), NULL);
}
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);
+ SURF_LINK_FATPIPE, NULL));
im_net_modified_set =
xbt_swag_new(xbt_swag_offset(comm, action_list_hookup));
}
xbt_dynar_t last_route;
};
-XBT_PUBLIC(void) routing_model_create(size_t size_of_link, void *loopback, double_f_cpvoid_t get_link_latency_fun);
+XBT_PUBLIC(void) routing_model_create(size_t size_of_link, void *loopback);
XBT_PUBLIC(void) routing_register_callbacks(void);
/**
static const char *dst = NULL; /* temporary store the destination name of a route */
static char *gw_src = NULL; /* temporary store the gateway source name of a route */
static char *gw_dst = NULL; /* temporary store the gateway destination name of a route */
-static double_f_cpvoid_t get_link_latency = NULL;
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf");
*
* Make a global routing structure and set all the parsing functions.
*/
-void routing_model_create(size_t size_of_links, void *loopback,
- double_f_cpvoid_t get_link_latency_fun)
+void routing_model_create(size_t size_of_links, void *loopback)
{
/* config the uniq global routing */
global_routing = xbt_new0(s_routing_global_t, 1);
global_routing->loopback = loopback;
global_routing->size_of_link = size_of_links;
global_routing->last_route = NULL;
- get_link_latency = get_link_latency_fun;
/* no current routing at moment */
current_routing = NULL;
}
route = route ? route : rc->get_route(rc, src, dst);
xbt_dynar_foreach(route->generic_route.link_list, i, link) {
- latency += get_link_latency(link);
+ latency += surf_network_model->extension.network.get_link_latency(link);
}
if (need_to_clean)
generic_free_extended_route(route);