Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not mix the enums (good catch, sonar)
[simgrid.git] / src / surf / xml / surfxml_sax_cb.cpp
index 272755c..d3a1168 100644 (file)
@@ -81,11 +81,6 @@ void surf_parse_assert_netpoint(std::string hostname, std::string pre, std::stri
   surf_parse_error(msg);
 }
 
-void surf_parse_warn(std::string msg)
-{
-  XBT_WARN("%s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg.c_str());
-}
-
 double surf_parse_get_double(std::string s)
 {
   try {
@@ -388,7 +383,7 @@ void STag_surfxml_platform() {
   if (version < 4.1) {
     XBT_INFO("You're using a v%.1f XML file (%s) while the current standard is v4.1 "
              "That's fine, the new version is backward compatible. \n\n"
-             "Use simgrid_update_xml to update your file automatically. "
+             "Use simgrid_update_xml to update your file automatically to get ride of this warning. "
              "This program is installed automatically with SimGrid, or "
              "available in the tools/ directory of the source archive.",
              version, surf_parsed_filename);
@@ -485,16 +480,16 @@ void ETag_surfxml_cluster(){
 
   switch(AX_surfxml_cluster_topology){
   case A_surfxml_cluster_topology_FLAT:
-    cluster.topology= SURF_CLUSTER_FLAT ;
+    cluster.topology = ClusterTopology::FLAT;
     break;
   case A_surfxml_cluster_topology_TORUS:
-    cluster.topology= SURF_CLUSTER_TORUS ;
+    cluster.topology = ClusterTopology::TORUS;
     break;
   case A_surfxml_cluster_topology_FAT___TREE:
-    cluster.topology = SURF_CLUSTER_FAT_TREE;
+    cluster.topology = ClusterTopology::FAT_TREE;
     break;
   case A_surfxml_cluster_topology_DRAGONFLY:
-    cluster.topology= SURF_CLUSTER_DRAGONFLY ;
+    cluster.topology = ClusterTopology::DRAGONFLY;
     break;
   default:
     surf_parse_error(std::string("Invalid cluster topology for cluster ") + cluster.id);
@@ -508,7 +503,11 @@ void ETag_surfxml_cluster(){
     cluster.sharing_policy = SURF_LINK_SHARED;
     break;
   case A_surfxml_cluster_sharing___policy_FULLDUPLEX:
-    cluster.sharing_policy = SURF_LINK_FULLDUPLEX;
+    XBT_WARN("FULLDUPLEX is now deprecated. Please update your platform file to use SPLITDUPLEX instead.");
+    cluster.sharing_policy = SURF_LINK_SPLITDUPLEX;
+    break;
+  case A_surfxml_cluster_sharing___policy_SPLITDUPLEX:
+    cluster.sharing_policy = SURF_LINK_SPLITDUPLEX;
     break;
   case A_surfxml_cluster_sharing___policy_FATPIPE:
     cluster.sharing_policy = SURF_LINK_FATPIPE;
@@ -597,8 +596,12 @@ void ETag_surfxml_link(){
      link.policy = SURF_LINK_FATPIPE;
      break;
   case A_surfxml_link_sharing___policy_FULLDUPLEX:
-     link.policy = SURF_LINK_FULLDUPLEX;
-     break;
+    XBT_WARN("FULLDUPLEX is now deprecated. Please update your platform file to use SPLITDUPLEX instead.");
+    link.policy = SURF_LINK_SPLITDUPLEX;
+    break;
+  case A_surfxml_link_sharing___policy_SPLITDUPLEX:
+    link.policy = SURF_LINK_SPLITDUPLEX;
+    break;
   default:
     surf_parse_error(std::string("Invalid sharing policy in link ") + link.id);
     break;
@@ -692,7 +695,7 @@ void STag_surfxml_bypassZoneRoute(){
 }
 
 void ETag_surfxml_route(){
-  s_sg_platf_route_cbarg_t route;
+  RouteCreationArgs route;
 
   route.src         = sg_netpoint_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
   route.dst         = sg_netpoint_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
@@ -716,7 +719,7 @@ void ETag_surfxml_ASroute()
 }
 void ETag_surfxml_zoneRoute()
 {
-  s_sg_platf_route_cbarg_t ASroute;
+  RouteCreationArgs ASroute;
 
   ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_src); // tested to not be nullptr in start tag
   ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_dst); // tested to not be nullptr in start tag
@@ -742,7 +745,7 @@ void ETag_surfxml_zoneRoute()
 }
 
 void ETag_surfxml_bypassRoute(){
-  s_sg_platf_route_cbarg_t route;
+  RouteCreationArgs route;
 
   route.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
   route.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
@@ -765,7 +768,7 @@ void ETag_surfxml_bypassASroute()
 }
 void ETag_surfxml_bypassZoneRoute()
 {
-  s_sg_platf_route_cbarg_t ASroute;
+  RouteCreationArgs ASroute;
 
   ASroute.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_src);
   ASroute.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_dst);