-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·89 lines (71 loc) · 3.2 KB
/
run.sh
File metadata and controls
executable file
·89 lines (71 loc) · 3.2 KB
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
#!/bin/bash
n_runs=${n_runs:-10}
variation=${1:-"sc"} # s: server, c: client, b: both are varying in msg size
instance_type=$(ec2-metadata --instance-type | cut -d ' ' -f 2)
file_name="single_instance-$instance_type-$(date --utc +%FT%TZ | tr : _ | tr - _)-$(git rev-parse --short HEAD).csv"
export RESULT_FILE=$file_name
msg_sizes=""
for exp in $(seq 3 22); do
msg_sizes="$msg_sizes $((2**exp))"
done
for i in $(seq 1 4); do
msg_sizes="$msg_sizes $((2**15+i*4096)) $((2**16+i*4096))"
done
# Find the maximum value in msg_sizes - at least 1024
buf_size=$(echo $msg_sizes 1024 | tr ' ' '\n' | sort -n | tail -1)
export TIMEOUT_SEC=${timeout_sec:-10}
export PRINT_HEADER=yes
for i in $(seq 1 "$n_runs"); do
if [[ "$variation" == *"c"* ]]; then
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - host->enclave (vsock) with fix response size (8 byte)..."
make run-enclave-server
for msg_size in $msg_sizes; do
make CLIENT_MSG_SIZE=$msg_size SERVER_BUF_SIZE=$buf_size SERVER_RSP_SIZE=8 run-host-client2enclave
export PRINT_HEADER=""
done
make terminate-enclave-server
make upload-results
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - host->host (inet) with fix response size (8 byte)..."
make run-host-server-background
for msg_size in $msg_sizes; do
make CLIENT_MSG_SIZE=$msg_size SERVER_BUF_SIZE=$buf_size SERVER_RSP_SIZE=8 run-host-client2host
done
make terminate-host-server
make upload-results
fi
if [[ "$variation" == *"s"* ]]; then
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - host->enclave (vsock) with fix request size (8 byte)..."
make run-enclave-server
for msg_size in $msg_sizes; do
make CLIENT_MSG_SIZE=8 CLIENT_BUF_SIZE=$buf_size SERVER_RSP_SIZE=$msg_size run-host-client2enclave
export PRINT_HEADER=""
done
make terminate-enclave-server
make upload-results
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - host->host (inet) with fix request size (8 byte)..."
make run-host-server-background
for msg_size in $msg_sizes; do
make CLIENT_MSG_SIZE=8 CLIENT_BUF_SIZE=$buf_size SERVER_RSP_SIZE=$msg_size run-host-client2host
done
make terminate-host-server
make upload-results
fi
if [[ "$variation" == *"b"* ]]; then
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - host->enclave (vsock) with equal msg sizes..."
make run-enclave-server
for msg_size in $msg_sizes; do
make CLIENT_BUF_SIZE=$buf_size SERVER_BUF_SIZE=$buf_size CLIENT_MSG_SIZE=$msg_size SERVER_RSP_SIZE=$msg_size run-host-client2enclave
export PRINT_HEADER=""
done
make terminate-enclave-server
make upload-results
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - host->host (inet) with equal msg sizes..."
make run-host-server-background
for msg_size in $msg_sizes; do
make CLIENT_BUF_SIZE=$buf_size SERVER_BUF_SIZE=$buf_size CLIENT_MSG_SIZE=$msg_size SERVER_RSP_SIZE=$msg_size run-host-client2host
done
make terminate-host-server
make upload-results
fi
done
echo "Done."