"script/profile_splitK_gemm.sh" did not exist on "e1a3fff67510be2af023b31587e411230b994631"
netperf_sysconf.py 3.14 KB
Newer Older
Hejing Li's avatar
Hejing Li committed
1
2
3
4

import simbricks.orchestration.system as system
import simbricks.orchestration.simulation as sim
import simbricks.orchestration.instantiation as inst
5
6
7
8
9
10
11
12
13
"""
Netperf Example:
One Client: Host_0, One Server: Host1 connected through a switch
HOST0 -- NIC0 ------ SWITCH ------ NIC1 -- HOST1

This scripts generates the experiments with all the combinations of different execution modes
"""

# host_types = ['qemu', 'gem5', 'qt']
Hejing Li's avatar
Hejing Li committed
14
host_types = ['gem5']
15
nic_types = ['i40e', 'vr']
16
17
18
net_types = ['switch']
experiments = []

Hejing Li's avatar
Hejing Li committed
19
sys = system.System()
20
21

# create a host instance and a NIC instance then install the NIC on the host
Hejing Li's avatar
Hejing Li committed
22
23
24
25
26
27
host0 = system.I40ELinuxHost(sys)
pcie0 = system.PCIeHostInterface(host0)
host0.add_if(pcie0)
nic0 = system.IntelI40eNIC(sys)
nic0.add_ipv4('10.0.0.1')
pcichannel0 = system.PCIeChannel(pcie0, nic0.pci_if)
28

Hejing Li's avatar
Hejing Li committed
29
30
31
32
33
34
35
36
# create a host instance and a NIC instance then install the NIC on the host
host1 = system.I40ELinuxHost(sys)
pcie1 = system.PCIeHostInterface(host1)
host1.add_if(pcie0)
nic1 = system.IntelI40eNIC(sys)
nic1.add_ipv4('10.0.0.2')
pcichannel1 = system.PCIeChannel(pcie1, nic1.pci_if)

Hejing Li's avatar
Hejing Li committed
37
38
39
40
41
42
# create switch and its ports
switch = system.EthSwitch(sys)
netif0 = system.EthInterface(switch)
switch.if_add(netif0)
netif1 = system.EthInterface(switch)
switch.if_add(netif1)
43

Hejing Li's avatar
Hejing Li committed
44
45
46
# create channels and connect the switch to the host nics
ethchannel0 = system.EthChannel(switch.eth_ifs[0], nic0.eth_if)
ethchannel1 = system.EthChannel(switch.eth_ifs[1], nic1.eth_if)
47
48

# configure the software to run on the host
Hejing Li's avatar
Hejing Li committed
49
50
host0.add_app(system.NetperfClient(host0, nic1.ip))
host1.add_app(system.NetperfServer(host1))
51
52
53
54
55
56
57

"""
Execution Config
"""
for host_type in host_types:
    for nic_type in nic_types:
        for net_type in net_types:
58
            e = sim.Simulation(
59
60
61
62
                'n-' + host_type + '-' + nic_type + '-' + net_type
            )
            # Host
            if host_type == 'gem5':
63
                host_sim = sim.Gem5Sim
64
65
66
            elif host_type == 'qemu':

                def qemu_sim(e):
67
                    h = sim.QemuSim(e)
68
69
70
71
72
                    h.sync = False
                    return h
                host_sim = qemu_sim

            elif host_type == 'qt':
73
                host_sim = sim.QemuSim
74
75
            else:
                raise NameError(host_type)
76

77
            # NIC
78
79
            if nic_type == 'i40e':
                nic_sim = sim.I40eNicSim
80
            elif nic_type == 'vr':
81
                nic_sim = sim.CorundumVerilatorNICSim
82
83
84
85
86
            else:
                raise NameError(nic_type)

            # Net
            if net_type == 'switch':
87
                net_sim = sim.SwitchNet
88
89
90
            else:
                raise NameError(net_type)

91
            host_inst0 = host_sim(e)
92
93
            host_inst0.add(host0)

94
            host_inst1 = host_sim(e)
95
96
            host_inst1.add(host1)

97
            nic_inst0 = nic_sim(e)
98
99
            nic_inst0.add(nic0)

100
            nic_inst1 = nic_sim(e)
101
102
            nic_inst1.add(nic1)

103
            net_inst = net_sim(e)
104
105
106
107
            net_inst.add(switch)
            
            print(e.name + "   all simulators:")
            sims = e.all_simulators()
108
109
            for s in sims:
                print(s)
110

Hejing Li's avatar
Hejing Li committed
111
            experiments.append(e)