Commit 6fe1bc33 authored by Jialin Li's avatar Jialin Li
Browse files

ae: add nopaxos experiment scripts

parent 38502e36
#!/bin/bash
SB_BASE="$(readlink -f $(dirname ${BASH_SOURCE[0]})/../..)"
# Run nopaxos with endhost sequencer in Figure 10
echo "Start running nopaxos with endhost sequencer data points"
python3 run.py pyexps/ae/nopaxos.py --filter nopaxos-qt-ib-ehseq-* --force --verbose
# Run nopaxos with switch sequencer in Figure 10
echo "Start running nopaxos with switch sequencer data points"
python3 run.py pyexps/ae/nopaxos.py --filter nopaxos-qt-ib-swseq-* --force --verbose
# Parse nopaxos result
python3 pyexps/ae/data_nopaxos.py out/ > ae/nopaxos.data
# Copyright 2021 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import sys
import utils.parse_nopaxos as pn
if len(sys.argv) != 2:
print('Usage: data_nopaxos.py OUTDIR')
sys.exit(1)
types_of_network = ['swseq', 'ehseq']
num_clients = [1, 2, 3, 4, 5, 6, 8, 10]
basedir = sys.argv[1]
for network in types_of_network:
for c in num_clients:
line = [network, str(c)]
path = '%s/nopaxos-qt-ib-%s-%s-1.json' % (basedir, network, c)
ret = pn.parse_nopaxos_run(c, path)
if ret is not None:
line.append('%d' % ret['throughput'])
line.append('%d' % ret['latency'])
print('\t'.join(line))
# Copyright 2021 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.nodeconfig as node
from simbricks.simulator_utils import create_basic_hosts
host_configs = ['qt']
seq_configs = ['swseq', 'ehseq', 'tofino']
nic_configs = ['ib']
proto_configs = ['nopaxos']
num_client_configs = [1, 2, 3, 4, 5, 6, 8, 10]
experiments = []
sync_period = 200
link_rate_opt = '--LinkRate=100Gb/s ' # don't forget space at the end
link_latency_opt = '--LinkLatency=500ns '
for proto_config in proto_configs:
for num_c in num_client_configs:
for host_config in host_configs:
for seq_config in seq_configs:
for nic_config in nic_configs:
e = exp.Experiment(proto_config + '-' + host_config + '-' + nic_config + '-' + seq_config + f'-{num_c}')
if seq_config == 'tofino':
net = sim.TofinoNet()
else:
net = sim.NS3SequencerNet()
net.sync_period = sync_period
net.opt = link_rate_opt + link_latency_opt
e.add_network(net)
# host
if host_config == 'qemu':
host_class = sim.QemuHost
net.sync = False
elif host_config == 'gt':
host_class = sim.Gem5Host
e.checkpoint = True
elif host_config == 'qt':
def qemu_timing():
h = sim.QemuHost()
h.sync = True
return h
host_class = qemu_timing
else:
raise NameError(host_config)
# nic
if nic_config == 'ib':
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
elif nic_config == 'cb':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumLinuxNode
elif nic_config == 'cv':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumLinuxNode
else:
raise NameError(nic_config)
# app
if proto_config == 'vr':
replica_class = node.VRReplica
client_class = node.VRClient
elif proto_config == 'nopaxos':
replica_class = node.NOPaxosReplica
client_class = node.NOPaxosClient
else:
raise NameError(proto_config)
# endhost sequencer
if seq_config == 'ehseq' and proto_config == 'nopaxos':
sequencer = create_basic_hosts(e, 1, 'sequencer', net, nic_class,
host_class, nc_class, node.NOPaxosSequencer, ip_start = 100)
sequencer[0].node_config.disk_image = 'nopaxos'
sequencer[0].pcidevs[0].sync_period = sync_period
sequencer[0].sync_period = sync_period
replicas = create_basic_hosts(e, 3, 'replica', net, nic_class,
host_class, nc_class, replica_class)
for i in range(len(replicas)):
replicas[i].node_config.app.index = i
replicas[i].node_config.disk_image = 'nopaxos'
replicas[i].pcidevs[0].sync_period = sync_period
replicas[i].sync_period = sync_period
clients = create_basic_hosts(e, num_c, 'client', net, nic_class,
host_class, nc_class, client_class, ip_start = 4)
for c in clients:
c.node_config.app.server_ips = ['10.0.0.1', '10.0.0.2', '10.0.0.3']
if seq_config == 'ehseq':
c.node_config.app.server_ips.append('10.0.0.100')
c.node_config.app.use_ehseq = True
c.node_config.disk_image = 'nopaxos'
c.pcidevs[0].sync_period = sync_period
c.sync_period = sync_period
clients[num_c - 1].wait = True
clients[num_c - 1].node_config.app.is_last = True
experiments.append(e)
......@@ -24,48 +24,38 @@ import json
import re
import os
def parse_nopaxos_run(num_c, seq, path):
def parse_nopaxos_run(num_c, path):
if not os.path.exists(path):
return None
ret = {}
ret['throughput'] = None
ret['latency'] = None
tp_pat = re.compile(r'(.*)Completed *([0-9\.]*) requests in *([0-9\.]*) seconds')
lat_pat = re.compile(r'(.*)Average latency is *([0-9\.]*) ns(.*)')
if not os.path.exists(path):
return ret
tp_pat = re.compile(r'(.*)Total throughput is *([0-9\.]*) ops/sec(.*)')
lat_pat = re.compile(r'(.*)Median latency is *([0-9\.]*) us(.*)')
f_log = open(path, 'r')
log = json.load(f_log)
total_tput = 0
total_avglat = 0
total_lat = 0
for i in range(num_c):
sim_name = f'host.client.{i}'
#print(sim_name)
# in this host log stdout
for j in log["sims"][sim_name]["stdout"]:
#print(j)
m_t = tp_pat.match(j)
m_l = lat_pat.match(j)
if m_l:
#print(j)
lat = float(m_l.group(2)) / 1000 # us latency
#print(lat)
total_avglat += lat
total_lat += float(m_l.group(2))
if m_t:
n_req = float(m_t.group(2))
n_time = float(m_t.group(3))
total_tput += n_req/n_time
total_tput += int(m_t.group(2))
avglat = total_avglat/num_c
#print(avglat)
#print(total_tput)
avg_lat = total_lat/num_c
ret['throughput'] = total_tput
ret['latency'] = avglat
ret['latency'] = int(avg_lat)
return ret
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment