X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/12bb2ab8248bff29a4305780636a4c859693340d..a28f8d4f0a7734d65dafa41486ca0ab78038a975:/src/mc/ModelChecker.cpp diff --git a/src/mc/ModelChecker.cpp b/src/mc/ModelChecker.cpp index be6f39b164..4411458d65 100644 --- a/src/mc/ModelChecker.cpp +++ b/src/mc/ModelChecker.cpp @@ -54,7 +54,7 @@ ModelChecker::ModelChecker(pid_t pid, int socket) : page_store_(500), parent_snapshot_(nullptr) { - process_ = std::unique_ptr(new Process(pid_, socket_)); + } ModelChecker::~ModelChecker() @@ -74,6 +74,14 @@ const char* ModelChecker::get_host_name(const char* hostname) return elt->key; } +// HACK, for the unit test only +void ModelChecker::init_process() +{ + // TODO, avoid direct dependency on sg_cfg + process_ = std::unique_ptr(new Process(pid_, socket_)); + process_->privatized(sg_cfg_get_boolean("smpi/privatize_global_variables")); +} + void ModelChecker::start() { // Block SIGCHLD (this will be handled with accept/signalfd): @@ -110,9 +118,7 @@ void ModelChecker::start() if (res < 0 || !WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) xbt_die("Could not wait model-checked process"); - - // TODO, avoid direct dependency on sg_cfg - process_->privatized(sg_cfg_get_boolean("smpi/privatize_global_variables")); + this->init_process(); /* Initialize statistics */ mc_stats = xbt_new0(s_mc_stats_t, 1);