-
Notifications
You must be signed in to change notification settings - Fork 6
/
run_all.sh
executable file
·120 lines (96 loc) · 2.77 KB
/
run_all.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
#! /bin/bash
PID_FILE=/tmp/vmplaces.pid
source xprc
function do_abort() {
echo Killing java process with PID `cat $PID_FILE`
kill -9 `cat $PID_FILE`
rm -f $PID_FILE
exit 2
}
trap do_abort SIGINT
error=0
# run <nb nodes> <algo> <implem>
# Ex: run 128 centralized scheduling.centralized.entropy2.Entropy2RP
function run() {
n_nodes=$1
algo=$2
implem=$3
turn_off=$4
if [ "$3" != "none" ]
then
implem="-Dsimulator.implementation=$implem"
# Yes, this is ugly
name=`echo ${implem} | rev | cut -d "." -f1 | rev`
name="${algo}-${name}-${n_nodes}-${turn_off}"
else
implem=''
name="${algo}-${n_nodes}-${turn_off}"
fi
n_service='1'
case "$algo" in
"centralized")
n_service=1
;;
"hierarchical")
n_service=$(($n_nodes / 32 + 1))
;;
"distributed")
n_service=0
;;
esac
n_vms=$(($n_nodes * 10))
mean=60
std=20
SIM_ARGS="-Dsimulator.algorithm=$algo $implem"
SIM_ARGS="$SIM_ARGS -Dhostingnodes.number=$n_nodes"
SIM_ARGS="$SIM_ARGS -Dservicenodes.number=$n_service"
SIM_ARGS="$SIM_ARGS -Dvm.number=$n_vms"
SIM_ARGS="$SIM_ARGS -Dhostingnodes.cpunumber=8"
SIM_ARGS="$SIM_ARGS -Dhostingnodes.memorytotal=32768"
SIM_ARGS="$SIM_ARGS -Dhosts.turn_off=$turn_off"
SIM_ARGS="$SIM_ARGS -Dload.mean=$mean"
SIM_ARGS="$SIM_ARGS -Dload.std=$std"
echo '----------------------------------------'
echo "Running $algo $implem with $n_nodes compute and $n_service service nodes turning off hosts: $turn_off, load.mean=$mean, load.std=$std"
echo "Command: java $VM_OPTIONS $SIM_ARGS simulation.Main $PROGRAM_ARGUMENTS"
echo "Command: VM_OPTIONS $VM_OPTIONS"
echo "Command: SIM_ARGS $SIM_ARGS"
echo "Command: PROGRAM_ARGUMENTS $PROGRAM_ARGUMENTS"
echo '----------------------------------------'
java $VM_OPTIONS $SIM_ARGS simulation.Main $PROGRAM_ARGUMENTS &
pid=$!
echo $pid > $PID_FILE
wait $pid
ret=$?
echo java returned $ret
if [ $ret -ne 0 ] && [ $ret -ne 134 ]
then
error=1
exit $ret
fi
mkdir -p visu/events/$name
cp events.json visu/events/$name/
}
#######################################
# Main #
#######################################
# Number of hosting nodes
nodes='64'
abort=0
rm -rf logs/ffd
{
for n in $nodes; do
run $n centralized scheduling.centralized.entropy2.Entropy2RP false
run $n centralized scheduling.centralized.ffd.LazyFirstFitDecreased false
run $n centralized scheduling.centralized.ffd.OptimisticFirstFitDecreased false
run $n centralized scheduling.centralized.entropy2.Entropy2RP true
run $n centralized scheduling.centralized.ffd.LazyFirstFitDecreased true
run $n centralized scheduling.centralized.ffd.OptimisticFirstFitDecreased true
#run $n hierarchical false
#run $n distributed false
done
} 2>&1 | tee run_all.log
if [ ! $error ]
then
visu/energy_plot.py run_all.log energy.dat
fi