X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b1267b59e70deb98dbf69b1231f597ed292aaaf..3690ed44d179e57962bb0f4e377057314cd79455:/src/mc/api/RemoteApp.cpp?ds=sidebyside diff --git a/src/mc/api/RemoteApp.cpp b/src/mc/api/RemoteApp.cpp index 810f5271a7..259716fe36 100644 --- a/src/mc/api/RemoteApp.cpp +++ b/src/mc/api/RemoteApp.cpp @@ -97,7 +97,12 @@ RemoteApp::RemoteApp(const std::function& code) RemoteApp::~RemoteApp() { - this->close(); + initial_snapshot_ = nullptr; + if (model_checker_) { + model_checker_->shutdown(); + model_checker_ = nullptr; + mc_model_checker = nullptr; + } } void RemoteApp::restore_initial_state() const @@ -105,29 +110,9 @@ void RemoteApp::restore_initial_state() const this->initial_snapshot_->restore(&model_checker_->get_remote_process()); } -void RemoteApp::log_state() const -{ - model_checker_->get_exploration()->log_state(); - - if (not _sg_mc_dot_output_file.get().empty()) { - fprintf(dot_output, "}\n"); - fclose(dot_output); - } - if (getenv("SIMGRID_MC_SYSTEM_STATISTICS")) { - int ret = system("free"); - if (ret != 0) - XBT_WARN("Call to system(free) did not return 0, but %d", ret); - } -} - -void RemoteApp::close() +unsigned long RemoteApp::get_maxpid() const { - initial_snapshot_ = nullptr; - if (model_checker_) { - model_checker_->shutdown(); - model_checker_ = nullptr; - mc_model_checker = nullptr; - } + return model_checker_->get_remote_process().get_maxpid(); } void RemoteApp::get_actors_status(std::map& whereto) @@ -175,7 +160,7 @@ void RemoteApp::check_deadlock() const for (auto const& frame : model_checker_->get_exploration()->get_textual_trace()) XBT_CINFO(mc_global, " %s", frame.c_str()); XBT_CINFO(mc_global, "Path = %s", model_checker_->get_exploration()->get_record_trace().to_string().c_str()); - log_state(); + model_checker_->get_exploration()->log_state(); throw DeadlockError(); } }