-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_expr_free.sh
executable file
·89 lines (80 loc) · 2.6 KB
/
run_expr_free.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
#! /bin/bash
thread_list=( 16 )
extra=""
unset -v wl_num
unset -v dirname
extra=""
max_num_ngram=-1
while getopts ":d:r:q:t:w:k:" opt; do
case "${opt}" in
d) echo "Option -d is triggered with value $OPTARG"
data_file=$OPTARG
;;
r) echo "Option -r is triggered with value $OPTARG"
regex_file=$OPTARG
;;
q) echo "Option -q is triggered with value $OPTARG"
extra="--test ${OPTARG} "
;;
t) echo "Option -t is triggered."
thread_list=( 16 12 10 8 6 4 2 1 )
;;
k) echo "Option -k is triggered with value $OPTARG"
extra="-k ${OPTARG} "
max_num_ngram=${OPTARG}
;;
w) echo "Option -w is triggered with value $OPTARG"
dirname=result/${OPTARG}_free_result4
echo "$OPTARG"
if [ "$OPTARG" == "traffic" ]; then
wl_num=1
elif [ "$OPTARG" == "db_x" ]; then
wl_num=2
elif [ "$OPTARG" == "webpages" ]; then
wl_num=3
elif [ "$OPTARG" == "protein" ]; then
wl_num=4
else
wl_num=0
fi
;;
\?) echo "Invalid argument $OPTARG" >&2
;;
esac
done
: ${wl_num:?Missing -h}
if [ "$wl_num" == "0" ]; then
extra="${extra}-r ${regex_file} -d ${data_file}"
fi
timeout_prefix="{ timeout 3h time -v "
timeout_suffix="; } 2> ${dirname}/time_report"
echo ${dirname}
mkdir -p ${dirname}
sel_list=( 0.7 0.5 0.2 0.15 0.12 0.1 0.05 0.02 )
num_repeat=10
# Free
# for n in 2 4 6 8 10; do
for n in 2 4 6; do
for c in ${sel_list[*]}; do
for t in ${thread_list[*]}; do
curr_suffix="${timeout_suffix}_free_t${t}_c${c}_n${n}_${max_num_ngram}.txt"
curr_cmd="${timeout_prefix} ./benchmark.out FREE -t ${t} -w ${wl_num} -o ${dirname} -n ${n} -c ${c} -e ${num_repeat} ${extra} ${curr_suffix}"
echo ${curr_cmd}
eval "${curr_cmd}"
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Timeout"
break
fi
# curr_suffix="${timeout_suffix}_free-presuf_t${t}_c${c}_n${n}_${max_num_ngram}.txt"
# curr_cmd="${timeout_prefix} ./benchmark.out FREE -t ${t} -w ${wl_num} -o ${dirname} -n ${n} --presuf -c ${c} -e ${num_repeat} ${extra} ${curr_suffix}"
# echo ${curr_cmd}
# eval "${curr_cmd}"
# retVal=$?
# if [ $retVal -ne 0 ]; then
# echo "Timeout"
# break
# fi
done
done
done