-
Notifications
You must be signed in to change notification settings - Fork 4
/
runClient.sh
executable file
·100 lines (83 loc) · 3.3 KB
/
runClient.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
96
97
98
99
bench_dir="sample_docs"
correct="false"
bf_sz="1024"
num_docs="128"
malicious="true"
fast_setup="true"
use_master="true"
throughput="false"
throughput_sec="60"
throughput_threads="64"
num_updates="5"
num_searches="5"
num_clusters="1"
only_setup="false"
latency_prints="false"
latency_bench="false"
update_bench="false"
while getopts ":h?:d:t:b:n:m:f:s:c:x:y:q:r:p:z:l:a:u:" opt; do
case "$opt" in
h|\?)
echo -e "\nArguments: "
echo -e "-b \t\t Bits in Bloom filter (default 1120)"
echo -e "-n \t\t Max number of documents (default 1024)"
echo -e "-m \t\t Malicious security? (default true)"
echo -e "-s \t\t Run with master? (default true)"
echo -e "-p \t\t Number of clusters (default 1)"
echo -e "\nBenchmarking/testing arguments: "
echo -e "-c \t\t Run correctness tests? (default false)"
echo -e "-f \t\t Run with fast setup? (default true; insecure, only for benchmarking)"
echo -e "-t \t\t Run throughput tests? (default false)"
echo -e "-x \t\t Seconds to run throughput tests (default 60)"
echo -e "-y \t\t Client threads for throughput tests (default 64)"
echo -e "-q \t\t Number of consecutive updates in throughput tests (default 5)"
echo -e "-r \t\t Number of consecutive searches in throughput tests (default 5)"
echo -e "-d \t\t Input directory for generating updates for benchmarks\n"
echo -e "-l \t\t Print latency breakdown (only for some options)\n"
echo -e "-a \t\t Run search latency benchmark\n"
echo -e "-u \t\t Run update latency benchmark\n"
exit 0
;;
d)
bench_dir=$OPTARG
;;
c)
correct=$OPTARG
;;
b)
bf_sz=$OPTARG
;;
n)
num_docs=$OPTARG
;;
m)
malicious=$OPTARG
;;
f) fast_setup=$OPTARG
;;
s) use_master=$OPTARG
;;
t) throughput=$OPTARG
;;
x) throughput_sec=$OPTARG
;;
y) throughput_threads=$OPTARG
;;
q) num_updates=$OPTARG
;;
r) num_searches=$OPTARG
;;
p) num_clusters=$OPTARG
;;
z) only_setup=$OPTARG
;;
l) latency_prints=$OPTARG
;;
a) latency_bench=$OPTARG
;;
u) update_bench=$OPTARG
;;
esac
done
echo "bench_dir='$bench_dir', tests='$correct', bf_sz='$bf_sz', num_docs='$num_docs'"
CGO_CFLAGS="-I./libsolv-sys/src -D LIBSOLV_INTERNAL -w" CGO_LDFLAGS="-lssl -lpthread -lcrypto -lm "$PWD"/src/c/libstemmer.o" go run src/bench/client.go --config=src/config/client.config --test="$correct" --bench_dir="$bench_dir" --bf_sz="$bf_sz" --num_docs="$num_docs" --malicious="$malicious" --fast_setup="$fast_setup" --use_master="$use_master" --throughput="$throughput" --throughput_sec="$throughput_sec" --throughput_threads="$throughput_threads" --num_updates="$num_updates" --num_searches="$num_searches" --num_clusters="$num_clusters" --only_setup="$only_setup" --latency_prints="$latency_prints" --latency_bench="$latency_bench" --update_bench="$update_bench"