-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.sh
executable file
·92 lines (74 loc) · 2.57 KB
/
benchmark.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
#!/bin/bash
datasets=("noise_image_lena_const.txt" "noise_image_tulips_const.txt" "noise_image_house_const.txt")
data_path="./data/"
datasets_prefixed="${datasets[@]/#/$data_path}"
mkdir -p results
echo "version,dataset,patch_size,blocks,threads,time" >>./results/results.csv
patch_sizes=(3 5 7)
run_v1() {
block_sizes=(16 32 64 128 256 512 1024 2048 4094)
thread_nums=(32 64 128 256 512 1024 2048)
for dataset in ${datasets_prefixed[@]}; do
printf "\n------------------ %25s -------------\n" "$dataset"
for patch_size in ${patch_sizes[@]}; do
for block_size in ${block_sizes[@]}; do
for threads in ${thread_nums[@]}; do
export OMP_NUM_THREADS=$t
printf "%50s threads\n" "$t"
./bin/v1 $dataset $patch_size $block_size $threads
done
done
done
done
}
run_v2() {
block_sizes=(16 32 64 128 256 512 1024 2048 4094)
thread_nums=(32 64 96 128 256 512 672)
for dataset in ${datasets_prefixed[@]}; do
printf "\n------------------ %25s -------------\n" "$dataset"
for patch_size in ${patch_sizes[@]}; do
for block_size in ${block_sizes[@]}; do
for threads in ${thread_nums[@]}; do
export OMP_NUM_THREADS=$t
printf "%s patch_size | %s block_size | %s threads\n" "$patch_size" "$block_size" "$threads"
./bin/v2 $dataset $patch_size $block_size $threads
done
done
done
done
}
run_v1
run_v2
# sweep_files_threads() {
# for d in ${datasets_prefixed[@]}; do
# printf "\n------------------ %25s -------------\n" "$d"
# for t in ${thread_nums[@]}; do
# export CILK_NWORKERS=$t
# export OMP_NUM_THREADS=$t
# printf "%50s threads\n" "$t"
# ./build/main $d $t
# done
# done
# }
# run_library() {
# for i in 1; do
# echo "#define FRAMEWORK ${i}" >./include/framework.h
# printf "\n==============================================================\n"
# printf "\n[Framework] %s" "${make_options[$i]}"
# if [ ${make_options[$i]} == "cilk" ]; then
# module purge gcc
# module load OpenCilk
# else
# module purge OpenCilk
# module load gcc
# fi
# make ${make_options[$i]}
# for i in $(seq 1 5); do
# sweep_files_threads
# done
# done
# }
# for i in $(seq 1 5); do
# sweep_files_threads
# done
# run_library