Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Really check the privatization option in the MCed SMPI app.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 14 Mar 2023 15:34:28 +0000 (16:34 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 14 Mar 2023 15:34:28 +0000 (16:34 +0100)
src/mc/api/RemoteApp.cpp
src/smpi/internals/smpi_global.cpp

index 31637db..6782fa3 100644 (file)
@@ -4,14 +4,9 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/api/RemoteApp.hpp"
-#include "src/internal_config.h" // HAVE_SMPI
 #include "src/mc/explo/Exploration.hpp"
 #include "src/mc/mc_config.hpp"
 #include "xbt/asserts.h"
-#if HAVE_SMPI
-#include "smpi/smpi.h"
-#include "src/smpi/include/private.hpp"
-#endif
 #include "src/mc/api/State.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
@@ -102,12 +97,6 @@ XBT_ATTRIB_NORETURN static void run_child_process(int socket, const std::vector<
 
 RemoteApp::RemoteApp(const std::vector<char*>& args)
 {
-#if HAVE_SMPI
-  smpi_init_options(); // only performed once
-  xbt_assert(smpi_cfg_privatization() != SmpiPrivStrategies::MMAP,
-             "Please use the dlopen privatization schema when model-checking SMPI code");
-#endif
-
   // Create an AF_LOCAL socketpair used for exchanging messages
   // between the model-checker process (ourselves) and the model-checked
   // process:
index 9e1c6c0..b7d4dce 100644 (file)
@@ -529,6 +529,9 @@ int smpi_main(const char* executable, int argc, char* argv[])
   engine.load_platform(argv[1]);
   engine.set_default_comm_data_copy_callback(smpi_comm_copy_buffer_callback);
 
+  xbt_assert(not MC_is_active() || smpi_cfg_privatization() != SmpiPrivStrategies::MMAP,
+             "Please use the dlopen privatization schema when model-checking SMPI code");
+
   if (smpi_cfg_privatization() == SmpiPrivStrategies::DLOPEN)
     smpi_init_privatization_dlopen(executable);
   else