Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Set level COORD_HOST_LEVEL and COORD_ASR_LEVEL if there are used.
[simgrid.git] / src / surf / network_gtnets.c
index 6564fb5..34eaca4 100644 (file)
@@ -23,7 +23,7 @@ static void link_new(char *name, double bw, double lat, xbt_dict_t props)
   static int link_count = -1;
   network_link_GTNETS_t gtnets_link;
 
-  if (xbt_dict_get_or_null(surf_network_model->resource_set, name)) {
+  if (xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL)) {
     return;
   }
 
@@ -46,8 +46,7 @@ static void link_new(char *name, double bw, double lat, xbt_dict_t props)
   }
   gtnets_link->id = link_count;
 
-  xbt_dict_set(surf_network_model->resource_set, name, gtnets_link,
-               surf_resource_free);
+  xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, gtnets_link);
 }
 
 static void route_new(int src_id, int dst_id, xbt_dynar_t links,
@@ -110,7 +109,6 @@ static void parse_link_init(void)
   if (state_trace)
     XBT_INFO("The GTNetS network model doesn't support link state traces");
 
-  current_property_set = xbt_dict_new();
   if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
   {
          link_new(bprintf("%s_UP",name), bw, lat, current_property_set);
@@ -118,6 +116,7 @@ static void parse_link_init(void)
 
   }
   else  link_new(name, bw, lat, current_property_set);
+  current_property_set = NULL;
 }
 
 /* Create the gtnets topology based on routing strategy */
@@ -167,7 +166,7 @@ static void create_gtnets_topology()
 static void define_callbacks(const char *file)
 {
   /* Figuring out the network links */
-  surfxml_add_callback(STag_surfxml_link_cb_list, &parse_link_init);
+  surfxml_add_callback(ETag_surfxml_link_cb_list, &parse_link_init);
   surfxml_add_callback(ETag_surfxml_platform_cb_list,
                        &create_gtnets_topology);
 }