-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-gtx-test.sh
executable file
·51 lines (46 loc) · 3.07 KB
/
run-gtx-test.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
#!/bin/bash
# Author: Gregor Daiss
# Do whatever you want with this!
# Get base dir
basedir=$(pwd)
# Get current date
today=$(date +%m-%d-%H-%M)
cd src/octotiger
current_commit_message=$(git log --oneline -n 1)
cd "$basedir"
result_folder="${current_commit_message}-$today"
result_folder="$(echo "$result_folder" | sed -e 's/[ \t]/-/g')"
mkdir "$result_folder"
cd "$result_folder"
# Get scenario arguments and current commits
octotiger_args="-t 28 --problem=moving_star --max_level=6 --odt=0.3 --theta=0.35 --stop_time=0.2 \
--xscale=12 --omega=0.1 --stop_step=10 --disable_output=false --p2p_kernel_type=SOA_CPU \
--p2m_kernel_type=SOA_CPU --multipole_kernel_type=SOA_CPU"
echo "$octotiger_args" > LOG.txt
result_filename="results.txt"
echo ";number_of_cuda_streams total_runtime, computation_runtime,cpu launches multipole, cuda \
launches multipole, percentage of multipole launches on GPU, cpu launches p2p, cpu launches\
p2p, percentage of multipole" > "$result_filename"
for i in $(seq 0 32 256); do
echo "---->>Running test $i" | tee -a LOG.txt
output=$(nvprof "../build/octotiger/octotiger" $octotiger_args --cuda_streams_per_locality=$i --cuda_streams_per_gpu=32)
filename="scenario${i}_output.txt"
echo "$output" > "$filename"
total_time=$(echo "$output" | grep Total: | sed 's/ Total: //g')
computation_time=$(echo "$output" | grep Computation: | sed 's/ Computation: //g')
cpu_multipole=$(echo "$output" | grep 'CPU multipole launches' | sed 's/CPU multipole launches //g')
cuda_multipole=$(echo "$output" | grep 'CUDA multipole launches' | sed 's/CUDA multipole launches //g')
multipole_percentage=$(echo "$output" | grep '=> Percentage of multipole on the GPU: ' | sed 's/=> Percentage of multipole on the GPU: //g')
cpu_non_rho_multipole=$(echo "$output" | grep 'CPU non-rho-multipole launches' | sed 's/CPU non-rho-multipole launches //g')
cuda_non_rho_multipole=$(echo "$output" | grep 'CUDA non-rho-multipole launches' | sed 's/CUDA non-rho-multipole launches //g')
non_rho_multipole_percentage=$(echo "$output" | grep '=> Percentage of non-rho-multipole on the GPU: ' | sed 's/=> Percentage of non-rho-multipole on the GPU: //g')
cpu_p2p=$(echo "$output" | grep 'CPU p2p launches' | sed 's/CPU p2p launches //g')
cuda_p2p=$(echo "$output" | grep 'CUDA p2p launches' | sed 's/CUDA p2p launches //g')
p2p_percentage=$(echo "$output" | grep '=> Percentage of p2p on the GPU: ' | sed 's/=> Percentage of p2p on the GPU: //g')
echo "$i, $total_time , $computation_time , $cpu_multipole , $cuda_multipole , \
$multipole_percentage , $cpu_non_rho_multipole , $cuda_non_rho_multipole , $non_rho_multipole_percentage , $cpu_p2p , $cuda_p2p , $p2p_percentage"
echo "$i, $total_time , $computation_time , $cpu_multipole , $cuda_multipole , \
$multipole_percentage , $cpu_non_rho_multipole , $cuda_non_rho_multipole , $non_rho_multipole_percentage , $cpu_p2p , $cuda_p2p , $p2p_percentage" >> "$result_filename"
done
perf record "../build/octotiger/octotiger" $octotiger_args --cuda_streams_per_locality=0 --cuda_streams_per_gpu=0
mv perf.data baseline.data