Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
using correct variables name when getting route from global_routing
[simgrid.git] / src / surf / network.c
index 7a3c23a..262dacc 100644 (file)
@@ -255,6 +255,10 @@ static int net_action_unref(surf_action_t action)
     if (((surf_action_network_CM02_t) action)->variable)
       lmm_variable_free(network_maxmin_system,
                         ((surf_action_network_CM02_t) action)->variable);
+#ifdef HAVE_TRACING
+    xbt_free (((surf_action_network_CM02_t)action)->src_name);
+    xbt_free (((surf_action_network_CM02_t)action)->dst_name);
+#endif
     free(action);
     return 1;
   }
@@ -338,7 +342,7 @@ static void net_update_actions_state(double now, double delta)
                                    action->weight);
     }
 #ifdef HAVE_TRACING
-    xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
+    xbt_dynar_t route = global_routing->get_route(action->src_name, action->dst_name);
     link_CM02_t link;
     unsigned int i;
     xbt_dynar_foreach(route, i, link) {
@@ -473,7 +477,7 @@ static void net_update_resource_state(void *id,
 
 
 static surf_action_t net_communicate(const char *src_name, const char *dst_name,
-                                 int src, int dst, double size, double rate)
+                                 double size, double rate)
 {
   unsigned int i;
   link_CM02_t link;
@@ -483,14 +487,15 @@ 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 = 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 = global_routing->get_route(src_name, dst_name);
   }
-
+  
   /* LARGE PLATFORMS HACK:
      total_route_size = route_size + src->link_nb + dst->nb */
 
@@ -582,9 +587,13 @@ static surf_action_t net_communicate(const char *src_name, const char *dst_name,
   }  /* LARGE PLATFORMS HACK:
      expand also with src->link and dst->link */
 
-  /* saving the src and dst of this communication */
-  action->src = src;
-  action->dst = dst;
+#ifdef HAVE_TRACING
+  action->src_name = xbt_new (char, strlen(src_name)+1);
+  strncpy (action->src_name, src_name, strlen(src_name)+1);
+
+  action->dst_name = xbt_new (char, strlen(dst_name)+1);
+  strncpy (action->dst_name, dst_name, strlen(dst_name)+1);
+#endif
 
   XBT_OUT;
 
@@ -635,8 +644,9 @@ static void net_finalize(void)
 {
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
-
-  used_routing->finalize();
+  
+  global_routing->finalize();
+  
   lmm_system_free(network_maxmin_system);
   network_maxmin_system = NULL;
 }