-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_pmembench.sh
executable file
·46 lines (39 loc) · 1.33 KB
/
import_pmembench.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
set -e
declare -a variants_plotter=("pmdk" "safepm" "spp")
declare -a variants_results=("vanilla" "safepm" "spp")
declare -a pmembench_benchmark=("pmembench_map" "pmembench_tx")
# declare -a variants_plotter=("pmdk" "spp")
# declare -a variants_results=("vanilla" "spp")
# declare -a pmembench_benchmark=("pmembench_map" "pmembench_tx")
if [ "$#" -ne 1 ]
then
echo "Usage: import_pmembench.sh <results location>" 2>&1
exit 1
fi
for (( i=0; i<${#variants_plotter[@]}; i++))
do
variant_plotter="${variants_plotter[i]}"
mkdir -p "$variant_plotter"
variant_results="${variants_results[i]}"
for (( k=0; k<${#pmembench_benchmark[@]}; k++))
do
if ! [ -e $1/"${pmembench_benchmark[k]}"/${variant_results}.txt ]
then
continue
fi
if [ -e ${variant_plotter}/"${pmembench_benchmark[k]}"_result ]
then
j=1
while true
do
if ! [ -e ${variant_plotter}/"${pmembench_benchmark[k]}"_result_${j} ]
then
break
fi
j=$((j+1))
done
mv ${variant_plotter}/"${pmembench_benchmark[k]}"_result ${variant_plotter}/"${pmembench_benchmark[k]}"_result_${j}
fi
cp $1/"${pmembench_benchmark[k]}"/${variant_results}.txt ${variant_plotter}/"${pmembench_benchmark[k]}"_result
done
done