Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Objectify Semaphore kernel counterpart
[simgrid.git] / src / simix / smx_global.cpp
index 4c53ae6..c696cab 100644 (file)
@@ -144,12 +144,6 @@ double SIMIX_timer_next()
   return simix_timers.empty() ? -1.0 : simix_timers.top().first;
 }
 
-static void kill_process(smx_actor_t process)
-{
-  SIMIX_process_kill(process, nullptr);
-}
-
-
 namespace simgrid {
 namespace simix {
 
@@ -179,7 +173,7 @@ void SIMIX_global_init(int *argc, char **argv)
   simgrid::mc::Client::initialize();
 #endif
 
-  if (not simix_global) {
+  if (simix_global == nullptr) {
     simix_global = std::unique_ptr<simgrid::simix::Global>(new simgrid::simix::Global());
     simix_global->maestro_process = nullptr;
 
@@ -198,7 +192,7 @@ void SIMIX_global_init(int *argc, char **argv)
 #endif
     /* register a function to be called by SURF after the environment creation */
     sg_platf_init();
-    simgrid::s4u::on_platform_created.connect(SIMIX_post_create_environment);
+    simgrid::s4u::on_platform_created.connect(surf_presolve);
 
     simgrid::s4u::Storage::on_creation.connect([](simgrid::s4u::Storage& storage) {
       sg_storage_t s = simgrid::s4u::Storage::by_name(storage.get_cname());
@@ -246,7 +240,7 @@ void SIMIX_clean()
 #endif
 
   /* Kill all processes (but maestro) */
-  SIMIX_process_killall(simix_global->maestro_process);
+  simix_global->maestro_process->kill_all();
   SIMIX_context_runall();
   SIMIX_process_empty_trash();
 
@@ -476,7 +470,7 @@ void SIMIX_run()
       if (simix_global->process_list.size() == simix_global->daemons.size())
         for (auto const& dmon : simix_global->daemons) {
           XBT_DEBUG("Kill %s", dmon->get_cname());
-          SIMIX_process_kill(dmon, simix_global->maestro_process);
+          simix_global->maestro_process->kill(dmon);
         }
     }