"sims/git@developer.sourcefind.cn:cnjsdfcy/simbricks.git" did not exist on "391e5cb8832e1d9d8cf80fe9194f57e060aecd43"
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
......@@ -26,12 +26,12 @@ for f in glob.glob('testbed-results/*_*pktgap/*.txt'):
runk = (mtu, k)
clients = runmap.get(runk, {})
with open(f, 'r') as f:
with open(f, 'r', encoding='utf-8') as f:
clients['host.client.' + m.group(3)] = {'stdout': f.readlines()}
runmap[runk] = clients
for ((mtu, k), clients) in runmap.items():
ofn = '%stb-ib-dumbbell-DCTCPm%d-%d-1.json' % (outdir, k, mtu)
ofn = f'{outdir}tb-ib-dumbbell-DCTCPm{k}-{mtu}-1.json'
data = {'sims': clients}
with open(ofn, 'w') as outfile:
with open(ofn, 'w', encoding='utf-8') as outfile:
json.dump(data, outfile)
......@@ -31,9 +31,12 @@
# TCP_STREAM test
#
# The command to run all the experiments is:
# $: python3 run.py pyexps/ae/corundum_pcilat.py --filter cblat-gt-sw --verbose --force
# $: python3 run.py pyexps/ae/corundum_pcilat.py --filter cblat-gt-sw --verbose
# --force
########################################################################
from functools import partial
import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts
......@@ -52,28 +55,22 @@ for pci_type in pci_latency:
net.eth_latency = pci_type
e.add_network(net)
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
def nic_pci():
# pylint: disable=redefined-outer-name
def nic_pci(pci_type):
n = sim.CorundumBMNIC()
n.sync_period = pci_type
n.pci_latency = pci_type
return n
nic_class = nic_pci
nc_class = node.CorundumLinuxNode
NicClass = partial(nic_pci, pci_type)
NcClass = node.CorundumLinuxNode
# create servers and clients
servers = create_basic_hosts(
e,
1,
'server',
net,
nic_class,
host_class,
nc_class,
node.NetperfServer
e, 1, 'server', net, NicClass, HostClass, NcClass, node.NetperfServer
)
clients = create_basic_hosts(
......@@ -81,9 +78,9 @@ for pci_type in pci_latency:
1,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfClient,
ip_start=2
)
......
......@@ -23,7 +23,7 @@
import sys
from time import gmtime, strftime
from utils.netperf import *
from utils.netperf import parse_netperf_run
def fmt_lat(lat):
......@@ -32,20 +32,21 @@ def fmt_lat(lat):
x = float(lat)
if x >= 1000.:
return '%.1f\\,ms' % (x / 1000)
return f'{x / 1000:.1f}\\,ms'
else:
return '%d\\,$\\mu$s' % (int(x))
return f'{int(x)}\\,$\\mu$s'
# pylint: disable=redefined-outer-name
def fmt_tp(tp):
if not tp:
return ''
x = float(tp)
if x > 1000.:
return '%.2f\\,G' % (x / 1000)
return f'{x / 1000:.2f}\\,G'
else:
return '%d\\,M' % (int(x))
return f'{int(x)}\\,M'
hosts = [('gt', 'G5')]
......@@ -57,7 +58,7 @@ outdir = sys.argv[1]
for (h, h_l) in hosts:
for (nic, nic_l) in nics:
for (net, net_l) in nets:
path = '%s/cblat-%s-%s-1.json' % (outdir, h, net)
path = f'{outdir}/cblat-{h}-{net}-1.json'
data = parse_netperf_run(path)
if 'simtime' in data:
t = strftime('%H:%M:%S', gmtime(data['simtime']))
......@@ -67,7 +68,4 @@ for (h, h_l) in hosts:
tp = fmt_tp(data.get('throughput', ''))
latMean = fmt_lat(data.get('latenyMean', ''))
latTail = fmt_lat(data.get('latenyTail', ''))
print(
' %s & %s & %s & %s & %s & %s \\\\' %
(h_l, nic_l, net_l, tp, latMean, t)
)
print(' {h_l} & {nic_l} & {net_l} & {tp} & {latMean} & {t} \\\\')
......@@ -20,9 +20,6 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import glob
import itertools
import json
import os
import sys
......@@ -34,19 +31,17 @@ out_file = sys.argv[1]
if not os.path.isfile(out_file):
print('no result file at: ' + out_file)
exit(0)
sys.exit()
f = open(out_file, 'r')
lines = f.readlines()
with open(out_file, 'r', encoding='utf-8') as f:
lines = f.readlines()
for line in lines:
if 'start:' in line:
start_time = float(line.split()[1])
for line in lines:
if 'start:' in line:
start_time = float(line.split()[1])
if 'end:' in line:
end_time = float(line.split()[1])
if 'end:' in line:
end_time = float(line.split()[1])
time_diff = end_time - start_time
print('SimTime: %d (s)' % (time_diff))
f.close()
time_diff = end_time - start_time
print(f'SimTime: {time_diff} (s)')
......@@ -20,9 +20,6 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import glob
import itertools
import json
import os
import sys
......@@ -35,6 +32,7 @@ basedir = sys.argv[1]
types_of_host = [2, 8, 16, 32]
# pylint: disable=redefined-outer-name
def time_diff_min(data):
start_time = data['start_time']
end_time = data['end_time']
......@@ -48,13 +46,13 @@ print('# Number of hosts' + '\t' + 'Sim.Time')
for workload in types_of_host:
line = [str(workload)]
path_pat = '%srun-%d.out' % (basedir, workload)
path_pat = f'{basedir}run-{workload}.out'
if not os.path.isfile(path_pat):
#print("no result file at: " + path_pat)
line.append(' ')
else:
with open(path_pat, 'r') as f:
with open(path_pat, 'r', encoding='utf-8') as f:
read_lines = f.readlines()
for l in read_lines:
......@@ -67,6 +65,6 @@ for workload in types_of_host:
#print("end_time: %d" % end_time)
sim_time = (end_time - start_time) / 60
line.append('%d' % sim_time)
line.append(f'{sim_time}')
print('\t'.join(line))
......@@ -21,9 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import glob
import itertools
import json
import os
import sys
if len(sys.argv) != 2:
......@@ -35,6 +33,7 @@ basedir = sys.argv[1]
types_of_client = [1, 4, 9, 14, 20]
# pylint: disable=redefined-outer-name
def time_diff_min(data):
start_time = data['start_time']
end_time = data['end_time']
......@@ -48,7 +47,7 @@ print('# Number of hosts' + '\t' + 'Sim.Time')
for workload in types_of_client:
line = [str(workload)]
path_pat = '%shost-gt-ib-sw-1000m-%s' % (basedir, workload)
path_pat = f'{basedir}host-gt-ib-sw-1000m-{workload}'
runs = []
for path in glob.glob(path_pat + '-*.json'):
......@@ -56,7 +55,7 @@ for workload in types_of_client:
# skip checkpoints
continue
with open(path, 'r') as f:
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
res = time_diff_min(data)
......@@ -66,6 +65,6 @@ for workload in types_of_client:
if not runs:
line.append(' ')
else:
line.append('%d' % (sum(runs) / len(runs)))
line.append(f'{sum(runs) / len(runs)}')
print('\t'.join(line))
......@@ -23,7 +23,7 @@
import sys
from time import gmtime, strftime
from utils.netperf import *
from utils.netperf import parse_netperf_run
def fmt_lat(lat):
......@@ -32,20 +32,21 @@ def fmt_lat(lat):
x = float(lat)
if x >= 1000.:
return '%.1f\\,ms' % (x / 1000)
return f'{x / 1000:.1f}\\,ms'
else:
return '%d\\,$\\mu$s' % (int(x))
return f'{int(x)}\\,$\\mu$s'
# pylint: disable=redefined-outer-name
def fmt_tp(tp):
if not tp:
return ''
x = float(tp)
if x > 1000.:
return '%.2f\\,G' % (x / 1000)
return f'{x / 1000:.2f}\\,G'
else:
return '%d\\,M' % (int(x))
return f'{int(x)}\\,M'
hosts = [('qemu', 'QK'), ('qt', 'QT'), ('gt', 'G5')]
......@@ -57,7 +58,7 @@ outdir = sys.argv[1]
for (h, h_l) in hosts:
for (nic, nic_l) in nics:
for (net, net_l) in nets:
path = '%s/nf-%s-%s-%s-1.json' % (outdir, h, net, nic)
path = f'{outdir}/nf-{h}-{net}-{nic}-1.json'
data = parse_netperf_run(path)
if 'simtime' in data:
t = strftime('%H:%M:%S', gmtime(data['simtime']))
......@@ -67,7 +68,4 @@ for (h, h_l) in hosts:
tp = fmt_tp(data.get('throughput', ''))
latMean = fmt_lat(data.get('latenyMean', ''))
latTail = fmt_lat(data.get('latenyTail', ''))
print(
' %s & %s & %s & %s & %s & %s \\\\' %
(h_l, nic_l, net_l, tp, latMean, t)
)
print(f' {h_l} & {nic_l} & {net_l} & {tp} & {latMean} & {t} \\\\')
......@@ -36,9 +36,9 @@ 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)
path = f'{basedir}/nopaxos-qt-ib-{network}-{c}-1.json'
ret = pn.parse_nopaxos_run(c, path)
if ret is not None:
line.append('%d' % ret['throughput'])
line.append('%d' % ret['latency'])
line.append(f'{ret["throughput"]}')
line.append(f'{ret["latency"]}')
print('\t'.join(line))
......@@ -20,12 +20,9 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import itertools
import os
import sys
import utils.iperf
if len(sys.argv) != 2:
print('Usage: ns3-dctcp.py OUTDIR')
sys.exit(1)
......@@ -41,27 +38,25 @@ print('\t'.join(['threshold'] + confignames))
for k_val in range(0, max_k + 1, k_step):
line = [str(k_val)]
path_pat = '%sdctcp-modes-tput-4000-%d-50us.dat' % (basedir, k_val)
path_pat = f'{basedir}dctcp-modes-tput-4000-{k_val}-50us.dat'
tps = []
if not os.path.isfile(path_pat):
print('no result file at: ' + path_pat)
exit(0)
f = open(path_pat, 'r')
lines = f.readlines()
tp = float(lines[1].split()[2]) / 1000
tps.append(tp)
sys.exit()
with open(path_pat, 'r', encoding='utf-8') as f:
lines = f.readlines()
tp = float(lines[2].split()[2]) / 1000
tps.append(tp)
tp = float(lines[1].split()[2]) / 1000
tps.append(tp)
f.close()
tp = float(lines[2].split()[2]) / 1000
tps.append(tp)
total_tp = sum(tps)
# TP * (MTU + PPP(2)) / (MTU - IP (20) - TCP w/option (24))
tp_calib = total_tp * (mtu + 2) / (mtu - 20 - 24)
line.append('%.2f' % (tp_calib))
line.append(f'{tp_calib:.2f}')
print('\t'.join(line))
......@@ -21,9 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import glob
import itertools
import json
import os
import sys
if len(sys.argv) != 2:
......@@ -35,6 +33,7 @@ basedir = sys.argv[1]
types_of_pci = [10, 50, 100, 500, 1000]
# pylint: disable=redefined-outer-name
def time_diff_min(data):
start_time = data['start_time']
end_time = data['end_time']
......@@ -48,7 +47,7 @@ print('# PCI latency (ns)' + '\t' + 'Sim.Time')
for workload in types_of_pci:
line = [str(workload)]
path_pat = '%spci-gt-ib-sw-%s' % (basedir, workload)
path_pat = f'{basedir}pci-gt-ib-sw-{workload}'
runs = []
for path in glob.glob(path_pat + '-*.json'):
......@@ -56,7 +55,7 @@ for workload in types_of_pci:
# skip checkpoints
continue
with open(path, 'r') as f:
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
res = time_diff_min(data)
......@@ -66,6 +65,6 @@ for workload in types_of_pci:
if not runs:
line.append(' ')
else:
line.append('%d' % (sum(runs) / len(runs)))
line.append(f'{sum(runs) / len(runs)}')
print('\t'.join(line))
......@@ -43,7 +43,7 @@ print('\t'.join(['threshold'] + confignames))
for k_val in range(0, max_k + 1, k_step):
line = [str(k_val)]
for h, mtu in configs:
path_pat = '%s%s-ib-dumbbell-DCTCPm%d-%d' % (basedir, h, k_val, mtu)
path_pat = f'{basedir}{h}-ib-dumbbell-DCTCPm{k_val}-{mtu}'
res = utils.iperf.parse_iperf(path_pat)
if res['avg'] is None:
......@@ -52,11 +52,12 @@ for k_val in range(0, max_k + 1, k_step):
tp = res['avg']
# TP * (MTU ) / (MTU - IP (20) - TCP w/option (24))
if (h == 'gt' or h == 'qt'):
if h in ('gt', 'qt'):
tp_calib = tp * (mtu) / (mtu - 20 - 24)
else:
# TP * (MTU + ETH(14) + PHY(24)) / (MTU - IP (20) - TCP w/option (24))
# TP * (MTU + ETH(14) + PHY(24)) / (MTU - IP (20)
# - TCP w/option (24))
tp_calib = tp * (mtu + 14 + 24) / (mtu - 20 - 24)
line.append('%.2f' % (tp_calib))
line.append(f'{tp_calib:.2f}')
print('\t'.join(line))
......@@ -21,9 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import glob
import itertools
import json
import os
import sys
if len(sys.argv) != 2:
......@@ -36,6 +34,7 @@ types_of_workload = ['sleep', 'busy']
types_of_sync = ['with', 'without'] # with or without simbricks
# pylint: disable=redefined-outer-name
def time_diff_min(data):
start_time = data['start_time']
end_time = data['end_time']
......@@ -50,9 +49,9 @@ for workload in types_of_workload:
line = [workload]
for sync in types_of_sync:
if sync == 'with':
path_pat = '%snoTraf-gt-ib-sw-%s' % (basedir, workload)
path_pat = f'{basedir}noTraf-gt-ib-sw-{workload}'
else:
path_pat = '%sno_simb-gt-%s' % (basedir, workload)
path_pat = f'{basedir}no_simb-gt-{workload}'
runs = []
for path in glob.glob(path_pat + '-*.json'):
......@@ -60,7 +59,7 @@ for workload in types_of_workload:
# skip checkpoints
continue
with open(path, 'r') as f:
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
res = time_diff_min(data)
......@@ -70,6 +69,6 @@ for workload in types_of_workload:
if not runs:
line.append(' ')
else:
line.append('%d' % (sum(runs) / len(runs)))
line.append(f'{sum(runs) / len(runs)}')
print('\t'.join(line))
......@@ -38,11 +38,11 @@ experiments = []
e = exp.Experiment('dt-gt-ib-sw')
net = sim.SwitchNet()
e.add_network(net)
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = False
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
NicClass = sim.I40eNIC
NcClass = node.I40eLinuxNode
# create a host
servers = create_basic_hosts(
......@@ -50,9 +50,9 @@ servers = create_basic_hosts(
1,
'server',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.IperfUDPServer,
ip_start=2
)
......@@ -69,9 +69,9 @@ clients = create_basic_hosts(
1,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.IperfUDPShortClient,
ip_start=2
)
......
......@@ -67,27 +67,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():
......@@ -95,17 +95,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()
......@@ -113,32 +113,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
......@@ -148,9 +148,9 @@ for mtu in types_of_mtu:
num_pairs,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.DctcpClient,
freq,
mtu,
......@@ -162,10 +162,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
......
......@@ -29,7 +29,8 @@
# NIC: Intel i40e behavioral model
# NET: Switch behavioral model
#
# In each simulation, one server host and several clients are connected by a switch
# In each simulation, one server host and several clients are connected by a
# switch
# [HOST_0] - [NIC_0] ---- [SWITCH] ---- [NIC_1] - [HOST_1]
# server | .....| client_0
# Client_1 Clinet_n
......@@ -83,7 +84,7 @@ for n_client in num_client_types:
# host
if host_type == 'qemu':
host_class = sim.QemuHost
HostClass = sim.QemuHost
elif host_type == 'qt':
def qemu_timing():
......@@ -91,23 +92,23 @@ for n_client in num_client_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)
......@@ -117,9 +118,9 @@ for n_client in num_client_types:
1,
'server',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.IperfUDPServer
)
......@@ -128,9 +129,9 @@ for n_client in num_client_types:
n_client,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.IperfUDPClient,
ip_start=2
)
......
......@@ -34,6 +34,8 @@
# $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose
########################################################################
from functools import partial
import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts
......@@ -52,28 +54,22 @@ for pci_type in pci_latency:
net.eth_latency = pci_type
e.add_network(net)
host_class = sim.Gem5Host
HostClass = sim.Gem5Host
e.checkpoint = True
def nic_pci():
# pylint: disable=redefined-outer-name
def nic_pci(pci_type: int):
n = sim.I40eNIC()
n.sync_period = pci_type
n.pci_latency = pci_type
return n
nic_class = nic_pci
nc_class = node.I40eLinuxNode
NicClass = partial(nic_pci, pci_type)
NcClass = node.I40eLinuxNode
# create servers and clients
servers = create_basic_hosts(
e,
1,
'server',
net,
nic_class,
host_class,
nc_class,
node.NetperfServer
e, 1, 'server', net, NicClass, HostClass, NcClass, node.NetperfServer
)
clients = create_basic_hosts(
......@@ -81,9 +77,9 @@ for pci_type in pci_latency:
1,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfClient,
ip_start=2
)
......
......@@ -33,17 +33,17 @@ 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'
host.cpu_freq = '3GHz'
node_config = nc_class()
node_config = NcClass()
node_config.ip = '10.0.0.1'
node_config.app = node.NoTraffic()
node_config.cores = 1
......
......@@ -57,7 +57,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():
......@@ -65,23 +65,23 @@ 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)
......@@ -91,9 +91,9 @@ for host_type in host_types:
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
)
......
......@@ -21,12 +21,13 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
########################################################################
# This script is for reproducing [Table 1] in the paper.
# It generates experiments for all combinations of simulation.
# This script is for reproducing [Table 1] in the paper. It generates
# experiments for all combinations of simulation.
#
# Host type has qemu-kvm(qemu in short), gem5-timing-mode(gt), qemu-timing-mode(qt)
# Nic type has Intel_i40e behavioral model(ib), corundum behavioral model(cb), corundum verilator(cv)
# Net type has Switch behavioral model(sw), ns-3(ns3)
# Host type has qemu-kvm(qemu in short), gem5-timing-mode(gt),
# qemu-timing-mode(qt) Nic type has Intel_i40e behavioral model(ib), corundum
# behavioral model(cb), corundum verilator(cv) Net type has Switch behavioral
# model(sw), ns-3(ns3)
#
# In each simulation, two hosts are connected by a switch
# [HOST_0] - [NIC_0] ---- [SWITCH] ---- [NIC_1] - [HOST_1]
......@@ -70,7 +71,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():
......@@ -78,23 +79,23 @@ 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)
......@@ -104,9 +105,9 @@ for host_type in host_types:
1,
'server',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfServer
)
......@@ -115,9 +116,9 @@ for host_type in host_types:
1,
'client',
net,
nic_class,
host_class,
nc_class,
NicClass,
HostClass,
NcClass,
node.NetperfClient,
ip_start=2
)
......
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