Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
log_state has nothing to do in RemoteApp, it belongs to the exploration
[simgrid.git] / src / mc / api / RemoteApp.cpp
index 810f5271a71b6ffe0f3ab3dd5a163c3e532e8329..259716fe361d1639ac6b5d711d93e4b81ba897df 100644 (file)
@@ -97,7 +97,12 @@ RemoteApp::RemoteApp(const std::function<void()>& 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<aid_t, ActorState>& 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();
   }
 }