Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] if route doesn't exist, just continue extracing the topology
[simgrid.git] / src / instr / instr_routing.c
index 4dc65be..f77a341 100644 (file)
@@ -109,7 +109,10 @@ static void recursiveGraphExtraction (routing_component_t rc, container_t contai
           (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 = NULL;
+        route = global_routing->get_route_or_null (child1_name, child2_name);
+        if (route == NULL) continue;
+
         if (TRACE_onelink_only()){
           if (xbt_dynar_length (route) > 1) continue;
         }
@@ -209,10 +212,12 @@ static void instr_routing_parse_start_link ()
 
     container_t new = newContainer (link_name, INSTR_LINK, father);
 
-    type_t bandwidth = getVariableType ("bandwidth", NULL, new->type);
-    type_t latency = getVariableType ("latency", NULL, new->type);
-    new_pajeSetVariable (0, new, bandwidth, bandwidth_value);
-    new_pajeSetVariable (0, new, latency, latency_value);
+    if (TRACE_categorized() || TRACE_uncategorized()){
+      type_t bandwidth = getVariableType ("bandwidth", NULL, new->type);
+      type_t latency = getVariableType ("latency", NULL, new->type);
+      new_pajeSetVariable (0, new, bandwidth, bandwidth_value);
+      new_pajeSetVariable (0, new, latency, latency_value);
+    }
     if (TRACE_uncategorized()){
       getVariableType ("bandwidth_used", "0.5 0.5 0.5", new->type);
     }
@@ -230,18 +235,18 @@ static void instr_routing_parse_start_host ()
   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
   container_t new = newContainer (A_surfxml_host_id, INSTR_HOST, father);
 
-  type_t power = getVariableType ("power", NULL, new->type);
-  new_pajeSetVariable (0, new, power, atof(A_surfxml_host_power));
+  if (TRACE_categorized() || TRACE_uncategorized()) {
+    type_t power = getVariableType ("power", NULL, new->type);
+    new_pajeSetVariable (0, new, power, atof(A_surfxml_host_power));
+  }
   if (TRACE_uncategorized()){
     getVariableType ("power_used", "0.5 0.5 0.5", new->type);
   }
 
-  if (TRACE_smpi_is_enabled()) {
-    if (TRACE_smpi_is_grouped()){
-      type_t mpi = getContainerType("MPI", new->type);
-      getStateType ("MPI_STATE", mpi);
-      getLinkType ("MPI_LINK", getRootType(), mpi, mpi);
-    }
+  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
+    type_t mpi = getContainerType("MPI", new->type);
+    getStateType ("MPI_STATE", mpi);
+    getLinkType ("MPI_LINK", getRootType(), mpi, mpi);
   }
 
   if (TRACE_msg_process_is_enabled()) {