-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscriptForPerfTests
More file actions
executable file
·94 lines (82 loc) · 3.5 KB
/
scriptForPerfTests
File metadata and controls
executable file
·94 lines (82 loc) · 3.5 KB
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
#!/bin/bash
# Script to launch series of perf tests
# - on 2 to maxnumber machines
# - with the size listed in listsize
# The machines used are listed in hostnames
# It is also possible to specify the following parameters
# - ntr (number of trains)
# - warmup
# - measurement
# - cooldown
# - sleepAfterCooldown
#
# Each test generates 2 or more file (depending on the number of
# participants to the protocol) named for instance
# perf_cooldown_10_measurement_600_number_5_ntr_2_size_7000_warmup_300_concernedHost
TRAINS_PERF_USER=${TRAINS_PERF_USER:-TRAINS_PERF_USER_must_be_defined_before_invoking_this_script}
##########################################
# Parameters of the different tests
##########################################
# Minumum number of trains on the road
mintr=2
# Maximum number of trains on the road
maxtr=2
# List of the size of the message
#listsize="10 100 200 300 400 500 1000 2000 3000 5000 7000 10000 15000 20000"
listsize="10 100"
# Warmup time in seconds
#warmup=300
warmup=2
# Measure time in seconds
#measurement=600
measurement=10
# Times (in seconds) related to cooldown phase
#cooldown=10 # done by perf program
cooldown=0
#sleepAfterCooldown=1 # done by script program. Should be 290 (because cooldown+sleepAfterCooldown must be 300) for real tests
sleepAfterCooldown=0
# Array of hostnames on which to launch the test
# WARNING : if hostnames does not contain any localhost, then in the following ficname definition,
# take off final '_'$i
#hostnames=('b313-01' 'b313-02' 'b313-03' 'b313-04' 'b313-05')
#hostnames=('localhost' 'localhost' 'localhost' 'localhost' 'localhost')
hostnames=('b313-04' 'b313-08')
# Maximum number of machines for simultaneous launch of perf code
# NB : Cannot be more than the size hostname list
maxnumber=2
##########################################
# Let's go for the different tests
##########################################
for ((number=2; number<=$maxnumber; number+=1))
do
for ((ntr=$mintr; ntr<=$maxtr; ntr+=1))
do
for size in $listsize
do
# We build the different ssh commands to be lauched for this iteration
cmd=''
for ((i=0; i<$number; i+=1))
do
ficname='perfJava_cooldown_'$cooldown'_measurement_'$measurement'_number_'$number'_ntr_'$ntr'_size_'$size'_warmup_'$warmup'_'${hostnames[$i]}'_'$i
# NB : About the 'export FAKE=toAVoidBug' hereafter, if it is not here, the
# export TRAINS_HOST=${hostnames[$i]} which follows is not taken into account. I did not
# find why :-( ==> Solved. Now get hostname automatically
#perfdir="TrainsProtocol/tests/integration/perf/"
perfdir="TrainsProtocolJava"
opt="--broadcasters $number --cooldown $cooldown --measurement $measurement --number $number --size $size --trainsNumber $ntr --warmup $warmup"
dist="\"export TRAINS_PORT=2000 ; export BROADCASTERS="$number"; export WARMUP="$warmup"; export COOLDOWN="$cooldown"; export MEASUREMENT="$measurement"; export NUMBER="$number"; export SIZE="$size"; export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk; export ANT_HOME=/usr/share/ant; cd $perfdir ; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/TrainsProtocolJava/TrainsProtocol/lib; cd bin; java perf.Perf > ~/results/$ficname \""
cmd="$cmd (ssh $TRAINS_PERF_USER@${hostnames[$i]} $dist"
if ((i < $number-1))
then
cmd="$cmd &"
fi
cmd="$cmd );"
done
# we launch the test
echo -e "$cmd\n"
eval "$cmd"
# we do the sleep after cooldown
sleep $sleepAfterCooldown;
done
done
done