Commit 978a6cb8 authored by Hejing Li's avatar Hejing Li
Browse files

ScaleHost script minor change

parent dfa9594d
...@@ -34,13 +34,13 @@ import simbricks.nodeconfig as node ...@@ -34,13 +34,13 @@ import simbricks.nodeconfig as node
host_types = ['gt', 'qt', 'qemu'] host_types = ['gt', 'qt', 'qemu']
nic_types = ['cv','cb','ib'] nic_types = ['cv','cb','ib']
net_types = ['switch', 'bridge'] net_types = ['sw', 'br']
app = ['UDPmicro'] 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, 3, 7, 15, 31] num_client_types = [1, 4, 9, 14, 20]
#for n in range(1, num_client_max + 1, num_client_step): #for n in range(1, num_client_max + 1, num_client_step):
# num_client_types.append(n) # num_client_types.append(n)
# print(n) # print(n)
...@@ -59,11 +59,11 @@ for n_client in num_client_types: ...@@ -59,11 +59,11 @@ for n_client in num_client_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 + '-UDPmicro-' + f'{total_rate}' + 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 == 'switch': if net_type == 'sw':
net = sim.SwitchNet() net = sim.SwitchNet()
elif net_type == 'bridge': elif net_type == 'br':
net = sim.NS3BridgeNet() net = sim.NS3BridgeNet()
else: else:
raise NameError(net_type) raise NameError(net_type)
...@@ -105,12 +105,13 @@ for n_client in num_client_types: ...@@ -105,12 +105,13 @@ for n_client in num_client_types:
clients = sim.create_basic_hosts(e, n_client, 'client', net, nic_class, host_class, clients = sim.create_basic_hosts(e, n_client, 'client', net, nic_class, host_class,
nc_class, node.IperfUDPClient, ip_start=2) nc_class, node.IperfUDPClient, ip_start=2)
clients[n_client-1].node_config.app = node.IperfUDPClientLast() clients[n_client-1].node_config.app.is_last = True
clients[n_client-1].wait = 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
print(e.name) print(e.name)
......
...@@ -317,11 +317,18 @@ class IperfUDPServer(AppConfig): ...@@ -317,11 +317,18 @@ class IperfUDPServer(AppConfig):
class IperfTCPClient(AppConfig): class IperfTCPClient(AppConfig):
server_ip = '10.0.0.1' server_ip = '10.0.0.1'
procs = 1 procs = 1
is_last = False
def run_cmds(self, node): def run_cmds(self, node):
return ['sleep 1',
cmds = ['sleep 1',
'iperf -l 32M -w 32M -c ' + self.server_ip + ' -i 1 -P ' + 'iperf -l 32M -w 32M -c ' + self.server_ip + ' -i 1 -P ' +
str(self.procs)] str(self.procs)]
if self.is_last:
cmds.append('sleep 0.5')
else:
cmds.append('sleep 10')
return cmds
class IperfUDPClient(AppConfig): class IperfUDPClient(AppConfig):
server_ip = '10.0.0.1' server_ip = '10.0.0.1'
...@@ -335,7 +342,7 @@ class IperfUDPClient(AppConfig): ...@@ -335,7 +342,7 @@ class IperfUDPClient(AppConfig):
if self.is_last: if self.is_last:
cmds.append('sleep 0.5') cmds.append('sleep 0.5')
else: else:
cmds.append('sleep infinity') cmds.append('sleep 10')
return cmds return cmds
......
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