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