Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve the final stats reported by SafetyChecker, and revalidate tesh files
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 12 Feb 2022 10:17:46 +0000 (11:17 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 12 Feb 2022 10:17:46 +0000 (11:17 +0100)
examples/cpp/mc-bugged1/s4u-mc-bugged1.tesh
examples/cpp/mc-bugged2/s4u-mc-bugged2.tesh
examples/cpp/mc-electric-fence/s4u-mc-electric-fence.tesh
examples/cpp/mc-failing-assert/s4u-mc-failing-assert.tesh
examples/smpi/mc/sendsend.tesh
src/mc/checker/SafetyChecker.cpp
src/mc/checker/SafetyChecker.hpp
teshsuite/mc/random-bug/random-bug.tesh
teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh

index 19be70e..dc547c7 100644 (file)
@@ -32,6 +32,4 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/s4u-mc-bugged1 ${platfdir:=.
 > [  0.000000] (0:maestro@)   3: iSend(mbox=0)
 > [  0.000000] (0:maestro@)   1: WaitComm(from 3 to 1, mbox=0, no timeout)
 > [  0.000000] (0:maestro@) Path = 1;2;1;1;2;4;1;1;3;1
-> [  0.000000] (0:maestro@) Expanded states = 22
-> [  0.000000] (0:maestro@) Visited states = 56
-> [  0.000000] (0:maestro@) Executed transitions = 22
+> [  0.000000] (0:maestro@) 22 unique states visited; 4 backtracks (56 transition replays, 30 states visited overall)
\ No newline at end of file
index 469afc1..036b20f 100644 (file)
@@ -552,6 +552,4 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/s4u-mc-bugged2 ${platfdir:=.
 > [  0.000000] (0:maestro@)   3: iSend(mbox=0)
 > [  0.000000] (0:maestro@)   1: WaitComm(from 3 to 1, mbox=0, no timeout)
 > [  0.000000] (0:maestro@) Path = 1;3;1;3;1;3;1
-> [  0.000000] (0:maestro@) Expanded states = 1006
-> [  0.000000] (0:maestro@) Visited states = 5319
-> [  0.000000] (0:maestro@) Executed transitions = 1006
\ No newline at end of file
+> [  0.000000] (0:maestro@) 1006 unique states visited; 350 backtracks (5319 transition replays, 3963 states visited overall)
index 011b0c1..d402818 100644 (file)
@@ -10,6 +10,4 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/s4u-mc-electric-fence ${plat
 > [HostB:client:(2) 0.000000] [electric_fence/INFO] Sent!
 > [HostC:client:(3) 0.000000] [electric_fence/INFO] Sent!
 > [0.000000] [mc_safety/INFO] No property violation found.
-> [0.000000] [mc_safety/INFO] Expanded states = 15
-> [0.000000] [mc_safety/INFO] Visited states = 32
-> [0.000000] [mc_safety/INFO] Executed transitions = 14
+> [0.000000] [mc_safety/INFO] 15 unique states visited; 5 backtracks (32 transition replays, 13 states visited overall)
index 081a4af..6e56e19 100644 (file)
@@ -23,6 +23,4 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/s4u-mc-failing-assert ${plat
 > [  0.000000] (0:maestro@)   2: iSend(mbox=0)
 > [  0.000000] (0:maestro@)   1: WaitComm(from 2 to 1, mbox=0, no timeout)
 > [  0.000000] (0:maestro@) Path = 1;3;1;1;2;1
-> [  0.000000] (0:maestro@) Expanded states = 18
-> [  0.000000] (0:maestro@) Visited states = 36
-> [  0.000000] (0:maestro@) Executed transitions = 18
+> [  0.000000] (0:maestro@) 18 unique states visited; 4 backtracks (36 transition replays, 14 states visited overall)
index 4bb94f7..e264152 100644 (file)
@@ -10,9 +10,7 @@ $ ../../../smpi_script/bin/smpirun -quiet -wrapper "${bindir:=.}/../../../bin/si
 > rank 1 recv the data
 > Sent 0 to rank 1
 > [0.000000] [mc_safety/INFO] No property violation found.
-> [0.000000] [mc_safety/INFO] Expanded states = 7
-> [0.000000] [mc_safety/INFO] Visited states = 10
-> [0.000000] [mc_safety/INFO] Executed transitions = 8
+> [0.000000] [mc_safety/INFO] 7 unique states visited; 2 backtracks (10 transition replays, 2 states visited overall)
 
 p Testing the paranoid model
 ! timeout 60
@@ -23,10 +21,8 @@ $ ../../../smpi_script/bin/smpirun -quiet -wrapper "${bindir:=.}/../../../bin/si
 > [0.000000] [mc_global/INFO] *** DEADLOCK DETECTED ***
 > [0.000000] [mc_global/INFO] **************************
 > [0.000000] [mc_global/INFO] Counter-example execution trace:
-> [0.000000] [mc_global/INFO]   [(1)node-0.simgrid.org (0)] iSend(src=(1)node-0.simgrid.org (0), buff=(verbose only), size=(verbose only))
-> [0.000000] [mc_global/INFO]   [(2)node-1.simgrid.org (1)] iSend(src=(2)node-1.simgrid.org (1), buff=(verbose only), size=(verbose only))
-> [0.000000] [mc_record/INFO] Path = 1;2
-> [0.000000] [mc_safety/INFO] Expanded states = 3
-> [0.000000] [mc_safety/INFO] Visited states = 3
-> [0.000000] [mc_safety/INFO] Executed transitions = 2
+> [0.000000] [mc_global/INFO]   1: iSend(mbox=2)
+> [0.000000] [mc_global/INFO]   2: iSend(mbox=0)
+> [0.000000] [Api/INFO] Path = 1;2
+> [0.000000] [mc_safety/INFO] 3 unique states visited; 1 backtracks (3 transition replays, 0 states visited overall)
 > Execution failed with code 3.
index 7094cef..5a8c938 100644 (file)
@@ -66,9 +66,9 @@ std::vector<std::string> SafetyChecker::get_textual_trace() // override
 
 void SafetyChecker::log_state() // override
 {
-  XBT_INFO("Expanded states = %ld", State::get_expanded_states());
-  XBT_INFO("Visited states = %lu", api::get().mc_get_visited_states());
-  XBT_INFO("Executed transitions = %lu", Transition::get_executed_transitions());
+  XBT_INFO("%ld unique states visited; %ld backtracks (%ld transition replays, %ld states visited overall)",
+           State::get_expanded_states(), backtrack_count_, api::get().mc_get_visited_states(),
+           Transition::get_replayed_transitions());
 }
 
 void SafetyChecker::run()
@@ -175,6 +175,7 @@ void SafetyChecker::run()
 
 void SafetyChecker::backtrack()
 {
+  backtrack_count_++;
   stack_.pop_back();
 
   api::get().mc_check_deadlock();
index 9a934a8..4cf5f25 100644 (file)
@@ -21,6 +21,7 @@ namespace mc {
 
 class XBT_PRIVATE SafetyChecker : public Checker {
   ReductionMode reductionMode_ = ReductionMode::unset;
+  long backtrack_count_        = 0;
 
 public:
   explicit SafetyChecker(Session* session);
index d67b4fc..153b2ca 100644 (file)
@@ -10,9 +10,7 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug assert ${platfdir
 > [  0.000000] (0:maestro@)   Random([0;5] ~> 3)
 > [  0.000000] (0:maestro@)   Random([0;5] ~> 4)
 > [  0.000000] (0:maestro@) Path = 1/3;1/4
-> [  0.000000] (0:maestro@) Expanded states = 27
-> [  0.000000] (0:maestro@) Visited states = 68
-> [  0.000000] (0:maestro@) Executed transitions = 27
+> [  0.000000] (0:maestro@) 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall)
 
 ! expect return 6
 # because SIMGRID_MC_EXIT_PROGRAM_CRASH = 6
@@ -27,9 +25,7 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug abort ${platfdir}
 > [  0.000000] (0:maestro@)   Random([0;5] ~> 3)
 > [  0.000000] (0:maestro@)   Random([0;5] ~> 4)
 > [  0.000000] (0:maestro@) Path = 1/3;1/4
-> [  0.000000] (0:maestro@) Expanded states = 27
-> [  0.000000] (0:maestro@) Visited states = 68
-> [  0.000000] (0:maestro@) Executed transitions = 27
+> [  0.000000] (0:maestro@) 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall)
 > [  0.000000] (0:maestro@) Stack trace not displayed because you passed --log=no_loc
 
 $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug printf ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" --log=xbt_cfg.thresh:warning
@@ -37,9 +33,7 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug printf ${platfdir
 > [  0.000000] (0:maestro@) Behavior: printf
 > [  0.000000] (1:app@Fafard) Error reached
 > [  0.000000] (0:maestro@) No property violation found.
-> [  0.000000] (0:maestro@) Expanded states = 43
-> [  0.000000] (0:maestro@) Visited states = 108
-> [  0.000000] (0:maestro@) Executed transitions = 42
+> [  0.000000] (0:maestro@) 43 unique states visited; 36 backtracks (108 transition replays, 30 states visited overall)
 
 ! expect return 6
 # because SIMGRID_MC_EXIT_PROGRAM_CRASH = 6
@@ -55,7 +49,5 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug segv ${platfdir}/
 > [  0.000000] (0:maestro@)   Random([0;5] ~> 3)
 > [  0.000000] (0:maestro@)   Random([0;5] ~> 4)
 > [  0.000000] (0:maestro@) Path = 1/3;1/4
-> [  0.000000] (0:maestro@) Expanded states = 27
-> [  0.000000] (0:maestro@) Visited states = 68
-> [  0.000000] (0:maestro@) Executed transitions = 27
+> [  0.000000] (0:maestro@) 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall)
 > [  0.000000] (0:maestro@) Stack trace not displayed because you passed --log=no_loc
index 2942047..91fb56e 100644 (file)
@@ -30,6 +30,4 @@ $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -wrapper
 > This can be done automatically by setting --cfg=smpi/auto-shared-malloc-thresh to the minimum size wanted size (this can alter execution if data content is necessary)
 >
 > [0.000000] [mc_safety/INFO] No property violation found.
-> [0.000000] [mc_safety/INFO] Expanded states = 63
-> [0.000000] [mc_safety/INFO] Visited states = 500
-> [0.000000] [mc_safety/INFO] Executed transitions = 484
+> [0.000000] [mc_safety/INFO] 63 unique states visited; 16 backtracks (500 transition replays, 422 states visited overall)