Skip to content

Commit

Permalink
update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyabhatkajake committed Jan 28, 2021
1 parent 5c138de commit 39a1efd
Show file tree
Hide file tree
Showing 25 changed files with 942 additions and 293 deletions.
2 changes: 1 addition & 1 deletion scripts/aws/get_pvt_ips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ done < $FILE

for ip in "${IPS[@]}"
do
ssh arch@$ip 'ip address show' | \
ssh -o StrictHostKeyChecking=accept-new arch@$ip 'ip address show' | \
grep "inet .* brd" | \
sed 's/ brd.*//g' | \
sed 's/inet //' | \
Expand Down
1 change: 1 addition & 0 deletions scripts/aws/throughput-vs-latency/apollo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ fi
--config $TESTDIR/nodes-$ID.json \
--ip ips_file \
--delta "$DELAY" \
--sleep 120 \
$CLI_TYPE &
2 changes: 1 addition & 1 deletion scripts/aws/throughput-vs-latency/clean-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ for file in $1/* ; do
sed -i "/\[Start\]/d" "$1"/$fname-cleaned.log
sed -i "/\[End\]/d" "$1"/$fname-cleaned.log

python scripts/throughput-vs-latency/vary-b/parse-exp.py "$1"/$fname-cleaned.log "$1"/$fname-cleaned.csv
python scripts/throughput-vs-latency/vary-d/parse-exp.py "$1"/$fname-cleaned.log "$1"/$fname-cleaned.csv
done
6 changes: 4 additions & 2 deletions scripts/aws/throughput-vs-latency/exp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ do
ssh arch@$ip 'bash -ls --' < scripts/aws/throughput-vs-latency/$TYPE.sh $i $TESTDIR $DELAY $CLI_TYPE &
done

sleep 60
sleep 150

echo "Using M: $M"

client=${ACTUAL_IPS[$N]}
ssh arch@$client 'bash -ls --' < scripts/aws/throughput-vs-latency/client.sh $TESTDIR $W $CLI_TYPE
ssh arch@$client 'bash -ls --' < scripts/aws/throughput-vs-latency/client.sh $TESTDIR $W $CLI_TYPE $M

for((i=0;i<$N;i++))
do
Expand Down
1 change: 1 addition & 0 deletions scripts/aws/throughput-vs-latency/synchs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ cd libchatter-rs
./target/release/node-synchs \
--config $TESTDIR/nodes-$ID.json \
--delta "$DELAY" \
--sleep 120 \
--ip ips_file &
72 changes: 36 additions & 36 deletions scripts/aws/throughput-vs-latency/vary-b/exp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi

if [ -e $1 ]; then
echo "Run directory [$1] already exists"
exit 0
# exit 0
fi

mkdir -p "$1"
Expand All @@ -31,23 +31,23 @@ SW5_List=(8000 10000 20000 40000 60000 80000 100000 120000 150000)
# ================
# Block size: 100
# ================
# for w in ${SW_List[@]}; do
# echo "DP[Window]: $w"
# bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b100-n3" $w "synchs"
# sleep 2
# done >> $1/b100-synchs-run.log
for w in ${SW_List[@]}; do
echo "DP[Window]: $w"
bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b100-n3" $w "synchs"
sleep 2
done >> $1/b100-synchs-run.log

for w in ${SW_List[@]}; do
echo "DP[Window]: $w"
M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b100-n3" $w "synchs-rr"
sleep 2
done >> $1/b100-synchs-rr-run.log

# for w in ${W_List[@]}; do
# echo "DP[Window]: $w"
# bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b100-n3" $w "apollo"
# sleep 2
# done >> $1/b100-apollo-run.log
for w in ${W_List[@]}; do
echo "DP[Window]: $w"
bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b100-n3" $w "apollo"
sleep 2
done >> $1/b100-apollo-run.log

# for w in ${W_List[@]}; do
# echo "DP[Window]: $w"
Expand All @@ -64,11 +64,11 @@ done >> $1/b100-synchs-rr-run.log
# sleep 2
# done >> $1/b400-synchs-run.log

for w in ${SW2_List[@]}; do
echo "DP[Window]: $w"
M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b400-n3" $w "synchs-rr"
sleep 2
done >> $1/b400-synchs-rr-run.log
# for w in ${SW2_List[@]}; do
# echo "DP[Window]: $w"
# M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b400-n3" $w "synchs-rr"
# sleep 2
# done >> $1/b400-synchs-rr-run.log

# for w in ${W2_List[@]}; do
# echo "DP[Window]: $w"
Expand All @@ -91,11 +91,11 @@ done >> $1/b400-synchs-rr-run.log
# sleep 2
# done >> $1/b800-synchs-run.log

for w in ${SW3_List[@]}; do
echo "DP[Window]: $w"
M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b800-n3" $w "synchs-rr"
sleep 2
done >> $1/b800-synchs-rr-run.log
# for w in ${SW3_List[@]}; do
# echo "DP[Window]: $w"
# M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b800-n3" $w "synchs-rr"
# sleep 2
# done >> $1/b800-synchs-rr-run.log

# for w in ${W3_List[@]}; do
# echo "DP[Window]: $w"
Expand All @@ -118,11 +118,11 @@ done >> $1/b800-synchs-rr-run.log
# sleep 2
# done >> $1/b2000-synchs-run.log

for w in ${SW4_List[@]}; do
echo "DP[Window]: $w"
M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b2000-n3" $w "synchs-rr"
sleep 2
done >> $1/b2000-synchs-rr-run.log
# for w in ${SW4_List[@]}; do
# echo "DP[Window]: $w"
# M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b2000-n3" $w "synchs-rr"
# sleep 2
# done >> $1/b2000-synchs-rr-run.log

# for w in ${W4_List[@]}; do
# echo "DP[Window]: $w"
Expand All @@ -139,17 +139,17 @@ done >> $1/b2000-synchs-rr-run.log
# ================
# Block size: 4000
# ================
for w in ${SW5_List[@]}; do
echo "DP[Window]: $w"
bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b4000-n3" $w "synchs"
sleep 2
done >> $1/b4000-synchs-run.log
# for w in ${SW5_List[@]}; do
# echo "DP[Window]: $w"
# bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b4000-n3" $w "synchs"
# sleep 2
# done >> $1/b4000-synchs-run.log

for w in ${SW5_List[@]}; do
echo "DP[Window]: $w"
M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b4000-n3" $w "synchs-rr"
sleep 2
done >> $1/b4000-synchs-rr-run.log
# for w in ${SW5_List[@]}; do
# echo "DP[Window]: $w"
# M=100000 bash scripts/aws/throughput-vs-latency/exp.sh "scripts/aws/aws_ips.log" "testdata/b4000-n3" $w "synchs-rr"
# sleep 2
# done >> $1/b4000-synchs-rr-run.log

for w in ${W5_List[@]}; do
echo "DP[Window]: $w"
Expand Down
4 changes: 2 additions & 2 deletions scripts/aws/throughput-vs-latency/vary-d/do_exp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

IN_FILE=${1:-"scripts/aws/aws_ips.log"}
TESTDIR=${2:-"testdata/b100-n3"}
W=${3:-"50000"}
W=${3:-"40000"}
TYPE=${4:-"apollo"}
N=${5:-"3"}
DELAY=${6:-"50"}
Expand All @@ -33,7 +33,7 @@ do
ssh arch@$ip 'bash -ls --' < scripts/aws/throughput-vs-latency/$TYPE.sh $i $TESTDIR $DELAY &
done

sleep 60
sleep 180

client=${ACTUAL_IPS[$N]}
ssh arch@$client 'bash -ls --' < scripts/aws/throughput-vs-latency/client.sh $TESTDIR $W $CLI_TYPE
Expand Down
20 changes: 13 additions & 7 deletions scripts/aws/throughput-vs-latency/vary-d/exp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi

if [ -e $1 ]; then
echo "Run directory [$1] already exists"
exit 0
# exit 0
fi

mkdir -p "$1"
Expand All @@ -16,18 +16,24 @@ F=${F:-"1"}

# Test settings for T1 micro
DELAY=(50 100 200 500)
W=20000
SW=20000
# W=(10000 20000 40000 80000)
W=(40000 80000)
# SW=(10000 20000 40000 80000)

N=$(( (2*$F)+1 ))

for w in ${SW[@]}; do
for d in ${DELAY[@]};do
echo "DP[Delay]: $d"
bash scripts/aws/throughput-vs-latency/vary-d/do_exp.sh "scripts/aws/aws_ips.log" "testdata/b400-p0-f$F" "$W" "synchs" "$N" "$d"
bash scripts/aws/throughput-vs-latency/vary-d/do_exp.sh "scripts/aws/aws_ips.log" "testdata/b400-p0-f$F" "$w" "synchs" "$N" "$d"
sleep 2 # Sleep after an experiment so that the OS releases the socket
done &>> $1/$F-synchs-run.log
done &>> $1/$w-$F-synchs-run.log
done

for w in ${W[@]}; do
for d in ${DELAY[@]};do
echo "DP[Delay]: $d"
bash scripts/aws/throughput-vs-latency/vary-d/do_exp.sh "scripts/aws/aws_ips.log" "testdata/b400-p0-f$F" "$W" "apollo" "$N" "$d"
bash scripts/aws/throughput-vs-latency/vary-d/do_exp.sh "scripts/aws/aws_ips.log" "testdata/b400-p0-f$F" "$w" "apollo" "$N" "$d"
sleep 2 # Sleep after an experiment so that the OS releases the socket
done >> $1/$F-apollo-run.log
done >> $1/$w-$F-apollo-run.log
done
Binary file removed scripts/ping/Ping-AWS.pdf
Binary file not shown.
19 changes: 11 additions & 8 deletions scripts/ping/plot-ping.ipynb

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
39 changes: 24 additions & 15 deletions scripts/throughput-vs-latency/vary-b/plot-exp.ipynb

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions scripts/throughput-vs-latency/vary-b/synchs-rr.ipynb

Large diffs are not rendered by default.

312 changes: 100 additions & 212 deletions scripts/throughput-vs-latency/vary-d/plot-exp.ipynb

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions scripts/throughput-vs-latency/vary-d/plot1-backup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
# Build a ping percentile plot

import matplotlib.pyplot as plt
from numpy import percentile
from csv import reader
import math

ROOT="/run/media/haxolotl/Backup/GitRoot/libapollo-rust"


# %%
# Plot Tput vs Delta for f=4,8,16,32, w=40

faults = [4,8,16,32]
w = 40000

new_data = {}
new_data["x"] = []
new_data["y"] = []

shs_data = {}
apl_data = {}

from copy import deepcopy

Protocol="synchs"
for Faults in faults:
File = f"{ROOT}/data/Jan20/c5/vary-d/F{Faults}/w{w}-{Faults}-{Protocol}-run-cleaned.csv"
# print(File)
shs_data[Faults] = deepcopy(new_data)
with open(File) as f:
rdr = reader(f)
for row in rdr:
delta = int(row[0])
tput = float(row[1])/1000
lat = float(row[2])
shs_data[Faults]["x"].append(delta)
shs_data[Faults]["y"].append(tput)

Protocol="apollo"
for Faults in faults:
File = f"{ROOT}/data/Jan20/c5/vary-d/F{Faults}/w{w}-{Faults}-{Protocol}-run-cleaned.csv"
# print(File)
apl_data[Faults] = deepcopy(new_data)
with open(File) as f:
rdr = reader(f)
for row in rdr:
delta = int(row[0])
tput = float(row[1])/1000
lat = float(row[2])
apl_data[Faults]["x"].append(delta)
apl_data[Faults]["y"].append(tput)
# print(data)
for f in shs_data:
plt.plot(shs_data[f]["x"], shs_data[f]["y"], linestyle="--", marker="*", label=f"Synchs-f{f}")
for f in apl_data:
plt.plot(apl_data[f]["x"], apl_data[f]["y"], linestyle="--", marker=".",label=f"Apollo-f{f}")
plt.legend()
plt.xlabel("Delta $\Delta$ (in ms)")
plt.ylabel("Response rate (in Kops/s)")
plt.savefig(f"{ROOT}/Plots/vary-d/t-vs-d.pdf", bbox_inches="tight")


# %%
# Plot Tput vs Delta for f=4,8,16,32, w=40

faults = [4,8,16,32]
w = 40000

new_data = {}
new_data["x"] = []
new_data["y"] = []

shs_data = {}
apl_data = {}

from copy import deepcopy

Protocol="synchs"
for Faults in faults:
File = f"{ROOT}/data/Jan20/c5/vary-d/F{Faults}/w{w}-{Faults}-{Protocol}-run-cleaned.csv"
# print(File)
shs_data[Faults] = deepcopy(new_data)
with open(File) as f:
rdr = reader(f)
for row in rdr:
delta = int(row[0])
tput = float(row[1])/1000
lat = float(row[2])
shs_data[Faults]["x"].append(delta)
shs_data[Faults]["y"].append(lat)

Protocol="apollo"
for Faults in faults:
File = f"{ROOT}/data/Jan20/c5/vary-d/F{Faults}/w{w}-{Faults}-{Protocol}-run-cleaned.csv"
# print(File)
apl_data[Faults] = deepcopy(new_data)
with open(File) as f:
rdr = reader(f)
for row in rdr:
delta = int(row[0])
tput = float(row[1])/1000
lat = float(row[2])
apl_data[Faults]["x"].append(delta)
apl_data[Faults]["y"].append(lat)
# print(data)
for f in shs_data:
plt.plot(shs_data[f]["x"], shs_data[f]["y"], linestyle="--", marker="*", label=f"Synchs-f{f}")
for f in apl_data:
plt.plot(apl_data[f]["x"], apl_data[f]["y"], linestyle="--", marker=".",label=f"Apollo-f{f}")
plt.legend()
plt.xlabel("Delta $\Delta$ (in ms)")
plt.ylabel("Response rate (in Kops/s)")
plt.savefig(f"{ROOT}/Plots/vary-d/l-vs-d.pdf", bbox_inches="tight")


Loading

0 comments on commit 39a1efd

Please sign in to comment.