Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Add methods to Session
[simgrid.git] / src / mc / Session.cpp
index 961a9ab..842fa3c 100644 (file)
@@ -81,7 +81,7 @@ 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(
-    sg_cfg_get_boolean("smpi/privatize_global_variables"));
+    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);
@@ -94,6 +94,12 @@ Session::~Session()
   this->close();
 }
 
+void Session::execute(Transition const& transition)
+{
+  modelChecker_->handle_simcall(transition);
+  modelChecker_->wait_for_requests();
+}
+
 // static
 Session* Session::fork(std::function<void(void)> code)
 {
@@ -144,5 +150,7 @@ void Session::close()
   }
 }
 
+simgrid::mc::Session* session;
+
+}
 }
-}
\ No newline at end of file