Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove MC_state_get_internal_request()
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 7 Apr 2016 09:48:47 +0000 (11:48 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 7 Apr 2016 10:43:23 +0000 (12:43 +0200)
src/mc/SafetyChecker.cpp
src/mc/mc_request.cpp
src/mc/mc_state.cpp
src/mc/mc_state.h

index 831a061..664379d 100644 (file)
@@ -209,7 +209,7 @@ int SafetyChecker::backtrack()
     std::unique_ptr<simgrid::mc::State> state = std::move(stack_.back());
     stack_.pop_back();
     if (reductionMode_ == simgrid::mc::ReductionMode::dpor) {
-      smx_simcall_t req = MC_state_get_internal_request(state.get());
+      smx_simcall_t req = &state->internal_req;
       if (req->call == SIMCALL_MUTEX_LOCK || req->call == SIMCALL_MUTEX_TRYLOCK)
         xbt_die("Mutex is currently not supported with DPOR, "
           "use --cfg=model-check/reduction:none");
@@ -217,7 +217,7 @@ int SafetyChecker::backtrack()
       for (auto i = stack_.rbegin(); i != stack_.rend(); ++i) {
         simgrid::mc::State* prev_state = i->get();
         if (reductionMode_ != simgrid::mc::ReductionMode::none
-            && simgrid::mc::request_depend(req, MC_state_get_internal_request(prev_state))) {
+            && simgrid::mc::request_depend(req, &prev_state->internal_req)) {
           if (XBT_LOG_ISENABLED(mc_safety, xbt_log_priority_debug)) {
             XBT_DEBUG("Dependent Transitions:");
             int value = prev_state->req_num;
@@ -241,17 +241,17 @@ int SafetyChecker::backtrack()
 
           break;
 
-        } else if (req->issuer == MC_state_get_internal_request(prev_state)->issuer) {
+        } else if (req->issuer == prev_state->internal_req.issuer) {
 
-          XBT_DEBUG("Simcall %d and %d with same issuer", req->call, MC_state_get_internal_request(prev_state)->call);
+          XBT_DEBUG("Simcall %d and %d with same issuer", req->call, prev_state->internal_req.call);
           break;
 
         } else {
 
-          const smx_process_t previous_issuer = MC_smx_simcall_get_issuer(MC_state_get_internal_request(prev_state));
+          const smx_process_t previous_issuer = MC_smx_simcall_get_issuer(&prev_state->internal_req);
           XBT_DEBUG("Simcall %d, process %lu (state %d) and simcall %d, process %lu (state %d) are independant",
                     req->call, issuer->pid, state->num,
-                    MC_state_get_internal_request(prev_state)->call,
+                    prev_state->internal_req.call,
                     previous_issuer->pid,
                     prev_state->num);
 
index f7ac9b2..cc84403 100644 (file)
@@ -134,7 +134,7 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
   return true;
 }
 
-// Those are MC_state_get_internal_request(state)
+// Those are internal_req
 bool request_depend(smx_simcall_t r1, smx_simcall_t r2)
 {
   if (r1->issuer == r2->issuer)
index af22aa5..1a4b90a 100644 (file)
@@ -68,11 +68,6 @@ RecordTraceElement State::getRecordElement() const
 }
 }
 
-smx_simcall_t MC_state_get_internal_request(simgrid::mc::State* state)
-{
-  return &state->internal_req;
-}
-
 static inline smx_simcall_t MC_state_get_request_for_process(
   simgrid::mc::State* state, int*value, smx_process_t process)
 {
index 880098c..957a080 100644 (file)
@@ -166,7 +166,6 @@ XBT_PRIVATE void replay(std::list<std::unique_ptr<simgrid::mc::State>> const& st
 }
 
 XBT_PRIVATE simgrid::mc::State* MC_state_new(void);
-XBT_PRIVATE smx_simcall_t MC_state_get_internal_request(simgrid::mc::State* state);
 XBT_PRIVATE smx_simcall_t MC_state_get_request(simgrid::mc::State* state, int *value);
 
 #endif