A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the lazy management improvement for network models.
[simgrid.git]
/
src
/
surf
/
surf_routing.c
diff --git
a/src/surf/surf_routing.c
b/src/surf/surf_routing.c
index
6d6bec9
..
e675518
100644
(file)
--- a/
src/surf/surf_routing.c
+++ b/
src/surf/surf_routing.c
@@
-1864,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;
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;
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),
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),
@@
-1876,6
+1877,7
@@
static void route_new_dijkstra(routing_component_dijkstra_t rc, int src_id,
(char *) (&dst_id),
sizeof(int));
(char *) (&dst_id),
sizeof(int));
+
if (src_elm)
src = src_elm->node;
if (src_elm)
src = src_elm->node;
@@
-2224,11
+2226,13
@@
static void model_dijkstra_both_end(void)
xbt_dynar_t nodes = NULL;
/* Create the topology graph */
xbt_dynar_t nodes = NULL;
/* Create the topology graph */
+ if(!routing->route_graph)
routing->route_graph = xbt_graph_new_graph(1, NULL);
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->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)
/* Add the loopback if needed */
if (current_routing->hierarchy == SURF_ROUTING_BASE)
@@
-2251,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);
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();
if (routing->cached && !routing->route_cache)
routing->route_cache = xbt_dict_new();