X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/237fd22b56db7d1c67360c37559ce3aab16a002d..206a2b027325f16558bdf3f673da223a8a4921d4:/src/kernel/routing/NetZoneImpl.cpp diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index bd320c88b7..bfcf4cee95 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -72,12 +72,13 @@ xbt::signalget_netzone_root()) { - s4u::Engine::get_instance()->set_netzone_root(&piface_); + if (not engine->get_netzone_root()) { + engine->set_netzone_root(&piface_); /* root netzone set, initialize models */ simgrid::s4u::Engine::on_platform_creation(); @@ -91,7 +92,7 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name) surf_config_models_setup(); } - xbt_assert(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()), + xbt_assert(nullptr == engine->netpoint_by_name_or_null(get_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 '%lu'", get_cname(), netpoint_->id());