Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Call surf_parse_models_setup() from the right level
[simgrid.git] / src / surf / surf_routing.c
index e5e66a0..007a2cc 100644 (file)
@@ -429,6 +429,9 @@ void routing_AS_init(const char *AS_id, const char *wanted_routing_type)
   routing_component_t new_routing;
   model_type_t model = NULL;
   int cpt;
+
+  surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag and before the first <AS>-like */
+
   /* search the routing model */
   for (cpt = 0; routing_models[cpt].name; cpt++)
     if (!strcmp(wanted_routing_type, routing_models[cpt].name))
@@ -487,15 +490,6 @@ void routing_AS_init(const char *AS_id, const char *wanted_routing_type)
   current_routing = new_routing;
 }
 
-/*
- * Detect the routing model type of the routing component from XML platforms
- */
-static void parse_S_AS(void)
-{
-  routing_AS_init(A_surfxml_AS_id, A_surfxml_AS_routing);
-}
-
-
 /**
  * \brief Finish the creation of a new routing component
  *
@@ -524,14 +518,6 @@ void routing_AS_end(const char *AS_id)
   }
 }
 
-/*
- * \brief Finish the creation of a new routing component from XML
- */
-static void parse_E_AS(void)
-{
-  routing_AS_end(A_surfxml_AS_id);
-}
-
 /* Aux Business methods */
 
 /**
@@ -991,9 +977,6 @@ void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_
   surfxml_add_callback(ETag_surfxml_bypassRoute_cb_list,
                        &parse_E_bypassRoute_store_route);
 
-  surfxml_add_callback(STag_surfxml_AS_cb_list, &parse_S_AS);
-  surfxml_add_callback(ETag_surfxml_AS_cb_list, &parse_E_AS);
-
   surfxml_add_callback(STag_surfxml_cluster_cb_list,
                        &routing_parse_Scluster);