-Session::Session(pid_t pid, int socket)
-{
- std::unique_ptr<simgrid::mc::Process> process(new simgrid::mc::Process(pid, socket));
- // TODO, automatic detection of the config from the process
- process->privatized(
- xbt_cfg_get_boolean("smpi/privatize_global_variables"));
- modelChecker_ = std::unique_ptr<ModelChecker>(
- new simgrid::mc::ModelChecker(std::move(process)));
- xbt_assert(mc_model_checker == nullptr);
- mc_model_checker = modelChecker_.get();
- mc_model_checker->start();
+ // Parent (model-checker):
+ ::close(sockets[0]);
+
+ xbt_assert(mc_model_checker == nullptr, "Did you manage to start the MC twice in this process?");
+
+ auto process = std::make_unique<simgrid::mc::RemoteSimulation>(pid);
+ model_checker_ = std::make_unique<simgrid::mc::ModelChecker>(std::move(process), sockets[1]);
+
+ mc_model_checker = model_checker_.get();
+ model_checker_->start();