Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Split TransitionAny and TransitionRandom to their own files
[simgrid.git] / src / mc / ModelChecker.cpp
index 5b517e5..ea47b49 100644 (file)
@@ -5,13 +5,12 @@
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/Session.hpp"
-#include "src/mc/api/Transition.hpp"
-#include "src/mc/api/TransitionComm.hpp"
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
 #include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/transition/TransitionComm.hpp"
 #include "xbt/automaton.hpp"
 #include "xbt/system_error.hpp"
 
@@ -318,6 +317,10 @@ Transition* ModelChecker::handle_simcall(aid_t aid, int times_considered, bool n
   m.times_considered_ = times_considered;
   checker_side_.get_channel().send(m);
 
+  this->remote_process_->clear_cache();
+  if (this->remote_process_->running())
+    checker_side_.dispatch(); // The app may send messages while processing the transition
+
   s_mc_message_simcall_execute_answer_t answer;
   ssize_t s = checker_side_.get_channel().receive(answer);
   xbt_assert(s != -1, "Could not receive message");
@@ -327,12 +330,8 @@ Transition* ModelChecker::handle_simcall(aid_t aid, int times_considered, bool n
              to_c_str(answer.type), (int)answer.type, (int)s, (int)MessageType::SIMCALL_EXECUTE_ANSWER,
              (int)sizeof(answer));
 
-  this->remote_process_->clear_cache();
-  if (this->remote_process_->running())
-    checker_side_.dispatch(); // The app may send messages while processing the transition
-
   if (new_transition) {
-    std::stringstream stream(answer.buffer);
+    std::stringstream stream(answer.buffer.data());
     return deserialize_transition(aid, times_considered, stream);
   } else
     return nullptr;