Commit 78d4c701 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

fix all pylint issues except missing doc strings in experiments/

parent 7549fa9e
......@@ -22,17 +22,15 @@
import fnmatch
import glob
import itertools
import json
import os
import re
import sys
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\.]*)'
r'- *([0-9\.]*) sec.*Bytes *([0-9\.]*) ([GM])bits.*'
))
tps_time = {}
for hn in fnmatch.filter(data['sims'].keys(), 'host.client.*'):
sim = data['sims'][hn]
......@@ -47,7 +45,7 @@ def parse_iperf_run(data, skip=1, use=8):
if time >= skip + use:
continue
if not time in tps_time:
if time not in tps_time:
tps_time[time] = []
if m.group(4) == 'G':
......@@ -73,7 +71,7 @@ def parse_iperf(basename, skip=1, use=8):
# skip checkpoints
continue
with open(path, 'r') as f:
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
result = parse_iperf_run(data, skip, use)
if result is not None:
......
......@@ -30,7 +30,7 @@ def parse_netperf_run(path):
if not os.path.exists(path):
return ret
with open(path, 'r') as f:
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
ret['simtime'] = data['end_time'] - data['start_time']
......
......@@ -37,25 +37,25 @@ def parse_nopaxos_run(num_c, path):
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_lat = 0
for i in range(num_c):
sim_name = f'host.client.{i}'
# in this host log stdout
for j in log['sims'][sim_name]['stdout']:
m_t = tp_pat.match(j)
m_l = lat_pat.match(j)
if m_l:
total_lat += float(m_l.group(2))
if m_t:
total_tput += int(m_t.group(2))
avg_lat = total_lat / num_c
ret['throughput'] = total_tput
ret['latency'] = int(avg_lat)
with open(path, 'r', encoding='utf-8') as f_log:
log = json.load(f_log)
total_tput = 0
total_lat = 0
for i in range(num_c):
sim_name = f'host.client.{i}'
# in this host log stdout
for j in log['sims'][sim_name]['stdout']:
m_t = tp_pat.match(j)
m_l = lat_pat.match(j)
if m_l:
total_lat += float(m_l.group(2))
if m_t:
total_tput += int(m_t.group(2))
avg_lat = total_lat / num_c
ret['throughput'] = total_tput
ret['latency'] = int(avg_lat)
return ret
......@@ -55,27 +55,27 @@ ip_start = '192.168.64.1'
experiments = []
# set network sim
net_class = sim.NS3DumbbellNet
NetClass = sim.NS3DumbbellNet
for mtu in types_of_mtu:
for h in types_of_host:
for c in types_of_nic:
for host in types_of_host:
for nic in types_of_nic:
for k_val in range(0, max_k + 1, k_step):
net = net_class()
net = NetClass()
net.opt = link_rate_opt + link_latency_opt + f'--EcnTh={k_val}'
e = exp.Experiment(
h + '-' + c + '-' + 'dumbbell' + '-' + 'DCTCPm' +
host + '-' + nic + '-' + 'dumbbell' + '-' + 'DCTCPm' +
f'{k_val}' + f'-{mtu}'
)
e.add_network(net)
freq = cpu_freq
# host
if h == 'qemu':
host_class = sim.QemuHost
elif h == 'qt':
if host == 'qemu':
HostClass = sim.QemuHost
elif host == 'qt':
freq = cpu_freq_qemu
def qemu_timing():
......@@ -83,17 +83,17 @@ for mtu in types_of_mtu:
h.sync = True
return h
host_class = qemu_timing
elif h == 'gt':
HostClass = qemu_timing
elif host == 'gt':
def gem5_timing():
h = sim.Gem5Host()
#h.sys_clock = sys_clock
return h
host_class = gem5_timing
HostClass = gem5_timing
e.checkpoint = True
elif h == 'gO3':
elif host == 'gO3':
def gem5_o3():
h = sim.Gem5Host()
......@@ -101,32 +101,32 @@ for mtu in types_of_mtu:
h.sys_clock = sys_clock
return h
host_class = gem5_o3
HostClass = gem5_o3
e.checkpoint = True
else:
raise NameError(h)
raise NameError(host)
# nic
if c == 'ib':
nic_class = sim.I40eNIC
nc_class = node.I40eDCTCPNode
elif c == 'cb':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumDCTCPNode
elif c == 'cv':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumDCTCPNode
if nic == 'ib':
NicClass = sim.I40eNIC
NcClass = node.I40eDCTCPNode
elif nic == 'cb':
NicClass = sim.CorundumBMNIC
NcClass = node.CorundumDCTCPNode
elif nic == 'cv':
NicClass = sim.CorundumVerilatorNIC
NcClass = node.CorundumDCTCPNode
else:
raise NameError(c)
raise NameError(nic)
servers = create_dctcp_hosts(
e,
num_pairs,
'server',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.DctcpServer,
freq,
mtu
......@@ -136,9 +136,9 @@ for mtu in types_of_mtu:
num_pairs,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.DctcpClient,
freq,
mtu,
......@@ -150,10 +150,12 @@ for mtu in types_of_mtu:
cl.node_config.app.server_ip = servers[i].node_config.ip
i += 1
# All the clients will not poweroff after finishing iperf test except the last one
# This is to prevent the simulation gets stuck when one of host exits.
# All the clients will not poweroff after finishing iperf test
# except the last one 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].wait = True
......
......@@ -24,11 +24,11 @@ import math
import random
import simbricks.nodeconfig as node
import simbricks.proxy as proxy
import simbricks.simulators as sim
from simbricks.simulator_utils import create_multinic_hosts
import simbricks.experiments as exp
from simbricks import proxy
host_types = ['qemu', 'gem5', 'qt']
n_nets = [1, 2, 3, 4, 8, 16, 32]
......@@ -39,7 +39,8 @@ separate_net = True
nets_per_host = 1
def select_servers(i, j, racks, n, n_host):
# pylint: disable=redefined-outer-name
def select_servers(i, racks, n, n_host):
nc = int(n_host / 2)
if n == 1:
......@@ -75,7 +76,7 @@ for host_type in host_types:
# host
if host_type == 'qemu':
host_class = sim.QemuHost
HostClass = sim.QemuHost
elif host_type == 'qt':
def qemu_timing():
......@@ -83,9 +84,9 @@ for host_type in host_types:
h.sync = True
return h
host_class = qemu_timing
HostClass = qemu_timing
elif host_type == 'gem5':
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = False
else:
raise NameError(host_type)
......@@ -104,7 +105,7 @@ for host_type in host_types:
h_i += 1
switch = sim.SwitchNet()
switch.name = 'switch_%d' % (i,)
switch.name = f'switch_{i}'
if host_type == 'qemu':
switch.sync = False
e.add_network(switch)
......@@ -117,9 +118,9 @@ for host_type in host_types:
servers = create_multinic_hosts(
e,
m,
'server_%d' % (i,),
f'server_{i}',
switch,
host_class,
HostClass,
node.I40eLinuxNode,
node.MemcachedServer,
ip_start=i * n_host + 1,
......@@ -136,9 +137,9 @@ for host_type in host_types:
clients = create_multinic_hosts(
e,
m,
'client_%d' % (i,),
f'client_{i}',
switch,
host_class,
HostClass,
node.I40eLinuxNode,
node.MemcachedClient,
ip_start=i * n_host + 1 + m,
......@@ -157,12 +158,12 @@ for host_type in host_types:
if h_i != 0:
lp = proxy.SocketsNetProxyListener()
lp.name = 'listener-%d' % (i,)
lp.name = f'listener-{i}'
e.add_proxy(lp)
e.assign_sim_host(lp, h_i)
cp = proxy.SocketsNetProxyConnecter(lp)
cp.name = 'connecter-%d' % (i,)
cp.name = f'connecter-{i}'
e.add_proxy(cp)
e.assign_sim_host(cp, 0)
......@@ -183,7 +184,7 @@ for host_type in host_types:
for i in range(0, n):
for j in range(0, int(n_host / 2)):
c = racks[i][1][j]
servers = select_servers(i, j, racks, n, n_host)
servers = select_servers(i, racks, n, n_host)
server_ips = [s.node_config.ip for s in servers]
c.node_config.app.server_ips = server_ips
......
......@@ -21,11 +21,11 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import simbricks.nodeconfig as node
import simbricks.proxy as proxy
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
from simbricks import proxy
host_types = ['qemu', 'gem5', 'qt']
n_nets = [1, 2, 3, 4]
......@@ -44,7 +44,7 @@ for host_type in host_types:
# host
if host_type == 'qemu':
host_class = sim.QemuHost
HostClass = sim.QemuHost
elif host_type == 'qt':
def qemu_timing():
......@@ -52,9 +52,9 @@ for host_type in host_types:
h.sync = True
return h
host_class = qemu_timing
HostClass = qemu_timing
elif host_type == 'gem5':
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
else:
raise NameError(host_type)
......@@ -69,7 +69,7 @@ for host_type in host_types:
for i in range(0, n):
h_i = i if not separate_net else i + 1
switch = sim.SwitchNet()
switch.name = 'switch_%d' % (i,)
switch.name = f'switch_{i}'
if host_type == 'qemu':
switch.sync = False
e.add_network(switch)
......@@ -83,10 +83,10 @@ for host_type in host_types:
servers = create_basic_hosts(
e,
1,
'server_%d' % (i,),
f'server_{i}',
switch,
sim.I40eNIC,
host_class,
HostClass,
node.I40eLinuxNode,
node.NetperfServer,
ip_start=i * (n_client + 1) + 1
......@@ -100,10 +100,10 @@ for host_type in host_types:
clients = create_basic_hosts(
e,
m,
'client_%d' % (i,),
f'client_{i}',
switch,
sim.I40eNIC,
host_class,
HostClass,
node.I40eLinuxNode,
node.NetperfClient,
ip_start=i * (n_client + 1) + 2
......@@ -120,12 +120,12 @@ for host_type in host_types:
if h_i != 0:
lp = proxy.SocketsNetProxyListener()
lp.name = 'listener-%d' % (i,)
lp.name = f'listener-{i}'
e.add_proxy(lp)
e.assign_sim_host(lp, h_i)
cp = proxy.SocketsNetProxyConnecter(lp)
cp.name = 'connecter-%d' % (i,)
cp.name = f'connecter-{i}'
e.add_proxy(cp)
e.assign_sim_host(cp, 0)
......
......@@ -21,11 +21,11 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import simbricks.nodeconfig as node
import simbricks.proxy as proxy
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
from simbricks import proxy
host_types = ['qemu', 'gem5', 'qt']
nic_types = ['i40e', 'cd_bm', 'cd_verilator']
......@@ -44,7 +44,7 @@ for host_type in host_types:
# host
if host_type == 'qemu':
host_class = sim.QemuHost
HostClass = sim.QemuHost
net.sync = False
elif host_type == 'qt':
......@@ -53,23 +53,23 @@ for host_type in host_types:
h.sync = True
return h
host_class = qemu_timing
HostClass = qemu_timing
elif host_type == 'gem5':
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
else:
raise NameError(host_type)
# nic
if nic_type == 'i40e':
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
NicClass = sim.I40eNIC
NcClass = node.I40eLinuxNode
elif nic_type == 'cd_bm':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumBMNIC
NcClass = node.CorundumLinuxNode
elif nic_type == 'cd_verilator':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumVerilatorNIC
NcClass = node.CorundumLinuxNode
else:
raise NameError(nic_type)
......@@ -79,9 +79,9 @@ for host_type in host_types:
1,
'server',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfServer
)
......@@ -90,9 +90,9 @@ for host_type in host_types:
n,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfClient,
ip_start=2
)
......
......@@ -46,15 +46,15 @@ experiments = []
for n in kinds_of_net:
if n == 'switch':
net_class = sim.SwitchNet
NetClass = sim.SwitchNet
if n == 'dumbbell':
net_class = sim.NS3DumbbellNet
NetClass = sim.NS3DumbbellNet
if n == 'bridge':
net_class = sim.NS3BridgeNet
NetClass = sim.NS3BridgeNet
# set nic sim
for c in kinds_of_nic:
net = net_class()
net = NetClass()
e = exp.Experiment('gt-' + c + '-' + n + '-' + 'TCPm')
e.add_network(net)
e.checkpoint = True
......
......@@ -43,17 +43,17 @@ experiments = []
# set network sim
for n in kinds_of_net:
if n == 'wire':
net_class = sim.WireNet
NetClass = sim.WireNet
if n == 'switch':
net_class = sim.SwitchNet
NetClass = sim.SwitchNet
if n == 'dumbbell':
net_class = sim.NS3DumbbellNet
NetClass = sim.NS3DumbbellNet
if n == 'bridge':
net_class = sim.NS3BridgeNet
NetClass = sim.NS3BridgeNet
# set nic sim
for c in kinds_of_nic:
net = net_class()
net = NetClass()
e = exp.Experiment('gt-' + c + '-' + n + '-' + 'TCPs')
e.checkpoint = True
e.add_network(net)
......
......@@ -47,15 +47,15 @@ experiments = []
for n in kinds_of_net:
if n == 'switch':
net_class = sim.SwitchNet
NetClass = sim.SwitchNet
if n == 'dumbbell':
net_class = sim.NS3DumbbellNet
NetClass = sim.NS3DumbbellNet
if n == 'bridge':
net_class = sim.NS3BridgeNet
NetClass = sim.NS3BridgeNet
# set nic sim
for c in kinds_of_nic:
net = net_class()
net = NetClass()
e = exp.Experiment('gt-' + c + '-' + n + '-' + 'UDPm')
e.checkpoint = True
e.add_network(net)
......
......@@ -24,7 +24,6 @@ import json
import os
import pathlib
import re
import shutil
import sys
# How to use
......@@ -32,42 +31,41 @@ import sys
#
log_file = sys.argv[1]
log = open(log_file, 'r')
exp_log = json.load(log)
run_num = re.split('-|\.', log_file)[-2]
#Name, starting & ending time
exp_name = exp_log['exp_name']
with open(log_file, 'r', encoding='utf-8') as log:
exp_log = json.load(log)
run_num = re.split(r'-|\.', log_file)[-2]
#Name, starting & ending time
exp_name = exp_log['exp_name']
p = pathlib.Path(log_file)
tooutdir = f'/{exp_name}/{run_num}'
outdir = '/'.join(list(p.parts)[0:-1]) + tooutdir
p = pathlib.Path(log_file)
tooutdir = f'/{exp_name}/{run_num}'
outdir = '/'.join(list(p.parts)[0:-1]) + tooutdir
if not os.path.exists(outdir):
raise Exception('no such directory')
if not os.path.exists(outdir):
raise Exception('no such directory')
start_end_path = os.path.join(outdir, 'start_end.txt')
start_end_file = open(start_end_path, 'w')
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('success: ' + str(exp_log['success']))
start_end_file.close()
start_end_path = os.path.join(outdir, 'start_end.txt')
for i in exp_log['sims']:
#print(i)
simdir = os.path.join(outdir, i)
sim_out_file = open(simdir, 'w')
with open(start_end_path, 'w', encoding='utf-8') as start_end_file:
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('success: ' + str(exp_log['success']))
for j in exp_log['sims'][i]:
#print(j)
sim_out_file.write(j + '\n')
for i in exp_log['sims']:
#print(i)
simdir = os.path.join(outdir, i)
if (j == 'class'):
sim_out_file.write(exp_log['sims'][i][j] + '\n')
with open(simdir, 'w', encoding='utf-8') as sim_out_file:
else:
for j in exp_log['sims'][i]:
#print(j)
sim_out_file.write(j + '\n')
for k in exp_log['sims'][i][j]:
sim_out_file.write(k + '\n')
if j == 'class':
sim_out_file.write(exp_log['sims'][i][j] + '\n')
sim_out_file.close()
else:
for k in exp_log['sims'][i][j]:
sim_out_file.write(k + '\n')
......@@ -45,7 +45,7 @@ experiments = []
for mode in types_of_mode:
for num_pairs in types_of_num_pairs:
for h in types_of_host:
for host in types_of_host:
for c in types_of_nic:
net = sim.SwitchNet()
......@@ -53,44 +53,44 @@ for mode in types_of_mode:
#net.opt = link_rate_opt + link_latency_opt
e = exp.Experiment(
f'mode-{mode}-' + h + '-' + c + '-' + 'switch' +
f'mode-{mode}-' + host + '-' + c + '-' + 'switch' +
f'-{num_pairs}'
)
e.add_network(net)
# host
if h == 'qemu':
host_class = sim.QemuHost
elif h == 'qt':
if host == 'qemu':
HostClass = sim.QemuHost
elif host == 'qt':
def qemu_timing():
h = sim.QemuHost()
h.sync = True
return h
host_class = qemu_timing
elif h == 'gt':
HostClass = qemu_timing
elif host == 'gt':
def gem5_timing():
h = sim.Gem5Host()
return h
host_class = gem5_timing
HostClass = gem5_timing
e.checkpoint = True
else:
raise NameError(h)
raise NameError(host)
# nic
if c == 'cb':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumBMNIC
NcClass = node.CorundumLinuxNode
elif c == 'cv':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumVerilatorNIC
NcClass = node.CorundumLinuxNode
elif c == 'ib':
nic_class = sim.I40eNIC
nc_class = node.I40eDCTCPNode
NicClass = sim.I40eNIC
NcClass = node.I40eDCTCPNode
else:
raise NameError(c)
......@@ -99,9 +99,9 @@ for mode in types_of_mode:
num_pairs,
'server',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.IperfTCPServer
)
clients = create_basic_hosts(
......@@ -109,9 +109,9 @@ for mode in types_of_mode:
num_pairs,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.IperfTCPClient,
ip_start=num_pairs + 1
)
......@@ -129,10 +129,12 @@ for mode in types_of_mode:
i += 1
#cl.wait = True
# All the clients will not poweroff after finishing iperf test except the last one
# This is to prevent the simulation gets stuck when one of host exits.
# All the clients will not poweroff after finishing iperf test
# except the last one. 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].wait = True
......
......@@ -36,9 +36,7 @@ msg_size = 64
experiments = []
for server_cores in server_cores_configs:
for stack in stacks:
e = exp.Experiment(
'qemu-ib-switch-mtcp_cores-%s-%d' % (stack, server_cores)
)
e = exp.Experiment(f'qemu-ib-switch-mtcp_cores-{stack}-{server_cores}')
e.timeout = 5 * 60
# add meta data for output file
e.metadata['msg_size'] = msg_size
......@@ -48,14 +46,14 @@ for server_cores in server_cores_configs:
e.add_network(net)
if stack == 'tas':
n = node.TASNode
N = node.TASNode
elif stack == 'mtcp':
n = node.MtcpNode
N = node.MtcpNode
else:
n = node.I40eLinuxNode
N = node.I40eLinuxNode
servers = create_basic_hosts(
e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, n, node.RPCServer
e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, N, node.RPCServer
)
clients = create_basic_hosts(
......@@ -65,7 +63,7 @@ for server_cores in server_cores_configs:
net,
sim.I40eNIC,
sim.QemuHost,
n,
N,
node.RPCClient,
ip_start=2
)
......@@ -92,6 +90,6 @@ for server_cores in server_cores_configs:
if stack == 'linux':
h.node_config.disk_image = 'tas'
elif stack == 'tas':
c.node_config.cores += 2
c.node_config.fp_cores = 1
h.node_config.cores += 2
h.node_config.fp_cores = 1
experiments.append(e)
......@@ -41,7 +41,7 @@ file_size = 64
experiments = []
for (nodec, appc, clientc, label) in configs:
e = exp.Experiment('qemu-ib-switch-mtcp_httpd-%s' % (label))
e = exp.Experiment(f'qemu-ib-switch-mtcp_httpd-{label}')
e.timeout = 5 * 60
net = sim.SwitchNet()
......
......@@ -37,7 +37,7 @@ msg_size = 64
experiments = []
for mpc in mpcs:
for stack in stacks:
e = exp.Experiment('qemu-ib-switch-mtcp_mpc-%s-%d' % (stack, mpc))
e = exp.Experiment(f'qemu-ib-switch-mtcp_mpc-P{stack}-{mpc}')
e.timeout = 5 * 60
# add meta data for output file
e.metadata['mpc'] = mpc
......@@ -47,14 +47,14 @@ for mpc in mpcs:
e.add_network(net)
if stack == 'tas':
n = node.TASNode
N = node.TASNode
elif stack == 'mtcp':
n = node.MtcpNode
N = node.MtcpNode
else:
n = node.I40eLinuxNode
N = node.I40eLinuxNode
servers = create_basic_hosts(
e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, n, node.RPCServer
e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, N, node.RPCServer
)
clients = create_basic_hosts(
......@@ -64,7 +64,7 @@ for mpc in mpcs:
net,
sim.I40eNIC,
sim.QemuHost,
n,
N,
node.RPCClient,
ip_start=2
)
......@@ -91,6 +91,6 @@ for mpc in mpcs:
if stack == 'linux':
h.node_config.disk_image = 'tas'
elif stack == 'tas':
c.node_config.cores += 2
c.node_config.fp_cores = 1
h.node_config.cores += 2
h.node_config.fp_cores = 1
experiments.append(e)
......@@ -36,9 +36,7 @@ connections = 512
experiments = []
for msg_size in msg_sizes:
for stack in stacks:
e = exp.Experiment(
'qemu-ib-switch-mtcp_msgsz-%s-%d' % (stack, msg_size)
)
e = exp.Experiment(f'qemu-ib-switch-mtcp_msgsz-{stack}-{msg_size}')
e.timeout = 5 * 60
# add meta data for output file
e.metadata['msg_size'] = msg_size
......@@ -48,14 +46,14 @@ for msg_size in msg_sizes:
e.add_network(net)
if stack == 'tas':
n = node.TASNode
N = node.TASNode
elif stack == 'mtcp':
n = node.MtcpNode
N = node.MtcpNode
else:
n = node.I40eLinuxNode
N = node.I40eLinuxNode
servers = create_basic_hosts(
e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, n, node.RPCServer
e, 1, 'server', net, sim.I40eNIC, sim.QemuHost, N, node.RPCServer
)
clients = create_basic_hosts(
......@@ -65,7 +63,7 @@ for msg_size in msg_sizes:
net,
sim.I40eNIC,
sim.QemuHost,
n,
N,
node.RPCClient,
ip_start=2
)
......@@ -92,6 +90,6 @@ for msg_size in msg_sizes:
if stack == 'linux':
h.node_config.disk_image = 'tas'
elif stack == 'tas':
c.node_config.cores += 2
c.node_config.fp_cores = 1
h.node_config.cores += 2
h.node_config.fp_cores = 1
experiments.append(e)
......@@ -58,7 +58,7 @@ for host_type in host_types:
# host
if host_type == 'qemu':
host_class = sim.QemuHost
HostClass = sim.QemuHost
elif host_type == 'qt':
def qemu_timing():
......@@ -66,23 +66,23 @@ for host_type in host_types:
h.sync = True
return h
host_class = qemu_timing
HostClass = qemu_timing
elif host_type == 'gem5':
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
else:
raise NameError(host_type)
# nic
if nic_type == 'i40e':
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
NicClass = sim.I40eNIC
NcClass = node.I40eLinuxNode
elif nic_type == 'cd_bm':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumBMNIC
NcClass = node.CorundumLinuxNode
elif nic_type == 'cd_verilator':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumVerilatorNIC
NcClass = node.CorundumLinuxNode
else:
raise NameError(nic_type)
......@@ -92,9 +92,9 @@ for host_type in host_types:
1,
'server',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfServer
)
......@@ -103,9 +103,9 @@ for host_type in host_types:
1,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfClient,
ip_start=2
)
......
......@@ -33,16 +33,16 @@ for app_type in app_types:
e = exp.Experiment('no_simb-gt-' + app_type)
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
e.no_simbricks = True
nc_class = node.I40eLinuxNode
NcClass = node.I40eLinuxNode
# create servers and clients
host = host_class()
host = HostClass()
host.name = 'host.0'
node_config = nc_class()
node_config = NcClass()
node_config.ip = '10.0.0.1'
node_config.app = node.NoTraffic()
node_config.cores = 1
......
......@@ -64,7 +64,7 @@ for host_type in host_types:
# host
if host_type == 'qemu':
host_class = sim.QemuHost
HostClass = sim.QemuHost
elif host_type == 'qt':
def qemu_timing():
......@@ -72,45 +72,51 @@ for host_type in host_types:
h.sync = True
return h
host_class = qemu_timing
HostClass = qemu_timing
elif host_type == 'gt':
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
else:
raise NameError(host_type)
# nic
if nic_type == 'ib':
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
NicClass = sim.I40eNIC
NcClass = node.I40eLinuxNode
elif nic_type == 'cb':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumBMNIC
NcClass = node.CorundumLinuxNode
elif nic_type == 'cv':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumVerilatorNIC
NcClass = node.CorundumLinuxNode
else:
raise NameError(nic_type)
# create servers and clients
"""
servers = create_basic_hosts(e, 1, 'server', net, nic_class, host_class,
nc_class, node.NoTraffic)
for s in servers:
s.node_config.cores = num_cores
s.node_config.app.is_sleep = 0
s.node_config.app.is_server = 1
"""
# servers = create_basic_hosts(
# e,
# 1,
# 'server',
# net,
# NicClass,
# HostClass,
# NcClass,
# node.NoTraffic
# )
# for s in servers:
# s.node_config.cores = num_cores
# s.node_config.app.is_sleep = 0
# s.node_config.app.is_server = 1
clients = create_basic_hosts(
e,
n_client,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NoTraffic,
ip_start=2
)
......
......@@ -56,10 +56,10 @@ for proto_config in proto_configs:
# host
if host_config == 'qemu':
host_class = sim.QemuHost
HostClass = sim.QemuHost
net.sync = False
elif host_config == 'gt':
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
elif host_config == 'qt':
......@@ -68,30 +68,30 @@ for proto_config in proto_configs:
h.sync = True
return h
host_class = qemu_timing
HostClass = qemu_timing
else:
raise NameError(host_config)
# nic
if nic_config == 'ib':
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
NicClass = sim.I40eNIC
NcClass = node.I40eLinuxNode
elif nic_config == 'cb':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumBMNIC
NcClass = node.CorundumLinuxNode
elif nic_config == 'cv':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumLinuxNode
NicClass = sim.CorundumVerilatorNIC
NcClass = node.CorundumLinuxNode
else:
raise NameError(nic_config)
# app
if proto_config == 'vr':
replica_class = node.VRReplica
client_class = node.VRClient
ReplicaClass = node.VRReplica
ClientClass = node.VRClient
elif proto_config == 'nopaxos':
replica_class = node.NOPaxosReplica
client_class = node.NOPaxosClient
ReplicaClass = node.NOPaxosReplica
ClientClass = node.NOPaxosClient
else:
raise NameError(proto_config)
......@@ -102,9 +102,9 @@ for proto_config in proto_configs:
1,
'sequencer',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NOPaxosSequencer,
ip_start=100
)
......@@ -117,10 +117,10 @@ for proto_config in proto_configs:
3,
'replica',
net,
nic_class,
host_class,
nc_class,
replica_class
NicClass,
HostClass,
NcClass,
ReplicaClass
)
for i in range(len(replicas)):
replicas[i].node_config.app.index = i
......@@ -133,10 +133,10 @@ for proto_config in proto_configs:
num_c,
'client',
net,
nic_class,
host_class,
nc_class,
client_class,
NicClass,
HostClass,
NcClass,
ClientClass,
ip_start=4
)
......
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