Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move some snapshot_compare() overload with their respective checker
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 24 Mar 2016 11:06:27 +0000 (12:06 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 29 Mar 2016 10:58:51 +0000 (12:58 +0200)
src/mc/SafetyChecker.cpp
src/mc/mc_compare.cpp
src/mc/mc_safety.h
src/mc/mc_state.h
src/mc/mc_visited.cpp

index dfd9863..e1b87d3 100644 (file)
@@ -43,6 +43,15 @@ static void MC_show_non_termination(void)
   MC_print_statistics(mc_stats);
 }
 
+static int snapshot_compare(mc_state_t state1, mc_state_t state2)
+{
+  simgrid::mc::Snapshot* s1 = state1->system_state;
+  simgrid::mc::Snapshot* s2 = state2->system_state;
+  int num1 = state1->num;
+  int num2 = state2->num;
+  return snapshot_compare(num1, s1, num2, s2);
+}
+
 static int is_exploration_stack_state(mc_state_t current_state){
 
   xbt_fifo_item_t item;
index fc84a15..9874969 100644 (file)
@@ -542,23 +542,5 @@ int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc:
   return errors > 0 || hash_result;
 }
 
-int snapshot_compare(mc_state_t state1, mc_state_t state2)
-{
-  simgrid::mc::Snapshot* s1 = state1->system_state;
-  simgrid::mc::Snapshot* s2 = state2->system_state;
-  int num1 = state1->num;
-  int num2 = state2->num;
-  return snapshot_compare(num1, s1, num2, s2);
-}
-
-int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::VisitedState* state2)
-{
-  simgrid::mc::Snapshot* s1 = state1->system_state;
-  simgrid::mc::Snapshot* s2 = state2->system_state;
-  int num1 = state1->num;
-  int num2 = state2->num;
-  return snapshot_compare(num1, s1, num2, s2);
-}
-
 }
 }
index 4ee245f..688134a 100644 (file)
@@ -44,7 +44,6 @@ struct XBT_PRIVATE VisitedState {
 
 extern XBT_PRIVATE std::vector<std::unique_ptr<simgrid::mc::VisitedState>> visited_states;
 XBT_PRIVATE std::unique_ptr<simgrid::mc::VisitedState> is_visited_state(mc_state_t graph_state, bool compare_snpashots);
-XBT_PRIVATE int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::VisitedState* state2);
 
 }
 }
index 93b350f..292d15c 100644 (file)
@@ -68,12 +68,4 @@ XBT_PRIVATE void MC_state_remove_interleave_process(mc_state_t state, smx_proces
 
 SG_END_DECL()
 
-namespace simgrid {
-namespace mc {
-
-XBT_PRIVATE int snapshot_compare(mc_state_t state1, mc_state_t state2);
-
-}
-}
-
 #endif
index d26d7ae..149a7f3 100644 (file)
@@ -131,6 +131,15 @@ static void prune_visited_states()
   }
 }
 
+static int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::VisitedState* state2)
+{
+  simgrid::mc::Snapshot* s1 = state1->system_state;
+  simgrid::mc::Snapshot* s2 = state2->system_state;
+  int num1 = state1->num;
+  int num2 = state2->num;
+  return snapshot_compare(num1, s1, num2, s2);
+}
+
 /**
  * \brief Checks whether a given state has already been visited by the algorithm.
  */