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 dfd9863f96ffa83d08eb9782767d67ce4f8dd7eb..e1b87d30765dbf8f8a0edd0dcdf042f036f91f27 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 fc84a15db906ce446befa5f78b267e5628994d2a..9874969b4c57fcca8511e311b583c490244057aa 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 4ee245f6479f86a7e927413a55265df3a048826c..688134a786beeb0f650b649e3928792fc2581ac4 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 93b350ffee3f396ba81e6845cb5644d3fdc96bc0..292d15ceb2df39e43789c490b376f3efacc0d82a 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 d26d7aef7e90fdaa2403af5736f8f95f2450651b..149a7f37fa6aba6448741bdc0cfce6a5883ca9cf 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.
  */