Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
BasicGuide handle next_transition if asked to
[simgrid.git] / src / kernel / EngineImpl.cpp
index 6b2da71..f7af9b4 100644 (file)
@@ -178,19 +178,17 @@ void EngineImpl::initialize(int* argc, char** argv)
   simgrid::mc::AppSide::initialize();
 #endif
 
-  static bool inited = false;
-  if (not inited) {
+  if (static bool inited = false; not inited) {
     inited = true;
     xbt_log_init(argc, argv);
 
     simgrid::xbt::install_exception_handler();
 
-    for (int i = 0; i < *argc; i++)
-      cmdline_.emplace_back(argv[i]);
-
     sg_config_init(argc, argv);
   }
 
+  cmdline_.assign(argv, argv + *argc);
+
   instance_->context_mod_init();
 
   install_signal_handlers();
@@ -364,7 +362,7 @@ void EngineImpl::handle_ended_actions() const
         if (action->get_activity()->get_actor() == maestro_)
           action->get_activity()->get_iface()->complete(s4u::Activity::State::FAILED);
 
-        activity::ActivityImplPtr(action->get_activity())->post();
+        activity::ActivityImplPtr(action->get_activity())->finish();
       }
     }
     XBT_DEBUG("Handling the terminated actions (if any)");
@@ -377,7 +375,7 @@ void EngineImpl::handle_ended_actions() const
         if (action->get_activity()->get_actor() == maestro_)
           action->get_activity()->get_iface()->complete(s4u::Activity::State::FINISHED);
 
-        activity::ActivityImplPtr(action->get_activity())->post();
+        activity::ActivityImplPtr(action->get_activity())->finish();
       }
     }
   }