Commit 7549fa9e authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

pre-commit run -a

parent aac98df8
...@@ -20,11 +20,12 @@ ...@@ -20,11 +20,12 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
host_configs = ['qt'] host_configs = ['qt']
seq_configs = ['swseq', 'ehseq', 'tofino'] seq_configs = ['swseq', 'ehseq', 'tofino']
nic_configs = ['ib'] nic_configs = ['ib']
...@@ -41,7 +42,10 @@ for proto_config in proto_configs: ...@@ -41,7 +42,10 @@ for proto_config in proto_configs:
for host_config in host_configs: for host_config in host_configs:
for seq_config in seq_configs: for seq_config in seq_configs:
for nic_config in nic_configs: for nic_config in nic_configs:
e = exp.Experiment(proto_config + '-' + host_config + '-' + nic_config + '-' + seq_config + f'-{num_c}') e = exp.Experiment(
proto_config + '-' + host_config + '-' + nic_config +
'-' + seq_config + f'-{num_c}'
)
if seq_config == 'tofino': if seq_config == 'tofino':
net = sim.TofinoNet() net = sim.TofinoNet()
else: else:
...@@ -58,10 +62,12 @@ for proto_config in proto_configs: ...@@ -58,10 +62,12 @@ for proto_config in proto_configs:
host_class = sim.Gem5Host host_class = sim.Gem5Host
e.checkpoint = True e.checkpoint = True
elif host_config == 'qt': elif host_config == 'qt':
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
else: else:
raise NameError(host_config) raise NameError(host_config)
...@@ -79,7 +85,6 @@ for proto_config in proto_configs: ...@@ -79,7 +85,6 @@ for proto_config in proto_configs:
else: else:
raise NameError(nic_config) raise NameError(nic_config)
# app # app
if proto_config == 'vr': if proto_config == 'vr':
replica_class = node.VRReplica replica_class = node.VRReplica
...@@ -92,25 +97,53 @@ for proto_config in proto_configs: ...@@ -92,25 +97,53 @@ for proto_config in proto_configs:
# endhost sequencer # endhost sequencer
if seq_config == 'ehseq' and proto_config == 'nopaxos': if seq_config == 'ehseq' and proto_config == 'nopaxos':
sequencer = create_basic_hosts(e, 1, 'sequencer', net, nic_class, sequencer = create_basic_hosts(
host_class, nc_class, node.NOPaxosSequencer, ip_start = 100) e,
1,
'sequencer',
net,
nic_class,
host_class,
nc_class,
node.NOPaxosSequencer,
ip_start=100
)
sequencer[0].node_config.disk_image = 'nopaxos' sequencer[0].node_config.disk_image = 'nopaxos'
sequencer[0].pcidevs[0].sync_period = sync_period sequencer[0].pcidevs[0].sync_period = sync_period
sequencer[0].sync_period = sync_period sequencer[0].sync_period = sync_period
replicas = create_basic_hosts(e, 3, 'replica', net, nic_class, replicas = create_basic_hosts(
host_class, nc_class, replica_class) e,
3,
'replica',
net,
nic_class,
host_class,
nc_class,
replica_class
)
for i in range(len(replicas)): for i in range(len(replicas)):
replicas[i].node_config.app.index = i replicas[i].node_config.app.index = i
replicas[i].node_config.disk_image = 'nopaxos' replicas[i].node_config.disk_image = 'nopaxos'
replicas[i].pcidevs[0].sync_period = sync_period replicas[i].pcidevs[0].sync_period = sync_period
replicas[i].sync_period = sync_period replicas[i].sync_period = sync_period
clients = create_basic_hosts(e, num_c, 'client', net, nic_class, clients = create_basic_hosts(
host_class, nc_class, client_class, ip_start = 4) e,
num_c,
'client',
net,
nic_class,
host_class,
nc_class,
client_class,
ip_start=4
)
for c in clients: for c in clients:
c.node_config.app.server_ips = ['10.0.0.1', '10.0.0.2', '10.0.0.3'] c.node_config.app.server_ips = [
'10.0.0.1', '10.0.0.2', '10.0.0.3'
]
if seq_config == 'ehseq': if seq_config == 'ehseq':
c.node_config.app.server_ips.append('10.0.0.100') c.node_config.app.server_ips.append('10.0.0.100')
c.node_config.app.use_ehseq = True c.node_config.app.use_ehseq = True
......
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
# $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose # $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose
######################################################################## ########################################################################
import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.nodeconfig as node import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
host_types = ['qemu', 'gt', 'qt'] host_types = ['qemu', 'gt', 'qt']
nic_types = ['ib', 'cb', 'cv'] nic_types = ['ib', 'cb', 'cv']
net_types = ['sw', 'ns3'] net_types = ['sw', 'ns3']
...@@ -55,7 +55,9 @@ experiments = [] ...@@ -55,7 +55,9 @@ experiments = []
for host_type in host_types: for host_type in host_types:
for nic_type in nic_types: for nic_type in nic_types:
for net_type in net_types: for net_type in net_types:
e = exp.Experiment('nf-' + host_type + '-' + net_type + '-' + nic_type) e = exp.Experiment(
'nf-' + host_type + '-' + net_type + '-' + nic_type
)
# network # network
if net_type == 'sw': if net_type == 'sw':
...@@ -70,10 +72,12 @@ for host_type in host_types: ...@@ -70,10 +72,12 @@ for host_type in host_types:
if host_type == 'qemu': if host_type == 'qemu':
host_class = sim.QemuHost host_class = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
elif host_type == 'gt': elif host_type == 'gt':
host_class = sim.Gem5Host host_class = sim.Gem5Host
...@@ -95,11 +99,28 @@ for host_type in host_types: ...@@ -95,11 +99,28 @@ for host_type in host_types:
raise NameError(nic_type) raise NameError(nic_type)
# create servers and clients # create servers and clients
servers = create_basic_hosts(e, 1, 'server', net, nic_class, host_class, servers = create_basic_hosts(
nc_class, node.NetperfServer) e,
1,
'server',
net,
nic_class,
host_class,
nc_class,
node.NetperfServer
)
clients = create_basic_hosts(e, 1, 'client', net, nic_class, host_class, clients = create_basic_hosts(
nc_class, node.NetperfClient, ip_start = 2) e,
1,
'client',
net,
nic_class,
host_class,
nc_class,
node.NetperfClient,
ip_start=2
)
for c in clients: for c in clients:
c.wait = True c.wait = True
......
...@@ -20,16 +20,19 @@ ...@@ -20,16 +20,19 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import fnmatch
import glob import glob
import itertools
import json import json
import os import os
import fnmatch
import re import re
import itertools
import sys import sys
def parse_iperf_run(data, skip=1, use=8): def parse_iperf_run(data, skip=1, use=8):
tp_pat = re.compile(r'\[ *\d*\] *([0-9\.]*)- *([0-9\.]*) sec.*Bytes *([0-9\.]*) ([GM])bits.*') tp_pat = re.compile(
r'\[ *\d*\] *([0-9\.]*)- *([0-9\.]*) sec.*Bytes *([0-9\.]*) ([GM])bits.*'
)
tps_time = {} tps_time = {}
for hn in fnmatch.filter(data['sims'].keys(), 'host.client.*'): for hn in fnmatch.filter(data['sims'].keys(), 'host.client.*'):
sim = data['sims'][hn] sim = data['sims'][hn]
...@@ -50,7 +53,7 @@ def parse_iperf_run(data, skip=1, use=8): ...@@ -50,7 +53,7 @@ def parse_iperf_run(data, skip=1, use=8):
if m.group(4) == 'G': if m.group(4) == 'G':
tps_time[time].append(float(m.group(3))) tps_time[time].append(float(m.group(3)))
elif m.group(4) == 'M': elif m.group(4) == 'M':
m_tps = float(m.group(3))/1000 m_tps = float(m.group(3)) / 1000
tps_time[time].append(m_tps) tps_time[time].append(m_tps)
tps = [] tps = []
...@@ -58,11 +61,11 @@ def parse_iperf_run(data, skip=1, use=8): ...@@ -58,11 +61,11 @@ def parse_iperf_run(data, skip=1, use=8):
x = sum(tps_time[t]) x = sum(tps_time[t])
tps.append(x) tps.append(x)
if len(tps) == 0: if len(tps) == 0:
return None return None
return sum(tps) / len(tps) return sum(tps) / len(tps)
def parse_iperf(basename, skip=1, use=8): def parse_iperf(basename, skip=1, use=8):
runs = [] runs = []
for path in glob.glob(basename + '-*.json'): for path in glob.glob(basename + '-*.json'):
...@@ -79,6 +82,7 @@ def parse_iperf(basename, skip=1, use=8): ...@@ -79,6 +82,7 @@ def parse_iperf(basename, skip=1, use=8):
if not runs: if not runs:
return {'avg': None, 'min': None, 'max': None} return {'avg': None, 'min': None, 'max': None}
else: else:
return {'avg': sum(runs) / len(runs), 'min': min(runs), return {
'max': max(runs)} 'avg': sum(runs) / len(runs), 'min': min(runs), 'max': max(runs)
}
result = {} result = {}
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import json import json
import re
import os import os
import re
def parse_netperf_run(path): def parse_netperf_run(path):
ret = {} ret = {}
...@@ -50,8 +51,6 @@ def parse_netperf_run(path): ...@@ -50,8 +51,6 @@ def parse_netperf_run(path):
m = tp_pat.match(tp_line) m = tp_pat.match(tp_line)
ret['throughput'] = float(m.group(1)) ret['throughput'] = float(m.group(1))
lath_pat = re.compile(r'\s*Mean Latency.*') lath_pat = re.compile(r'\s*Mean Latency.*')
start = None start = None
i = 0 i = 0
...@@ -64,7 +63,9 @@ def parse_netperf_run(path): ...@@ -64,7 +63,9 @@ def parse_netperf_run(path):
if start is not None: if start is not None:
lat_line = lines[start + 1] lat_line = lines[start + 1]
lat_pat = re.compile(r'\s*([-0-9\.]*),([-0-9\.]*),([-0-9\.]*),([-0-9\.]*).*') lat_pat = re.compile(
r'\s*([-0-9\.]*),([-0-9\.]*),([-0-9\.]*),([-0-9\.]*).*'
)
m = lat_pat.match(lat_line) m = lat_pat.match(lat_line)
ret['latenyMean'] = float(m.group(1)) ret['latenyMean'] = float(m.group(1))
ret['latenyTail'] = float(m.group(4)) ret['latenyTail'] = float(m.group(4))
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import json import json
import re
import os import os
import re
def parse_nopaxos_run(num_c, path): def parse_nopaxos_run(num_c, path):
...@@ -45,7 +46,7 @@ def parse_nopaxos_run(num_c, path): ...@@ -45,7 +46,7 @@ def parse_nopaxos_run(num_c, path):
sim_name = f'host.client.{i}' sim_name = f'host.client.{i}'
# in this host log stdout # in this host log stdout
for j in log["sims"][sim_name]["stdout"]: for j in log['sims'][sim_name]['stdout']:
m_t = tp_pat.match(j) m_t = tp_pat.match(j)
m_l = lat_pat.match(j) m_l = lat_pat.match(j)
if m_l: if m_l:
...@@ -53,8 +54,7 @@ def parse_nopaxos_run(num_c, path): ...@@ -53,8 +54,7 @@ def parse_nopaxos_run(num_c, path):
if m_t: if m_t:
total_tput += int(m_t.group(2)) total_tput += int(m_t.group(2))
avg_lat = total_lat / num_c
avg_lat = total_lat/num_c
ret['throughput'] = total_tput ret['throughput'] = total_tput
ret['latency'] = int(avg_lat) ret['latency'] = int(avg_lat)
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_dctcp_hosts from simbricks.simulator_utils import create_dctcp_hosts
import simbricks.experiments as exp
# iperf TCP_multi_client test # iperf TCP_multi_client test
# naming convention following host-nic-net-app # naming convention following host-nic-net-app
...@@ -33,8 +33,8 @@ from simbricks.simulator_utils import create_dctcp_hosts ...@@ -33,8 +33,8 @@ from simbricks.simulator_utils import create_dctcp_hosts
# net: switch/dumbbell/bridge # net: switch/dumbbell/bridge
# app: DCTCPm # app: DCTCPm
types_of_host = ['qemu', 'qt','gt', 'gO3'] types_of_host = ['qemu', 'qt', 'gt', 'gO3']
types_of_nic = ['cv','cb','ib'] types_of_nic = ['cv', 'cb', 'ib']
types_of_net = ['dumbbell'] types_of_net = ['dumbbell']
types_of_app = ['DCTCPm'] types_of_app = ['DCTCPm']
types_of_mtu = [1500, 4000, 9000] types_of_mtu = [1500, 4000, 9000]
...@@ -65,7 +65,10 @@ for mtu in types_of_mtu: ...@@ -65,7 +65,10 @@ for mtu in types_of_mtu:
net = net_class() net = net_class()
net.opt = link_rate_opt + link_latency_opt + f'--EcnTh={k_val}' net.opt = link_rate_opt + link_latency_opt + f'--EcnTh={k_val}'
e = exp.Experiment( h + '-' + c + '-' + 'dumbbell' + '-' + 'DCTCPm' + f'{k_val}' + f'-{mtu}') e = exp.Experiment(
h + '-' + c + '-' + 'dumbbell' + '-' + 'DCTCPm' +
f'{k_val}' + f'-{mtu}'
)
e.add_network(net) e.add_network(net)
freq = cpu_freq freq = cpu_freq
...@@ -74,24 +77,30 @@ for mtu in types_of_mtu: ...@@ -74,24 +77,30 @@ for mtu in types_of_mtu:
host_class = sim.QemuHost host_class = sim.QemuHost
elif h == 'qt': elif h == 'qt':
freq = cpu_freq_qemu freq = cpu_freq_qemu
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
elif h == 'gt': elif h == 'gt':
def gem5_timing(): def gem5_timing():
h = sim.Gem5Host() h = sim.Gem5Host()
#h.sys_clock = sys_clock #h.sys_clock = sys_clock
return h return h
host_class = gem5_timing host_class = gem5_timing
e.checkpoint = True e.checkpoint = True
elif h == 'gO3': elif h == 'gO3':
def gem5_o3(): def gem5_o3():
h = sim.Gem5Host() h = sim.Gem5Host()
h.cpu_type = 'DerivO3CPU' h.cpu_type = 'DerivO3CPU'
h.sys_clock = sys_clock h.sys_clock = sys_clock
return h return h
host_class = gem5_o3 host_class = gem5_o3
e.checkpoint = True e.checkpoint = True
else: else:
...@@ -110,12 +119,31 @@ for mtu in types_of_mtu: ...@@ -110,12 +119,31 @@ for mtu in types_of_mtu:
else: else:
raise NameError(c) raise NameError(c)
servers = create_dctcp_hosts(
servers = create_dctcp_hosts(e, num_pairs, 'server', net, nic_class, host_class, e,
nc_class, node.DctcpServer, freq, mtu) num_pairs,
clients = create_dctcp_hosts(e, num_pairs, 'client', net, nic_class, host_class, 'server',
nc_class, node.DctcpClient, freq, mtu, ip_start=num_pairs+1) net,
nic_class,
host_class,
nc_class,
node.DctcpServer,
freq,
mtu
)
clients = create_dctcp_hosts(
e,
num_pairs,
'client',
net,
nic_class,
host_class,
nc_class,
node.DctcpClient,
freq,
mtu,
ip_start=num_pairs + 1
)
i = 0 i = 0
for cl in clients: for cl in clients:
...@@ -126,9 +154,8 @@ for mtu in types_of_mtu: ...@@ -126,9 +154,8 @@ for mtu in types_of_mtu:
# This is to prevent the simulation gets stuck when one of host exits. # This is to prevent the simulation gets stuck when one of host exits.
# The last client waits for the output printed in other hosts, then cleanup # The last client waits for the output printed in other hosts, then cleanup
clients[num_pairs-1].node_config.app.is_last = True clients[num_pairs - 1].node_config.app.is_last = True
clients[num_pairs-1].wait = True clients[num_pairs - 1].wait = True
print(e.name) print(e.name)
experiments.append(e) experiments.append(e)
...@@ -22,12 +22,14 @@ ...@@ -22,12 +22,14 @@
import math import math
import random import random
import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.proxy as proxy
import simbricks.nodeconfig as node import simbricks.nodeconfig as node
import simbricks.proxy as proxy
import simbricks.simulators as sim
from simbricks.simulator_utils import create_multinic_hosts from simbricks.simulator_utils import create_multinic_hosts
import simbricks.experiments as exp
host_types = ['qemu', 'gem5', 'qt'] host_types = ['qemu', 'gem5', 'qt']
n_nets = [1, 2, 3, 4, 8, 16, 32] n_nets = [1, 2, 3, 4, 8, 16, 32]
n_hosts = [2, 10, 20, 30, 35, 40, 50, 60, 70, 80] n_hosts = [2, 10, 20, 30, 35, 40, 50, 60, 70, 80]
...@@ -36,6 +38,7 @@ separate_net = True ...@@ -36,6 +38,7 @@ separate_net = True
nets_per_host = 1 nets_per_host = 1
def select_servers(i, j, racks, n, n_host): def select_servers(i, j, racks, n, n_host):
nc = int(n_host / 2) nc = int(n_host / 2)
...@@ -56,6 +59,7 @@ def select_servers(i, j, racks, n, n_host): ...@@ -56,6 +59,7 @@ def select_servers(i, j, racks, n, n_host):
servers_other = random.sample(all_other_servers, k=n_remote) servers_other = random.sample(all_other_servers, k=n_remote)
return servers_local + servers_other return servers_local + servers_other
for host_type in host_types: for host_type in host_types:
for n in n_nets: for n in n_nets:
for n_host in n_hosts: for n_host in n_hosts:
...@@ -65,16 +69,20 @@ for host_type in host_types: ...@@ -65,16 +69,20 @@ for host_type in host_types:
if separate_net: if separate_net:
nh += 1 nh += 1
e = exp.DistributedExperiment(f'dist_memcache-{host_type}-{n}-{n_host}', nh) e = exp.DistributedExperiment(
f'dist_memcache-{host_type}-{n}-{n_host}', nh
)
# host # host
if host_type == 'qemu': if host_type == 'qemu':
host_class = sim.QemuHost host_class = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
elif host_type == 'gem5': elif host_type == 'gem5':
host_class = sim.Gem5Host host_class = sim.Gem5Host
...@@ -106,23 +114,43 @@ for host_type in host_types: ...@@ -106,23 +114,43 @@ for host_type in host_types:
# create servers and clients # create servers and clients
m = int(n_host / 2) m = int(n_host / 2)
servers = create_multinic_hosts(e, m, 'server_%d' % (i,), servers = create_multinic_hosts(
switch, host_class, node.I40eLinuxNode, e,
node.MemcachedServer, ip_start = i * n_host + 1, m,
ip_prefix=16) 'server_%d' % (i,),
switch,
host_class,
node.I40eLinuxNode,
node.MemcachedServer,
ip_start=i * n_host + 1,
ip_prefix=16
)
for s in servers: for s in servers:
e.assign_sim_host(s, h_i) e.assign_sim_host(s, h_i)
s_multisubnic = next(pcidev for pcidev in s.pcidevs if isinstance(pcidev, sim.MultiSubNIC)) s_multisubnic = next(
pcidev for pcidev in s.pcidevs
if isinstance(pcidev, sim.MultiSubNIC)
)
e.assign_sim_host(s_multisubnic.multinic, h_i) e.assign_sim_host(s_multisubnic.multinic, h_i)
clients = create_multinic_hosts(e, m, 'client_%d' % (i,), clients = create_multinic_hosts(
switch, host_class, node.I40eLinuxNode, e,
node.MemcachedClient, ip_start = i * n_host + 1 + m, m,
ip_prefix=16) 'client_%d' % (i,),
switch,
host_class,
node.I40eLinuxNode,
node.MemcachedClient,
ip_start=i * n_host + 1 + m,
ip_prefix=16
)
for c in clients: for c in clients:
c.wait = True c.wait = True
e.assign_sim_host(c, h_i) e.assign_sim_host(c, h_i)
c_multisubnic = next(pcidev for pcidev in c.pcidevs if isinstance(pcidev, sim.MultiSubNIC)) c_multisubnic = next(
pcidev for pcidev in c.pcidevs
if isinstance(pcidev, sim.MultiSubNIC)
)
e.assign_sim_host(c_multisubnic.multinic, h_i) e.assign_sim_host(c_multisubnic.multinic, h_i)
racks.append((servers, clients)) racks.append((servers, clients))
...@@ -147,7 +175,7 @@ for host_type in host_types: ...@@ -147,7 +175,7 @@ for host_type in host_types:
all_servers = [] all_servers = []
all_clients = [] all_clients = []
for (s,c) in racks: for (s, c) in racks:
all_servers += s all_servers += s
all_clients += c all_clients += c
......
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.proxy as proxy
import simbricks.nodeconfig as node import simbricks.nodeconfig as node
import simbricks.proxy as proxy
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
host_types = ['qemu', 'gem5', 'qt'] host_types = ['qemu', 'gem5', 'qt']
n_nets = [1, 2, 3, 4] n_nets = [1, 2, 3, 4]
n_clients = [1, 10, 20, 30, 40, 50] n_clients = [1, 10, 20, 30, 40, 50]
...@@ -37,16 +38,20 @@ for host_type in host_types: ...@@ -37,16 +38,20 @@ for host_type in host_types:
for n in n_nets: for n in n_nets:
for n_client in n_clients: for n_client in n_clients:
nh = n if not separate_net else n + 1 nh = n if not separate_net else n + 1
e = exp.DistributedExperiment(f'dist_multinet-{host_type}-{n}-{n_client}', nh) e = exp.DistributedExperiment(
f'dist_multinet-{host_type}-{n}-{n_client}', nh
)
# host # host
if host_type == 'qemu': if host_type == 'qemu':
host_class = sim.QemuHost host_class = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
elif host_type == 'gem5': elif host_type == 'gem5':
host_class = sim.Gem5Host host_class = sim.Gem5Host
...@@ -75,18 +80,34 @@ for host_type in host_types: ...@@ -75,18 +80,34 @@ for host_type in host_types:
# create servers and clients # create servers and clients
m = n_client m = n_client
if i == 0 or separate_server: if i == 0 or separate_server:
servers = create_basic_hosts(e, 1, 'server_%d' % (i,), servers = create_basic_hosts(
switch, sim.I40eNIC, host_class, node.I40eLinuxNode, e,
node.NetperfServer, ip_start = i * (n_client + 1) + 1) 1,
'server_%d' % (i,),
switch,
sim.I40eNIC,
host_class,
node.I40eLinuxNode,
node.NetperfServer,
ip_start=i * (n_client + 1) + 1
)
if not separate_server: if not separate_server:
m = m - 1 m = m - 1
e.assign_sim_host(servers[0], h_i) e.assign_sim_host(servers[0], h_i)
e.assign_sim_host(servers[0].pcidevs[0], h_i) e.assign_sim_host(servers[0].pcidevs[0], h_i)
clients = create_basic_hosts(e, m, 'client_%d' % (i,), clients = create_basic_hosts(
switch, sim.I40eNIC, host_class, node.I40eLinuxNode, e,
node.NetperfClient, ip_start = i * (n_client + 1) + 2) m,
'client_%d' % (i,),
switch,
sim.I40eNIC,
host_class,
node.I40eLinuxNode,
node.NetperfClient,
ip_start=i * (n_client + 1) + 2
)
for c in clients: for c in clients:
c.wait = True c.wait = True
......
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.proxy as proxy
import simbricks.nodeconfig as node import simbricks.nodeconfig as node
import simbricks.proxy as proxy
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
host_types = ['qemu', 'gem5', 'qt'] host_types = ['qemu', 'gem5', 'qt']
nic_types = ['i40e', 'cd_bm', 'cd_verilator'] nic_types = ['i40e', 'cd_bm', 'cd_verilator']
n_clients = [1, 4, 8, 16, 32] n_clients = [1, 4, 8, 16, 32]
...@@ -34,7 +35,9 @@ experiments = [] ...@@ -34,7 +35,9 @@ experiments = []
for host_type in host_types: for host_type in host_types:
for nic_type in nic_types: for nic_type in nic_types:
for n in n_clients: for n in n_clients:
e = exp.DistributedExperiment(f'dist_netperf-{host_type}-{nic_type}-{n}', 2) e = exp.DistributedExperiment(
f'dist_netperf-{host_type}-{nic_type}-{n}', 2
)
net = sim.SwitchNet() net = sim.SwitchNet()
e.add_network(net) e.add_network(net)
...@@ -44,10 +47,12 @@ for host_type in host_types: ...@@ -44,10 +47,12 @@ for host_type in host_types:
host_class = sim.QemuHost host_class = sim.QemuHost
net.sync = False net.sync = False
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
elif host_type == 'gem5': elif host_type == 'gem5':
host_class = sim.Gem5Host host_class = sim.Gem5Host
...@@ -69,11 +74,28 @@ for host_type in host_types: ...@@ -69,11 +74,28 @@ for host_type in host_types:
raise NameError(nic_type) raise NameError(nic_type)
# create servers and clients # create servers and clients
servers = create_basic_hosts(e, 1, 'server', net, nic_class, host_class, servers = create_basic_hosts(
nc_class, node.NetperfServer) e,
1,
'server',
net,
nic_class,
host_class,
nc_class,
node.NetperfServer
)
clients = create_basic_hosts(e, n, 'client', net, nic_class, host_class, clients = create_basic_hosts(
nc_class, node.NetperfClient, ip_start = 2) e,
n,
'client',
net,
nic_class,
host_class,
nc_class,
node.NetperfClient,
ip_start=2
)
for c in clients: for c in clients:
c.wait = True c.wait = True
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
import simbricks.experiments as exp
experiments = [] experiments = []
...@@ -45,7 +46,6 @@ for h in ['qk', 'gk']: ...@@ -45,7 +46,6 @@ for h in ['qk', 'gk']:
e.add_host(host) e.add_host(host)
host.wait = True host.wait = True
femu = sim.FEMUDev() femu = sim.FEMUDev()
femu.name = 'femu0' femu.name = 'femu0'
e.add_pcidev(femu) e.add_pcidev(femu)
......
...@@ -20,22 +20,40 @@ ...@@ -20,22 +20,40 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
e = exp.Experiment('gem5-i40e-pair') e = exp.Experiment('gem5-i40e-pair')
#e.timeout = 5 * 60 #e.timeout = 5 * 60
e.checkpoint = True e.checkpoint = True
net = sim.SwitchNet() net = sim.SwitchNet()
e.add_network(net) e.add_network(net)
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.Gem5Host, servers = create_basic_hosts(
node.I40eLinuxNode, node.IperfTCPServer) e,
1,
'server',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfTCPServer
)
clients = create_basic_hosts(e, 2, 'client', net, sim.I40eNIC, sim.Gem5Host, clients = create_basic_hosts(
node.I40eLinuxNode, node.IperfTCPClient, ip_start = 2) e,
2,
'client',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfTCPClient,
ip_start=2
)
for h in servers + clients: for h in servers + clients:
h.cpu_type = 'TimingSimpleCPU' h.cpu_type = 'TimingSimpleCPU'
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
# iperf TCP_multi_client test # iperf TCP_multi_client test
# naming convention following host-nic-net-app # naming convention following host-nic-net-app
...@@ -34,7 +34,7 @@ from simbricks.simulator_utils import create_basic_hosts ...@@ -34,7 +34,7 @@ from simbricks.simulator_utils import create_basic_hosts
# app: TCPm # app: TCPm
kinds_of_host = ['gem5-timing'] kinds_of_host = ['gem5-timing']
kinds_of_nic = ['cv','cb','ib'] kinds_of_nic = ['cv', 'cb', 'ib']
kinds_of_net = ['switch', 'dumbbell', 'bridge'] kinds_of_net = ['switch', 'dumbbell', 'bridge']
kinds_of_app = ['TCPm'] kinds_of_app = ['TCPm']
...@@ -52,7 +52,6 @@ for n in kinds_of_net: ...@@ -52,7 +52,6 @@ for n in kinds_of_net:
if n == 'bridge': if n == 'bridge':
net_class = sim.NS3BridgeNet net_class = sim.NS3BridgeNet
# set nic sim # set nic sim
for c in kinds_of_nic: for c in kinds_of_nic:
net = net_class() net = net_class()
...@@ -61,26 +60,73 @@ for n in kinds_of_net: ...@@ -61,26 +60,73 @@ for n in kinds_of_net:
e.checkpoint = True e.checkpoint = True
if c == 'cv': if c == 'cv':
servers = create_basic_hosts(e, 1, 'server', net, sim.CorundumVerilatorNIC, sim.Gem5Host, servers = create_basic_hosts(
node.CorundumLinuxNode, node.IperfTCPServer) e,
clients = create_basic_hosts(e, num_client, 'client', net, sim.CorundumVerilatorNIC, sim.Gem5Host, 1,
node.CorundumLinuxNode, node.IperfTCPClient, ip_start = 2) 'server',
net,
sim.CorundumVerilatorNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPServer
)
clients = create_basic_hosts(
e,
num_client,
'client',
net,
sim.CorundumVerilatorNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPClient,
ip_start=2
)
if c == 'cb': if c == 'cb':
servers = create_basic_hosts(e, 1, 'server', net, sim.CorundumBMNIC, sim.Gem5Host, servers = create_basic_hosts(
node.CorundumLinuxNode, node.IperfTCPServer) e,
clients = create_basic_hosts(e, num_client, 'client', net, sim.CorundumBMNIC, sim.Gem5Host, 1,
node.CorundumLinuxNode, node.IperfTCPClient, ip_start = 2) 'server',
net,
sim.CorundumBMNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPServer
)
clients = create_basic_hosts(
e,
num_client,
'client',
net,
sim.CorundumBMNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPClient,
ip_start=2
)
if c == 'ib': if c == 'ib':
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.Gem5Host, servers = create_basic_hosts(
node.I40eLinuxNode, node.IperfTCPServer) e,
clients = create_basic_hosts(e, num_client, 'client', net, sim.I40eNIC, sim.Gem5Host, 1,
node.I40eLinuxNode, node.IperfTCPClient, ip_start = 2) 'server',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfTCPServer
)
clients = create_basic_hosts(
e,
num_client,
'client',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfTCPClient,
ip_start=2
)
for cl in clients: for cl in clients:
cl.wait = True cl.wait = True
...@@ -88,4 +134,3 @@ for n in kinds_of_net: ...@@ -88,4 +134,3 @@ for n in kinds_of_net:
print(e.name) print(e.name)
experiments.append(e) experiments.append(e)
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
# iperf TCP_single test # iperf TCP_single test
# naming convention following host-nic-net-app # naming convention following host-nic-net-app
...@@ -34,7 +34,7 @@ from simbricks.simulator_utils import create_basic_hosts ...@@ -34,7 +34,7 @@ from simbricks.simulator_utils import create_basic_hosts
# app: TCPs # app: TCPs
kinds_of_host = ['gem5-timing'] kinds_of_host = ['gem5-timing']
kinds_of_nic = ['cv','cb','ib'] kinds_of_nic = ['cv', 'cb', 'ib']
kinds_of_net = ['wire', 'switch', 'dumbbell', 'bridge'] kinds_of_net = ['wire', 'switch', 'dumbbell', 'bridge']
kinds_of_app = ['TCPs'] kinds_of_app = ['TCPs']
...@@ -51,7 +51,6 @@ for n in kinds_of_net: ...@@ -51,7 +51,6 @@ for n in kinds_of_net:
if n == 'bridge': if n == 'bridge':
net_class = sim.NS3BridgeNet net_class = sim.NS3BridgeNet
# set nic sim # set nic sim
for c in kinds_of_nic: for c in kinds_of_nic:
net = net_class() net = net_class()
...@@ -60,29 +59,76 @@ for n in kinds_of_net: ...@@ -60,29 +59,76 @@ for n in kinds_of_net:
e.add_network(net) e.add_network(net)
if c == 'cv': if c == 'cv':
servers = create_basic_hosts(e, 1, 'server', net, sim.CorundumVerilatorNIC, sim.Gem5Host, servers = create_basic_hosts(
node.CorundumLinuxNode, node.IperfTCPServer) e,
clients = create_basic_hosts(e, 1, 'client', net, sim.CorundumVerilatorNIC, sim.Gem5Host, 1,
node.CorundumLinuxNode, node.IperfTCPClient, ip_start = 2) 'server',
net,
sim.CorundumVerilatorNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPServer
)
clients = create_basic_hosts(
e,
1,
'client',
net,
sim.CorundumVerilatorNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPClient,
ip_start=2
)
if c == 'cb': if c == 'cb':
servers = create_basic_hosts(e, 1, 'server', net, sim.CorundumBMNIC, sim.Gem5Host, servers = create_basic_hosts(
node.CorundumLinuxNode, node.IperfTCPServer) e,
clients = create_basic_hosts(e, 1, 'client', net, sim.CorundumBMNIC, sim.Gem5Host, 1,
node.CorundumLinuxNode, node.IperfTCPClient, ip_start = 2) 'server',
net,
sim.CorundumBMNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPServer
)
clients = create_basic_hosts(
e,
1,
'client',
net,
sim.CorundumBMNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfTCPClient,
ip_start=2
)
if c == 'ib': if c == 'ib':
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.Gem5Host, servers = create_basic_hosts(
node.I40eLinuxNode, node.IperfTCPServer) e,
clients = create_basic_hosts(e, 1, 'client', net, sim.I40eNIC, sim.Gem5Host, 1,
node.I40eLinuxNode, node.IperfTCPClient, ip_start = 2) 'server',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfTCPServer
)
clients = create_basic_hosts(
e,
1,
'client',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfTCPClient,
ip_start=2
)
clients[0].wait = True clients[0].wait = True
clients[0].node_config.app.server_ip = servers[0].node_config.ip clients[0].node_config.app.server_ip = servers[0].node_config.ip
print(e.name) print(e.name)
experiments.append(e) experiments.append(e)
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
# iperf TCP_multi_client test # iperf TCP_multi_client test
# naming convention following host-nic-net-app # naming convention following host-nic-net-app
...@@ -34,7 +34,7 @@ from simbricks.simulator_utils import create_basic_hosts ...@@ -34,7 +34,7 @@ from simbricks.simulator_utils import create_basic_hosts
# app: UDPm # app: UDPm
kinds_of_host = ['gem5-timing'] kinds_of_host = ['gem5-timing']
kinds_of_nic = ['cv','cb','ib'] kinds_of_nic = ['cv', 'cb', 'ib']
kinds_of_net = ['switch', 'dumbbell', 'bridge'] kinds_of_net = ['switch', 'dumbbell', 'bridge']
kinds_of_app = ['UDPm'] kinds_of_app = ['UDPm']
...@@ -53,7 +53,6 @@ for n in kinds_of_net: ...@@ -53,7 +53,6 @@ for n in kinds_of_net:
if n == 'bridge': if n == 'bridge':
net_class = sim.NS3BridgeNet net_class = sim.NS3BridgeNet
# set nic sim # set nic sim
for c in kinds_of_nic: for c in kinds_of_nic:
net = net_class() net = net_class()
...@@ -62,26 +61,73 @@ for n in kinds_of_net: ...@@ -62,26 +61,73 @@ for n in kinds_of_net:
e.add_network(net) e.add_network(net)
if c == 'cv': if c == 'cv':
servers = create_basic_hosts(e, 1, 'server', net, sim.CorundumVerilatorNIC, sim.Gem5Host, servers = create_basic_hosts(
node.CorundumLinuxNode, node.IperfUDPServer) e,
clients = create_basic_hosts(e, num_client, 'client', net, sim.CorundumVerilatorNIC, sim.Gem5Host, 1,
node.CorundumLinuxNode, node.IperfUDPClient, ip_start = 2) 'server',
net,
sim.CorundumVerilatorNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfUDPServer
)
clients = create_basic_hosts(
e,
num_client,
'client',
net,
sim.CorundumVerilatorNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfUDPClient,
ip_start=2
)
if c == 'cb': if c == 'cb':
servers = create_basic_hosts(e, 1, 'server', net, sim.CorundumBMNIC, sim.Gem5Host, servers = create_basic_hosts(
node.CorundumLinuxNode, node.IperfUDPServer) e,
clients = create_basic_hosts(e, num_client, 'client', net, sim.CorundumBMNIC, sim.Gem5Host, 1,
node.CorundumLinuxNode, node.IperfUDPClient, ip_start = 2) 'server',
net,
sim.CorundumBMNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfUDPServer
)
clients = create_basic_hosts(
e,
num_client,
'client',
net,
sim.CorundumBMNIC,
sim.Gem5Host,
node.CorundumLinuxNode,
node.IperfUDPClient,
ip_start=2
)
if c == 'ib': if c == 'ib':
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.Gem5Host, servers = create_basic_hosts(
node.I40eLinuxNode, node.IperfUDPServer) e,
clients = create_basic_hosts(e, num_client, 'client', net, sim.I40eNIC, sim.Gem5Host, 1,
node.I40eLinuxNode, node.IperfUDPClient, ip_start = 2) 'server',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfUDPServer
)
clients = create_basic_hosts(
e,
num_client,
'client',
net,
sim.I40eNIC,
sim.Gem5Host,
node.I40eLinuxNode,
node.IperfUDPClient,
ip_start=2
)
for cl in clients: for cl in clients:
cl.wait = True cl.wait = True
...@@ -90,4 +136,3 @@ for n in kinds_of_net: ...@@ -90,4 +136,3 @@ for n in kinds_of_net:
print(e.name) print(e.name)
experiments.append(e) experiments.append(e)
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import sys import json
import os import os
import pathlib import pathlib
import shutil
import json
import re import re
import shutil
import sys
# How to use # How to use
# $ python3 pyexps/parser.py out/qemu-wire-ib-TCPs-1.json # $ python3 pyexps/parser.py out/qemu-wire-ib-TCPs-1.json
...@@ -44,30 +44,30 @@ tooutdir = f'/{exp_name}/{run_num}' ...@@ -44,30 +44,30 @@ tooutdir = f'/{exp_name}/{run_num}'
outdir = '/'.join(list(p.parts)[0:-1]) + tooutdir outdir = '/'.join(list(p.parts)[0:-1]) + tooutdir
if not os.path.exists(outdir): if not os.path.exists(outdir):
raise Exception("no such directory") raise Exception('no such directory')
start_end_path = os.path.join(outdir, 'start_end.txt') start_end_path = os.path.join(outdir, 'start_end.txt')
start_end_file = open(start_end_path, 'w') start_end_file = open(start_end_path, 'w')
start_end_file.write('start time: ' + str(exp_log["start_time"]) + '\n') start_end_file.write('start time: ' + str(exp_log['start_time']) + '\n')
start_end_file.write('end time: ' + str(exp_log["end_time"]) + '\n') start_end_file.write('end time: ' + str(exp_log['end_time']) + '\n')
start_end_file.write('success: ' + str(exp_log["success"])) start_end_file.write('success: ' + str(exp_log['success']))
start_end_file.close() start_end_file.close()
for i in exp_log["sims"]: for i in exp_log['sims']:
#print(i) #print(i)
simdir = os.path.join(outdir, i) simdir = os.path.join(outdir, i)
sim_out_file = open(simdir, 'w') sim_out_file = open(simdir, 'w')
for j in exp_log["sims"][i]: for j in exp_log['sims'][i]:
#print(j) #print(j)
sim_out_file.write( j + '\n') sim_out_file.write(j + '\n')
if (j == 'class' ): if (j == 'class'):
sim_out_file.write(exp_log["sims"][i][j] + '\n') sim_out_file.write(exp_log['sims'][i][j] + '\n')
else: else:
for k in exp_log["sims"][i][j]: for k in exp_log['sims'][i][j]:
sim_out_file.write(k + '\n') sim_out_file.write(k + '\n')
sim_out_file.close() sim_out_file.close()
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
# iperf TCP_multi_client test # iperf TCP_multi_client test
# naming convention following host-nic-net-app # naming convention following host-nic-net-app
...@@ -33,16 +33,14 @@ from simbricks.simulator_utils import create_basic_hosts ...@@ -33,16 +33,14 @@ from simbricks.simulator_utils import create_basic_hosts
# net: switch/dumbbell/bridge # net: switch/dumbbell/bridge
# app: DCTCPm # app: DCTCPm
types_of_host = ['qemu', 'qt','gt'] types_of_host = ['qemu', 'qt', 'gt']
types_of_nic = ['ib', 'cv','cb'] types_of_nic = ['ib', 'cv', 'cb']
types_of_net = ['switch'] types_of_net = ['switch']
types_of_app = ['TCPm'] types_of_app = ['TCPm']
types_of_num_pairs = [1, 4] types_of_num_pairs = [1, 4]
types_of_mode = [0, 1] types_of_mode = [0, 1]
experiments = [] experiments = []
for mode in types_of_mode: for mode in types_of_mode:
for num_pairs in types_of_num_pairs: for num_pairs in types_of_num_pairs:
...@@ -54,22 +52,29 @@ for mode in types_of_mode: ...@@ -54,22 +52,29 @@ for mode in types_of_mode:
net.sync_mode = mode net.sync_mode = mode
#net.opt = link_rate_opt + link_latency_opt #net.opt = link_rate_opt + link_latency_opt
e = exp.Experiment( f'mode-{mode}-' + h + '-' + c + '-' + 'switch' + f'-{num_pairs}') e = exp.Experiment(
f'mode-{mode}-' + h + '-' + c + '-' + 'switch' +
f'-{num_pairs}'
)
e.add_network(net) e.add_network(net)
# host # host
if h == 'qemu': if h == 'qemu':
host_class = sim.QemuHost host_class = sim.QemuHost
elif h == 'qt': elif h == 'qt':
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
elif h == 'gt': elif h == 'gt':
def gem5_timing(): def gem5_timing():
h = sim.Gem5Host() h = sim.Gem5Host()
return h return h
host_class = gem5_timing host_class = gem5_timing
e.checkpoint = True e.checkpoint = True
else: else:
...@@ -89,19 +94,32 @@ for mode in types_of_mode: ...@@ -89,19 +94,32 @@ for mode in types_of_mode:
else: else:
raise NameError(c) raise NameError(c)
servers = create_basic_hosts(
servers = create_basic_hosts(e, num_pairs, 'server', net, nic_class, host_class, e,
nc_class, node.IperfTCPServer) num_pairs,
clients = create_basic_hosts(e, num_pairs, 'client', net, nic_class, host_class, 'server',
nc_class, node.IperfTCPClient, ip_start=num_pairs+1) net,
nic_class,
host_class,
nc_class,
node.IperfTCPServer
)
clients = create_basic_hosts(
e,
num_pairs,
'client',
net,
nic_class,
host_class,
nc_class,
node.IperfTCPClient,
ip_start=num_pairs + 1
)
for se in servers: for se in servers:
se.sync_mode = mode se.sync_mode = mode
se.pcidevs[0].sync_mode = mode se.pcidevs[0].sync_mode = mode
i = 0 i = 0
for cl in clients: for cl in clients:
cl.sync_mode = mode cl.sync_mode = mode
...@@ -115,9 +133,8 @@ for mode in types_of_mode: ...@@ -115,9 +133,8 @@ for mode in types_of_mode:
# This is to prevent the simulation gets stuck when one of host exits. # This is to prevent the simulation gets stuck when one of host exits.
# The last client waits for the output printed in other hosts, then cleanup # The last client waits for the output printed in other hosts, then cleanup
clients[num_pairs-1].node_config.app.is_last = True clients[num_pairs - 1].node_config.app.is_last = True
clients[num_pairs-1].wait = True clients[num_pairs - 1].wait = True
print(e.name) print(e.name)
experiments.append(e) experiments.append(e)
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
server_cores_configs = [1, 2, 4, 8] server_cores_configs = [1, 2, 4, 8]
stacks = ['linux', 'mtcp'] stacks = ['linux', 'mtcp']
...@@ -36,8 +36,10 @@ msg_size = 64 ...@@ -36,8 +36,10 @@ msg_size = 64
experiments = [] experiments = []
for server_cores in server_cores_configs: for server_cores in server_cores_configs:
for stack in stacks: for stack in stacks:
e = exp.Experiment('qemu-ib-switch-mtcp_cores-%s-%d' % (stack,server_cores)) e = exp.Experiment(
e.timeout = 5* 60 'qemu-ib-switch-mtcp_cores-%s-%d' % (stack, server_cores)
)
e.timeout = 5 * 60
# add meta data for output file # add meta data for output file
e.metadata['msg_size'] = msg_size e.metadata['msg_size'] = msg_size
e.metadata['stack'] = stack e.metadata['stack'] = stack
...@@ -52,11 +54,21 @@ for server_cores in server_cores_configs: ...@@ -52,11 +54,21 @@ for server_cores in server_cores_configs:
else: else:
n = node.I40eLinuxNode n = node.I40eLinuxNode
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, servers = create_basic_hosts(
n, node.RPCServer) e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, n, node.RPCServer
)
clients = create_basic_hosts(e, num_clients, 'client', net, sim.I40eNIC,
sim.QemuHost, n, node.RPCClient, ip_start = 2) clients = create_basic_hosts(
e,
num_clients,
'client',
net,
sim.I40eNIC,
sim.QemuHost,
n,
node.RPCClient,
ip_start=2
)
for h in servers: for h in servers:
h.node_config.cores = server_cores h.node_config.cores = server_cores
...@@ -64,8 +76,6 @@ for server_cores in server_cores_configs: ...@@ -64,8 +76,6 @@ for server_cores in server_cores_configs:
h.node_config.app.max_flows = connections * 4 h.node_config.app.max_flows = connections * 4
h.sleep = 5 h.sleep = 5
for c in clients: for c in clients:
c.wait = True c.wait = True
c.node_config.cores = client_cores c.node_config.cores = client_cores
...@@ -85,4 +95,3 @@ for server_cores in server_cores_configs: ...@@ -85,4 +95,3 @@ for server_cores in server_cores_configs:
c.node_config.cores += 2 c.node_config.cores += 2
c.node_config.fp_cores = 1 c.node_config.fp_cores = 1
experiments.append(e) experiments.append(e)
...@@ -20,16 +20,17 @@ ...@@ -20,16 +20,17 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
configs = [ configs = [
(node.I40eLinuxNode, node.HTTPDLinux, node.HTTPCLinux, 'linux'), (node.I40eLinuxNode, node.HTTPDLinux, node.HTTPCLinux, 'linux'),
(node.I40eLinuxNode, node.HTTPDLinuxRPO, node.HTTPCLinux, 'linuxrpo'), (node.I40eLinuxNode, node.HTTPDLinuxRPO, node.HTTPCLinux, 'linuxrpo'),
(node.MtcpNode, node.HTTPDMtcp, node.HTTPCMtcp, 'mtcp') (node.MtcpNode, node.HTTPDMtcp, node.HTTPCMtcp, 'mtcp')
] ]
server_cores = 1 server_cores = 1
client_cores = 1 client_cores = 1
...@@ -41,16 +42,26 @@ experiments = [] ...@@ -41,16 +42,26 @@ experiments = []
for (nodec, appc, clientc, label) in configs: for (nodec, appc, clientc, label) in configs:
e = exp.Experiment('qemu-ib-switch-mtcp_httpd-%s' % (label)) e = exp.Experiment('qemu-ib-switch-mtcp_httpd-%s' % (label))
e.timeout = 5* 60 e.timeout = 5 * 60
net = sim.SwitchNet() net = sim.SwitchNet()
e.add_network(net) e.add_network(net)
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, servers = create_basic_hosts(
sim.QemuHost, nodec, appc) e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, nodec, appc
)
clients = create_basic_hosts(e, num_clients, 'client', net, sim.I40eNIC, clients = create_basic_hosts(
sim.QemuHost, nodec, clientc, ip_start = 2) e,
num_clients,
'client',
net,
sim.I40eNIC,
sim.QemuHost,
nodec,
clientc,
ip_start=2
)
for h in servers: for h in servers:
h.node_config.cores = server_cores h.node_config.cores = server_cores
...@@ -70,4 +81,3 @@ for (nodec, appc, clientc, label) in configs: ...@@ -70,4 +81,3 @@ for (nodec, appc, clientc, label) in configs:
for h in servers + clients: for h in servers + clients:
h.node_config.disk_image = 'mtcp' h.node_config.disk_image = 'mtcp'
experiments.append(e) experiments.append(e)
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
mpcs = [1, 8, 128] mpcs = [1, 8, 128]
stacks = ['linux', 'mtcp'] stacks = ['linux', 'mtcp']
...@@ -37,8 +37,8 @@ msg_size = 64 ...@@ -37,8 +37,8 @@ msg_size = 64
experiments = [] experiments = []
for mpc in mpcs: for mpc in mpcs:
for stack in stacks: for stack in stacks:
e = exp.Experiment('qemu-ib-switch-mtcp_mpc-%s-%d' % (stack,mpc)) e = exp.Experiment('qemu-ib-switch-mtcp_mpc-%s-%d' % (stack, mpc))
e.timeout = 5* 60 e.timeout = 5 * 60
# add meta data for output file # add meta data for output file
e.metadata['mpc'] = mpc e.metadata['mpc'] = mpc
e.metadata['stack'] = stack e.metadata['stack'] = stack
...@@ -53,11 +53,21 @@ for mpc in mpcs: ...@@ -53,11 +53,21 @@ for mpc in mpcs:
else: else:
n = node.I40eLinuxNode n = node.I40eLinuxNode
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, servers = create_basic_hosts(
n, node.RPCServer) e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, n, node.RPCServer
)
clients = create_basic_hosts(e, num_clients, 'client', net, sim.I40eNIC,
sim.QemuHost, n, node.RPCClient, ip_start = 2) clients = create_basic_hosts(
e,
num_clients,
'client',
net,
sim.I40eNIC,
sim.QemuHost,
n,
node.RPCClient,
ip_start=2
)
for h in servers: for h in servers:
h.node_config.cores = server_cores h.node_config.cores = server_cores
...@@ -65,8 +75,6 @@ for mpc in mpcs: ...@@ -65,8 +75,6 @@ for mpc in mpcs:
h.node_config.app.max_flows = connections * 4 h.node_config.app.max_flows = connections * 4
h.sleep = 5 h.sleep = 5
for c in clients: for c in clients:
c.wait = True c.wait = True
c.node_config.cores = client_cores c.node_config.cores = client_cores
...@@ -86,4 +94,3 @@ for mpc in mpcs: ...@@ -86,4 +94,3 @@ for mpc in mpcs:
c.node_config.cores += 2 c.node_config.cores += 2
c.node_config.fp_cores = 1 c.node_config.fp_cores = 1
experiments.append(e) experiments.append(e)
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # 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 import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
msg_sizes = [64, 1024, 8092] msg_sizes = [64, 1024, 8092]
stacks = ['linux', 'mtcp'] stacks = ['linux', 'mtcp']
...@@ -36,8 +36,10 @@ connections = 512 ...@@ -36,8 +36,10 @@ connections = 512
experiments = [] experiments = []
for msg_size in msg_sizes: for msg_size in msg_sizes:
for stack in stacks: for stack in stacks:
e = exp.Experiment('qemu-ib-switch-mtcp_msgsz-%s-%d' % (stack,msg_size)) e = exp.Experiment(
e.timeout = 5* 60 'qemu-ib-switch-mtcp_msgsz-%s-%d' % (stack, msg_size)
)
e.timeout = 5 * 60
# add meta data for output file # add meta data for output file
e.metadata['msg_size'] = msg_size e.metadata['msg_size'] = msg_size
e.metadata['stack'] = stack e.metadata['stack'] = stack
...@@ -52,11 +54,21 @@ for msg_size in msg_sizes: ...@@ -52,11 +54,21 @@ for msg_size in msg_sizes:
else: else:
n = node.I40eLinuxNode n = node.I40eLinuxNode
servers = create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, servers = create_basic_hosts(
n, node.RPCServer) e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, n, node.RPCServer
)
clients = create_basic_hosts(e, num_clients, 'client', net, sim.I40eNIC,
sim.QemuHost, n, node.RPCClient, ip_start = 2) clients = create_basic_hosts(
e,
num_clients,
'client',
net,
sim.I40eNIC,
sim.QemuHost,
n,
node.RPCClient,
ip_start=2
)
for h in servers: for h in servers:
h.node_config.cores = server_cores h.node_config.cores = server_cores
...@@ -64,8 +76,6 @@ for msg_size in msg_sizes: ...@@ -64,8 +76,6 @@ for msg_size in msg_sizes:
h.node_config.app.max_flows = connections * 4 h.node_config.app.max_flows = connections * 4
h.sleep = 5 h.sleep = 5
for c in clients: for c in clients:
c.wait = True c.wait = True
c.node_config.cores = client_cores c.node_config.cores = client_cores
...@@ -85,4 +95,3 @@ for msg_size in msg_sizes: ...@@ -85,4 +95,3 @@ for msg_size in msg_sizes:
c.node_config.cores += 2 c.node_config.cores += 2
c.node_config.fp_cores = 1 c.node_config.fp_cores = 1
experiments.append(e) experiments.append(e)
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