Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move the callbacks to the cluster creation from surfxml_parse to sg_platf
[simgrid.git] / src / surf / network.c
index e3bd03a..7ef0533 100644 (file)
@@ -413,8 +413,7 @@ static void net_update_actions_state(double now, double delta)
     }
 #ifdef HAVE_TRACING
     if (TRACE_is_enabled()) {
-      xbt_dynar_t route = global_routing->get_route(action->src_name,
-                                                    action->dst_name);
+      xbt_dynar_t route = routing_get_route(action->src_name, action->dst_name);
       link_CM02_t link;
       unsigned int i;
       xbt_dynar_foreach(route, i, link) {
@@ -590,7 +589,7 @@ static surf_action_t net_communicate(const char *src_name,
   global_routing->get_route_latency(src_name, dst_name, &route, &latency, 0);
 
   if (sg_network_fullduplex == 1) {
-    back_route = global_routing->get_route(dst_name, src_name);
+    back_route = routing_get_route(dst_name, src_name);
   }
 
   /* LARGE PLATFORMS HACK:
@@ -628,21 +627,21 @@ static surf_action_t net_communicate(const char *src_name,
         (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
     if (bandwidth_bound < 0.0)
       bandwidth_bound =
-          (*bandwidth_factor_callback) (size) *
+          bandwidth_factor_callback(size) *
           (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
     else
       bandwidth_bound =
           min(bandwidth_bound,
-              (*bandwidth_factor_callback) (size) *
+              bandwidth_factor_callback(size) *
               (link->lmm_resource.power.peak *
                link->lmm_resource.power.scale));
   }
   /* LARGE PLATFORMS HACK:
      Add src->link and dst->link latencies */
   action->lat_current = action->latency;
-  action->latency *= (*latency_factor_callback) (size);
+  action->latency *= latency_factor_callback(size);
   action->rate =
-      (*bandwidth_constraint_callback) (action->rate, bandwidth_bound,
+      bandwidth_constraint_callback(action->rate, bandwidth_bound,
                                         size);
 
   if(xbt_dynar_length(route) > 0) {
@@ -723,7 +722,7 @@ static surf_action_t net_communicate(const char *src_name,
 
 static xbt_dynar_t net_get_route(const char *src, const char *dst)
 {
-  return global_routing->get_route(src, dst);
+  return routing_get_route(src, dst);
 }
 
 static double net_get_link_bandwidth(const void *link)
@@ -785,8 +784,6 @@ static void net_finalize(void)
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
 
-  global_routing->finalize();
-
   lmm_system_free(network_maxmin_system);
   network_maxmin_system = NULL;
 }