Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
3ef36cc3a26f586b012cbc4cf5fb20084a0cf1aa
[simgrid.git] / examples / cpp / synchro-mutex / s4u-mc-synchro-mutex.tesh
1 #!/usr/bin/env tesh
2
3 p This file tests the dependencies between MUTEX transitions
4
5 $ $VALGRIND_NO_TRACE_CHILDREN ${bindir:=.}/../../../bin/simgrid-mc --log=mc_dfs.thres:verbose --log=root.fmt="[Checker]%e%m%n" -- ${bindir:=.}/s4u-synchro-mutex --cfg=actors:1 --log=s4u_test.thres:critical --log=root.fmt="[App%e%e%e%e]%e%m%n"
6 > [App    ] Configuration change: Set 'actors' to '1'
7 > [Checker] Start a DFS exploration. Reduction is: dpor.
8 > [Checker] Execute 1: MUTEX_ASYNC_LOCK(mutex: 0, owner: 1) (stack depth: 1, state: 1, 0 interleaves)
9 > [Checker] Execute 1: MUTEX_WAIT(mutex: 0, owner: 1) (stack depth: 2, state: 2, 0 interleaves)
10 > [Checker] Execute 1: MUTEX_UNLOCK(mutex: 0, owner: -1) (stack depth: 3, state: 3, 0 interleaves)
11 > [Checker] Execute 2: MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (stack depth: 4, state: 4, 0 interleaves)
12 > [Checker] INDEPENDENT Transitions:
13 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: -1) (state=3)
14 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=4)
15 > [Checker] INDEPENDENT Transitions:
16 > [Checker]   MUTEX_WAIT(mutex: 0, owner: 1) (state=2)
17 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=4)
18 > [Checker] Dependent Transitions:
19 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 1) (state=1)
20 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=4)
21 > [Checker] Execute 2: MUTEX_WAIT(mutex: 0, owner: 2) (stack depth: 5, state: 5, 0 interleaves)
22 > [Checker] Dependent Transitions:
23 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: -1) (state=3)
24 > [Checker]   MUTEX_WAIT(mutex: 0, owner: 2) (state=5)
25 > [Checker] Execute 2: MUTEX_UNLOCK(mutex: 0, owner: -1) (stack depth: 6, state: 6, 0 interleaves)
26 > [Checker] Dependent Transitions:
27 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: -1) (state=3)
28 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: -1) (state=6)
29 > [Checker] 0 actors remain, but none of them need to be interleaved (depth 8).
30 > [Checker] Execution came to an end at 1;1;1;2;2;2 (state: 7, depth: 7)
31 > [Checker] Backtracking from 1;1;1;2;2;2
32 > [Checker] Execute 2: MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (stack depth: 1, state: 1, 0 interleaves)
33 > [Checker] Execute 1: MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (stack depth: 2, state: 8, 0 interleaves)
34 > [Checker] Dependent Transitions:
35 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=1)
36 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=8)
37 > [Checker] Execute 2: MUTEX_WAIT(mutex: 0, owner: 2) (stack depth: 3, state: 9, 0 interleaves)
38 > [Checker] INDEPENDENT Transitions:
39 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=8)
40 > [Checker]   MUTEX_WAIT(mutex: 0, owner: 2) (state=9)
41 > [Checker] Execute 2: MUTEX_UNLOCK(mutex: 0, owner: 1) (stack depth: 4, state: 10, 0 interleaves)
42 > [Checker] INDEPENDENT Transitions:
43 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=8)
44 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: 1) (state=10)
45 > [Checker] Execute 1: MUTEX_WAIT(mutex: 0, owner: 1) (stack depth: 5, state: 11, 0 interleaves)
46 > [Checker] Dependent Transitions:
47 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: 1) (state=10)
48 > [Checker]   MUTEX_WAIT(mutex: 0, owner: 1) (state=11)
49 > [Checker] Execute 1: MUTEX_UNLOCK(mutex: 0, owner: -1) (stack depth: 6, state: 12, 0 interleaves)
50 > [Checker] Dependent Transitions:
51 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: 1) (state=10)
52 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: -1) (state=12)
53 > [Checker] 0 actors remain, but none of them need to be interleaved (depth 8).
54 > [Checker] Execution came to an end at 2;1;2;2;1;1 (state: 13, depth: 7)
55 > [Checker] Backtracking from 2;1;2;2;1;1
56 > [Checker] Execute 2: MUTEX_ASYNC_LOCK(mutex: 0, owner: 1) (stack depth: 3, state: 3, 0 interleaves)
57 > [Checker] INDEPENDENT Transitions:
58 > [Checker]   MUTEX_WAIT(mutex: 0, owner: 1) (state=2)
59 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 1) (state=3)
60 > [Checker] Execute 1: MUTEX_UNLOCK(mutex: 0, owner: 2) (stack depth: 4, state: 14, 0 interleaves)
61 > [Checker] INDEPENDENT Transitions:
62 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 1) (state=3)
63 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: 2) (state=14)
64 > [Checker] INDEPENDENT Transitions:
65 > [Checker]   MUTEX_ASYNC_LOCK(mutex: 0, owner: 2) (state=1)
66 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: 2) (state=14)
67 > [Checker] Execute 2: MUTEX_WAIT(mutex: 0, owner: 2) (stack depth: 5, state: 15, 0 interleaves)
68 > [Checker] Dependent Transitions:
69 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: 2) (state=14)
70 > [Checker]   MUTEX_WAIT(mutex: 0, owner: 2) (state=15)
71 > [Checker] Execute 2: MUTEX_UNLOCK(mutex: 0, owner: -1) (stack depth: 6, state: 16, 0 interleaves)
72 > [Checker] Dependent Transitions:
73 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: 2) (state=14)
74 > [Checker]   MUTEX_UNLOCK(mutex: 0, owner: -1) (state=16)
75 > [Checker] 0 actors remain, but none of them need to be interleaved (depth 8).
76 > [Checker] Execution came to an end at 1;1;2;1;2;2 (state: 17, depth: 7)
77 > [Checker] Backtracking from 1;1;2;1;2;2
78 > [Checker] DFS exploration ended. 17 unique states visited; 2 backtracks (21 transition replays, 2 states visited overall)
79
80 $ $VALGRIND_NO_TRACE_CHILDREN ${bindir:=.}/../../../bin/simgrid-mc --cfg=model-check/sleep-set:true -- ${bindir:=.}/s4u-synchro-mutex --cfg=actors:2 --log=s4u_test.thres:critical
81 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/sleep-set' to 'true'
82 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'actors' to '2'
83 > [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
84 > [0.000000] [mc_dfs/INFO] DFS exploration ended. 130 unique states visited; 27 backtracks (308 transition replays, 151 states visited overall)
85
86 $ $VALGRIND_NO_TRACE_CHILDREN ${bindir:=.}/../../../bin/simgrid-mc --cfg=model-check/sleep-set:true --cfg=model-check/strategy:nb_wait -- ${bindir:=.}/s4u-synchro-mutex  --cfg=actors:3 --log=s4u_test.thres:critical
87 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/sleep-set' to 'true'
88 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/strategy' to 'nb_wait'
89 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'actors' to '3'
90 > [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
91 > [0.000000] [mc_dfs/INFO] DFS exploration ended. 3492 unique states visited; 743 backtracks (12498 transition replays, 8263 states visited overall)