-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun_example.sh
executable file
·60 lines (45 loc) · 1.2 KB
/
run_example.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
#! /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
function run() {
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: PROGRAM_ARGUMENTS $PROGRAM_ARGUMENTS"
echo '----------------------------------------'
java $VM_OPTIONS 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
{
run $nodes example scheduling.simple.ExampleReconfigurationPlanner false
} 2>&1 | tee run_all.log
if [ ! $error ]
then
visu/energy_plot.py run_all.log energy.dat
fi