From 585776ec815a9c0fe5283e95a67313259ec86b94 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 1 Apr 2021 09:52:25 +0200 Subject: [PATCH] sg_exit never allowed to reload a platform afterward, so reduce the visibility of a variable At least it never worked properly --- src/surf/sg_platf.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index a1304dd59d..8c42b9f53d 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -38,8 +38,6 @@ xbt::signal on_cluster_creation; } // namespace kernel } // namespace simgrid -static int surf_parse_models_setup_already_called = 0; - /** The current NetZone in the parsing */ static simgrid::kernel::routing::NetZoneImpl* current_routing = nullptr; static simgrid::kernel::routing::NetZoneImpl* routing_get_current() @@ -59,8 +57,6 @@ void sg_platf_exit() simgrid::kernel::routing::on_cluster_creation.disconnect_slots(); simgrid::s4u::Engine::on_platform_created.disconnect_slots(); - /* make sure that we will reinit the models while loading the platf once reinited */ - surf_parse_models_setup_already_called = 0; surf_parse_lex_destroy(); } @@ -552,6 +548,7 @@ simgrid::kernel::routing::NetZoneImpl* sg_platf_new_Zone_begin(const simgrid::ke */ auto* new_zone = sg_platf_create_zone(zone); + static bool surf_parse_models_setup_already_called = false; if (not surf_parse_models_setup_already_called) { simgrid::s4u::Engine::on_platform_creation(); @@ -562,7 +559,7 @@ simgrid::kernel::routing::NetZoneImpl* sg_platf_new_Zone_begin(const simgrid::ke * (FIXME: check it out by creating a file beginning with one of these tags) * but cluster and peer come down to zone creations, so putting this verification here is correct. */ - surf_parse_models_setup_already_called = 1; + surf_parse_models_setup_already_called = true; surf_config_models_setup(); } -- 2.20.1