-
Notifications
You must be signed in to change notification settings - Fork 0
/
executeTest.sh
executable file
·95 lines (84 loc) · 3.28 KB
/
executeTest.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
#!/bin/bash
# Shell script to execute the test
# check correct number of parameters
if [ "$#" -ne 2 ]; then
echo "Usage: ./executeTest.sh [k-value, Eg. 25] [total runs, Eg. 2]"
exit 2
fi
k=$1
totalRuns=$2
allThreads=(1 2 4 8 16 32 64 128 256)
inputFiles=("input_20k_s123.txt" "input_50k_s456.txt" "input_100k_s789.txt")
echo "k-value: $k"
echo "Total runs: $totalRuns"
# Running sequential version
#----------------------------------------------------------------------------------------------------------------------
echo "---------------Running sequential version---------------"
for inputFile in ${inputFiles[@]}
do
for ((i=0;i<$totalRuns; i++)); do ./bin/stl_seq_knn $k data/$inputFile -d ; done | awk '{sum+=$6} END {printf "[STL Sequence]: [ "(sum/NR)/1000000 " sec"}'; echo "] ["$inputFile"]";
done
# Running parallel version
echo "---------------Running STL CPP parallel version---------------"
for inputFile in ${inputFiles[@]}
do
for nw in ${allThreads[@]}
do
for ((i=0;i<$totalRuns; i++)); do ./bin/stl_par_knn $nw $k data/$inputFile -d ; done | awk '{sum+=$6} END {printf "[STL Par]: [ "(sum/NR)/1000000 " sec"}'; echo "] ["$inputFile"]" "[ "$nw" ]";
done
echo " "
done
# Running parallel version
echo "---------------Running FF parallel for version---------------"
for inputFile in ${inputFiles[@]}
do
for nw in ${allThreads[@]}
do
for ((i=0;i<$totalRuns; i++)); do ./bin/ff_pf_knn $nw $k data/$inputFile -d ; done | awk '{sum+=$6} END {printf "[FF Par]: [ "(sum/NR)/1000000 " sec"}'; echo "] ["$inputFile"]" "[ "$nw" ]";
done
echo " "
done
# Running parallel version
echo "---------------Running openMP parallel version---------------"
#echo "Running parallel version"
for inputFile in ${inputFiles[@]}
do
for nw in ${allThreads[@]}
do
for ((i=0;i<$totalRuns; i++)); do ./bin/openmp_par_knn $nw $k data/$inputFile -d ; done | awk '{sum+=$6} END {printf "[openMp Par]: [ "(sum/NR)/1000000 " sec"}'; echo "] ["$inputFile"]" "[ "$nw" ]";
done
echo " "
done
# Running parallel version
echo "---------------Running openMP NoBottleneck version---------------"
#echo "Running parallel version"
for inputFile in ${inputFiles[@]}
do
for nw in ${allThreads[@]}
do
for ((i=0;i<$totalRuns; i++)); do ./bin/openmp_par_knn_nobottleneck $nw $k data/$inputFile -d ; done | awk '{sum+=$6} END {printf "[openMp Par]: [ "(sum/NR)/1000000 " sec"}'; echo "] ["$inputFile"]" "[ "$nw" ]";
done
echo " "
done
# Running parallel version
echo "---------------Running STL NoBottleneck version---------------"
#echo "Running parallel version"
for inputFile in ${inputFiles[@]}
do
for nw in ${allThreads[@]}
do
for ((i=0;i<$totalRuns; i++)); do ./bin/stl_par_knn_nobottleneck $nw $k data/$inputFile -d ; done | awk '{sum+=$6} END {printf "[STL Par]: [ "(sum/NR)/1000000 " sec"}'; echo "] ["$inputFile"]" "[ "$nw" ]";
done
echo " "
done
# Running parallel version
echo "---------------Running STL pinThread version---------------"
#echo "Running parallel version"
for inputFile in ${inputFiles[@]}
do
for nw in ${allThreads[@]}
do
for ((i=0;i<$totalRuns; i++)); do ./bin/stl_par_knn_pinthreads $nw $k data/$inputFile -d ; done | awk '{sum+=$6} END {printf "[STL Par]: [ "(sum/NR)/1000000 " sec"}'; echo "] ["$inputFile"]" "[ "$nw" ]";
done
echo " "
done