Debian Codegraph @

testsuite/sanitytests/divergence.test

raw
1 #!/bin/sh
2
3 NP=3
4 music_conf="$( echo "${0##*/}" | sed 's/\.test//' ).music"
5
6 abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
7 path="`dirname $abspath`"
8
9 . ${path}/run_test
10
11 write_configuration ()
12 {
13
14 method=$1
15 echo "Communication method: ${method}"
16
17 # this is music configuration file
18 cat <<EOF > "${MUSIC_DATA_PATH}/${music_conf}"
19 stoptime=1.0
20 [from]
21 binary=${TEST_BINDIR}/eventsource
22 args=10 ${MUSIC_DATA_PATH}/spikes
23 np=1
24 [to]
25 binary=${TEST_BINDIR}/eventlogger
26 args=-a
27 np=2
28 from.out -> to.in [10,${method}]
29 EOF
30
31 }
32
33 # this is input data
34 cat <<\EOF > "${MUSIC_DATA_PATH}/spikes0.dat"
35 # spikes
36 0.0 0
37 0.1 1
38 0.2 2
39 0.3 3
40 0.4 4
41 0.5 5
42 0.6 6
43 0.7 7
44 0.8 8
45 0.9 9
46 EOF
47
48 # this is the output we should expect to see
49 cat <<\EOF > "${MUSIC_DATA_PATH}/ok"
50 Rank 0: Event (0, 0) detected at 0
51 Rank 0: Event (1, 0.1) detected at 0
52 Rank 0: Event (2, 0.2) detected at 0
53 Rank 1: Event (0, 0) detected at 0
54 Rank 0: Event (3, 0.3) detected at 0
55 Rank 0: Event (4, 0.4) detected at 0
56 Rank 0: Event (5, 0.5) detected at 0
57 Rank 0: Event (6, 0.6) detected at 0
58 Rank 0: Event (7, 0.7) detected at 0
59 Rank 0: Event (8, 0.8) detected at 0
60 Rank 0: Event (9, 0.9) detected at 0
61 Rank 1: Event (1, 0.1) detected at 0
62 Rank 1: Event (2, 0.2) detected at 0
63 Rank 1: Event (3, 0.3) detected at 0
64 Rank 1: Event (4, 0.4) detected at 0
65 Rank 1: Event (5, 0.5) detected at 0
66 Rank 1: Event (6, 0.6) detected at 0
67 Rank 1: Event (7, 0.7) detected at 0
68 Rank 1: Event (8, 0.8) detected at 0
69 Rank 1: Event (9, 0.9) detected at 0
70 EOF
71 # sort the file using locale specified by current environment
72 sort "${MUSIC_DATA_PATH}/ok" -o "${MUSIC_DATA_PATH}/ok"
73
74 cat <<\EOF > "${MUSIC_DATA_PATH}/errok"
75 EOF
76
77 for method in point-to-point collective ; do
78 write_configuration "${method}"
79
80 run_test "${NP}" "${music_conf}"
81 exit_code=$?
82
83 if test "${exit_code}" -gt 0 ; then
84 exit "${exit_code}"
85 fi
86 done
87
88 exit 0
89
90