X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2ba101ad63a69b10c38f0134d76813d56aa33272..e1d9c1d28c6bbf8c0ad26b067f8a67a5a36a7f63:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 1e3ba3d687..4b4858ac1d 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -289,9 +289,6 @@ static void parse_S_router(void) info->rc_type = SURF_NETWORK_ELEMENT_ROUTER; xbt_dict_set(global_routing->where_network_elements, A_surfxml_router_id, (void *) info, xbt_free); -#ifdef HAVE_TRACING - TRACE_surf_host_declaration(A_surfxml_router_id, 0); -#endif if (strcmp(A_surfxml_router_coordinates,"")) { xbt_dynar_t ctn = xbt_str_split_str(A_surfxml_router_coordinates, " "); xbt_dynar_shrink(ctn,0); @@ -1111,6 +1108,10 @@ void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_ &routing_parse_Sconfig); surfxml_add_callback(ETag_surfxml_config_cb_list, &routing_parse_Econfig); + +#ifdef HAVE_TRACING + instr_routing_define_callbacks(); +#endif } /* ************************************************************************** */ @@ -1327,7 +1328,7 @@ static void model_full_set_route(routing_component_t rc, const char *src, (void*)TO_ROUTE_FULL(*src_id, *dst_id)->generic_route.link_list, (void*)link_route_to_test, (int_f_cpvoid_cpvoid_t) surf_pointer_resource_cmp), - "The route between \"%s\" and \"%s\" already exists", src,dst); + "The route between \"%s\" and \"%s\" already exists. If you are trying to define a reverse route, you must set the symmetrical=no attribute to your routes tags.", src,dst); xbt_dynar_free(&link_route_to_test); } else @@ -1863,9 +1864,10 @@ static void route_new_dijkstra(routing_component_dijkstra_t rc, int src_id, int dst_id, route_extended_t e_route) { routing_component_dijkstra_t routing = (routing_component_dijkstra_t) rc; - + DEBUG2("Load Route from \"%d\" to \"%d\"", src_id, dst_id); xbt_node_t src = NULL; xbt_node_t dst = NULL; + graph_node_map_element_t src_elm = (graph_node_map_element_t) xbt_dict_get_or_null_ext(routing->graph_node_map, (char *) (&src_id), @@ -1875,6 +1877,7 @@ static void route_new_dijkstra(routing_component_dijkstra_t rc, int src_id, (char *) (&dst_id), sizeof(int)); + if (src_elm) src = src_elm->node; @@ -2223,11 +2226,13 @@ static void model_dijkstra_both_end(void) xbt_dynar_t nodes = NULL; /* Create the topology graph */ + if(!routing->route_graph) routing->route_graph = xbt_graph_new_graph(1, NULL); + if(!routing->graph_node_map) routing->graph_node_map = xbt_dict_new(); if (routing->cached && !routing->route_cache) - routing->route_cache = xbt_dict_new(); + routing->route_cache = xbt_dict_new(); /* Add the loopback if needed */ if (current_routing->hierarchy == SURF_ROUTING_BASE) @@ -2250,6 +2255,12 @@ static void model_dijkstra_both_set_route (routing_component_t rc, const char *s src_id = xbt_dict_get_or_null(rc->to_index, src); dst_id = xbt_dict_get_or_null(rc->to_index, dst); + /* Create the topology graph */ + if(!routing->route_graph) + routing->route_graph = xbt_graph_new_graph(1, NULL); + if(!routing->graph_node_map) + routing->graph_node_map = xbt_dict_new(); + if (routing->cached && !routing->route_cache) routing->route_cache = xbt_dict_new(); @@ -3266,8 +3277,6 @@ static void routing_parse_Scluster(void) char *cluster_state_file = A_surfxml_cluster_state_file; char *host_id, *groups, *link_id = NULL; char *router_id, *link_router, *link_backbone; - char *host_availability_file = NULL; - char *host_state_file = NULL; char *availability_file = bprintf("%s",cluster_availability_file); char *state_file = bprintf("%s",cluster_state_file); @@ -3615,6 +3624,8 @@ static void routing_parse_Speer(void) char *peer_bw_out = A_surfxml_peer_bw_out; char *peer_lat = A_surfxml_peer_lat; char *peer_coord = A_surfxml_peer_coordinates; + char *peer_state_file = A_surfxml_peer_state_file; + char *peer_availability_file = A_surfxml_peer_availability_file; char *host_id = NULL; char *router_id, *link_router, *link_backbone, *link_id_up, *link_id_down; @@ -3662,8 +3673,8 @@ static void routing_parse_Speer(void) SURFXML_BUFFER_SET(host_id, host_id); SURFXML_BUFFER_SET(host_power, peer_power); SURFXML_BUFFER_SET(host_availability, "1.0"); - SURFXML_BUFFER_SET(host_availability_file, ""); - SURFXML_BUFFER_SET(host_state_file, ""); + SURFXML_BUFFER_SET(host_availability_file, peer_availability_file); + SURFXML_BUFFER_SET(host_state_file, peer_state_file); SURFXML_START_TAG(host); SURFXML_END_TAG(host);