-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_benchmarks_cpp.sh
73 lines (69 loc) · 2.27 KB
/
run_benchmarks_cpp.sh
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 -e
N_CPUS=$([ $(uname) == 'Darwin' ] && sysctl -n hw.physicalcpu_max ||
lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l)
N_CPUS_LOGICAL=$([ $(uname) == 'Darwin' ] && sysctl -n hw.logicalcpu_max ||
lscpu -p | egrep -v '^#' | wc -l)
echo "Physical number of processors: $N_CPUS"
echo "Logical number of processors: $N_CPUS_LOGICAL"
if [ "$3" == "test" ]; then
THREADS="1 $N_CPUS"
THREADS_BIG="$N_CPUS"
SCALING="1 8"
SCALING_BIG="32"
MONITORS="false"
N_REPEATS=1
RUNTIME=1
else
if [ $N_CPUS -ne $N_CPUS_LOGICAL ]; then
THREADS="1 $N_CPUS $N_CPUS_LOGICAL"
THREADS_BIG="$N_CPUS $N_CPUS_LOGICAL"
else
THREADS="1 $N_CPUS"
THREADS_BIG="$N_CPUS"
fi
SCALING="0.05 0.1 0.25 0.5 1 2 4 8 16 32 64"
MONITORS="false"
if [ "$1" == "COBAHH.py" ]; then
if [ "$3" == "short" ]; then
SCALING_BIG="128"
else
SCALING_BIG="128 256 512"
fi
else
if [ "$3" == "short" ]; then
SCALING_BIG="128 256 512 1024 2048 4096"
else
SCALING_BIG="128 256 512 1024 2048 4096 8192"
fi
fi
N_REPEATS=3
RUNTIME=10
fi
for monitor in $MONITORS; do
for threads in $THREADS; do
for scaling in $SCALING; do
for float_dtype in float32 float64; do
for repeat in $(seq $N_REPEATS); do
echo Repeat $repeat: python $1 $scaling cpp_standalone $threads $RUNTIME $monitor $float_dtype $2
python $1 $scaling cpp_standalone $threads $RUNTIME $monitor $float_dtype $2
rm -r output
done
done
done
done
done
# The really long runs (don't run with low # of threads, etc.)
RUNTIME=1
for monitor in $MONITORS; do
for threads in $THREADS_BIG; do
for scaling in $SCALING_BIG; do
for float_dtype in float32 float64; do
for repeat in $(seq $N_REPEATS); do
echo Repeat $repeat: python $1 $scaling cpp_standalone $threads $RUNTIME $monitor $float_dtype $2
python $1 $scaling cpp_standalone $threads $RUNTIME $monitor $float_dtype $2
rm -r output
done
done
done
done
done