-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench
73 lines (55 loc) · 1.22 KB
/
bench
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
####################################################################
# Intel Xeon Phi KNC benchmarking script
#
# by Alexander M. Albertian, 10 Dec 2016
#
# Do NOT set -e!
EXE="./dls9.mic"
DATA="dls9_count_data"
for fn in "$EXE" "$DATA"; do
if [ ! -f "$fn" ]; then
echo "*** ERROR: File \"$fn\" doesn't exist" >&2
exit 1
fi
done
chmod 0755 "$EXE" 2>&1 >/dev/null
MPIEXEC="$(which "mpiexec" 2>/dev/null | head -n 1 2>/dev/null)"
if [ -z "$MPIEXEC" ] || [ ! -x "$MPIEXEC" ]; then
echo "*** ERROR: Can't find mpiexec" >&2
exit 1
else
echo "MPIEXEC : \"$MPIEXEC\"" >&2
fi
START=1
STEP=1
let "NPROC=$1" 2>/dev/null
let "STOP=$2" 2>/dev/null
if [ ! -z "$NPROC" ]; then
START=$NPROC
fi
let START+=1
if [ -z "$STOP" ]; then
STOP=280
fi
let STOP+=1
echo " START = $START" >&2
echo " STOP = $STOP" >&2
echo " STEP = $STEP" >&2
echo >&2
if [ $START -lt 2 -o $START -gt $STOP ]; then
echo "*** ERROR: Invalid number of processes" >&2
exit 1
fi
for i in `seq $START $STEP $STOP`; do
echo "= $i Ranks =============================" >&2
"$MPIEXEC" -np $i "$EXE" "$DATA" -1 /dev/null >"$i.log" 2>&1
RES=$?
if [ $RES -ne 0 ]; then
echo "*** ERROR: ($RES)" >&2
exit 1
fi
echo "...Ok" >&2
sleep 1s
done
exit 0