Commit 013f0651 authored by Hejing Li's avatar Hejing Li
Browse files

gt_udp_sinlge.py: add host types and bw option

parent bbd232d7
...@@ -10,59 +10,87 @@ import modes.nodeconfig as node ...@@ -10,59 +10,87 @@ import modes.nodeconfig as node
# net: wire/switch/dumbbell/bridge # net: wire/switch/dumbbell/bridge
# app: UDPs # app: UDPs
kinds_of_host = ['gem5-timing'] host_types = ['gt', 'qt', 'qemu']
kinds_of_nic = ['cv','cb','ib'] nic_types = ['cv','cb','ib']
kinds_of_net = ['wire', 'switch', 'dumbbell', 'bridge'] net_types = ['wire', 'switch', 'bridge']
kinds_of_app = ['UDPs'] app = ['UDPs']
rate = '200m' rate_types = []
rate_start = 0
rate_end = 140
rate_step = 20
for r in range(rate_start, rate_end + 1, rate_step):
rate = f'{r}m'
rate_types.append(rate)
experiments = [] experiments = []
# set network sim for rate in rate_types:
for n in kinds_of_net: for host_type in host_types:
if n == 'wire': for nic_type in nic_types:
net_class = sim.WireNet for net_type in net_types:
if n == 'switch':
net_class = sim.SwitchNet e = exp.Experiment(host_type + '-' + nic_type + '-' + net_type + '-UDPs-' + rate )
if n == 'dumbbell': # network
net_class = sim.NS3DumbbellNet if net_type == 'switch':
if n == 'bridge': net = sim.SwitchNet()
net_class = sim.NS3BridgeNet elif net_type == 'bridge':
net = sim.NS3BridgeNet()
elif net_type == 'wire':
# set nic sim net = sim.WireNet()
for c in kinds_of_nic: else:
net = net_class() raise NameError(net_type)
e = exp.Experiment('gt-' + c + '-' + n + '-' + 'UDPs') e.add_network(net)
e.checkpoint = True
e.add_network(net) # host
if host_type == 'qemu':
if c == 'cv': host_class = sim.QemuHost
servers = sim.create_basic_hosts(e, 1, 'server', net, sim.CorundumVerilatorNIC, sim.Gem5Host, elif host_type == 'qt':
node.CorundumLinuxNode, node.IperfUDPServer) def qemu_timing():
clients = sim.create_basic_hosts(e, 1, 'client', net, sim.CorundumVerilatorNIC, sim.Gem5Host, h = sim.QemuHost()
node.CorundumLinuxNode, node.IperfUDPClient, ip_start = 2) h.sync = True
return h
host_class = qemu_timing
if c == 'cb': elif host_type == 'gt':
servers = sim.create_basic_hosts(e, 1, 'server', net, sim.CorundumBMNIC, sim.Gem5Host, host_class = sim.Gem5Host
node.CorundumLinuxNode, node.IperfUDPServer) e.checkpoint = False
clients = sim.create_basic_hosts(e, 1, 'client', net, sim.CorundumBMNIC, sim.Gem5Host, else:
node.CorundumLinuxNode, node.IperfUDPClient, ip_start = 2) raise NameError(host_type)
# nic
if nic_type == 'ib':
if c == 'ib': nic_class = sim.I40eNIC
servers = sim.create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.Gem5Host, nc_class = node.I40eLinuxNode
node.I40eLinuxNode, node.IperfUDPServer) elif nic_type == 'cb':
clients = sim.create_basic_hosts(e, 1, 'client', net, sim.I40eNIC, sim.Gem5Host, nic_class = sim.CorundumBMNIC
node.I40eLinuxNode, node.IperfUDPClient, ip_start = 2) nc_class = node.CorundumLinuxNode
elif nic_type == 'cv':
clients[0].wait = True nic_class = sim.CorundumVerilatorNIC
clients[0].node_config.app.server_ip = servers[0].node_config.ip nc_class = node.CorundumLinuxNode
clients[0].node_config.app.rate = rate else:
raise NameError(nic_type)
print(e.name)
experiments.append(e) # create servers and clients
servers = sim.create_basic_hosts(e, 1, 'server', net, nic_class, host_class,
nc_class, node.IperfUDPServer)
if rate == '0m':
clients = sim.create_basic_hosts(e, 1, 'client', net, nic_class, host_class,
nc_class, node.IperfUDPClientSleep, ip_start=2)
else:
clients = sim.create_basic_hosts(e, 1, 'client', net, nic_class, host_class,
nc_class, node.IperfUDPClient, ip_start=2)
clients[0].wait = True
clients[0].node_config.app.server_ip = servers[0].node_config.ip
clients[0].node_config.app.rate = rate
print(e.name)
# add to experiments
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