Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[java] Sync code generation with generated source code
[simgrid.git] / src / surf / surf_routing.cpp
index 97fa809..a80a7f6 100644 (file)
@@ -110,7 +110,7 @@ struct s_model_type routing_models[] = {
 /**
  * \brief Add a "host_link" to the network element list
  */
-static void parse_S_host_link(sg_platf_host_link_cbarg_t host)
+static void parse_S_host(sg_platf_host_link_cbarg_t host)
 {
   RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
   xbt_assert(info, "Host '%s' not found!", host->id);
@@ -140,8 +140,11 @@ static void parse_S_host_link(sg_platf_host_link_cbarg_t host)
 /**
  * \brief Add a "host" to the network element list
  */
-static void parse_S_host(sg_platf_host_cbarg_t host)
+void routing_parse_init(sg_platf_host_cbarg_t host)
 {
+  if (! current_routing)
+    return;
+
   if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
     current_routing->p_hierarchy = SURF_ROUTING_BASE;
   xbt_assert(!sg_host_by_name(host->id),
@@ -1273,9 +1276,8 @@ static void check_disk_attachment()
 
 void routing_register_callbacks()
 {
-  sg_platf_host_add_cb(parse_S_host);
   sg_platf_router_add_cb(parse_S_router);
-  sg_platf_host_link_add_cb(parse_S_host_link);
+  sg_platf_host_link_add_cb(parse_S_host);
   sg_platf_route_add_cb(parse_E_route);
   sg_platf_ASroute_add_cb(parse_E_ASroute);
   sg_platf_bypassRoute_add_cb(parse_E_bypassRoute);