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

pre-commit run -a

parent aac98df8
import sys
import os
import re
import glob import glob
import json import json
import os
import re
import sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
print('Usage: generate_json.py OUTDIR') print('Usage: generate_json.py OUTDIR')
...@@ -23,7 +23,7 @@ for f in glob.glob('testbed-results/*_*pktgap/*.txt'): ...@@ -23,7 +23,7 @@ for f in glob.glob('testbed-results/*_*pktgap/*.txt'):
mtu = int(m.group(1)) mtu = int(m.group(1))
k = int(m.group(2)) * cellsz k = int(m.group(2)) * cellsz
runk = (mtu,k) runk = (mtu, k)
clients = runmap.get(runk, {}) clients = runmap.get(runk, {})
with open(f, 'r') as f: with open(f, 'r') as f:
......
...@@ -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 UDP test # iperf UDP test
# naming convention following host-nic-net-app # naming convention following host-nic-net-app
...@@ -34,11 +34,11 @@ from simbricks.simulator_utils import create_basic_hosts ...@@ -34,11 +34,11 @@ from simbricks.simulator_utils import create_basic_hosts
# app: UDPs # app: UDPs
host_types = ['gt', 'qt', 'qemu'] host_types = ['gt', 'qt', 'qemu']
nic_types = ['cv','cb','ib'] nic_types = ['cv', 'cb', 'ib']
net_types = ['sw', 'br'] net_types = ['sw', 'br']
app = ['Host'] app = ['Host']
total_rate = 1000 # Mbps total_rate = 1000 # Mbps
num_client_max = 8 num_client_max = 8
num_client_step = 2 num_client_step = 2
num_client_types = [1, 4, 9, 14, 20] num_client_types = [1, 4, 9, 14, 20]
...@@ -46,21 +46,21 @@ num_client_types = [1, 4, 9, 14, 20] ...@@ -46,21 +46,21 @@ num_client_types = [1, 4, 9, 14, 20]
# num_client_types.append(n) # num_client_types.append(n)
# print(n) # print(n)
experiments = [] experiments = []
for n_client in num_client_types: for n_client in num_client_types:
per_client_rate = int(total_rate/n_client) per_client_rate = int(total_rate / n_client)
rate = f'{per_client_rate}m' rate = f'{per_client_rate}m'
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(host_type + '-' + nic_type + '-' + net_type + '-Host-' + f'{total_rate}m' + f'-{n_client}') e = exp.Experiment(
host_type + '-' + nic_type + '-' + net_type + '-Host-' +
f'{total_rate}m' + f'-{n_client}'
)
# network # network
if net_type == 'sw': if net_type == 'sw':
net = sim.SwitchNet() net = sim.SwitchNet()
...@@ -74,10 +74,12 @@ for n_client in num_client_types: ...@@ -74,10 +74,12 @@ for n_client in num_client_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
...@@ -99,27 +101,38 @@ for n_client in num_client_types: ...@@ -99,27 +101,38 @@ for n_client in num_client_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.IperfUDPServer) e,
1,
'server',
clients = create_basic_hosts(e, n_client, 'client', net, nic_class, host_class, net,
nc_class, node.IperfUDPClient, ip_start=2) nic_class,
host_class,
clients[n_client-1].node_config.app.is_last = True nc_class,
clients[n_client-1].wait = True node.IperfUDPServer
)
clients = create_basic_hosts(
e,
n_client,
'client',
net,
nic_class,
host_class,
nc_class,
node.IperfUDPClient,
ip_start=2
)
clients[n_client - 1].node_config.app.is_last = True
clients[n_client - 1].wait = True
for c in clients: for c in clients:
c.node_config.app.server_ip = servers[0].node_config.ip c.node_config.app.server_ip = servers[0].node_config.ip
c.node_config.app.rate = rate c.node_config.app.rate = rate
#c.wait = True #c.wait = True
print(e.name) print(e.name)
# add to experiments # add to experiments
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 UDP Load Scalability test # iperf UDP Load Scalability test
# naming convention following host-nic-net # naming convention following host-nic-net
...@@ -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: UDPs # app: UDPs
host_types = ['gt', 'qt', 'qemu'] host_types = ['gt', 'qt', 'qemu']
nic_types = ['cv','cb','ib'] nic_types = ['cv', 'cb', 'ib']
net_types = ['wire', 'sw', 'br'] net_types = ['wire', 'sw', 'br']
app = ['UDPs'] app = ['UDPs']
...@@ -45,7 +45,6 @@ rate_step = 100 ...@@ -45,7 +45,6 @@ rate_step = 100
for r in range(rate_start, rate_end + 1, rate_step): for r in range(rate_start, rate_end + 1, rate_step):
rate = f'{r}m' rate = f'{r}m'
rate_types.append(rate) rate_types.append(rate)
experiments = [] experiments = []
...@@ -54,7 +53,10 @@ for rate in rate_types: ...@@ -54,7 +53,10 @@ for rate in rate_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(host_type + '-' + nic_type + '-' + net_type + '-Load-' + rate ) e = exp.Experiment(
host_type + '-' + nic_type + '-' + net_type + '-Load-' +
rate
)
# network # network
if net_type == 'sw': if net_type == 'sw':
net = sim.SwitchNet() net = sim.SwitchNet()
...@@ -70,10 +72,12 @@ for rate in rate_types: ...@@ -70,10 +72,12 @@ for rate in rate_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,15 +99,41 @@ for rate in rate_types: ...@@ -95,15 +99,41 @@ for rate in rate_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.IperfUDPServer) e,
1,
'server',
net,
nic_class,
host_class,
nc_class,
node.IperfUDPServer
)
if rate == '0m': if rate == '0m':
clients = create_basic_hosts(e, 1, 'client', net, nic_class, host_class, clients = create_basic_hosts(
nc_class, node.IperfUDPClientSleep, ip_start=2) e,
1,
'client',
net,
nic_class,
host_class,
nc_class,
node.IperfUDPClientSleep,
ip_start=2
)
else: else:
clients = create_basic_hosts(e, 1, 'client', net, nic_class, host_class, clients = create_basic_hosts(
nc_class, node.IperfUDPClient, ip_start=2) e,
1,
'client',
net,
nic_class,
host_class,
nc_class,
node.IperfUDPClient,
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
...@@ -112,9 +142,5 @@ for rate in rate_types: ...@@ -112,9 +142,5 @@ for rate in rate_types:
print(e.name) print(e.name)
# add to experiments # add to experiments
experiments.append(e) experiments.append(e)
...@@ -23,23 +23,23 @@ ...@@ -23,23 +23,23 @@
######################################################################## ########################################################################
# This script is for generating the result in 8.1 in the paper. # This script is for generating the result in 8.1 in the paper.
# #
# 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]
# server client # server client
# #
# The server host runs netperf server and client host runs TCP_RR and # The server host runs netperf server and client host runs TCP_RR and
# 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
######################################################################## ########################################################################
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
pci_latency = [1000] pci_latency = [1000]
experiments = [] experiments = []
...@@ -60,16 +60,33 @@ for pci_type in pci_latency: ...@@ -60,16 +60,33 @@ for pci_type in pci_latency:
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 nic_class = nic_pci
nc_class = node.CorundumLinuxNode nc_class = node.CorundumLinuxNode
# 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 s in servers: for s in servers:
s.pci_latency = pci_type s.pci_latency = pci_type
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +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.
from utils.netperf import *
import sys import sys
from time import strftime from time import gmtime, strftime
from time import gmtime
from utils.netperf import *
def fmt_lat(lat): def fmt_lat(lat):
...@@ -60,7 +60,7 @@ for (h, h_l) in hosts: ...@@ -60,7 +60,7 @@ for (h, h_l) in hosts:
path = '%s/cblat-%s-%s-1.json' % (outdir, h, net) path = '%s/cblat-%s-%s-1.json' % (outdir, h, net)
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']))
else: else:
t = '' t = ''
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
# 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 os
import itertools
import sys import sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
...@@ -33,23 +33,20 @@ if len(sys.argv) != 2: ...@@ -33,23 +33,20 @@ if len(sys.argv) != 2:
out_file = sys.argv[1] 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) exit(0)
f = open(out_file, 'r') f = open(out_file, 'r')
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('SimTime: %d (s)' % (time_diff))
f.close() f.close()
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
# 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 os
import itertools
import sys import sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
...@@ -34,20 +34,22 @@ basedir = sys.argv[1] ...@@ -34,20 +34,22 @@ basedir = sys.argv[1]
types_of_host = [2, 8, 16, 32] types_of_host = [2, 8, 16, 32]
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']
time_diff_in_min = (end_time - start_time) / 60 time_diff_in_min = (end_time - start_time) / 60
return time_diff_in_min return time_diff_in_min
print('# Number of hosts' + '\t' + 'Sim.Time') 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 = '%srun-%d.out' % (basedir, workload)
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(' ')
...@@ -56,15 +58,15 @@ for workload in types_of_host: ...@@ -56,15 +58,15 @@ for workload in types_of_host:
read_lines = f.readlines() read_lines = f.readlines()
for l in read_lines: for l in read_lines:
if "START" in l: if 'START' in l:
start_time = float(l.split()[1]) start_time = float(l.split()[1])
#print("start_time: %d" % start_time) #print("start_time: %d" % start_time)
if "EXIT" in l or "KILLED" in l: if 'EXIT' in l or 'KILLED' in l:
end_time = float(l.split()[1]) end_time = float(l.split()[1])
#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('%d' % sim_time)
print('\t'.join(line)) print('\t'.join(line))
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
# 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 os
import itertools
import sys import sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
...@@ -34,20 +34,22 @@ basedir = sys.argv[1] ...@@ -34,20 +34,22 @@ basedir = sys.argv[1]
types_of_client = [1, 4, 9, 14, 20] types_of_client = [1, 4, 9, 14, 20]
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']
time_diff_in_min = (end_time - start_time) / 60 time_diff_in_min = (end_time - start_time) / 60
return time_diff_in_min return time_diff_in_min
print('# Number of hosts' + '\t' + 'Sim.Time') 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 = '%shost-gt-ib-sw-1000m-%s' % (basedir, workload)
runs = [] runs = []
for path in glob.glob(path_pat + '-*.json'): for path in glob.glob(path_pat + '-*.json'):
if path == path_pat + '-0.json': if path == path_pat + '-0.json':
...@@ -56,11 +58,11 @@ for workload in types_of_client: ...@@ -56,11 +58,11 @@ for workload in types_of_client:
with open(path, 'r') as f: with open(path, 'r') as f:
data = json.load(f) data = json.load(f)
res = time_diff_min(data) res = time_diff_min(data)
if res is not None: if res is not None:
runs.append(res) runs.append(res)
if not runs: if not runs:
line.append(' ') line.append(' ')
else: else:
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +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.
from utils.netperf import *
import sys import sys
from time import strftime from time import gmtime, strftime
from time import gmtime
from utils.netperf import *
def fmt_lat(lat): def fmt_lat(lat):
...@@ -60,7 +60,7 @@ for (h, h_l) in hosts: ...@@ -60,7 +60,7 @@ for (h, h_l) in hosts:
path = '%s/nf-%s-%s-%s-1.json' % (outdir, h, net, nic) path = '%s/nf-%s-%s-%s-1.json' % (outdir, h, net, nic)
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']))
else: else:
t = '' t = ''
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import sys import sys
import utils.parse_nopaxos as pn import utils.parse_nopaxos as pn
if len(sys.argv) != 2: if len(sys.argv) != 2:
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
import itertools import itertools
import os import os
import sys import sys
import utils.iperf import utils.iperf
if len(sys.argv) != 2: if len(sys.argv) != 2:
...@@ -35,7 +36,7 @@ max_k = 199680 ...@@ -35,7 +36,7 @@ max_k = 199680
k_step = 16640 k_step = 16640
mtu = 4000 mtu = 4000
confignames = ["ns3-4000"] confignames = ['ns3-4000']
print('\t'.join(['threshold'] + confignames)) 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):
...@@ -45,22 +46,22 @@ for k_val in range(0, max_k + 1, k_step): ...@@ -45,22 +46,22 @@ for k_val in range(0, max_k + 1, k_step):
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) exit(0)
f = open(path_pat, 'r') f = open(path_pat, 'r')
lines = f.readlines() lines = f.readlines()
tp = float(lines[1].split()[2]) / 1000 tp = float(lines[1].split()[2]) / 1000
tps.append(tp) tps.append(tp)
tp = float(lines[2].split()[2]) / 1000 tp = float(lines[2].split()[2]) / 1000
tps.append(tp) tps.append(tp)
f.close() 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('%.2f' % (tp_calib))
print('\t'.join(line)) print('\t'.join(line))
\ No newline at end of file
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
# 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 os
import itertools
import sys import sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
...@@ -34,20 +34,22 @@ basedir = sys.argv[1] ...@@ -34,20 +34,22 @@ basedir = sys.argv[1]
types_of_pci = [10, 50, 100, 500, 1000] types_of_pci = [10, 50, 100, 500, 1000]
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']
time_diff_in_min = (end_time - start_time) / 60 time_diff_in_min = (end_time - start_time) / 60
return time_diff_in_min return time_diff_in_min
print('# PCI latency (ns)' + '\t' + 'Sim.Time') 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 = '%spci-gt-ib-sw-%s' % (basedir, workload)
runs = [] runs = []
for path in glob.glob(path_pat + '-*.json'): for path in glob.glob(path_pat + '-*.json'):
if path == path_pat + '-0.json': if path == path_pat + '-0.json':
...@@ -56,11 +58,11 @@ for workload in types_of_pci: ...@@ -56,11 +58,11 @@ for workload in types_of_pci:
with open(path, 'r') as f: with open(path, 'r') as f:
data = json.load(f) data = json.load(f)
res = time_diff_min(data) res = time_diff_min(data)
if res is not None: if res is not None:
runs.append(res) runs.append(res)
if not runs: if not runs:
line.append(' ') line.append(' ')
else: else:
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
import itertools import itertools
import sys import sys
import utils.iperf import utils.iperf
if len(sys.argv) != 2: if len(sys.argv) != 2:
...@@ -39,7 +40,6 @@ configs = list(itertools.product(types_of_host, mtus)) ...@@ -39,7 +40,6 @@ configs = list(itertools.product(types_of_host, mtus))
confignames = [h + '-' + str(mtu) for h, mtu in configs] confignames = [h + '-' + str(mtu) for h, mtu in configs]
print('\t'.join(['threshold'] + confignames)) 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:
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
# 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 os
import itertools
import sys import sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
...@@ -33,15 +33,17 @@ if len(sys.argv) != 2: ...@@ -33,15 +33,17 @@ if len(sys.argv) != 2:
basedir = sys.argv[1] basedir = sys.argv[1]
types_of_workload = ['sleep', 'busy'] types_of_workload = ['sleep', 'busy']
types_of_sync = ['with', 'without'] # with or without simbricks types_of_sync = ['with', 'without'] # with or without simbricks
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']
time_diff_in_min = (end_time - start_time) / 60 time_diff_in_min = (end_time - start_time) / 60
return time_diff_in_min return time_diff_in_min
print('# Workload' + '\t' + 'w/ simbricks' + '\t' + 'w/o simbricks') print('# Workload' + '\t' + 'w/ simbricks' + '\t' + 'w/o simbricks')
for workload in types_of_workload: for workload in types_of_workload:
...@@ -51,7 +53,7 @@ for workload in types_of_workload: ...@@ -51,7 +53,7 @@ for workload in types_of_workload:
path_pat = '%snoTraf-gt-ib-sw-%s' % (basedir, workload) path_pat = '%snoTraf-gt-ib-sw-%s' % (basedir, workload)
else: else:
path_pat = '%sno_simb-gt-%s' % (basedir, workload) path_pat = '%sno_simb-gt-%s' % (basedir, workload)
runs = [] runs = []
for path in glob.glob(path_pat + '-*.json'): for path in glob.glob(path_pat + '-*.json'):
if path == path_pat + '-0.json': if path == path_pat + '-0.json':
...@@ -60,11 +62,11 @@ for workload in types_of_workload: ...@@ -60,11 +62,11 @@ for workload in types_of_workload:
with open(path, 'r') as f: with open(path, 'r') as f:
data = json.load(f) data = json.load(f)
res = time_diff_min(data) res = time_diff_min(data)
if res is not None: if res is not None:
runs.append(res) runs.append(res)
if not runs: if not runs:
line.append(' ') line.append(' ')
else: else:
......
...@@ -20,17 +20,16 @@ ...@@ -20,17 +20,16 @@
# 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_types = ['gt'] host_types = ['gt']
nic_types = ['ib'] nic_types = ['ib']
net_types = ['sw'] net_types = ['sw']
num_cores = 1 num_cores = 1
n_client = 1 n_client = 1
...@@ -42,22 +41,40 @@ e.add_network(net) ...@@ -42,22 +41,40 @@ e.add_network(net)
host_class = sim.Gem5Host host_class = sim.Gem5Host
e.checkpoint = False e.checkpoint = False
nic_class = sim.I40eNIC nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode nc_class = node.I40eLinuxNode
# create a host # create a host
servers = create_basic_hosts(e, 1, 'server', net, nic_class, host_class, servers = create_basic_hosts(
nc_class, node.IperfUDPServer, ip_start=2) e,
1,
'server',
net,
nic_class,
host_class,
nc_class,
node.IperfUDPServer,
ip_start=2
)
servers[0].node_config.nockp = 1 servers[0].node_config.nockp = 1
servers[0].variant = 'opt' servers[0].variant = 'opt'
servers[0].cpu_freq = '3GHz' servers[0].cpu_freq = '3GHz'
servers[0].extra_main_args = ['--debug-flags=SimBricksSync,SimBricksPci,SimBricksEthernet'] servers[0].extra_main_args = [
'--debug-flags=SimBricksSync,SimBricksPci,SimBricksEthernet'
]
# create a host # create a host
clients = create_basic_hosts(e, 1, 'client', net, nic_class, host_class, clients = create_basic_hosts(
nc_class, node.IperfUDPShortClient, ip_start=2) e,
1,
'client',
net,
nic_class,
host_class,
nc_class,
node.IperfUDPShortClient,
ip_start=2
)
clients[0].cpu_freq = '3GHz' clients[0].cpu_freq = '3GHz'
clients[0].variant = 'opt' clients[0].variant = 'opt'
...@@ -65,14 +82,12 @@ clients[0].node_config.cores = num_cores ...@@ -65,14 +82,12 @@ clients[0].node_config.cores = num_cores
clients[0].node_config.app.is_sleep = 1 clients[0].node_config.app.is_sleep = 1
clients[0].node_config.nockp = 1 clients[0].node_config.nockp = 1
clients[0].node_config.app.is_last = True clients[0].node_config.app.is_last = True
clients[0].extra_main_args = ['--debug-flags=SimBricksSync,SimBricksPci,SimBricksEthernet'] clients[0].extra_main_args = [
'--debug-flags=SimBricksSync,SimBricksPci,SimBricksEthernet'
]
clients[0].wait = True clients[0].wait = True
print(e.name) print(e.name)
# add to experiments # add to experiments
experiments.append(e) experiments.append(e)
...@@ -19,16 +19,15 @@ ...@@ -19,16 +19,15 @@
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# 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.
""" """
This script is for reproducing Simbricks line in [Figure 1] DCTCP result. This script is for reproducing Simbricks line in [Figure 1] DCTCP result.
We used following combination of simulators. We used following combination of simulators.
HOST: Gem5 timing CPU HOST: Gem5 timing CPU
NIC: Intel i40e behavioral model NIC: Intel i40e behavioral model
NET: ns-3 dumbbell model NET: ns-3 dumbbell model
The simulation composed of two pairs of iperf server and client, connected The simulation composed of two pairs of iperf server and client, connected
in a dumbbell topology. in a dumbbell topology.
The link between two switches is the bottleneck link. The link between two switches is the bottleneck link.
...@@ -42,11 +41,12 @@ The command to run all the experiments is: ...@@ -42,11 +41,12 @@ The command to run all the experiments is:
$: python3 run.py pyexps/ae/f1_dctcp.py --filter gt-ib-* --force --verbose $: python3 run.py pyexps/ae/f1_dctcp.py --filter gt-ib-* --force --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_dctcp_hosts from simbricks.simulator_utils import create_dctcp_hosts
import simbricks.experiments as exp
types_of_host = ['gt'] types_of_host = ['gt']
types_of_nic = ['ib'] types_of_nic = ['ib']
types_of_net = ['dumbbell'] types_of_net = ['dumbbell']
...@@ -56,11 +56,11 @@ types_of_mtu = [4000] ...@@ -56,11 +56,11 @@ types_of_mtu = [4000]
num_pairs = 2 num_pairs = 2
max_k = 199680 max_k = 199680
k_step = 16640 k_step = 16640
link_rate_opt = '--LinkRate=10Gb/s ' # don't forget space at the end link_rate_opt = '--LinkRate=10Gb/s ' # don't forget space at the end
link_latency_opt = '--LinkLatency=500ns ' link_latency_opt = '--LinkLatency=500ns '
cpu_freq = '5GHz' cpu_freq = '5GHz'
cpu_freq_qemu = '2GHz' cpu_freq_qemu = '2GHz'
sys_clock = '1GHz' # if not set, default 1GHz sys_clock = '1GHz' # if not set, default 1GHz
ip_start = '192.168.64.1' ip_start = '192.168.64.1'
...@@ -77,7 +77,10 @@ for mtu in types_of_mtu: ...@@ -77,7 +77,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
...@@ -86,25 +89,31 @@ for mtu in types_of_mtu: ...@@ -86,25 +89,31 @@ 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:
raise NameError(h) raise NameError(h)
...@@ -122,25 +131,43 @@ for mtu in types_of_mtu: ...@@ -122,25 +131,43 @@ for mtu in types_of_mtu:
else: else:
raise NameError(c) raise NameError(c)
servers = create_dctcp_hosts(
e,
num_pairs,
'server',
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
)
servers = create_dctcp_hosts(e, num_pairs, 'server', 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:
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 except the last one
# 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)
...@@ -29,30 +29,30 @@ ...@@ -29,30 +29,30 @@
# 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
# #
# The server host runs iperf UDP server and client host runs UDP test # The server host runs iperf UDP server and client host runs UDP test
# The total aggregated bandwidth sent to the server are fixed to 1000 Mbps # The total aggregated bandwidth sent to the server are fixed to 1000 Mbps
# #
# The command to run all the experiments is: # The command to run all the experiments is:
# $: python3 run.py pyexps/ae/f7_scale.py --filter host-gt-ib-sw-* --verbose # $: python3 run.py pyexps/ae/f7_scale.py --filter host-gt-ib-sw-* --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 = ['gt'] host_types = ['gt']
nic_types = ['ib'] nic_types = ['ib']
net_types = ['sw'] net_types = ['sw']
app = ['Host'] app = ['Host']
total_rate = 1000 # Mbps total_rate = 1000 # Mbps
num_client_max = 8 num_client_max = 8
num_client_step = 2 num_client_step = 2
num_client_types = [1, 4, 9, 14, 20] num_client_types = [1, 4, 9, 14, 20]
...@@ -61,14 +61,17 @@ experiments = [] ...@@ -61,14 +61,17 @@ experiments = []
for n_client in num_client_types: for n_client in num_client_types:
per_client_rate = int(total_rate/n_client) per_client_rate = int(total_rate / n_client)
rate = f'{per_client_rate}m' rate = f'{per_client_rate}m'
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('host-' + host_type + '-' + nic_type + '-' + net_type + '-' + f'{total_rate}m' + f'-{n_client}') e = exp.Experiment(
'host-' + host_type + '-' + nic_type + '-' + net_type +
'-' + f'{total_rate}m' + f'-{n_client}'
)
# network # network
if net_type == 'sw': if net_type == 'sw':
net = sim.SwitchNet() net = sim.SwitchNet()
...@@ -82,10 +85,12 @@ for n_client in num_client_types: ...@@ -82,10 +85,12 @@ for n_client in num_client_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
...@@ -107,30 +112,41 @@ for n_client in num_client_types: ...@@ -107,30 +112,41 @@ for n_client in num_client_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.IperfUDPServer) e,
1,
'server',
clients = create_basic_hosts(e, n_client, 'client', net, nic_class, host_class, net,
nc_class, node.IperfUDPClient, ip_start=2) nic_class,
host_class,
clients[n_client-1].node_config.app.is_last = True nc_class,
clients[n_client-1].wait = True node.IperfUDPServer
)
clients = create_basic_hosts(
e,
n_client,
'client',
net,
nic_class,
host_class,
nc_class,
node.IperfUDPClient,
ip_start=2
)
clients[n_client - 1].node_config.app.is_last = True
clients[n_client - 1].wait = True
for c in clients: for c in clients:
c.node_config.app.server_ip = servers[0].node_config.ip c.node_config.app.server_ip = servers[0].node_config.ip
c.node_config.app.rate = rate c.node_config.app.rate = rate
c.cpu_freq = '3GHz' c.cpu_freq = '3GHz'
#c.wait = True #c.wait = True
servers[0].cpu_freq = '3GHz'
servers[0].cpu_freq = '3GHz'
print(e.name) print(e.name)
# add to experiments # add to experiments
experiments.append(e) experiments.append(e)
...@@ -23,23 +23,23 @@ ...@@ -23,23 +23,23 @@
######################################################################## ########################################################################
# This script is for reproducing [Figure 9] in the paper. # This script is for reproducing [Figure 9] in the paper.
# #
# 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]
# server client # server client
# #
# The server host runs netperf server and client host runs TCP_RR and # The server host runs netperf server and client host runs TCP_RR and
# 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/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
pci_latency = [10, 50, 100, 500, 1000] pci_latency = [10, 50, 100, 500, 1000]
experiments = [] experiments = []
...@@ -60,16 +60,33 @@ for pci_type in pci_latency: ...@@ -60,16 +60,33 @@ for pci_type in pci_latency:
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 nic_class = nic_pci
nc_class = node.I40eLinuxNode nc_class = node.I40eLinuxNode
# 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 s in servers: for s in servers:
s.pci_latency = pci_type s.pci_latency = pci_type
......
...@@ -20,16 +20,15 @@ ...@@ -20,16 +20,15 @@
# 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
app_types = ['sleep', 'busy'] app_types = ['sleep', 'busy']
experiments = [] experiments = []
for app_type in app_types: for app_type in app_types:
e = exp.Experiment('no_simb-gt-' + app_type) e = exp.Experiment('no_simb-gt-' + app_type)
...@@ -37,11 +36,10 @@ for app_type in app_types: ...@@ -37,11 +36,10 @@ for app_type in app_types:
host_class = sim.Gem5Host host_class = sim.Gem5Host
e.checkpoint = True e.checkpoint = True
e.no_simbricks = True e.no_simbricks = True
nc_class = node.I40eLinuxNode nc_class = node.I40eLinuxNode
# create servers and clients # create servers and clients
host = host_class() host = host_class()
host.name = 'host.0' host.name = 'host.0'
host.cpu_freq = '3GHz' host.cpu_freq = '3GHz'
...@@ -50,22 +48,17 @@ for app_type in app_types: ...@@ -50,22 +48,17 @@ for app_type in app_types:
node_config.app = node.NoTraffic() node_config.app = node.NoTraffic()
node_config.cores = 1 node_config.cores = 1
# is busy # is busy
if app_type == 'sleep': if app_type == 'sleep':
node_config.app.is_sleep = 1 node_config.app.is_sleep = 1
else: else:
node_config.app.is_sleep = 0 node_config.app.is_sleep = 0
host.set_config(node_config) host.set_config(node_config)
e.add_host(host) e.add_host(host)
host.wait = True host.wait = True
print(e.name) print(e.name)
# add to experiments # add to experiments
experiments.append(e) experiments.append(e)
...@@ -20,18 +20,17 @@ ...@@ -20,18 +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
host_types = ['gt'] host_types = ['gt']
nic_types = ['ib'] nic_types = ['ib']
net_types = ['sw'] net_types = ['sw']
app_types = ['sleep', 'busy'] app_types = ['sleep', 'busy']
num_cores = 1 num_cores = 1
n_client = 1 n_client = 1
...@@ -42,7 +41,10 @@ for host_type in host_types: ...@@ -42,7 +41,10 @@ for host_type in host_types:
for net_type in net_types: for net_type in net_types:
for app_type in app_types: for app_type in app_types:
e = exp.Experiment('noTraf-' + host_type + '-' + nic_type + '-' + net_type + '-' + app_type) e = exp.Experiment(
'noTraf-' + host_type + '-' + nic_type + '-' + net_type +
'-' + app_type
)
# network # network
if net_type == 'sw': if net_type == 'sw':
...@@ -57,10 +59,12 @@ for host_type in host_types: ...@@ -57,10 +59,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
...@@ -82,15 +86,24 @@ for host_type in host_types: ...@@ -82,15 +86,24 @@ for host_type in host_types:
raise NameError(nic_type) raise NameError(nic_type)
# create a host # create a host
clients = create_basic_hosts(e, n_client, 'client', net, nic_class, host_class, clients = create_basic_hosts(
nc_class, node.NoTraffic, ip_start=2) e,
n_client,
clients[n_client-1].wait = True 'client',
net,
nic_class,
host_class,
nc_class,
node.NoTraffic,
ip_start=2
)
clients[n_client - 1].wait = True
for c in clients: for c in clients:
c.cpu_freq = '3GHz' c.cpu_freq = '3GHz'
c.node_config.cores = num_cores c.node_config.cores = num_cores
# is busy # is busy
if app_type == 'sleep': if app_type == 'sleep':
c.node_config.app.is_sleep = 1 c.node_config.app.is_sleep = 1
else: else:
...@@ -98,9 +111,5 @@ for host_type in host_types: ...@@ -98,9 +111,5 @@ for host_type in host_types:
print(e.name) print(e.name)
# add to experiments # add to experiments
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