-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-experiment-pring.sh
434 lines (381 loc) · 10.1 KB
/
run-experiment-pring.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
#! /usr/bin/env bash
if [ ${HOSTNAME} != "salvia" ]
then
echo "ERROR: not salvia"
exit 1
fi
if [ ${TERM} != "screen" ]
then
echo "ERROR: not screen"
exit 1
fi
if [ $# != 2 ]
then
echo "ERROR: args"
exit 1
fi
METHOD_NAME=$1
NUM_NODES=$2
if [ $((${NUM_NODES} <= 0)) != 0 ]
then
echo "ERROR: number of nodes"
exit 1
fi
NODE_FILE="${HOME}/node.txt"
NODE_LIST=""
NODE_CNT=0
for node in $(cat ${NODE_FILE})
do
NODE_LIST="${NODE_LIST}${NODE_LIST:+ }${node}"
NODE_CNT=$((${NODE_CNT} + 1))
if [ $((${NODE_CNT} < ${NUM_NODES})) == 0 ]
then
break
fi
done
echo "======== EXPERIMENT ========"
echo ${METHOD_NAME} ${NUM_NODES}
echo "======== START ========"
LANG=C date
for node in ${NODE_LIST}
do
echo "== adisk${node} =="
screen -X screen ~/ssh-adisk.sh ${node} ". .bash_profile && ~/script/run.sh ${METHOD_NAME}"
done
sleep 10
# ####
# # testset1
# # 1
# id[100]=user1000053778378872380
# # 2
# id[200]=user1000053778378872380
# id[201]=user5150756240885596906
# # 4
# id[400]=user1000053778378872380
# id[401]=user3077411578082041711
# id[402]=user5150756240885596906
# id[403]=user7224432303514507081
# # 8
# id[800]=user1000053778378872380
# id[801]=user203738491240121849
# id[802]=user3077411578082041711
# id[803]=user4112413863593839013
# id[804]=user5150756240885596906
# id[805]=user6185758526397394208
# id[806]=user7224432303514507081
# id[807]=user826349051565622304
# # 16
# id[1600]=user1000053778378872380
# id[1601]=user1518053216608683138
# id[1602]=user203738491240121849
# id[1603]=user2554497397146177804
# id[1604]=user3077411578082041711
# id[1605]=user3595637185526878663
# id[1606]=user4112413863593839013
# id[1607]=user4629293380799368875
# id[1608]=user5150756240885596906
# id[1609]=user5666857482361144437
# id[1610]=user6185758526397394208
# id[1611]=user6705985989380068972
# id[1612]=user7224432303514507081
# id[1613]=user7741766550621848605
# id[1614]=user826349051565622304
# id[1615]=user8782908730474308738
# # 32
# id[3200]=user1000053778378872380
# id[3201]=user126041372390069927
# id[3202]=user1518166301216196235
# id[3203]=user177507778583081204
# id[3204]=user2037949279766002922
# id[3205]=user2295061423686463223
# id[3206]=user2554944273050805155
# id[3207]=user281551086169446142
# id[3208]=user3077971538594182159
# id[3209]=user3335184949826457771
# id[3210]=user3595865746213664131
# id[3211]=user385381541063394234
# id[3212]=user4112973824105979461
# id[3213]=user4371859262877492106
# id[3214]=user4629853341311509323
# id[3215]=user489198679434732978
# id[3216]=user5151760685830605431
# id[3217]=user5410543285463548564
# id[3218]=user566790567674456114
# id[3219]=user5930770748446223328
# id[3220]=user6186649886734889636
# id[3221]=user6445203925681047301
# id[3222]=user6707105910404349868
# id[3223]=user6967445061497257663
# id[3224]=user7224773948808805646
# id[3225]=user7484440054782059896
# id[3226]=user7741987257311449762
# id[3227]=user8002221177794028771
# id[3228]=user8263676286612703987
# id[3229]=user8522227934087102378
# id[3230]=user8783021815081821835
# id[3231]=user9040789724300812858
####
# testset2
# 1
id[100]=user1000053778378872380
# 2
id[200]=user1000053778378872380
id[201]=user5142835197696697420
# 4
id[400]=user1000053778378872380
id[401]=user3073737695004966866
id[402]=user5142835197696697420
id[403]=user7219633036887726303
# 8
id[800]=user1000053778378872380
id[801]=user203430598756149354
id[802]=user3073737695004966866
id[803]=user4112219055717379615
id[804]=user5142835197696697420
id[805]=user6180478631055660009
id[806]=user7219633036887726303
id[807]=user8258314668002023487
# 16
id[1600]=user1000053778378872380
id[1601]=user1516853963787215215
id[1602]=user203430598756149354
id[1603]=user2556621763115467225
id[1604]=user3073737695004966866
id[1605]=user3589717997875816989
id[1606]=user4112219055717379615
id[1607]=user4628961980974013895
id[1608]=user5142835197696697420
id[1609]=user5663370553163344679
id[1610]=user6180478631055660009
id[1611]=user6697084008587543446
id[1612]=user7219633036887726303
id[1613]=user7741766550621848605
id[1614]=user8258314668002023487
id[1615]=user8782122600747142096
# 32
id[3200]=user1000053778378872380
id[3201]=user1253919243834003090
id[3202]=user1516853963787215215
id[3203]=user1776615109552025114
id[3204]=user203430598756149354
id[3205]=user2294948339078950126
id[3206]=user2556621763115467225
id[3207]=user2810715789257383403
id[3208]=user3073737695004966866
id[3209]=user3334189930705387758
id[3210]=user3589717997875816989
id[3211]=user3850259810842368493
id[3212]=user4112219055717379615
id[3213]=user4366807928222543375
id[3214]=user4628961980974013895
id[3215]=user4889974177186575235
id[3216]=user5142835197696697420
id[3217]=user5405410227539653532
id[3218]=user5663370553163344679
id[3219]=user5921398384407687966
id[3220]=user6180478631055660009
id[3221]=user64414080959597372
id[3222]=user6697084008587543446
id[3223]=user6962004111089390136
id[3224]=user7219633036887726303
id[3225]=user7478973205561050610
id[3226]=user7741766550621848605
id[3227]=user800188244881830174
id[3228]=user8258314668002023487
id[3229]=user8521531381626066348
id[3230]=user8782122600747142096
id[3231]=user9037658521914755638
####
# DEBUG
# 4
# id[400]=a
# id[401]=b
# id[402]=c
# id[403]=d
echo "======== INIT ========"
LANG=C date
INIT_MACHINE=""
N=$((${NUM_NODES} * 100))
for node in ${NODE_LIST}
do
if [ -z ${INIT_MACHINE} ]
then
INIT_MACHINE=${node}
echo "== init adisk${node} ${id[${N}]} =="
(echo "init ${id[${N}]}" ; sleep 10) | telnet adisk${node} 8081
else
echo "== init adisk${node} ${id[${N}]} TO adisk${INIT_MACHINE} =="
(echo "init ${id[${N}]} adisk${INIT_MACHINE} 8081" ; sleep 10) | telnet adisk${node} 8081
fi
N=$((${N} + 1))
done
sleep 10
echo "======== ADJUST ========"
LANG=C date
for node in ${NODE_LIST}
do
echo "== adjust adisk${node} =="
(echo -e "interactive\r\nadjust\r\nquit" ; sleep 10) | telnet adisk${node} 8081 &
sleep 1
done
for node in ${NODE_LIST}
do
echo "== adjust adisk${node} =="
(echo -e "interactive\r\nadjust\r\nquit" ; sleep 10) | telnet adisk${node} 8081 &
sleep 1
done
for node in ${NODE_LIST}
do
echo "== adjust adisk${node} =="
(echo -e "interactive\r\nadjust\r\nquit" ; sleep 10) | telnet adisk${node} 8081 &
sleep 1
done
for node in ${NODE_LIST}
do
echo "== adjust adisk${node} =="
(echo -e "interactive\r\nadjust\r\nquit" ; sleep 10) | telnet adisk${node} 8081 &
sleep 1
done
for node in ${NODE_LIST}
do
echo "== adjust adisk${node} =="
(echo -e "interactive\r\nadjust\r\nquit" ; sleep 10) | telnet adisk${node} 8081 &
sleep 1
done
for node in ${NODE_LIST}
do
echo "== adjust adisk${node} =="
(echo -e "interactive\r\nadjust\r\nquit" ; sleep 10) | telnet adisk${node} 8081 &
sleep 1
done
for node in ${NODE_LIST}
do
echo "== adjust adisk${node} =="
(echo -e "interactive\r\nadjust\r\nquit" ; sleep 10) | telnet adisk${node} 8081 &
sleep 1
done
sleep 10
echo "======== STATUS ========"
LANG=C date
for node in ${NODE_LIST}
do
echo "== status adisk${node} =="
(echo -e "interactive\r\nstatus\r\nquit" ; sleep 10) | telnet adisk${node} 8081
done
# for debug
# exit 0
echo "======== PUT ========"
LANG=C date
N=0
for node in ${NODE_LIST}
do
echo "== source /home/naoki/testset/put/${NUM_NODES}/put${N}.dat TO adisk${node} =="
(echo "source /home/naoki/testset/put/${NUM_NODES}/put${N}.dat" ; sleep 10) | telnet adisk${node} 8081 &
N=$((N + 1))
done
# wait
FLAG_ALL_DONE=0
for i in $(seq 30) ; do
sleep 300
for node in ${NODE_LIST}
do
# echo "== source _status_ TO adisk${node} =="
(echo -e "interactive\r\nsource _status_\r\nquit" ; sleep 10) | telnet adisk${node} 8081
done > status.dump
echo "========"
LANG=C date
grep "SOURCE: isSourceRun:" status.dump
if [ $(grep "SOURCE: isSourceRun: false" status.dump | wc -l) == ${NUM_NODES} ]
then
FLAG_ALL_DONE=1
break
fi
done
if [ ${FLAG_ALL_DONE} == 0 ]
then
for node in ${NODE_LIST}
do
echo "== source _abort_ TO adisk${node} =="
(echo "source _abort_" ; sleep 10) | telnet adisk${node} 8081
done
fi
# echo "DEBUG"
# exit 0
echo "======== GET ========"
LANG=C date
N=0
for node in ${NODE_LIST}
do
echo "== source /home/naoki/testset/get/32/get${N}.dat TO adisk${node} =="
(echo "source /home/naoki/testset/get/32/get${N}.dat" ; sleep 10) | telnet adisk${node} 8081 &
N=$((N + 1))
# sleep 0.5
done
# wait
FLAG_ALL_DONE=0
for i in $(seq 30) ; do
sleep 300
for node in ${NODE_LIST}
do
# echo "== source _status_ TO adisk${node} =="
(echo -e "interactive\r\nsource _status_\r\nquit" ; sleep 10) | telnet adisk${node} 8081
done > status.dump
echo "========"
LANG=C date
grep "SOURCE: isSourceRun:" status.dump
if [ $(grep "SOURCE: isSourceRun: false" status.dump | wc -l) == ${NUM_NODES} ]
then
FLAG_ALL_DONE=1
break
fi
done
if [ ${FLAG_ALL_DONE} == 0 ]
then
for node in ${NODE_LIST}
do
echo "== source _abort_ TO adisk${node} =="
(echo "source _abort_" ; sleep 10) | telnet adisk${node} 8081
done
fi
echo "======== RANGE ========"
LANG=C date
N=0
for node in ${NODE_LIST}
do
echo "== source /home/naoki/testset/range/32/range${N}.dat TO adisk${node} =="
(echo "source /home/naoki/testset/range/32/range${N}.dat" ; sleep 10) | telnet adisk${node} 8081 &
N=$((N + 1))
done
# wait
FLAG_ALL_DONE=0
for i in $(seq 30) ; do
sleep 300
for node in ${NODE_LIST}
do
# echo "== source _status_ TO adisk${node} =="
(echo -e "interactive\r\nsource _status_\r\nquit" ; sleep 10) | telnet adisk${node} 8081
done > status.dump
echo "========"
LANG=C date
grep "SOURCE: isSourceRun:" status.dump
if [ $(grep "SOURCE: isSourceRun: false" status.dump | wc -l) == ${NUM_NODES} ]
then
FLAG_ALL_DONE=1
break
fi
done
if [ ${FLAG_ALL_DONE} == 0 ]
then
for node in ${NODE_LIST}
do
echo "== source _abort_ TO adisk${node} =="
(echo "source _abort_" ; sleep 10) | telnet adisk${node} 8081
done
fi
echo "======== END ========"
LANG=C date
# for node in ${NODE_LIST}
# do
# echo "== status TO adisk${node} =="
# (echo -e "interactive\r\nstatus\r\nquit" ; sleep 10) | telnet adisk${node} 8081
# done