Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill global_routing->get_route_or_null
[simgrid.git] / src / instr / instr_routing.c
index b346c19..f63b722 100644 (file)
@@ -83,11 +83,11 @@ static void linkContainers (container_t father, container_t src, container_t dst
   new_pajeEndLink(SIMIX_get_clock(), father, link_type, dst, "G", key);
 }
 
-static void recursiveGraphExtraction (routing_component_t rc, container_t container, xbt_dict_t filter)
+static void recursiveGraphExtraction (AS_t rc, container_t container, xbt_dict_t filter)
 {
   if (xbt_dict_length (rc->routing_sons)){
     xbt_dict_cursor_t cursor = NULL;
-    routing_component_t rc_son;
+    AS_t rc_son;
     char *child_name;
     //bottom-up recursion
     xbt_dict_foreach(rc->routing_sons, cursor, child_name, rc_son) {
@@ -110,7 +110,13 @@ static void recursiveGraphExtraction (routing_component_t rc, container_t contai
           strcmp (child1_name, child2_name) != 0){
 
         xbt_dynar_t route = NULL;
-        route = global_routing->get_route_or_null (child1_name, child2_name);
+        xbt_ex_t e;
+
+        TRY {
+          route = routing_get_route(child1_name, child2_name);
+        } CATCH(e) {
+          xbt_ex_free(e);
+        }
         if (route == NULL) continue;
 
         if (TRACE_onelink_only()){
@@ -288,8 +294,8 @@ void instr_routing_define_callbacks ()
   if (!TRACE_is_enabled()) return;
   //always need the call backs to ASes (we need only the root AS),
   //to create the rootContainer and the rootType properly
-  sg_platf_ASopen_add_cb(instr_routing_parse_start_AS);
-  sg_platf_ASclose_add_cb(instr_routing_parse_end_AS);
+  sg_platf_AS_begin_add_cb(instr_routing_parse_start_AS);
+  sg_platf_AS_end_add_cb(instr_routing_parse_end_AS);
   if (!TRACE_needs_platform()) return;
   sg_platf_link_add_cb(instr_routing_parse_start_link);
   sg_platf_host_add_cb(instr_routing_parse_start_host);
@@ -386,11 +392,11 @@ static xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_
 }
 
 static void recursiveXBTGraphExtraction (xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges,
-    routing_component_t rc, container_t container)
+    AS_t rc, container_t container)
 {
   if (xbt_dict_length (rc->routing_sons)){
     xbt_dict_cursor_t cursor = NULL;
-    routing_component_t rc_son;
+    AS_t rc_son;
     char *child_name;
     //bottom-up recursion
     xbt_dict_foreach(rc->routing_sons, cursor, child_name, rc_son) {
@@ -412,7 +418,7 @@ static void recursiveXBTGraphExtraction (xbt_graph_t graph, xbt_dict_t nodes, xb
           (child2->kind == INSTR_HOST  || child2->kind == INSTR_ROUTER) &&
           strcmp (child1_name, child2_name) != 0){
 
-        xbt_dynar_t route = global_routing->get_route (child1_name, child2_name);
+        xbt_dynar_t route = routing_get_route (child1_name, child2_name);
         if (TRACE_onelink_only()){
           if (xbt_dynar_length (route) > 1) continue;
         }