Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This commit breaks the simgrid-java execution; Revert "Avoid unnecessary loop."
[simgrid.git] / src / surf / surf_routing_generic.c
index c3d6d9a..38cc16d 100644 (file)
@@ -29,8 +29,6 @@ AS_t model_generic_create_sized(size_t childsize) {
   new_component->get_bypass_route =
       generic_get_bypassroute;
   new_component->finalize = model_generic_finalize;
-
-  new_component->nb_index = 0;
   new_component->bypassRoutes = xbt_dict_new_homogeneous((void (*)(void *)) generic_free_route);
 
   return new_component;
@@ -40,20 +38,18 @@ void model_generic_finalize(AS_t as) {
   model_none_finalize(as);
 }
 
-int generic_parse_PU(AS_t as, const char *name)
+int generic_parse_PU(AS_t as, network_element_t elm)
 {
-  XBT_DEBUG("Load process unit \"%s\"", name);
-  int id = as->nb_index;
-  (as->nb_index)++;
-  return id;
+  XBT_DEBUG("Load process unit \"%s\"", elm->name);
+  xbt_dynar_push_as(as->index_network_elm,network_element_t,elm);
+  return xbt_dynar_length(as->index_network_elm)-1;
 }
 
-int generic_parse_AS(AS_t as, const char *name)
+int generic_parse_AS(AS_t as, network_element_t elm)
 {
-  XBT_DEBUG("Load Autonomous system \"%s\"", name);
-  int id = as->nb_index;
-  as->nb_index++;
-  return id;
+  XBT_DEBUG("Load Autonomous system \"%s\"", elm->name);
+  xbt_dynar_push_as(as->index_network_elm,network_element_t,elm);
+  return xbt_dynar_length(as->index_network_elm)-1;
 }
 
 void generic_parse_bypassroute(AS_t rc,