File: synchro-mutex.tesh

package info (click to toggle)
simgrid 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,192 kB
  • sloc: cpp: 124,913; ansic: 66,744; python: 8,560; java: 6,773; fortran: 6,079; f90: 5,123; xml: 4,587; sh: 2,194; perl: 1,436; makefile: 111; lisp: 49; javascript: 7; sed: 6
file content (37 lines) | stat: -rw-r--r-- 2,627 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env tesh

p Testing Mutex

$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/synchro-mutex.py --platform ${platfdir}/two_hosts.xml --actors 1 "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
>[  0.000000] (1:worker-0(mgr)@Jupiter) Hello simgrid, I'm ready to compute after acquiring the mutex from a context manager
>[  0.000000] (2:worker-0@Tremblay) Hello simgrid, I'm ready to compute after a regular lock
>[  0.000000] (1:worker-0(mgr)@Jupiter) I'm done, good bye
>[  0.000000] (2:worker-0@Tremblay) I'm done, good bye
>[  0.000000] (0:maestro@) Result[0] -> 2

$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/synchro-mutex.py --platform ${platfdir}/two_hosts.xml --actors 5 "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
>[  0.000000] (1:worker-0(mgr)@Jupiter) Hello simgrid, I'm ready to compute after acquiring the mutex from a context manager
>[  0.000000] (3:worker-1(mgr)@Jupiter) Hello simgrid, I'm ready to compute after acquiring the mutex from a context manager
>[  0.000000] (5:worker-2(mgr)@Jupiter) Hello simgrid, I'm ready to compute after acquiring the mutex from a context manager
>[  0.000000] (7:worker-3(mgr)@Jupiter) Hello simgrid, I'm ready to compute after acquiring the mutex from a context manager
>[  0.000000] (9:worker-4(mgr)@Jupiter) Hello simgrid, I'm ready to compute after acquiring the mutex from a context manager
>[  0.000000] (2:worker-0@Tremblay) Hello simgrid, I'm ready to compute after a regular lock
>[  0.000000] (1:worker-0(mgr)@Jupiter) I'm done, good bye
>[  0.000000] (4:worker-1@Tremblay) Hello simgrid, I'm ready to compute after a regular lock
>[  0.000000] (3:worker-1(mgr)@Jupiter) I'm done, good bye
>[  0.000000] (6:worker-2@Tremblay) Hello simgrid, I'm ready to compute after a regular lock
>[  0.000000] (5:worker-2(mgr)@Jupiter) I'm done, good bye
>[  0.000000] (8:worker-3@Tremblay) Hello simgrid, I'm ready to compute after a regular lock
>[  0.000000] (7:worker-3(mgr)@Jupiter) I'm done, good bye
>[  0.000000] (10:worker-4@Tremblay) Hello simgrid, I'm ready to compute after a regular lock
>[  0.000000] (9:worker-4(mgr)@Jupiter) I'm done, good bye
>[  0.000000] (2:worker-0@Tremblay) I'm done, good bye
>[  0.000000] (4:worker-1@Tremblay) I'm done, good bye
>[  0.000000] (6:worker-2@Tremblay) I'm done, good bye
>[  0.000000] (8:worker-3@Tremblay) I'm done, good bye
>[  0.000000] (10:worker-4@Tremblay) I'm done, good bye
>[  0.000000] (0:maestro@) Result[0] -> 2
>[  0.000000] (0:maestro@) Result[1] -> 2
>[  0.000000] (0:maestro@) Result[2] -> 2
>[  0.000000] (0:maestro@) Result[3] -> 2
>[  0.000000] (0:maestro@) Result[4] -> 2