From: Martin Quinson Date: Sun, 15 Jan 2023 23:47:52 +0000 (+0100) Subject: Kill a useless function, and rename another one X-Git-Tag: v3.34~617 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6db71d12c7ea2f08e07c692bc67dde6748d5223f Kill a useless function, and rename another one --- diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index efbd8812a2..e769b07410 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -185,7 +185,6 @@ void EngineImpl::initialize(int* argc, char** argv) install_signal_handlers(); /* register a function to be called by SURF after the environment creation */ - sg_platf_init(); s4u::Engine::on_platform_created_cb([this]() { this->presolve(); }); if (config::get_value("debug/clean-atexit")) @@ -272,7 +271,7 @@ void EngineImpl::shutdown() } tmgr_finalize(); - sg_platf_exit(); + sg_platf_parser_finalize(); delete instance_; instance_ = nullptr; @@ -312,8 +311,7 @@ void EngineImpl::load_platform(const std::string& platf) void EngineImpl::load_deployment(const std::string& file) const { - sg_platf_exit(); - sg_platf_init(); + sg_platf_parser_finalize(); surf_parse_open(file); surf_parse(); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index db9026a2e5..59c6007baf 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -42,14 +42,8 @@ static simgrid::kernel::routing::ClusterZoneCreationArgs static simgrid::kernel::routing::NetZoneImpl* current_routing = nullptr; static simgrid::s4u::Host* current_host = nullptr; -/** Module management function: creates all internal data structures */ -void sg_platf_init() -{ - // Do nothing: just for symmetry of user code -} - /** Module management function: frees all internal data structures */ -void sg_platf_exit() +void sg_platf_parser_finalize() { simgrid::kernel::routing::on_cluster_creation.disconnect_slots(); diff --git a/src/surf/xml/platf.hpp b/src/surf/xml/platf.hpp index 853b66fc2c..203ca09b1e 100644 --- a/src/surf/xml/platf.hpp +++ b/src/surf/xml/platf.hpp @@ -11,8 +11,7 @@ #include /* Module management functions */ -XBT_PUBLIC void sg_platf_init(); -XBT_PUBLIC void sg_platf_exit(); +XBT_PUBLIC void sg_platf_parser_finalize(); XBT_PUBLIC void surf_parse_open(const std::string& file); XBT_PUBLIC void surf_parse_close(); diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp index 1d4b776675..5cfc7f2ffa 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -54,8 +54,6 @@ void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* /* This function acts as a main in the parsing area. */ void parse_platform_file(const std::string& file) { - sg_platf_init(); - /* init the flex parser */ surf_parse_open(file);