scale_load.py 4.9 KB
Newer Older
Antoine Kaufmann's avatar
Antoine Kaufmann committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright 2021 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

23
import simbricks.experiments as exp
24
import simbricks.nodeconfig as node
Jonas Kaufmann's avatar
Jonas Kaufmann committed
25
import simbricks.simulators as sim
26
from simbricks.simulator_utils import create_basic_hosts
27

Hejing Li's avatar
Hejing Li committed
28
29
# iperf UDP Load Scalability test
# naming convention following host-nic-net
30
31
32
33
34
# host: gem5-timing
# nic:  cv/cb/ib
# net:  wire/switch/dumbbell/bridge
# app: UDPs

35
host_types = ['gt', 'qt', 'qemu']
Jonas Kaufmann's avatar
Jonas Kaufmann committed
36
nic_types = ['cv', 'cb', 'ib']
Hejing Li's avatar
Hejing Li committed
37
net_types = ['wire', 'sw', 'br']
38
app = ['UDPs']
39

40
41
rate_types = []
rate_start = 0
Hejing Li's avatar
Hejing Li committed
42
43
rate_end = 1000
rate_step = 100
44
45
46
for r in range(rate_start, rate_end + 1, rate_step):
    rate = f'{r}m'
    rate_types.append(rate)
47
48
49

experiments = []

50
51
52
53
54
for rate in rate_types:
    for host_type in host_types:
        for nic_type in nic_types:
            for net_type in net_types:

Jonas Kaufmann's avatar
Jonas Kaufmann committed
55
56
57
58
                e = exp.Experiment(
                    host_type + '-' + nic_type + '-' + net_type + '-Load-' +
                    rate
                )
59
                # network
Hejing Li's avatar
Hejing Li committed
60
                if net_type == 'sw':
61
                    NetClass = sim.SwitchNet()
Hejing Li's avatar
Hejing Li committed
62
                elif net_type == 'br':
63
                    NetClass = sim.NS3BridgeNet()
64
                elif net_type == 'wire':
65
                    NetClass = sim.WireNet()
66
67
                else:
                    raise NameError(net_type)
68
                e.add_network(NetClass)
69
70
71

                # host
                if host_type == 'qemu':
72
                    HostClass = sim.QemuHost
73
                elif host_type == 'qt':
Jonas Kaufmann's avatar
Jonas Kaufmann committed
74

75
76
77
78
                    def qemu_timing():
                        h = sim.QemuHost()
                        h.sync = True
                        return h
Jonas Kaufmann's avatar
Jonas Kaufmann committed
79

80
                    HostClass = qemu_timing
81
                elif host_type == 'gt':
82
                    HostClass = sim.Gem5Host
Hejing Li's avatar
Hejing Li committed
83
                    e.checkpoint = True
84
85
86
87
88
                else:
                    raise NameError(host_type)

                # nic
                if nic_type == 'ib':
89
90
                    NicClass = sim.I40eNIC
                    NcClass = node.I40eLinuxNode
91
                elif nic_type == 'cb':
92
93
                    NicClass = sim.CorundumBMNIC
                    NcClass = node.CorundumLinuxNode
94
                elif nic_type == 'cv':
95
96
                    NicClass = sim.CorundumVerilatorNIC
                    NcClass = node.CorundumLinuxNode
97
98
99
100
                else:
                    raise NameError(nic_type)

                # create servers and clients
Jonas Kaufmann's avatar
Jonas Kaufmann committed
101
102
103
104
                servers = create_basic_hosts(
                    e,
                    1,
                    'server',
105
106
107
108
                    NetClass,
                    NicClass,
                    HostClass,
                    NcClass,
Jonas Kaufmann's avatar
Jonas Kaufmann committed
109
110
                    node.IperfUDPServer
                )
111
112

                if rate == '0m':
Jonas Kaufmann's avatar
Jonas Kaufmann committed
113
114
115
116
                    clients = create_basic_hosts(
                        e,
                        1,
                        'client',
117
118
119
120
                        NetClass,
                        NicClass,
                        HostClass,
                        NcClass,
Jonas Kaufmann's avatar
Jonas Kaufmann committed
121
122
123
                        node.IperfUDPClientSleep,
                        ip_start=2
                    )
124
                else:
Jonas Kaufmann's avatar
Jonas Kaufmann committed
125
126
127
128
                    clients = create_basic_hosts(
                        e,
                        1,
                        'client',
129
130
131
132
                        NetClass,
                        NicClass,
                        HostClass,
                        NcClass,
Jonas Kaufmann's avatar
Jonas Kaufmann committed
133
134
135
                        node.IperfUDPClient,
                        ip_start=2
                    )
136
137
138

                clients[0].wait = True
                clients[0].node_config.app.server_ip = servers[0].node_config.ip
Hejing Li's avatar
Hejing Li committed
139
                clients[0].node_config.app.is_last = True
140
141
142
143
144
145
                clients[0].node_config.app.rate = rate

                print(e.name)

                # add to experiments
                experiments.append(e)