"...resnet50_tensorflow.git" did not exist on "6cd536dc83be07e3adf5425fcee7444e4f189f82"
Commit cbd825e1 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

HostSim: pass node_config in __init__

parent 74a9f167
...@@ -89,16 +89,16 @@ for mtu in types_of_mtu: ...@@ -89,16 +89,16 @@ for mtu in types_of_mtu:
elif host == 'qt': elif host == 'qt':
freq = cpu_freq_qemu freq = cpu_freq_qemu
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
HostClass = qemu_timing HostClass = qemu_timing
elif host == 'gt': elif host == 'gt':
def gem5_timing(): def gem5_timing(node_config: node.NodeConfig):
h = sim.Gem5Host() h = sim.Gem5Host(node_config)
#h.sys_clock = sys_clock #h.sys_clock = sys_clock
return h return h
...@@ -106,8 +106,8 @@ for mtu in types_of_mtu: ...@@ -106,8 +106,8 @@ for mtu in types_of_mtu:
e.checkpoint = True e.checkpoint = True
elif host == 'gO3': elif host == 'gO3':
def gem5_o3(): def gem5_o3(node_config: node.NodeConfig):
h = sim.Gem5Host() h = sim.Gem5Host(node_config)
h.cpu_type = 'DerivO3CPU' h.cpu_type = 'DerivO3CPU'
h.sys_clock = sys_clock h.sys_clock = sys_clock
return h return h
......
...@@ -86,8 +86,8 @@ for n_client in num_client_types: ...@@ -86,8 +86,8 @@ for n_client in num_client_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -39,9 +39,6 @@ for app_type in app_types: ...@@ -39,9 +39,6 @@ for app_type in app_types:
NcClass = node.I40eLinuxNode NcClass = node.I40eLinuxNode
# create servers and clients # create servers and clients
host = HostClass()
host.name = 'host.0'
host.cpu_freq = '3GHz'
node_config = NcClass() 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()
...@@ -53,7 +50,10 @@ for app_type in app_types: ...@@ -53,7 +50,10 @@ for app_type in app_types:
else: else:
node_config.app.is_sleep = 0 node_config.app.is_sleep = 0
host.set_config(node_config) host = HostClass(node_config)
host.name = 'host.0'
host.cpu_freq = '3GHz'
e.add_host(host) e.add_host(host)
host.wait = True host.wait = True
......
...@@ -59,8 +59,8 @@ for host_type in host_types: ...@@ -59,8 +59,8 @@ for host_type in host_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -62,8 +62,8 @@ for proto_config in proto_configs: ...@@ -62,8 +62,8 @@ for proto_config in proto_configs:
e.checkpoint = True e.checkpoint = True
elif host_config == 'qt': elif host_config == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -73,8 +73,8 @@ for host_type in host_types: ...@@ -73,8 +73,8 @@ for host_type in host_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -77,16 +77,16 @@ for mtu in types_of_mtu: ...@@ -77,16 +77,16 @@ for mtu in types_of_mtu:
elif host == 'qt': elif host == 'qt':
freq = cpu_freq_qemu freq = cpu_freq_qemu
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
HostClass = qemu_timing HostClass = qemu_timing
elif host == 'gt': elif host == 'gt':
def gem5_timing(): def gem5_timing(node_config: node.NodeConfig):
h = sim.Gem5Host() h = sim.Gem5Host(node_config)
#h.sys_clock = sys_clock #h.sys_clock = sys_clock
return h return h
...@@ -94,8 +94,8 @@ for mtu in types_of_mtu: ...@@ -94,8 +94,8 @@ for mtu in types_of_mtu:
e.checkpoint = True e.checkpoint = True
elif host == 'gO3': elif host == 'gO3':
def gem5_o3(): def gem5_o3(node_config: node.NodeConfig):
h = sim.Gem5Host() h = sim.Gem5Host(node_config)
h.cpu_type = 'DerivO3CPU' h.cpu_type = 'DerivO3CPU'
h.sys_clock = sys_clock h.sys_clock = sys_clock
return h return h
......
...@@ -78,8 +78,8 @@ for host_type in host_types: ...@@ -78,8 +78,8 @@ for host_type in host_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -46,8 +46,8 @@ for host_type in host_types: ...@@ -46,8 +46,8 @@ for host_type in host_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -47,8 +47,8 @@ for host_type in host_types: ...@@ -47,8 +47,8 @@ for host_type in host_types:
net.sync = False net.sync = False
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -30,18 +30,17 @@ for h in ['qk', 'gk']: ...@@ -30,18 +30,17 @@ for h in ['qk', 'gk']:
e = exp.Experiment('femutest-' + h) e = exp.Experiment('femutest-' + h)
e.checkpoint = False e.checkpoint = False
if h == 'gk':
host = sim.Gem5Host()
host.cpu_type = 'X86KvmCPU'
elif h == 'qk':
host = sim.QemuHost()
host.name = 'host.0'
node_config = node.LinuxFEMUNode() node_config = node.LinuxFEMUNode()
node_config.app = node.NVMEFsTest() node_config.app = node.NVMEFsTest()
node_config.cores = 1 node_config.cores = 1
node_config.app.is_sleep = 1 node_config.app.is_sleep = 1
host.set_config(node_config)
if h == 'gk':
host = sim.Gem5Host(node_config)
host.cpu_type = 'X86KvmCPU'
elif h == 'qk':
host = sim.QemuHost(node_config)
host.name = 'host.0'
e.add_host(host) e.add_host(host)
host.wait = True host.wait = True
......
...@@ -62,16 +62,16 @@ for mode in types_of_mode: ...@@ -62,16 +62,16 @@ for mode in types_of_mode:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host == 'qt': elif host == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
HostClass = qemu_timing HostClass = qemu_timing
elif host == 'gt': elif host == 'gt':
def gem5_timing(): def gem5_timing(node_config: node.NodeConfig):
h = sim.Gem5Host() h = sim.Gem5Host(node_config)
return h return h
HostClass = gem5_timing HostClass = gem5_timing
......
...@@ -60,8 +60,8 @@ for host_type in host_types: ...@@ -60,8 +60,8 @@ for host_type in host_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -39,8 +39,6 @@ for app_type in app_types: ...@@ -39,8 +39,6 @@ for app_type in app_types:
NcClass = node.I40eLinuxNode NcClass = node.I40eLinuxNode
# create servers and clients # create servers and clients
host = HostClass()
host.name = 'host.0'
node_config = NcClass() 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()
...@@ -52,7 +50,9 @@ for app_type in app_types: ...@@ -52,7 +50,9 @@ for app_type in app_types:
else: else:
node_config.app.is_sleep = 0 node_config.app.is_sleep = 0
host.set_config(node_config) host = HostClass(node_config)
host.name = 'host.0'
e.add_host(host) e.add_host(host)
host.wait = True host.wait = True
......
...@@ -66,8 +66,8 @@ for host_type in host_types: ...@@ -66,8 +66,8 @@ for host_type in host_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -62,8 +62,8 @@ for proto_config in proto_configs: ...@@ -62,8 +62,8 @@ for proto_config in proto_configs:
e.checkpoint = True e.checkpoint = True
elif host_config == 'qt': elif host_config == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -39,18 +39,18 @@ for internal in [True, False]: ...@@ -39,18 +39,18 @@ for internal in [True, False]:
net = sim.SwitchNet() net = sim.SwitchNet()
e.add_network(net) e.add_network(net)
server = sim.Gem5Host() # server
server.name = 'server'
nc_server = node.E1000LinuxNode() nc_server = node.E1000LinuxNode()
nc_server.prefix = 24 nc_server.prefix = 24
nc_server.ip = '10.0.0.1' nc_server.ip = '10.0.0.1'
nc_server.force_mac_addr = '00:90:00:00:00:01' nc_server.force_mac_addr = '00:90:00:00:00:01'
nc_server.app = node.NetperfServer() nc_server.app = node.NetperfServer()
server.set_config(nc_server)
server = sim.Gem5Host(nc_server)
server.name = 'server'
e.add_host(server) e.add_host(server)
client = sim.Gem5Host() # client
client.name = 'client'
nc_client = node.E1000LinuxNode() nc_client = node.E1000LinuxNode()
nc_client.prefix = 24 nc_client.prefix = 24
nc_client.ip = '10.0.0.2' nc_client.ip = '10.0.0.2'
...@@ -59,7 +59,9 @@ for internal in [True, False]: ...@@ -59,7 +59,9 @@ for internal in [True, False]:
nc_client.app.server_ip = '10.0.0.1' nc_client.app.server_ip = '10.0.0.1'
nc_client.app.duration_tp = -1000000 nc_client.app.duration_tp = -1000000
nc_client.app.duration_lat = -1000 nc_client.app.duration_lat = -1000
client.set_config(nc_client)
client = sim.Gem5Host(nc_client)
client.name = 'client'
client.wait = True client.wait = True
e.add_host(client) e.add_host(client)
......
...@@ -74,8 +74,8 @@ for n_client in num_client_types: ...@@ -74,8 +74,8 @@ for n_client in num_client_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -72,8 +72,8 @@ for rate in rate_types: ...@@ -72,8 +72,8 @@ for rate in rate_types:
HostClass = sim.QemuHost HostClass = sim.QemuHost
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing(node_config: node.NodeConfig):
h = sim.QemuHost() h = sim.QemuHost(node_config)
h.sync = True h.sync = True
return h return h
......
...@@ -54,15 +54,14 @@ def create_basic_hosts( ...@@ -54,15 +54,14 @@ def create_basic_hosts(
#nic.name = '%s.%d' % (name_prefix, i) #nic.name = '%s.%d' % (name_prefix, i)
nic.set_network(net) nic.set_network(net)
host = host_class()
host.name = f'{name_prefix}.{i}'
node_config = nc_class() node_config = nc_class()
node_config.prefix = ip_prefix node_config.prefix = ip_prefix
ip = ip_start + i ip = ip_start + i
node_config.ip = f'10.0.{int(ip / 256)}.{ip % 256}' node_config.ip = f'10.0.{int(ip / 256)}.{ip % 256}'
node_config.app = app_class() node_config.app = app_class()
host.set_config(node_config)
host = host_class(node_config)
host.name = f'{name_prefix}.{i}'
host.add_nic(nic) host.add_nic(nic)
e.add_nic(nic) e.add_nic(nic)
...@@ -103,15 +102,14 @@ def create_multinic_hosts( ...@@ -103,15 +102,14 @@ def create_multinic_hosts(
#nic.name = '%s.%d' % (name_prefix, i) #nic.name = '%s.%d' % (name_prefix, i)
nic.set_network(net) nic.set_network(net)
host = host_class()
host.name = f'{name_prefix}.{i}'
node_config = nc_class() node_config = nc_class()
node_config.prefix = ip_prefix node_config.prefix = ip_prefix
ip = ip_start + i ip = ip_start + i
node_config.ip = f'10.0.{int(ip / 256)}.{ip % 256}' node_config.ip = f'10.0.{int(ip / 256)}.{ip % 256}'
node_config.app = app_class() node_config.app = app_class()
host.set_config(node_config)
host = host_class(node_config)
host.name = f'{name_prefix}.{i}'
host.add_nic(nic) host.add_nic(nic)
e.add_host(host) e.add_host(host)
...@@ -148,15 +146,14 @@ def create_dctcp_hosts( ...@@ -148,15 +146,14 @@ def create_dctcp_hosts(
#nic.name = '%s.%d' % (name_prefix, i) #nic.name = '%s.%d' % (name_prefix, i)
nic.set_network(net) nic.set_network(net)
host = host_class()
host.name = f'{name_prefix}.{i}'
host.cpu_freq = cpu_freq
node_config = nc_class() node_config = nc_class()
node_config.mtu = mtu node_config.mtu = mtu
node_config.ip = f'192.168.64.{ip_start + i}' node_config.ip = f'192.168.64.{ip_start + i}'
node_config.app = app_class() node_config.app = app_class()
host.set_config(node_config)
host = host_class(node_config)
host.name = f'{name_prefix}.{i}'
host.cpu_freq = cpu_freq
host.add_nic(nic) host.add_nic(nic)
e.add_nic(nic) e.add_nic(nic)
......
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