-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark
executable file
·153 lines (137 loc) · 3.44 KB
/
benchmark
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env bash
set -ex
GPUS=1
CPUS=0
BUILD=1
CASE=galaxy
#NUMA=-1
NUMA=0
export NO_PRINT=1
export NO_SAVE=1
fps=(double)
dims=(3)
steps=200
compilers=(acpp clang gcc nvgpu nvcpu)
if [ "${GPU}" = "amd" ]; then
compilers=(amdclang acpp)
elif [ "${GPU}" = "intel" ]; then
compilers=(acpp)
fi
algorithms=(all-pairs octree bvh all-pairs-collapsed)
if [ $BUILD = "1" ]; then
# Build all binaries
for c in ${compilers[@]}; do
for d in ${dims[@]}; do
BUILD_ONLY=1 ./ci/run ${c} all-pairs $CASE ${d}
done
done
# Build all binaries sequentially
for c in ${compilers[@]}; do
for d in ${dims[@]}; do
BUILD_ONLY=1 ./ci/run ${c} all-pairs $CASE ${d} double 1000 1000 1
done
done
fi
if command -v nvidia-smi > /dev/null ; then
# Log which GPU and Driver this run is from
nvidia-smi --query-gpu=gpu_name,driver_version --format=csv
elif command -v xpu-smi > /dev/null; then
xpu-smi discovery
fi
lscpu | grep "Model name"
lscpu | grep "Core(s) per socket"
echo "hostname:$(hostname)"
if [ $GPUS = "1" ]; then
compilers=(nvgpu acpp)
if [ "${GPU}" = "amd" ]; then
#compilers=(amdclang acpp)
compilers=(acpp)
algorithms=(all-pairs all-pairs-collapsed bvh)
elif [ "${GPU}" = "intel" ]; then
compilers=(acpp)
algorithms=(all-pairs bvh)
fi
# Run for all algorithms
bodies=(100000)
for fp in ${fps[@]}; do
for d in ${dims[@]}; do
for a in ${algorithms[@]}; do
for c in ${compilers[@]}; do
echo "compiler:${c}"
for b in ${bodies[@]}; do
NUMA=$NUMA RUN_ONLY=1 ./ci/run ${c} ${a} $CASE ${d} ${fp} ${b} ${steps}
done
done
done
done
done
# Only run large problems for these algorithms:
algorithms=(octree bvh)
if [ "${GPU}" = "amd" ]; then
algorithms=(bvh)
elif [ "${GPU}" = "intel" ]; then
algorithms=(bvh)
fi
bodies=(1000000)
for fp in ${fps[@]}; do
for d in ${dims[@]}; do
for a in ${algorithms[@]}; do
for c in ${compilers[@]}; do
echo "compiler:${c}"
for b in ${bodies[@]}; do
NUMA=$NUMA RUN_ONLY=1 ./ci/run ${c} ${a} $CASE ${d} ${fp} ${b} ${steps}
done
done
done
done
done
fi
if [ $CPUS = "1" ]; then
compilers=(nvcpu clang)
# Only run mid sizes on CPUs for algorithms different from all-pairs-collapsed
algorithms=(all-pairs octree bvh all-pairs-collapsed)
bodies=(100000)
for fp in ${fps[@]}; do
for d in ${dims[@]}; do
for a in ${algorithms[@]}; do
for c in ${compilers[@]}; do
echo "compiler:${c}"
for b in ${bodies[@]}; do
NUMA=$NUMA RUN_ONLY=1 ./ci/run ${c} ${a} $CASE ${d} ${fp} ${b} ${steps}
done
done
done
done
done
# Only run large problems for these algorithms:
algorithms=(octree bvh)
bodies=(1000000)
for fp in ${fps[@]}; do
for d in ${dims[@]}; do
for a in ${algorithms[@]}; do
for c in ${compilers[@]}; do
echo "compiler:${c}"
for b in ${bodies[@]}; do
NUMA=$NUMA RUN_ONLY=1 ./ci/run ${c} ${a} $CASE ${d} ${fp} ${b} ${steps}
done
done
done
done
done
# Only run small sizes sequentially
bodies=(10000)
algorithms=(all-pairs octree bvh all-pairs-collapsed)
echo "sequential:1"
for fp in ${fps[@]}; do
for d in ${dims[@]}; do
for a in ${algorithms[@]}; do
for c in ${compilers[@]}; do
echo "compiler:${c}"
for b in ${bodies[@]}; do
NUMA=$NUMA RUN_ONLY=1 ./ci/run ${c} ${a} $CASE ${d} ${fp} ${b} ${steps} 1
done
done
done
done
done
fi