Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not throw signal from sg_platf
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Thu, 29 Apr 2021 14:01:36 +0000 (16:01 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Thu, 29 Apr 2021 14:01:36 +0000 (16:01 +0200)
src/kernel/routing/NetZoneImpl.cpp
src/surf/sg_platf.cpp

index 036051f..ca5ae92 100644 (file)
@@ -90,6 +90,9 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name)
              "Refusing to create a second NetZone called '%s'.", get_cname());
   netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone);
   XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id());
+  _sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent
+                            * any further config now that we created some real content */
+  simgrid::s4u::NetZone::on_creation(piface_); // notify the signal
 }
 
 NetZoneImpl::~NetZoneImpl()
index 992fb55..24e7ab7 100644 (file)
@@ -517,20 +517,9 @@ sg_platf_create_zone(const simgrid::kernel::routing::ZoneCreationArgs* zone)
  */
 simgrid::kernel::routing::NetZoneImpl* sg_platf_new_Zone_begin(const simgrid::kernel::routing::ZoneCreationArgs* zone)
 {
-  /* First create the zone.
-   * This order is important to assure that root netzone is set when models are setting
-   * the default mode for each resource (CPU, network, etc)
-   */
-  auto* new_zone = sg_platf_create_zone(zone);
+  current_routing = sg_platf_create_zone(zone);
 
-  _sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent
-                            * any further config now that we created some real content */
-
-  /* set the new current component of the tree */
-  current_routing = new_zone;
-  simgrid::s4u::NetZone::on_creation(*new_zone->get_iface()); // notify the signal
-
-  return new_zone;
+  return current_routing;
 }
 
 void sg_platf_new_Zone_set_properties(const std::unordered_map<std::string, std::string>& props)