-
Notifications
You must be signed in to change notification settings - Fork 0
/
runall-cooley.sh
executable file
·175 lines (149 loc) · 4.36 KB
/
runall-cooley.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/bin/bash
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
cd $script_dir
#script params
rt=./run-ctest.sh
s="-s $((1<<24))"
t="-t 5"
a=""
#a="-a"
do_ctest1to3=no
#concurrency params
num_local_clients=4
if [[ ! -e $COBALT_NODEFILE ]] ; then
echo "ERROR: couldn't find COBALT_NODEFILE" >&2
exit 1
fi
nodes_raw=( $(cat $COBALT_NODEFILE) )
num_nodes=${#nodes_raw[@]}
if [[ -z $num_nodes || $num_nodes -eq 0 ]] ; then
echo "ERROR: COBALT_NODEFILE empty??" >&2
exit 1
fi
# two cases for tests 1-3 - all are separated or none are.
# Means that we either have a single node alloc or >2
# (rpc-server,bulk-server,client*)
if [[ ! ( $do_ctest1to3 == no || $num_nodes -eq 1 || $num_nodes -gt 2 ) ]] ; then
echo "ERROR: COBALT_NODEFILE must have either 1 node or >2 to run tests 1-3" >&2
exit 1
fi
# results subdirectory
[[ $num_nodes -eq 1 ]] && results_subdir=local || results_subdir=remote
# make sure we aren't squashing old results
if [[ -e results.cooley/$results_subdir ]] ; then
echo "ERROR: results dir already exists - (re)move it!" >&2
exit 1
fi
# create output directories
out_dir_pre=results.cooley/$results_subdir/ctest
# create node port pairs - in single node case, use 4 clients, one server
if [[ $num_nodes -eq 1 ]] ; then
nodes=()
for ((i = 0 ; i < $((num_local_clients+1)) ; i++)) ; do
nodes[$i]=${nodes_raw[0]}:$((3344+i))
done
else
nodes=( $(awk '{print $1":3344"}' $COBALT_NODEFILE) )
fi
num_nodes=${#nodes[@]}
if [[ $do_ctest1to3 == yes ]] ; then
mkdir -p ${out_dir_pre}1
mkdir -p ${out_dir_pre}2
mkdir -p ${out_dir_pre}3
# run each test
nds="${nodes[0]} ${nodes[1]} ${nodes[2]}"
$rt -n 1 $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 1 failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}1
$rt -n 2 $t $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 2 failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}2
$rt -n 3 $t $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 3 failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}3
fi
mkdir -p ${out_dir_pre}4/rpc.1
mkdir -p ${out_dir_pre}4/rpcbulk.1
mkdir -p ${out_dir_pre}4/bulk.1
# test 4 - 1 rpc client
nds="${nodes[0]} ${nodes[1]}"
$rt -n 4 $t -b 0 $a $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 (1 rpc client) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/rpc.1
# 1 rpcbulk client
$rt -n 4 $t -b 0 -m rpcbulk $a $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 (1 rpcbulk client) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/rpcbulk.1
# 1 bulk client
$rt -n 4 -b 1 $a $t $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 (1 bulk client) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/bulk.1
# short circuit if doing single client/server runs
[[ $num_nodes -le 2 ]] && exit 0
mkdir -p ${out_dir_pre}4/rpc.2
mkdir -p ${out_dir_pre}4/rpcbulk.2
mkdir -p ${out_dir_pre}4/bulk.2
nds="${nodes[0]} ${nodes[1]} ${nodes[2]}"
# two-client runs
$rt -n 4 $t -b 0 $a $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 (2 rpc clients) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/rpc.2
$rt -n 4 $t -b 0 -m rpcbulk $a $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 (2 rpcbulk clients) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/rpcbulk.2
$rt -n 4 -b 1 $a $t $s $nds
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 (1,1 rpc,bulk clients) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/bulk.2
# short circuit if doing two client runs
[[ $num_nodes -le 3 ]] && exit 0
mkdir -p ${out_dir_pre}4/rpc.$((num_nodes-1))
mkdir -p ${out_dir_pre}4/rpcbulk.$((num_nodes-1))
mkdir -p ${out_dir_pre}4/bulk.$((num_nodes-1))
# test 4 - N rpc clients, 0 bulk
$rt -n 4 -b 0 $a $t $s ${nodes[@]}
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 ($((num_nodes-1)) rpc clients) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/rpc.$((num_nodes-1))
# test 4 - N rpcbulk clients
$rt -n 4 -b 0 -m rpcbulk $a $t $s ${nodes[@]}
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 ($((num_nodes-1)) rpc clients) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/rpc.$((num_nodes-1))
# test 4 - 1 bulk, N-1 rpc clients
$rt -n 4 -b 1 $a $t $s ${nodes[@]}
if [[ $? -ne 0 ]] ; then
echo "ERROR: test 4 ($((num_nodes-2)),1 rpc,bulk clients) failed" >&2
exit 1
fi
mv cli_send* ${out_dir_pre}4/bulk.$((num_nodes-1))