Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get rid of SIMIX_global_init
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Fri, 17 Sep 2021 10:36:12 +0000 (12:36 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Fri, 17 Sep 2021 10:36:12 +0000 (12:36 +0200)
include/simgrid/simix.h
src/s4u/s4u_Engine.cpp
src/simix/smx_global.cpp

index 69488a2..630a064 100644 (file)
@@ -35,9 +35,6 @@ XBT_PUBLIC void SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode);
 XBT_PUBLIC int SIMIX_is_maestro();
 
 /********************************** Global ************************************/
-/* Initialization and exit */
-XBT_PUBLIC void SIMIX_global_init(int* argc, char** argv);
-
 /* Set some code to execute in the maestro (must be used before the engine creation)
  *
  * If no maestro code is registered (the default), the main thread
index 72f7b18..80a7997 100644 (file)
@@ -17,6 +17,7 @@
 #include "src/instr/instr_private.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
+#include "src/kernel/actor/ActorImpl.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/surf/network_interface.hpp"
 #include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON
@@ -28,6 +29,8 @@
 XBT_LOG_NEW_CATEGORY(s4u, "Log channels of the S4U (Simgrid for you) interface");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_engine, s4u, "Logging specific to S4U (engine)");
 
+static simgrid::kernel::actor::ActorCode maestro_code;
+
 namespace simgrid {
 namespace s4u {
 xbt::signal<void()> Engine::on_platform_creation;
@@ -44,7 +47,9 @@ void Engine::initialize(int* argc, char** argv)
   Engine::instance_ = this;
   instr::init();
   pimpl->initialize(argc, argv);
-  SIMIX_global_init(argc, argv);
+  // Either create a new context with maestro or create
+  // a context object with the current context maestro):
+  kernel::actor::create_maestro(maestro_code);
 }
 
 Engine::Engine(std::string name) : pimpl(new kernel::EngineImpl(nullptr, nullptr))
@@ -491,3 +496,12 @@ int simgrid_get_actor_count() // XBT_ATTRIB_DEPRECATED_v330
 {
   return simgrid::s4u::Engine::get_instance()->get_actor_count();
 }
+
+void SIMIX_set_maestro(void (*code)(void*), void* data)
+{
+#ifdef _WIN32
+  XBT_INFO("WARNING, SIMIX_set_maestro is believed to not work on windows. Please help us investigating this issue if "
+           "you need that feature");
+#endif
+  maestro_code = std::bind(code, data);
+}
index 1904af4..5debbf8 100644 (file)
@@ -45,25 +45,6 @@ xbt_dynar_t simix_global_get_dead_actors_addr()
 } // namespace simix
 } // namespace simgrid
 
-
-static simgrid::kernel::actor::ActorCode maestro_code;
-void SIMIX_set_maestro(void (*code)(void*), void* data)
-{
-#ifdef _WIN32
-  XBT_INFO("WARNING, SIMIX_set_maestro is believed to not work on windows. Please help us investigating this issue if "
-           "you need that feature");
-#endif
-  maestro_code = std::bind(code, data);
-}
-
-void SIMIX_global_init(int* argc, char** argv)
-{
-
-  // Either create a new context with maestro or create
-  // a context object with the current context maestro):
-  simgrid::kernel::actor::create_maestro(maestro_code);
-}
-
 /**
  * @ingroup SIMIX_API
  * @brief A clock (in second).