Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make synchro-mutex.py in line with s4u-synchro-mutex.cpp
[simgrid.git] / examples / python / synchro-mutex / synchro-mutex.tesh
1 #!/usr/bin/env tesh
2
3 p Testing Mutex
4
5 $ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/synchro-mutex.py --platform ${platfdir}/two_hosts.xml --actors 0 "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
6 >[ 10.000000] (1:master@Tremblay) The final result is: 0
7
8 $ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/synchro-mutex.py --platform ${platfdir}/two_hosts.xml --actors 1 "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
9 >[  0.000000] (2:worker-0(mgr)@Jupiter) I just started
10 >[  0.000000] (2:worker-0(mgr)@Jupiter) acquired the mutex with context manager
11 >[  0.000000] (2:worker-0(mgr)@Jupiter) updated shared result, which is now 1
12 >[  0.000000] (3:worker-0@Tremblay) I just started
13 >[  0.000000] (2:worker-0(mgr)@Jupiter) released the mutex after leaving the context manager
14 >[  0.000000] (2:worker-0(mgr)@Jupiter) Bye now!
15 >[  0.000000] (3:worker-0@Tremblay) acquired the mutex manually
16 >[  0.000000] (3:worker-0@Tremblay) updated shared result, which is now 2
17 >[  0.000000] (3:worker-0@Tremblay) released the mutex manually
18 >[  0.000000] (3:worker-0@Tremblay) Bye now!
19 >[ 10.000000] (1:master@Tremblay) The final result is: 2
20
21 $ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/synchro-mutex.py --platform ${platfdir}/two_hosts.xml --actors 5 "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
22 >[  0.000000] (2:worker-0(mgr)@Jupiter) I just started
23 >[  0.000000] (2:worker-0(mgr)@Jupiter) acquired the mutex with context manager
24 >[  0.000000] (2:worker-0(mgr)@Jupiter) updated shared result, which is now 1
25 >[  0.000000] (3:worker-0@Tremblay) I just started
26 >[  0.000000] (2:worker-0(mgr)@Jupiter) released the mutex after leaving the context manager
27 >[  0.000000] (2:worker-0(mgr)@Jupiter) Bye now!
28 >[  0.000000] (3:worker-0@Tremblay) acquired the mutex manually
29 >[  0.000000] (3:worker-0@Tremblay) updated shared result, which is now 2
30 >[  0.000000] (4:worker-1(mgr)@Jupiter) I just started
31 >[  0.000000] (3:worker-0@Tremblay) released the mutex manually
32 >[  0.000000] (3:worker-0@Tremblay) Bye now!
33 >[  0.000000] (4:worker-1(mgr)@Jupiter) acquired the mutex with context manager
34 >[  0.000000] (4:worker-1(mgr)@Jupiter) updated shared result, which is now 3
35 >[  0.000000] (5:worker-1@Tremblay) I just started
36 >[  0.000000] (4:worker-1(mgr)@Jupiter) released the mutex after leaving the context manager
37 >[  0.000000] (4:worker-1(mgr)@Jupiter) Bye now!
38 >[  0.000000] (5:worker-1@Tremblay) acquired the mutex manually
39 >[  0.000000] (5:worker-1@Tremblay) updated shared result, which is now 4
40 >[  0.000000] (6:worker-2(mgr)@Jupiter) I just started
41 >[  0.000000] (5:worker-1@Tremblay) released the mutex manually
42 >[  0.000000] (5:worker-1@Tremblay) Bye now!
43 >[  0.000000] (6:worker-2(mgr)@Jupiter) acquired the mutex with context manager
44 >[  0.000000] (6:worker-2(mgr)@Jupiter) updated shared result, which is now 5
45 >[  0.000000] (7:worker-2@Tremblay) I just started
46 >[  0.000000] (6:worker-2(mgr)@Jupiter) released the mutex after leaving the context manager
47 >[  0.000000] (6:worker-2(mgr)@Jupiter) Bye now!
48 >[  0.000000] (7:worker-2@Tremblay) acquired the mutex manually
49 >[  0.000000] (7:worker-2@Tremblay) updated shared result, which is now 6
50 >[  0.000000] (8:worker-3(mgr)@Jupiter) I just started
51 >[  0.000000] (7:worker-2@Tremblay) released the mutex manually
52 >[  0.000000] (7:worker-2@Tremblay) Bye now!
53 >[  0.000000] (8:worker-3(mgr)@Jupiter) acquired the mutex with context manager
54 >[  0.000000] (8:worker-3(mgr)@Jupiter) updated shared result, which is now 7
55 >[  0.000000] (9:worker-3@Tremblay) I just started
56 >[  0.000000] (8:worker-3(mgr)@Jupiter) released the mutex after leaving the context manager
57 >[  0.000000] (8:worker-3(mgr)@Jupiter) Bye now!
58 >[  0.000000] (9:worker-3@Tremblay) acquired the mutex manually
59 >[  0.000000] (9:worker-3@Tremblay) updated shared result, which is now 8
60 >[  0.000000] (10:worker-4(mgr)@Jupiter) I just started
61 >[  0.000000] (9:worker-3@Tremblay) released the mutex manually
62 >[  0.000000] (9:worker-3@Tremblay) Bye now!
63 >[  0.000000] (10:worker-4(mgr)@Jupiter) acquired the mutex with context manager
64 >[  0.000000] (10:worker-4(mgr)@Jupiter) updated shared result, which is now 9
65 >[  0.000000] (11:worker-4@Tremblay) I just started
66 >[  0.000000] (10:worker-4(mgr)@Jupiter) released the mutex after leaving the context manager
67 >[  0.000000] (10:worker-4(mgr)@Jupiter) Bye now!
68 >[  0.000000] (11:worker-4@Tremblay) acquired the mutex manually
69 >[  0.000000] (11:worker-4@Tremblay) updated shared result, which is now 10
70 >[  0.000000] (11:worker-4@Tremblay) released the mutex manually
71 >[  0.000000] (11:worker-4@Tremblay) Bye now!
72 >[ 10.000000] (1:master@Tremblay) The final result is: 10