From: navarrop Date: Tue, 14 Dec 2010 16:16:34 +0000 (+0000) Subject: Fix problem with get_route in Dijkstra. X-Git-Tag: v3.6_beta2~685 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c8a23ca82002d2dcec32e5dc5e3bc249d2f3b920 Fix problem with get_route in Dijkstra. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9238 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 44a6e90d65..e675518f6f 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -2225,6 +2225,15 @@ static void model_dijkstra_both_end(void) unsigned int cursor2; 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(); + /* Add the loopback if needed */ if (current_routing->hierarchy == SURF_ROUTING_BASE) add_loopback_dijkstra(routing); @@ -2247,7 +2256,7 @@ static void model_dijkstra_both_set_route (routing_component_t rc, const char *s dst_id = xbt_dict_get_or_null(rc->to_index, dst); /* Create the topology graph */ - if(!routing->route_cache) + 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();