Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove MC_state_get_executed_request()
[simgrid.git] / src / mc / mc_global.cpp
index cf23f62..04b2773 100644 (file)
 
 #include <vector>
 
+#include <xbt/dynar.h>
+#include <xbt/automaton.h>
+#include <xbt/swag.h>
+
 #include "mc_base.h"
 
 #include "mc/mc.h"
@@ -54,7 +58,6 @@ std::vector<double> processes_time;
 }
 
 #if HAVE_MC
-int user_max_depth_reached = 0;
 
 /* MC global data structures */
 simgrid::mc::State* mc_current_state = nullptr;
@@ -146,7 +149,7 @@ void replay(std::list<std::unique_ptr<simgrid::mc::State>> const& stack)
     assert(n == xbt_dynar_length(initial_communications_pattern));
     for (unsigned j=0; j < n ; j++) {
       xbt_dynar_reset((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, j, xbt_dynar_t));
-      xbt_dynar_get_as(initial_communications_pattern, j, mc_list_comm_pattern_t)->index_comm = 0;
+      xbt_dynar_get_as(initial_communications_pattern, j, simgrid::mc::PatternCommunicationList*)->index_comm = 0;
     }
   }
 
@@ -157,8 +160,8 @@ void replay(std::list<std::unique_ptr<simgrid::mc::State>> const& stack)
     if (state == stack.back())
       break;
 
-    int value;
-    smx_simcall_t saved_req = MC_state_get_executed_request(state.get(), &value);
+    int value = state->req_num;
+    smx_simcall_t saved_req = &state->executed_req;
     
     if (saved_req) {
       /* because we got a copy of the executed request, we have to fetch the  
@@ -168,11 +171,10 @@ void replay(std::list<std::unique_ptr<simgrid::mc::State>> const& stack)
       smx_simcall_t req = &issuer->simcall;
 
       /* Debug information */
-      if (XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)) {
-        char* req_str = simgrid::mc::request_to_string(req, value, simgrid::mc::RequestType::simix);
-        XBT_DEBUG("Replay: %s (%p)", req_str, state.get());
-        xbt_free(req_str);
-      }
+      XBT_DEBUG("Replay: %s (%p)",
+        simgrid::mc::request_to_string(
+          req, value, simgrid::mc::RequestType::simix).c_str(),
+        state.get());
 
       /* TODO : handle test and testany simcalls */
       e_mc_call_type_t call = MC_CALL_TYPE_NONE;