-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathauto.sh
149 lines (128 loc) · 3.14 KB
/
auto.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
#!/bin/bash
#
# Automatic Evaluation for the paper 'Timing Analysis of Asynchronized Distributed Cause-Effect Chains' (2021).
########################################
# Start this shell script with
# ./auto.sh x
# where x should be replace by the number of maximal concurrent jobs (typically not more than free processor of the machine that is used)
###
# We use the screen command to parallelize the execution.
# 'screen -ls' shows all current screens
# 'killall screen' aborts all current screens.
########################################
###
# Specify number of concurrent jobs
###
if [ $# -eq 0 ]
then
echo "Specify maximal number of concurrent jobs for the experiment (e.g. './auto.sh 5' )."
exit 1
else
var=$1
echo "with $var concurrent jobs"
fi
num_tries=100 # number of runs
runs_per_screen=10 # number of runs per screen
###
# Single ECU analysis
###
echo "===Start single ECU analysis"
date
# g=0 r=10 with different utilization
echo "automotive benchmark"
for util in {50..90..10}
do
echo "utilization: $util"
date
for ((i=0;i<num_tries;i++))
do
# start a new screen
screen -dmS ascr$i python3.7 main.py -j1 -u=$util -g0 -r$runs_per_screen -n=$i
numberrec=$(screen -list | grep -c ascr.*)
# wait until variable is reached
while (($numberrec >= $var))
do
sleep 1
numberrec=$(screen -list | grep -c ascr.*)
done
done
done
# g=1 r=10 with different utilization
echo "uunifast benchmark"
for util in {50..90..10}
do
echo "utilization: $util"
date
for ((i=0;i<num_tries;i++))
do
# start a new screen
screen -dmS ascr$i python3.7 main.py -j1 -u=$util -g1 -r$runs_per_screen -n=$i
numberrec=$(screen -list | grep -c ascr.*)
# wait until variable is reached
while (($numberrec >= $var))
do
sleep 1
numberrec=$(screen -list | grep -c ascr.*)
done
done
done
echo " "
# wait until all are closed
while screen -list | grep -q ascr.*
do
sleep 1
done
###
# Interconnected ECU analysis.
###
# Or manually with:
# for i in {50..90..10}; do screen -dmS g0util_$i python3 main.py -j2 -u=$i -g0; done
# for i in {50..90..10}; do screen -dmS g1util_$i python3 main.py -j2 -u=$i -g1; done
###
echo "===Start interconnected ECU analysis"
date
echo "automotive benchmark"
for i in {50..90..10}
do
screen -dmS ascrg0util_$i python3.7 main.py -j2 -u=$i -g0 -n=$num_tries
# wait until variable is reached
while (($numberrec >= $var))
do
sleep 1
numberrec=$(screen -list | grep -c ascr.*)
done
done
echo "uunifast benchmark"
for i in {50..90..10}
do
screen -dmS ascrg1util_$i python3.7 main.py -j2 -u=$i -g1 -n=$num_tries
# wait until variable is reached
while (($numberrec >= $var))
do
sleep 1
numberrec=$(screen -list | grep -c ascr.*)
done
done
# wait until all are closed
while screen -list | grep -q ascr.*
do
sleep 1
done
echo " "
###
# Draw plots.
###
# Or manually with:
# screen -dmS j3g0 python3 main.py -j3 -g0
# screen -dmS j3g1 python3 main.py -j3 -g1
###
echo "===Draw plots."
date
screen -dmS ascrj3g0 python3.7 main.py -j3 -g0
screen -dmS ascrj3g1 python3.7 main.py -j3 -g1
while screen -list | grep -q ascr.*
do
sleep 1
done
echo "DONE"
date