-
Notifications
You must be signed in to change notification settings - Fork 2
/
gpu_tests.sh
executable file
·222 lines (202 loc) · 13.3 KB
/
gpu_tests.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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
#!/bin/bash
max_cpu_threads=10
max_gpu_executors=128
max_level=4
stop_step=20
# Get base dir
basedir=`pwd`
# Get current date
today=`date +%Y-%m-%d_%H:%M:%S`
# Create Test folder
result_folder="Testrun-$today"
mkdir "$result_folder"
# Log configuration
echo "Using scenarion file: $1" | tee "$result_folder/LOG.txt"
# Create input files files
octotiger_args_gen="--problem=solid_sphere --max_level=${max_level} --hydro=off --xscale=1.0 --disable_diagnostics=on --disable_output=off --stop_step=1 --theta=0.34 "
eval "./build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args_gen"
cd "$result_folder"
cp ../final.silo final.silo
cp -r ../final.silo.data final.silo.data
# ===============================================
# ===============================================
# GPU Testing with events
gpu_args=" --cuda_streams_per_gpu=${max_gpu_executors} --cuda_buffer_capacity=1 "
octotiger_args="--problem=solid_sphere --max_level=${max_level} --hydro=off --xscale=1.0 --restart_file=../final.silo --disable_diagnostics=on --disable_output=on --stop_step=${stop_step} --theta=0.34 "
# 5. Testing for Vc + CUDA Baseline
# ------------------------------------------------
build_command="./build-all.sh Release with-CC with-cuda without-mpi without-papi without-apex with-kokkos with-simd without-hpx-backend-multipole without-hpx-backend-monopole with-hpx-cuda-polling kokkos octotiger"
kernel_args=" --multipole_device_kernel_type=CUDA --monopole_device_kernel_type=CUDA --multipole_host_kernel_type=Vc --monopole_host_kernel_type=Vc "
echo "# Date of run $today" > test1_gpu_baseline_results.txt
echo "# Measuring computation time using Vc + CUDA kernels (GPU args: $gpu_args " >> test1_gpu_baseline_results.txt
echo "# threads, runtime" >> test1_gpu_baseline_results.txt
pushd ..
rm -rf "./build/octotiger/build"
rm -rf "./build/kokkos"
rm -rf "./build/hpx-kokkos"
eval "${build_command}"
popd
for i in `seq 1 1 ${max_cpu_threads}`; do
output1="$(./../build/octotiger/build/octotiger -t$i $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test1_gpu_baseline_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 55 Testing for Vc + CUDA Baseline
#-------------------------------------------
echo "# Date of run $today" > test2_cuda_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of CUDA +vc device executors / polling " >> test2_cuda_gpu_executor_results.txt
echo "# executors, runtime" >> test2_cuda_gpu_executor_results.txt
kernel_args=" --multipole_device_kernel_type=CUDA --monopole_device_kernel_type=CUDA --multipole_host_kernel_type=Vc --monopole_host_kernel_type=Vc "
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=1 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test2_cuda_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 55 Testing for Vc + CUDA Baseline
#-------------------------------------------
echo "# Date of run $today" > test3_cuda_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of CUDA +vc device executors / polling / queue 2048 " >> test3_cuda_gpu_executor_results.txt
echo "# executors, runtime" >> test3_cuda_gpu_executor_results.txt
kernel_args=" --multipole_device_kernel_type=CUDA --monopole_device_kernel_type=CUDA --multipole_host_kernel_type=Vc --monopole_host_kernel_type=Vc "
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=2048 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test3_cuda_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 6. Same build but with KOKKOS GPU (+ CPU) Kernels
# -------------------------------------------------
kernel_args=" --multipole_device_kernel_type=KOKKOS_CUDA --monopole_device_kernel_type=KOKKOS_CUDA --multipole_host_kernel_type=KOKKOS --monopole_host_kernel_type=KOKKOS "
echo "# Date of run $today" > test4_kokkos_gpu_results.txt
echo "# Measuring computation time using Kokkos CPU+GPU kernels (GPU args: $gpu_args " >> test4_kokkos_gpu_results.txt
echo "# threads, runtime" >> test4_kokkos_gpu_results.txt
for i in `seq 1 1 ${max_cpu_threads}`; do
output1="$(./../build/octotiger/build/octotiger -t$i $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test4_kokkos_gpu_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 9. Testing increasing numbers of executors
#-------------------------------------------
echo "# Date of run $today" > test5_kokkos_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of device executors " >> test5_kokkos_gpu_executor_results.txt
echo "# executors, runtime" >> test5_kokkos_gpu_executor_results.txt
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=1 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test5_kokkos_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 10. Testing increasing numbers of executors with larger queues
#--------------------------------------------------------------
echo "# Date of run $today" > test6_kokkos_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of device executors (queue length 2048) " >> test6_kokkos_gpu_executor_results.txt
echo "# threads, runtime" >> test6_kokkos_gpu_executor_results.txt
pushd ..
rm -rf "./build/octotiger/build"
eval "${build_command}"
popd
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=2048 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test6_kokkos_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# =========================================
# ===============================================
# GPU Testing with callbacks
gpu_args=" --cuda_streams_per_gpu=${max_gpu_executors} --cuda_buffer_capacity=1 "
octotiger_args="--problem=solid_sphere --max_level=${max_level} --hydro=off --xscale=1.0 --restart_file=../final.silo --disable_diagnostics=on --disable_output=on --stop_step=${stop_step} --theta=0.34 "
# 5. Testing for Vc + CUDA Baseline
# ------------------------------------------------
build_command="./build-all.sh Release with-CC with-cuda without-mpi without-papi without-apex with-kokkos with-simd without-hpx-backend-multipole without-hpx-backend-monopole without-hpx-cuda-polling kokkos octotiger"
kernel_args=" --multipole_device_kernel_type=CUDA --monopole_device_kernel_type=CUDA --multipole_host_kernel_type=Vc --monopole_host_kernel_type=Vc "
echo "# Date of run $today" > test_callback1_gpu_baseline_results.txt
echo "# Measuring computation time using Vc + CUDA kernels (GPU args: $gpu_args " >> test_callback1_gpu_baseline_results.txt
echo "# threads, runtime" >> test_callback1_gpu_baseline_results.txt
pushd ..
rm -rf "./build/octotiger/build"
rm -rf "./build/kokkos"
rm -rf "./build/hpx-kokkos"
eval "${build_command}"
popd
for i in `seq 1 1 ${max_cpu_threads}`; do
output1="$(./../build/octotiger/build/octotiger -t$i $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test_callback1_gpu_baseline_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 55 Testing for Vc + CUDA Baseline
#-------------------------------------------
echo "# Date of run $today" > test_callback2_cuda_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of CUDA +vc device executors / polling " >> test_callback2_cuda_gpu_executor_results.txt
echo "# executors, runtime" >> test_callback2_cuda_gpu_executor_results.txt
kernel_args=" --multipole_device_kernel_type=CUDA --monopole_device_kernel_type=CUDA --multipole_host_kernel_type=Vc --monopole_host_kernel_type=Vc "
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=1 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test_callback2_cuda_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 55 Testing for Vc + CUDA Baseline
#-------------------------------------------
echo "# Date of run $today" > test_callback3_cuda_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of CUDA +vc device executors / polling / queue 2048 " >> test_callback3_cuda_gpu_executor_results.txt
echo "# executors, runtime" >> test_callback3_cuda_gpu_executor_results.txt
kernel_args=" --multipole_device_kernel_type=CUDA --monopole_device_kernel_type=CUDA --multipole_host_kernel_type=Vc --monopole_host_kernel_type=Vc "
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=2048 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test_callback3_cuda_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 6. Same build but with KOKKOS GPU (+ CPU) Kernels
# -------------------------------------------------
kernel_args=" --multipole_device_kernel_type=KOKKOS_CUDA --monopole_device_kernel_type=KOKKOS_CUDA --multipole_host_kernel_type=KOKKOS --monopole_host_kernel_type=KOKKOS "
echo "# Date of run $today" > test_callback4_kokkos_gpu_results.txt
echo "# Measuring computation time using Kokkos CPU+GPU kernels (GPU args: $gpu_args " >> test_callback4_kokkos_gpu_results.txt
echo "# threads, runtime" >> test_callback4_kokkos_gpu_results.txt
for i in `seq 1 1 ${max_cpu_threads}`; do
output1="$(./../build/octotiger/build/octotiger -t$i $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test_callback4_kokkos_gpu_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 9. Testing increasing numbers of executors
#-------------------------------------------
echo "# Date of run $today" > test_callback5_kokkos_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of device executors " >> test_callback5_kokkos_gpu_executor_results.txt
echo "# executors, runtime" >> test_callback5_kokkos_gpu_executor_results.txt
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=1 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test_callback5_kokkos_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
# 10. Testing increasing numbers of executors with larger queues
#--------------------------------------------------------------
echo "# Date of run $today" > test_callback6_kokkos_gpu_executor_results.txt
echo "# Measuring computation time using a varying number of device executors (queue length 2048) " >> test_callback6_kokkos_gpu_executor_results.txt
echo "# threads, runtime" >> test_callback6_kokkos_gpu_executor_results.txt
pushd ..
rm -rf "./build/octotiger/build"
eval "${build_command}"
popd
for i in `seq 0 2 128`; do
gpu_args=" --cuda_streams_per_gpu=${i} --cuda_buffer_capacity=2048 "
output1="$(./../build/octotiger/build/octotiger -t${max_cpu_threads} $octotiger_args $gpu_args $kernel_args | tee -a LOG.txt )"
compute_time="$i, $(echo "$output1" | grep '==> Average iteration execution time:' | sed 's/==> Average iteration execution time://g' | sed 's/ms//g')"
echo "$compute_time" >> "test_callback6_kokkos_gpu_executor_results.txt"
echo "$compute_time" | tee -a LOG.txt
done
#
# 11. Teecho "All done!" | tee -a LOG.txt