Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Restore public smpi_init_options().
[simgrid.git] / src / simix / smx_global.cpp
index 5831192..21a2e63 100644 (file)
@@ -29,8 +29,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix, "Logging specific to SIMIX
 
 std::unique_ptr<simgrid::simix::Global> simix_global;
 
-void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr) = nullptr;
-
 namespace simgrid {
 namespace simix {
 config::Flag<bool> cfg_verbose_exit{"debug/verbose-exit", "Display the actor status at exit", true};
@@ -140,14 +138,6 @@ static void install_segvhandler()
 
 #endif /* _WIN32 */
 
-/********************************* SIMIX **************************************/
-namespace simgrid {
-namespace simix {
-
-
-} // namespace simix
-} // namespace simgrid
-
 static simgrid::kernel::actor::ActorCode maestro_code;
 void SIMIX_set_maestro(void (*code)(void*), void* data)
 {
@@ -174,7 +164,6 @@ void SIMIX_global_init(int* argc, char** argv)
 
   surf_init(argc, argv); /* Initialize SURF structures */
 
-  simix_global->maestro_ = nullptr;
   SIMIX_context_mod_init();
 
   // Either create a new context with maestro or create
@@ -210,7 +199,7 @@ void SIMIX_clean()
   smx_cleaned = true;
   XBT_DEBUG("SIMIX_clean called. Simulation's over.");
   auto* engine = simgrid::kernel::EngineImpl::get_instance();
-  if (engine->has_actors_to_run() && SIMIX_get_clock() <= 0.0) {
+  if (engine->has_actors_to_run() && simgrid::s4u::Engine::get_clock() <= 0.0) {
     XBT_CRITICAL("   ");
     XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
     XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
@@ -229,20 +218,15 @@ void SIMIX_clean()
 #endif
 
   /* Kill all processes (but maestro) */
-  simix_global->maestro_->kill_all();
+  simix_global->get_maestro()->kill_all();
   engine->run_all_actors();
   engine->empty_trash();
 
-  /* Exit the SIMIX network module */
-  SIMIX_mailbox_exit();
-
-
   /* Let's free maestro now */
-  delete simix_global->maestro_;
-  simix_global->maestro_ = nullptr;
+  simix_global->destroy_maestro();
 
   /* Finish context module and SURF */
-  SIMIX_context_mod_exit();
+  simix_global->destroy_context_factory();
 
   surf_exit();
 
@@ -255,13 +239,9 @@ void SIMIX_clean()
  *
  * @return Return the clock.
  */
-double SIMIX_get_clock()
+double SIMIX_get_clock() // XBT_ATTRIB_DEPRECATED_v332
 {
-  if (MC_is_active() || MC_record_replay_is_active()) {
-    return MC_process_clock_get(SIMIX_process_self());
-  } else {
-    return surf_get_clock();
-  }
+  return simgrid::s4u::Engine::get_clock();
 }
 
 void SIMIX_run() // XBT_ATTRIB_DEPRECATED_v332
@@ -301,5 +281,5 @@ int SIMIX_is_maestro()
   if (simix_global == nullptr) // SimDag
     return true;
   const simgrid::kernel::actor::ActorImpl* self = SIMIX_process_self();
-  return self == nullptr || self == simix_global->maestro_;
+  return self == nullptr || simix_global->is_maestro(self);
 }