Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add in DTD direction for link_ctn and sharing_policy for link and cluster
[simgrid.git] / src / surf / network_gtnets.c
index b33e07d..3766095 100644 (file)
@@ -30,9 +30,6 @@ static void link_new(char *name, double bw, double lat, xbt_dict_t props)
   if (xbt_dict_get_or_null(surf_network_model->resource_set, name)) {
     return;
   }
-#ifdef HAVE_TRACING
-  TRACE_surf_link_declaration(name, bw, lat);
-#endif
 
   DEBUG1("Scanning link name %s", name);
   sscanf(name, "%d_%d", &tmp_idsrc, &tmp_iddst);
@@ -67,6 +64,9 @@ static void link_new(char *name, double bw, double lat, xbt_dict_t props)
   }
   xbt_dict_set(surf_network_model->resource_set, name, gtnets_link,
                surf_resource_free);
+#ifdef HAVE_TRACING
+  TRACE_surf_link_declaration(gtnets_link, name, bw, lat);
+#endif
 }
 
 static void route_new(int src_id, int dst_id, xbt_dynar_t links,
@@ -108,12 +108,11 @@ static void parse_link_init(void)
   double bw;
   double lat;
   e_surf_resource_state_t state;
-
   name = xbt_strdup(A_surfxml_link_id);
   surf_parse_get_double(&bw, A_surfxml_link_bandwidth);
   surf_parse_get_double(&lat, A_surfxml_link_latency);
   state = SURF_RESOURCE_ON;
-
+  DEBUG0("link_gtnets");
   tmgr_trace_t bw_trace;
   tmgr_trace_t state_trace;
   tmgr_trace_t lat_trace;
@@ -131,7 +130,13 @@ static void parse_link_init(void)
     INFO0("The GTNetS network model doesn't support link state traces");
 
   current_property_set = xbt_dict_new();
-  link_new(name, bw, lat, current_property_set);
+  if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
+  {
+         link_new(bprintf("%s_UP",name), bw, lat, current_property_set);
+         link_new(bprintf("%s_DOWN",name), bw, lat, current_property_set);
+
+  }
+  else  link_new(name, bw, lat, current_property_set);
 }
 
 /* Create the gtnets topology based on routing strategy */