-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_two_level.sh
46 lines (36 loc) · 1.33 KB
/
run_two_level.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
#!/bin/sh
tmp=$1
file="${tmp%.txt}"
filename="${file##*/}"
path="./storage/rear_coding_storage/"
query_path=${2:-"queries"}
query_path="${query_path}/"
for i in 4 16
do
blocksize1=$(($i*1024)) #4, 16
./two_level_tests/generate_test_PT "${path}${filename}_B_${blocksize1}.txt" $i "${query_path}${filename}-query.txt" "two_level_results" 1
blocksize2=$(($i*1024*2)) #8, 32
./two_level_tests/generate_test_array "${path}${filename}_B_${blocksize2}.txt" $(($i*2)) "${query_path}${filename}-query.txt" "two_level_results" 1
done
for i in 4 16
do
blocksize1=$(($i*1024)) #4, 16
./two_level_tests/generate_test_array "${path}${filename}_B_${blocksize1}.txt" $i "${query_path}${filename}-query.txt" "two_level_results" 1
blocksize2=$(($i*1024*2)) #8, 32
./two_level_tests/generate_test_PT "${path}${filename}_B_${blocksize2}.txt" $(($i*2)) "${query_path}${filename}-query.txt" "two_level_results" 1
done
if [ ! -d results ]; then
mkdir results
fi
for csvfile in *.csv;
do
csvfilename="${csvfile%.csv}"
if [ -f "results/${csvfile}" ]; then
echo "$(tail -n +2 ${csvfile})" > ${csvfile} #remove the first row from the file
cat results/${csvfile} ${csvfile} > results/${csvfilename}_tmp.csv
mv results/${csvfilename}_tmp.csv results/${csvfile}
rm ${csvfile}
else
mv ${csvfile} results
fi
done