| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
NP=4 |
| 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 |
np=1 |
| 20 |
stoptime=1.1 |
| 21 |
[A] |
| 22 |
binary=${TEST_BINARY}/eventdelay |
| 23 |
args=-d 0.1 -L 1 -b 2 |
| 24 |
[B] |
| 25 |
binary=${TEST_BINARY}/eventdelay |
| 26 |
args=-d 0.1 -L 2 -b 2 |
| 27 |
[from] |
| 28 |
binary=${TEST_BINARY}/eventsource |
| 29 |
args=-b 5 10 ${MUSIC_DATA_PATH}/spikes |
| 30 |
[to] |
| 31 |
binary=${TEST_BINARY}/eventlogger |
| 32 |
args=-b 5 |
| 33 |
|
| 34 |
from.out -> A.in [10, ${method}] |
| 35 |
A.out -> B.in [10, ${method}] |
| 36 |
B.out -> A.aux [10, ${method}] |
| 37 |
B.out -> to.in [10, ${method}] |
| 38 |
EOF |
| 39 |
|
| 40 |
} |
| 41 |
|
| 42 |
# this is input data |
| 43 |
cat <<\EOF > "${MUSIC_DATA_PATH}/spikes0.dat" |
| 44 |
# spikes |
| 45 |
0.0 0 |
| 46 |
0.1 1 |
| 47 |
0.2 2 |
| 48 |
0.3 3 |
| 49 |
0.4 4 |
| 50 |
0.5 5 |
| 51 |
0.6 6 |
| 52 |
0.7 7 |
| 53 |
0.8 8 |
| 54 |
0.9 9 |
| 55 |
EOF |
| 56 |
|
| 57 |
# this is the output we should expect to see |
| 58 |
cat <<\EOF > "${MUSIC_DATA_PATH}/ok" |
| 59 |
1:Got(0, 0.1) |
| 60 |
1:Got(1, 0.2) |
| 61 |
1:Sent(0, 0.1 @0.1) |
| 62 |
2:Got(0, 0.2) |
| 63 |
2:Sent(0, 0.2 @0.2) |
| 64 |
1:Got(0, 0.3) |
| 65 |
1:Sent(1, 0.2 @0.2) |
| 66 |
1:Got(2, 0.3) |
| 67 |
2:Got(1, 0.3) |
| 68 |
2:Sent(1, 0.3 @0.3) |
| 69 |
1:Got(1, 0.4) |
| 70 |
1:Sent(0, 0.3 @0.3) |
| 71 |
1:Sent(2, 0.3 @0.3) |
| 72 |
2:Got(0, 0.4) |
| 73 |
1:Got(3, 0.4) |
| 74 |
2:Got(2, 0.4) |
| 75 |
Rank 0: Event (0, 0.2) detected at 0.19 |
| 76 |
Rank 0: Event (1, 0.3) detected at 0.29 |
| 77 |
2:Sent(0, 0.4 @0.4) |
| 78 |
2:Sent(2, 0.4 @0.4) |
| 79 |
1:Got(0, 0.5) |
| 80 |
1:Got(2, 0.5) |
| 81 |
Rank 0: Event (0, 0.4) detected at 0.39 |
| 82 |
Rank 0: Event (2, 0.4) detected at 0.39 |
| 83 |
1:Sent(1, 0.4 @0.4) |
| 84 |
2:Got(1, 0.5) |
| 85 |
2:Got(3, 0.5) |
| 86 |
1:Sent(3, 0.4 @0.4) |
| 87 |
1:Got(4, 0.5) |
| 88 |
2:Sent(1, 0.5 @0.5) |
| 89 |
2:Sent(3, 0.5 @0.5) |
| 90 |
Rank 0: Event (1, 0.5) detected at 0.49 |
| 91 |
Rank 0: Event (3, 0.5) detected at 0.49 |
| 92 |
1:Got(1, 0.6) |
| 93 |
1:Got(3, 0.6) |
| 94 |
1:Sent(0, 0.5 @0.5) |
| 95 |
1:Sent(2, 0.5 @0.5) |
| 96 |
1:Sent(4, 0.5 @0.5) |
| 97 |
2:Got(0, 0.6) |
| 98 |
2:Got(2, 0.6) |
| 99 |
2:Got(4, 0.6) |
| 100 |
1:Got(0, 0.7) |
| 101 |
2:Sent(0, 0.6 @0.59) |
| 102 |
2:Sent(2, 0.6 @0.59) |
| 103 |
2:Sent(4, 0.6 @0.59) |
| 104 |
Rank 0: Event (0, 0.6) detected at 0.54 |
| 105 |
Rank 0: Event (2, 0.6) detected at 0.54 |
| 106 |
1:Got(2, 0.7) |
| 107 |
1:Got(4, 0.7) |
| 108 |
Rank 0: Event (4, 0.6) detected at 0.54 |
| 109 |
1:Got(5, 0.6) |
| 110 |
1:Got(6, 0.7) |
| 111 |
1:Sent(1, 0.6 @0.59) |
| 112 |
1:Sent(3, 0.6 @0.59) |
| 113 |
1:Sent(5, 0.6 @0.59) |
| 114 |
2:Got(1, 0.7) |
| 115 |
2:Got(3, 0.7) |
| 116 |
2:Got(5, 0.7) |
| 117 |
2:Sent(1, 0.7 @0.69) |
| 118 |
2:Sent(3, 0.7 @0.69) |
| 119 |
2:Sent(5, 0.7 @0.69) |
| 120 |
1:Got(1, 0.8) |
| 121 |
1:Got(3, 0.8) |
| 122 |
Rank 0: Event (1, 0.7) detected at 0.64 |
| 123 |
Rank 0: Event (3, 0.7) detected at 0.64 |
| 124 |
1:Got(5, 0.8) |
| 125 |
1:Sent(0, 0.7 @0.69) |
| 126 |
1:Sent(2, 0.7 @0.69) |
| 127 |
1:Sent(4, 0.7 @0.69) |
| 128 |
1:Sent(6, 0.7 @0.69) |
| 129 |
1:Got(7, 0.8) |
| 130 |
Rank 0: Event (5, 0.7) detected at 0.64 |
| 131 |
2:Got(0, 0.8) |
| 132 |
2:Got(2, 0.8) |
| 133 |
2:Got(4, 0.8) |
| 134 |
2:Got(6, 0.8) |
| 135 |
2:Sent(0, 0.8 @0.79) |
| 136 |
2:Sent(2, 0.8 @0.79) |
| 137 |
2:Sent(4, 0.8 @0.79) |
| 138 |
2:Sent(6, 0.8 @0.79) |
| 139 |
Rank 0: Event (0, 0.8) detected at 0.74 |
| 140 |
Rank 0: Event (2, 0.8) detected at 0.74 |
| 141 |
Rank 0: Event (4, 0.8) detected at 0.74 |
| 142 |
Rank 0: Event (6, 0.8) detected at 0.74 |
| 143 |
1:Got(0, 0.9) |
| 144 |
1:Got(2, 0.9) |
| 145 |
1:Got(4, 0.9) |
| 146 |
1:Got(6, 0.9) |
| 147 |
1:Sent(1, 0.8 @0.79) |
| 148 |
1:Sent(3, 0.8 @0.79) |
| 149 |
1:Sent(5, 0.8 @0.79) |
| 150 |
1:Sent(7, 0.8 @0.79) |
| 151 |
2:Got(1, 0.9) |
| 152 |
2:Got(3, 0.9) |
| 153 |
2:Got(5, 0.9) |
| 154 |
2:Got(7, 0.9) |
| 155 |
1:Got(8, 0.9) |
| 156 |
2:Sent(1, 0.9 @0.89) |
| 157 |
2:Sent(3, 0.9 @0.89) |
| 158 |
2:Sent(5, 0.9 @0.89) |
| 159 |
2:Sent(7, 0.9 @0.89) |
| 160 |
1:Got(1, 1) |
| 161 |
1:Got(3, 1) |
| 162 |
1:Got(5, 1) |
| 163 |
1:Got(7, 1) |
| 164 |
1:Sent(0, 0.9 @0.89) |
| 165 |
Rank 0: Event (1, 0.9) detected at 0.84 |
| 166 |
Rank 0: Event (3, 0.9) detected at 0.84 |
| 167 |
1:Sent(2, 0.9 @0.89) |
| 168 |
1:Sent(4, 0.9 @0.89) |
| 169 |
1:Sent(6, 0.9 @0.89) |
| 170 |
1:Sent(8, 0.9 @0.9) |
| 171 |
Rank 0: Event (5, 0.9) detected at 0.84 |
| 172 |
1:Got(9, 1) |
| 173 |
Rank 0: Event (7, 0.9) detected at 0.84 |
| 174 |
2:Got(0, 1) |
| 175 |
2:Got(2, 1) |
| 176 |
2:Got(4, 1) |
| 177 |
2:Got(6, 1) |
| 178 |
2:Got(8, 1) |
| 179 |
2:Sent(0, 1 @0.99) |
| 180 |
2:Sent(2, 1 @0.99) |
| 181 |
2:Sent(4, 1 @0.99) |
| 182 |
2:Sent(6, 1 @0.99) |
| 183 |
1:Got(0, 1.1) |
| 184 |
1:Got(2, 1.1) |
| 185 |
1:Got(4, 1.1) |
| 186 |
2:Sent(8, 1 @1) |
| 187 |
Rank 0: Event (0, 1) detected at 0.94 |
| 188 |
1:Got(6, 1.1) |
| 189 |
1:Sent(1, 1 @0.99) |
| 190 |
Rank 0: Event (2, 1) detected at 0.94 |
| 191 |
Rank 0: Event (4, 1) detected at 0.94 |
| 192 |
Rank 0: Event (6, 1) detected at 0.94 |
| 193 |
1:Sent(3, 1 @0.99) |
| 194 |
1:Sent(5, 1 @0.99) |
| 195 |
1:Sent(7, 1 @0.99) |
| 196 |
1:Got(8, 1.1) |
| 197 |
1:Sent(9, 1 @1) |
| 198 |
2:Got(1, 1.1) |
| 199 |
Rank 0: Event (8, 1) detected at 0.99 |
| 200 |
2:Got(3, 1.1) |
| 201 |
2:Got(5, 1.1) |
| 202 |
2:Got(7, 1.1) |
| 203 |
2:Got(9, 1.1) |
| 204 |
2:Sent(1, 1.1 @1.09) |
| 205 |
2:Sent(3, 1.1 @1.09) |
| 206 |
2:Sent(5, 1.1 @1.09) |
| 207 |
2:Sent(7, 1.1 @1.09) |
| 208 |
1:Got(1, 1.2) |
| 209 |
1:Got(3, 1.2) |
| 210 |
1:Got(5, 1.2) |
| 211 |
1:Got(7, 1.2) |
| 212 |
1:Sent(0, 1.1 @1.09) |
| 213 |
1:Sent(2, 1.1 @1.09) |
| 214 |
1:Sent(4, 1.1 @1.09) |
| 215 |
1:Sent(6, 1.1 @1.09) |
| 216 |
Rank 0: Event (1, 1.1) detected at 1.04 |
| 217 |
Rank 0: Event (3, 1.1) detected at 1.04 |
| 218 |
Rank 0: Event (5, 1.1) detected at 1.04 |
| 219 |
Rank 0: Event (7, 1.1) detected at 1.04 |
| 220 |
2:Got(0, 1.2) |
| 221 |
2:Got(2, 1.2) |
| 222 |
2:Got(4, 1.2) |
| 223 |
2:Got(6, 1.2) |
| 224 |
EOF |
| 225 |
# sort the file using locale specified by current environment |
| 226 |
sort "${MUSIC_DATA_PATH}/ok" -o "${MUSIC_DATA_PATH}/ok" |
| 227 |
|
| 228 |
cat <<\EOF > "${MUSIC_DATA_PATH}/errok" |
| 229 |
EOF |
| 230 |
|
| 231 |
for method in point-to-point collective ; do |
| 232 |
write_configuration "${method}" |
| 233 |
|
| 234 |
run_test "${NP}" "${music_conf}" |
| 235 |
exit_code=$? |
| 236 |
|
| 237 |
if test "${exit_code}" -gt 0 ; then |
| 238 |
exit "${exit_code}" |
| 239 |
fi |
| 240 |
done |
| 241 |
|
| 242 |
exit 0 |
| 243 |
|
| 244 |
|