From 2dba2db9e7afc3db8eb181ae8f85e09a6399d1d5 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 10 Nov 2011 11:18:17 +0100 Subject: [PATCH] what is that pimple, for god's sake?? --- src/surf/network.c | 3 +-- src/surf/network_constant.c | 2 +- src/surf/network_im.c | 3 +-- src/surf/surf_private.h | 2 +- src/surf/surf_routing.c | 7 ++----- src/surf/workstation_ptask_L07.c | 3 +-- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/surf/network.c b/src/surf/network.c index 061b4f3608..e3bd03a974 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -839,8 +839,7 @@ static void surf_network_model_init_internal(void) 498000000, NULL, 0.000015, NULL, SURF_RESOURCE_ON, NULL, - SURF_LINK_FATPIPE, NULL), - net_get_link_latency); + SURF_LINK_FATPIPE, NULL)); } diff --git a/src/surf/network_constant.c b/src/surf/network_constant.c index da086e0d7a..bf3893164b 100644 --- a/src/surf/network_constant.c +++ b/src/surf/network_constant.c @@ -235,5 +235,5 @@ void surf_network_model_init_Constant() 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); } diff --git a/src/surf/network_im.c b/src/surf/network_im.c index aeded8147d..1e29a61b10 100644 --- a/src/surf/network_im.c +++ b/src/surf/network_im.c @@ -873,8 +873,7 @@ static void im_surf_network_model_init_internal(void) 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)); } diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 1c508d9e05..bc442cb964 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -188,7 +188,7 @@ struct s_routing_global { 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); /** diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 20dba8ab68..de758a14e7 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -46,7 +46,6 @@ static const char *src = NULL; /* temporary store the source name of a route */ 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"); @@ -816,8 +815,7 @@ e_surf_network_element_type_t get_network_element_type(const char *name) * * 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); @@ -833,7 +831,6 @@ void routing_model_create(size_t size_of_links, void *loopback, 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; } @@ -956,7 +953,7 @@ double generic_get_link_latency(routing_component_t rc, 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); diff --git a/src/surf/workstation_ptask_L07.c b/src/surf/workstation_ptask_L07.c index 01f6019ae1..82acc84256 100644 --- a/src/surf/workstation_ptask_L07.c +++ b/src/surf/workstation_ptask_L07.c @@ -895,8 +895,7 @@ static void ptask_model_init_internal(void) 498000000, NULL, 0.000015, NULL, SURF_RESOURCE_ON, NULL, - SURF_LINK_FATPIPE, NULL), - ptask_get_link_latency); + SURF_LINK_FATPIPE, NULL)); } -- 2.20.1