-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_microbenchmarks.sh
executable file
·60 lines (46 loc) · 1.67 KB
/
run_microbenchmarks.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
#!/bin/bash
set -e
set -o pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
source $DIR/common.sh
setup
########################
# Parse input argument
########################
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <arg1>"
echo "Error: Please provide the benchmark type as argument, options are [board|miralis|protect]"
exit 1
fi
# We only allow three kind of benchmark types
if ! [[ "$1" == "board" || "$1" == "miralis" || "$1" == "protect" ]]; then
echo "Error: Invalid argument. Allowed values are 'board', 'miralis', or 'protect'."
exit 1
fi
echo "Benchmark type: $1"
# Determine ADDRESS based on VALUE
if [[ "$1" == "board" ]]; then
ADDRESS=$BOARD_IP
elif [[ "$1" == "miralis" ]]; then
ADDRESS=$MIRALIS_IP
elif [[ "$1" == "protect" ]]; then
ADDRESS=$PROTECT_PAYLOAD_IP
else
echo "Unknown value: $VALUE"
exit 1
fi
# Run benchmarks
echo "Running CPU Microbenchmark [Coremarkpro]"
RemoteExec $ADDRESS "./microbenchmark_cpu.sh" > "results/coremarkpro_$1.txt"
echo "Done with CPU microbenchmark"
echo "Running filesystem microbenchmark [Filesystem]"
RemoteExec $ADDRESS "./microbenchmark_fs.sh" > "results/iozone_$1.txt"
echo "Done with disk microbenchmark"
echo "Running network microbenchmark [netperf]"
# Start network server
RemoteExec $ADDRESS "./microbenchmark_network.sh $1"
# Launch remote benchmarks
netperf -H $(echo "$ADDRESS" | cut -d'@' -f2-) -t TCP_STREAM > "results/netperf_$1_tcp.txt"
netperf -H $(echo "$ADDRESS" | cut -d'@' -f2-) -t UDP_STREAM > "results/netperf_$1_udp.txt"
netperf -H $(echo "$ADDRESS" | cut -d'@' -f2-) -t TCP_RR > "results/netperf_$1_rtt.txt"
echo "Done with network microbenchmark"