Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move the stack as field of SafetyChecker and CommDetChecker
[simgrid.git] / src / mc / mc_visited.cpp
index e802ccb..ee5d9ee 100644 (file)
@@ -10,7 +10,6 @@
 #include <memory>
 #include <algorithm>
 
-#include <xbt/automaton.h>
 #include <xbt/log.h>
 #include <xbt/sysdep.h>
 #include <xbt/dynar.h>
@@ -19,7 +18,6 @@
 
 #include "src/mc/mc_comm_pattern.h"
 #include "src/mc/mc_safety.h"
-#include "src/mc/LivenessChecker.hpp"
 #include "src/mc/mc_private.h"
 #include "src/mc/Process.hpp"
 #include "src/mc/mc_smx.h"
@@ -32,18 +30,6 @@ namespace mc {
 
 std::vector<std::unique_ptr<simgrid::mc::VisitedState>> visited_states;
 
-static int is_exploration_stack_state(simgrid::mc::VisitedState* state){
-  xbt_fifo_item_t item = xbt_fifo_get_first_item(mc_stack);
-  while (item) {
-    if (((simgrid::mc::State*)xbt_fifo_get_item_content(item))->num == state->num){
-      ((simgrid::mc::State*)xbt_fifo_get_item_content(item))->in_visited_states = 0;
-      return 1;
-    }
-    item = xbt_fifo_get_next_item(item);
-  }
-  return 0;
-}
-
 /**
  * \brief Save the current state
  * \return Snapshot of the current state.
@@ -102,7 +88,8 @@ std::unique_ptr<simgrid::mc::VisitedState> is_visited_state(simgrid::mc::State*
     std::unique_ptr<simgrid::mc::VisitedState>(new VisitedState());
   graph_state->system_state = new_state->system_state;
   graph_state->in_visited_states = 1;
-  XBT_DEBUG("Snapshot %p of visited state %d (exploration stack state %d)", new_state->system_state, new_state->num, graph_state->num);
+  XBT_DEBUG("Snapshot %p of visited state %d (exploration stack state %d)",
+    new_state->system_state.get(), new_state->num, graph_state->num);
 
   auto range = std::equal_range(visited_states.begin(), visited_states.end(),
     new_state.get(), simgrid::mc::DerefAndCompareByNbProcessesAndUsedHeap());