Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Storage-kill: use right version number
[simgrid.git] / src / surf / xml / surfxml_sax_cb.cpp
index eebe69b..1c89668 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -73,7 +73,7 @@ void surf_parse_assert_netpoint(const std::string& hostname, const std::string&
       break;
     }
   }
-  surf_parse_error(std::move(msg));
+  surf_parse_error(msg);
 }
 
 double surf_parse_get_double(const std::string& s)
@@ -143,63 +143,30 @@ FILE *surf_file_to_parse = nullptr;
 /* Stuff relative to storage */
 void STag_surfxml_storage()
 {
-  XBT_DEBUG("STag_surfxml_storage");
-  property_sets.push_back(new std::unordered_map<std::string, std::string>());
+  xbt_die("<storage> tag was removed in SimGrid v3.27. Please stop using it now.");
 }
 
 void ETag_surfxml_storage()
 {
-  simgrid::kernel::routing::StorageCreationArgs storage;
-
-  storage.properties = property_sets.back();
-  property_sets.pop_back();
-
-  storage.filename     = surf_parsed_filename;
-  storage.lineno       = surf_parse_lineno;
-  storage.id           = A_surfxml_storage_id;
-  storage.type_id      = A_surfxml_storage_typeId;
-  storage.content      = A_surfxml_storage_content;
-  storage.attach       = A_surfxml_storage_attach;
-
-  sg_platf_new_storage(&storage);
+  /* Won't happen since <storage> is now removed since v3.27. */
 }
 void STag_surfxml_storage___type()
 {
-  XBT_DEBUG("STag_surfxml_storage___type");
-  property_sets.push_back(new std::unordered_map<std::string, std::string>());
-  xbt_assert(current_model_property_set == nullptr, "Someone forgot to reset the model property set to nullptr in its closing tag (or XML malformed)");
+  xbt_die("<storage_type> tag was removed in SimGrid v3.27. Please stop using it now.");
 }
 void ETag_surfxml_storage___type()
 {
-  simgrid::kernel::routing::StorageTypeCreationArgs storage_type;
-
-  storage_type.properties = property_sets.back();
-  property_sets.pop_back();
-
-  storage_type.model_properties = current_model_property_set;
-  current_model_property_set    = nullptr;
-
-  storage_type.content = A_surfxml_storage___type_content;
-  storage_type.id      = A_surfxml_storage___type_id;
-  storage_type.model   = A_surfxml_storage___type_model;
-  storage_type.size =
-      static_cast<sg_size_t>(surf_parse_get_size(surf_parsed_filename, surf_parse_lineno, A_surfxml_storage___type_size,
-                                                 "size of storage type", storage_type.id.c_str()));
-  sg_platf_new_storage_type(&storage_type);
+  /* Won't happen since <storage_type> is now removed since v3.27. */
 }
 
 void STag_surfxml_mount()
 {
-  XBT_DEBUG("STag_surfxml_mount");
+  xbt_die("<mount> tag was removed in SimGrid v3.27. Please stop using it now.");
 }
 
 void ETag_surfxml_mount()
 {
-  simgrid::kernel::routing::MountCreationArgs mount;
-
-  mount.name      = A_surfxml_mount_name;
-  mount.storageId = A_surfxml_mount_storageId;
-  sg_platf_new_mount(&mount);
+  /* Won't happen since <mount> is now removed since v3.27. */
 }
 
 void STag_surfxml_include()
@@ -288,7 +255,6 @@ void ETag_surfxml_host()    {
   XBT_DEBUG("pstate: %s", A_surfxml_host_pstate);
   host.core_amount = surf_parse_get_int(A_surfxml_host_core);
 
-  host.speed_trace = nullptr;
   if (A_surfxml_host_availability___file[0] != '\0') {
     XBT_WARN("The availability_file attribute in <host> is now deprecated. Please, use 'speed_file' instead.");
     host.speed_trace = simgrid::kernel::profile::Profile::from_file(A_surfxml_host_availability___file);
@@ -536,7 +502,7 @@ void STag_surfxml_link___ctn()
     surf_parse_error(std::string("Invalid direction for link ") + A_surfxml_link___ctn_id);
   }
 
-  const char* dirname = "";
+  const char* dirname;
   switch (A_surfxml_link___ctn_direction) {
     case A_surfxml_link___ctn_direction_UP:
       dirname = " (upward)";
@@ -554,7 +520,6 @@ void STag_surfxml_link___ctn()
 void ETag_surfxml_backbone(){
   simgrid::kernel::routing::LinkCreationArgs link;
 
-  link.properties = nullptr;
   link.id = std::string(A_surfxml_backbone_id);
   link.bandwidths.push_back(xbt_parse_get_bandwidth(
       surf_parsed_filename, surf_parse_lineno, A_surfxml_backbone_bandwidth, "bandwidth of backbone", link.id.c_str()));
@@ -608,9 +573,9 @@ void ETag_surfxml_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
-  route.gw_src    = nullptr;
-  route.gw_dst    = nullptr;
-  route.symmetrical = (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES);
+  route.symmetrical = (A_surfxml_route_symmetrical == AU_surfxml_route_symmetrical ||
+                       A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES ||
+                       A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_yes);
 
   route.link_list.swap(parsed_link_list);
 
@@ -638,17 +603,9 @@ void ETag_surfxml_zoneRoute()
 
   ASroute.link_list.swap(parsed_link_list);
 
-  switch (A_surfxml_zoneRoute_symmetrical) {
-  case AU_surfxml_zoneRoute_symmetrical:
-  case A_surfxml_zoneRoute_symmetrical_YES:
-    ASroute.symmetrical = true;
-    break;
-  case A_surfxml_zoneRoute_symmetrical_NO:
-    ASroute.symmetrical = false;
-    break;
-  default:
-    THROW_IMPOSSIBLE;
-  }
+  ASroute.symmetrical = (A_surfxml_zoneRoute_symmetrical == AU_surfxml_zoneRoute_symmetrical ||
+                         A_surfxml_zoneRoute_symmetrical == A_surfxml_zoneRoute_symmetrical_YES ||
+                         A_surfxml_zoneRoute_symmetrical == A_surfxml_zoneRoute_symmetrical_yes);
 
   sg_platf_new_route(&ASroute);
 }
@@ -658,8 +615,6 @@ void ETag_surfxml_bypassRoute(){
 
   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
-  route.gw_src = nullptr;
-  route.gw_dst = nullptr;
   route.symmetrical = false;
 
   route.link_list.swap(parsed_link_list);
@@ -735,7 +690,7 @@ void STag_surfxml_trace___connect()
 void STag_surfxml_AS()
 {
   AX_surfxml_zone_id = AX_surfxml_AS_id;
-  AX_surfxml_zone_routing = (AT_surfxml_zone_routing)AX_surfxml_AS_routing;
+  AX_surfxml_zone_routing = AX_surfxml_AS_routing;
   STag_surfxml_zone();
 }
 
@@ -786,7 +741,7 @@ void ETag_surfxml_config()
   for (std::string key : keys) {
     if (simgrid::config::is_default(key.c_str())) {
       std::string cfg = key + ":" + current_property_set->at(key);
-      simgrid::config::set_parse(std::move(cfg));
+      simgrid::config::set_parse(cfg);
     } else
       XBT_INFO("The custom configuration '%s' is already defined by user!", key.c_str());
   }