Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I comment all the calls to used_routing, in order to use global routing.
[simgrid.git] / src / surf / network.c
index 4827178..88232f0 100644 (file)
@@ -324,17 +324,17 @@ static void net_update_actions_state(double now, double delta)
    */
 
   xbt_swag_foreach_safe(action, next_action, running_actions) {
-
 #ifdef HAVE_TRACING
-    xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
-    link_CM02_t link;
-    unsigned int i;
-    xbt_dynar_foreach(route, i, link) {
-       TRACE_surf_link_set_utilization (link->lmm_resource.generic_resource.name,
-          action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
-    }
+// COMMENTED BY DAVID
+//     xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
+//     
+//     link_CM02_t link;
+//     unsigned int i;
+//     xbt_dynar_foreach(route, i, link) {
+//             TRACE_surf_link_set_utilization (link->lmm_resource.generic_resource.name,
+//           action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
+//     }
 #endif
-
     deltap = delta;
     if (action->latency > 0) {
       if (action->latency > deltap) {
@@ -348,6 +348,15 @@ static void net_update_actions_state(double now, double delta)
         lmm_update_variable_weight(network_maxmin_system, action->variable,
                                    action->weight);
     }
+#ifdef HAVE_TRACING
+    xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
+    link_CM02_t link;
+    unsigned int i;
+    xbt_dynar_foreach(route, i, link) {
+      TRACE_surf_link_set_utilization (link->lmm_resource.generic_resource.name,
+          action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
+    }
+#endif
     double_update(&(action->generic_action.remains),
                   lmm_variable_getvalue(action->variable) * deltap);
     if (action->generic_action.max_duration != NO_MAX_DURATION)
@@ -485,14 +494,17 @@ static surf_action_t net_communicate(const char *src_name, const char *dst_name,
   /* LARGE PLATFORMS HACK:
      Add a link_CM02_t *link and a int link_nb to network_card_CM02_t. It will represent local links for this node
      Use the cluster_id for ->id */
-  xbt_dynar_t route = used_routing->get_route(src, dst);
+
+  //xbt_dynar_t route = used_routing->get_route(src, dst);  // COMMENTED BY DAVID
+  xbt_dynar_t route = global_routing->get_route(src_name, dst_name);
   xbt_dynar_t back_route = NULL;
   int constraints_per_variable = 0;
 
   if( sg_network_fullduplex == 1){
-         back_route = used_routing->get_route(dst, src);
+         //back_route = used_routing->get_route(dst, src);  // COMMENTED BY DAVID
+         back_route = global_routing->get_route(src_name, dst_name);
   }
-
+  
   /* LARGE PLATFORMS HACK:
      total_route_size = route_size + src->link_nb + dst->nb */
 
@@ -638,7 +650,10 @@ static void net_finalize(void)
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
 
-  used_routing->finalize();
+  //used_routing->finalize(); // COMMENTED BY DAVID
+  
+  global_routing->finalize();
+  
   lmm_system_free(network_maxmin_system);
   network_maxmin_system = NULL;
 }