Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove old dual-stack-related comment
[simgrid.git] / src / mc / mc_global.cpp
index 766665b..5ad3660 100644 (file)
@@ -44,6 +44,7 @@
 #include "src/mc/mc_record.h"
 #include "src/mc/mc_protocol.h"
 #include "src/mc/Client.hpp"
+#include "src/mc/Transition.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc, "Logging specific to MC (global)");
 
@@ -115,17 +116,6 @@ void MC_run()
 namespace simgrid {
 namespace mc {
 
-void handle_simcall(smx_simcall_t req, int req_num)
-{
-  for (auto& pi : mc_model_checker->process().smx_process_infos)
-    if (req == &pi.copy.simcall) {
-      mc_model_checker->simcall_handle(
-        mc_model_checker->process(), pi.copy.pid, req_num);
-      return;
-    }
-  xbt_die("Could not find the request");
-}
-
 /**
  * \brief Re-executes from the state at position start all the transitions indicated by
  *        a given model-checker stack.
@@ -150,8 +140,6 @@ void replay(std::list<std::unique_ptr<simgrid::mc::State>> const& stack)
 
   /* Restore the initial state */
   simgrid::mc::restore_snapshot(simgrid::mc::initial_global_state->snapshot);
-  /* At the moment of taking the snapshot the raw heap was set, so restoring
-   * it will set it back again, we have to unset it to continue  */
 
   if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
     // int n = xbt_dynar_length(incomplete_communications_pattern);
@@ -171,7 +159,7 @@ void replay(std::list<std::unique_ptr<simgrid::mc::State>> const& stack)
     if (state == stack.back())
       break;
 
-    int req_num = state->req_num;
+    int req_num = state->transition.argument;
     smx_simcall_t saved_req = &state->executed_req;
     
     if (saved_req) {
@@ -192,7 +180,7 @@ void replay(std::list<std::unique_ptr<simgrid::mc::State>> const& stack)
       if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
         call = MC_get_call_type(req);
 
-      simgrid::mc::handle_simcall(req, req_num);
+      mc_model_checker->handle_simcall(state->transition);
       if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
         MC_handle_comm_pattern(call, req, req_num, nullptr, 1);
       mc_model_checker->wait_for_requests();