Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't qwack when the default empty string is passed as a replay path
[simgrid.git] / src / kernel / EngineImpl.cpp
index ff519e4b04eb3517b9c906477ae03f1db0d006f3..a5b2d5718ef51e1437f152c89c7362f178f1a674 100644 (file)
 #include "src/simgrid/sg_config.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 
+#if SIMGRID_HAVE_MC
+#include "src/mc/remote/AppSide.hpp"
+#endif
+
 #include "xbt/log.hpp"
 
 #include <boost/algorithm/string/predicate.hpp>
 #include <dlfcn.h>
 
-#if SIMGRID_HAVE_MC
-#include "src/mc/remote/AppSide.hpp"
-#endif
-
 XBT_LOG_NEW_DEFAULT_CATEGORY(ker_engine, "Logging specific to Engine (kernel)");
 
 namespace simgrid::kernel {
@@ -175,7 +175,7 @@ void EngineImpl::initialize(int* argc, char** argv)
   // The communication initialization is done ASAP, as we need to get some init parameters from the MC for different
   // layers. But instance_ needs to be created, as we send the address of some of its fields to the MC that wants to
   // read them directly.
-  simgrid::mc::AppSide::initialize();
+  simgrid::mc::AppSide::get(); // To ensure that it's initialized
 #endif
 
   if (static bool inited = false; not inited) {
@@ -184,12 +184,11 @@ void EngineImpl::initialize(int* argc, char** 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();