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,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 = ['sw', 'br'] net_types = ['sw', 'br']
app = ['Host'] app = ['Host']
...@@ -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']
...@@ -46,7 +46,6 @@ for r in range(rate_start, rate_end + 1, rate_step): ...@@ -46,7 +46,6 @@ 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 = []
for rate in rate_types: for rate in rate_types:
...@@ -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)
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
# $: 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 = []
...@@ -65,11 +65,28 @@ for pci_type in pci_latency: ...@@ -65,11 +65,28 @@ for pci_type in pci_latency:
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,13 +34,15 @@ basedir = sys.argv[1] ...@@ -34,13 +34,15 @@ 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:
...@@ -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,13 +34,15 @@ basedir = sys.argv[1] ...@@ -34,13 +34,15 @@ 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:
......
...@@ -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,7 +46,7 @@ for k_val in range(0, max_k + 1, k_step): ...@@ -45,7 +46,7 @@ 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()
......
...@@ -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,13 +34,15 @@ basedir = sys.argv[1] ...@@ -34,13 +34,15 @@ 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:
......
...@@ -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:
...@@ -35,13 +35,15 @@ basedir = sys.argv[1] ...@@ -35,13 +35,15 @@ 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:
......
...@@ -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,7 +19,6 @@ ...@@ -19,7 +19,6 @@
# 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.
...@@ -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']
...@@ -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,24 +89,30 @@ for mtu in types_of_mtu: ...@@ -86,24 +89,30 @@ for mtu in types_of_mtu:
host_class = sim.QemuHost host_class = sim.QemuHost
elif h == 'qt': elif h == 'qt':
freq = cpu_freq_qemu freq = cpu_freq_qemu
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
h.sync = True h.sync = True
return h return h
host_class = qemu_timing host_class = qemu_timing
elif h == 'gt': elif h == 'gt':
def gem5_timing(): def gem5_timing():
h = sim.Gem5Host() h = sim.Gem5Host()
#h.sys_clock = sys_clock #h.sys_clock = sys_clock
return h return h
host_class = gem5_timing host_class = gem5_timing
e.checkpoint = True e.checkpoint = True
elif h == 'gO3': elif h == 'gO3':
def gem5_o3(): def gem5_o3():
h = sim.Gem5Host() h = sim.Gem5Host()
h.cpu_type = 'DerivO3CPU' h.cpu_type = 'DerivO3CPU'
h.sys_clock = sys_clock h.sys_clock = sys_clock
return h return h
host_class = gem5_o3 host_class = gem5_o3
e.checkpoint = True e.checkpoint = True
else: else:
...@@ -122,12 +131,31 @@ for mtu in types_of_mtu: ...@@ -122,12 +131,31 @@ for mtu in types_of_mtu:
else: else:
raise NameError(c) raise NameError(c)
servers = create_dctcp_hosts(
servers = create_dctcp_hosts(e, num_pairs, 'server', net, nic_class, host_class, e,
nc_class, node.DctcpServer, freq, mtu) num_pairs,
clients = create_dctcp_hosts(e, num_pairs, 'client', net, nic_class, host_class, 'server',
nc_class, node.DctcpClient, freq, mtu, ip_start=num_pairs+1) net,
nic_class,
host_class,
nc_class,
node.DctcpServer,
freq,
mtu
)
clients = create_dctcp_hosts(
e,
num_pairs,
'client',
net,
nic_class,
host_class,
nc_class,
node.DctcpClient,
freq,
mtu,
ip_start=num_pairs + 1
)
i = 0 i = 0
for cl in clients: for cl in clients:
...@@ -138,9 +166,8 @@ for mtu in types_of_mtu: ...@@ -138,9 +166,8 @@ for mtu in types_of_mtu:
# This is to prevent the simulation gets stuck when one of host exits. # This is to prevent the simulation gets stuck when one of host exits.
# The last client waits for the output printed in other hosts, then cleanup # The last client waits for the output printed in other hosts, then cleanup
clients[num_pairs-1].node_config.app.is_last = True clients[num_pairs - 1].node_config.app.is_last = True
clients[num_pairs-1].wait = True clients[num_pairs - 1].wait = True
print(e.name) print(e.name)
experiments.append(e) experiments.append(e)
...@@ -41,12 +41,12 @@ ...@@ -41,12 +41,12 @@
# $: 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']
...@@ -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,15 +112,31 @@ for n_client in num_client_types: ...@@ -107,15 +112,31 @@ 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
...@@ -125,12 +146,7 @@ for n_client in num_client_types: ...@@ -125,12 +146,7 @@ for n_client in num_client_types:
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)
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
# $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose # $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose
######################################################################## ########################################################################
import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.nodeconfig as node import simbricks.nodeconfig as node
import simbricks.simulators as sim
from simbricks.simulator_utils import create_basic_hosts from simbricks.simulator_utils import create_basic_hosts
import simbricks.experiments as exp
pci_latency = [10, 50, 100, 500, 1000] pci_latency = [10, 50, 100, 500, 1000]
experiments = [] experiments = []
...@@ -65,11 +65,28 @@ for pci_type in pci_latency: ...@@ -65,11 +65,28 @@ for pci_type in pci_latency:
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)
...@@ -38,7 +37,6 @@ for app_type in app_types: ...@@ -38,7 +37,6 @@ for app_type in app_types:
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
...@@ -60,12 +58,7 @@ for app_type in app_types: ...@@ -60,12 +58,7 @@ for app_type in app_types:
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,10 +86,19 @@ for host_type in host_types: ...@@ -82,10 +86,19 @@ 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'
...@@ -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