-
Notifications
You must be signed in to change notification settings - Fork 1
/
experimenter.sh
executable file
·169 lines (156 loc) · 5.49 KB
/
experimenter.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
#!/bin/bash
# Experiment duration
PERIOD="1y"
# Workloads
# Independent workloads
WORKLOAD="data/workload/asplos.workload"
WORKLOAD="data/workload/hotmail.workload"
WORKLOAD="data/workload/messenger.workload"
WORKLOAD="data/workload/wikipedia.workload"
WORKLOAD="data/workload/flash.workload"
WORKLOAD="data/workload/variable.workload"
WORKLOAD="data/workload/mix.workload"
# All workloads
WORKLOADS="data/workload/asplos.workload data/workload/search.workload data/workload/hotmail.workload data/workload/messenger.workload data/workload/wikipedia.workload data/workload/flash.workload data/workload/orkut.workload data/workload/mix.workload"
# Locations
LOCATIONS=""
LOCATIONS=$LOCATIONS" data/locations/newark.location"
LOCATIONS=$LOCATIONS" data/locations/quito.location"
# Net metering. It's already defined in the location
NETMETER_0=0.0 # 0%
NETMETER_WR=0.4 # 40%
NETMETER_RR=1.0 # 100%
# Simple experiments
# LOCATIONS="data/locations/newark.location"
# WORKLOADS="data/workload/asplos.workload"
# Infrastructure
INFRASTRUCTURES=""
INFRASTRUCTURES=$INFRASTRUCTURES" data/parasol.infra"
INFRASTRUCTURES=$INFRASTRUCTURES" data/large.infra"
# Large
SOLARS="0 1MW 2MW 5MW 10MW 15MW"
BATTERIES="0 1MWh 2MWh 5MWh 10MWh 20MWh 50MWh 100MWh"
# Parasol
# SOLARS=" 0 800 1600 2400 3200 4000 4800"
# BATTERIES="0 800 8000 16000 24000 32000"
# Multiprocess
MAXTHREADS=`cat /proc/cpuinfo | grep processor | wc -l`
NUMTHREADS=0
# Read modes from command line
while [ $# -gt 0 ]; do
case $1 in
"--datacenter")
shift
while [[ $1 != --* && $# -gt 0 ]]; do
if [[ $1 == "large" ]]; then
INFRASTRUCTURES="data/large.infra"
SOLARS="0 1MW 2MW 5MW 10MW 15MW"
BATTERIES="0 1MWh 2MWh 5MWh 10MWh 20MWh 50MWh 100MWh"
elif [[ $1 == "parasol" ]]; then
INFRASTRUCTURES="data/parasol.infra"
SOLARS=" 0 800 1600 2400 3200 4000 4800"
BATTERIES="0 8000 16000 24000 32000"
fi
shift
done
;;
"--solar")
shift
SOLARS=$1
shift
while [[ $1 != --* && $# -gt 0 ]]; do
SOLARS=$SOLARS" "$1
shift
done
;;
"--battery")
shift
BATTERIES=$1
shift
while [[ $1 != --* && $# -gt 0 ]]; do
BATTERIES=$BATTERIES" "$1
shift
done
;;
"--location")
shift
LOCATIONS=$1
shift
while [[ $1 != --* && $# -gt 0 ]]; do
LOCATIONS=$LOCATIONS" "$1
shift
done
;;
"--infrastructure")
shift
INFRASTRUCTURES=$1
shift
while [[ $1 != --* && $# -gt 0 ]]; do
INFRASTRUCTURES=$INFRASTRUCTURES" "$1
shift
done
;;
"--workload")
shift
WORKLOADS=$1
shift
while [[ $1 != --* && $# -gt 0 ]]; do
WORKLOADS=$WORKLOADS" "$1
shift
done
;;
*)
echo "Unknown option: $1"
shift
;;
esac
done
if true; then
for ALWAYSON in ""; do # for ALWAYSON in "" "--alwayson"; do
for INFRASTRUCTURE in $INFRASTRUCTURES; do
for LOCATION in $LOCATIONS; do
for WORKLOAD in $WORKLOADS; do
for DELAY in "" "--delay"; do
for BATTERY in $BATTERIES; do
for SOLAR in $SOLARS; do
# Wait for empty slots
if [ $NUMTHREADS -ge $MAXTHREADS ]; then
# We have filled all the threads, wait for them to finish
echo "`date`: Waiting for ${THREADS[@]}"
for THREADID in ${THREADS[@]}; do
wait $THREADID
done
NUMTHREADS=0
fi
# Run more simulations
bash simulator.sh -i $INFRASTRUCTURE --solar $SOLAR --battery $BATTERY --period $PERIOD --workload $WORKLOAD -l $LOCATION $DELAY $ALWAYSON > /dev/null &
# Store the PID
THREADS[$NUMTHREADS]=$!
let NUMTHREADS=$NUMTHREADS+1
done; done; done; done; done; done; done
# Wait for everybody to finish
echo "`date`: Waiting for ${THREADS[@]}"
for THREADID in ${THREADS[@]}; do
wait $THREADID
done
fi
if false; then
bash simulator.sh --solar 0 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --alwayson
bash simulator.sh --solar 3200 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR
bash simulator.sh --solar 2400 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR
bash simulator.sh --solar 1600 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR
bash simulator.sh --solar 800 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR
bash simulator.sh --solar 0 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR
bash simulator.sh --solar 3200 --battery 32000 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR
bash simulator.sh --solar 0 --battery 32000 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR
fi
if false; then
bash simulator.sh --solar 3200 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay
bash simulator.sh --solar 2400 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay
bash simulator.sh --solar 1600 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay
bash simulator.sh --solar 800 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay
bash simulator.sh --solar 0 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay
bash simulator.sh --solar 3200 --battery 32000 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay
bash simulator.sh --solar 0 --battery 32000 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay
bash simulator.sh --solar 0 --battery 0 --period $PERIOD --workload $WORKLOAD --net $NETMETER_WR --delay --alwayson
fi