Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
53fa8c2d
Commit
53fa8c2d
authored
Jun 10, 2022
by
Hejing Li
Browse files
nodeconfig: add Iperf appconfig for deterministic experiment
Also add no checkpoint parameter
parent
b0e1a500
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
1 deletion
+96
-1
experiments/pyexps/ae/determ.py
experiments/pyexps/ae/determ.py
+74
-0
experiments/simbricks/nodeconfig.py
experiments/simbricks/nodeconfig.py
+22
-1
No files found.
experiments/pyexps/ae/
t1_combination
.py
→
experiments/pyexps/ae/
determ
.py
View file @
53fa8c2d
...
@@ -20,90 +20,55 @@
...
@@ -20,90 +20,55 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
########################################################################
# This script is for reproducing [Table 1] in the paper.
# It generates experiments for all combinations of simulation.
#
# Host type has qemu-kvm(qemu in short), gem5-timing-mode(gt), qemu-timing-mode(qt)
# Nic type has Intel_i40e behavioral model(ib), corundum behavioral model(cb), corundum verilator(cv)
# Net type has Switch behavioral model(sw), ns-3(ns3)
#
# In each simulation, two hosts are connected by a switch
# [HOST_0] - [NIC_0] ---- [SWITCH] ---- [NIC_1] - [HOST_1]
# server client
#
# The server host runs netperf server and client host runs TCP_RR and
# TCP_STREAM test
#
# The command to run all the experiments is:
# $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose
########################################################################
import
simbricks.experiments
as
exp
import
simbricks.experiments
as
exp
import
simbricks.simulators
as
sim
import
simbricks.simulators
as
sim
import
simbricks.nodeconfig
as
node
import
simbricks.nodeconfig
as
node
from
simbricks.simulator_utils
import
create_basic_hosts
from
simbricks.simulator_utils
import
create_basic_hosts
host_types
=
[
'qemu'
,
'gt'
,
'qt'
]
nic_types
=
[
'ib'
,
'cb'
,
'cv'
]
host_types
=
[
'gt'
]
net_types
=
[
'sw'
,
'ns3'
]
nic_types
=
[
'ib'
]
net_types
=
[
'sw'
]
num_cores
=
1
n_client
=
1
experiments
=
[]
experiments
=
[]
# Create multiple experiments with different simulator permutations, which can
e
=
exp
.
Experiment
(
'dt-gt-ib-sw'
)
# be filtered later.
net
=
sim
.
SwitchNet
()
for
host_type
in
host_types
:
e
.
add_network
(
net
)
for
nic_type
in
nic_types
:
host_class
=
sim
.
Gem5Host
for
net_type
in
net_types
:
e
.
checkpoint
=
False
e
=
exp
.
Experiment
(
'nf-'
+
host_type
+
'-'
+
net_type
+
'-'
+
nic_type
)
# network
nic_class
=
sim
.
I40eNIC
if
net_type
==
'sw'
:
nc_class
=
node
.
I40eLinuxNode
net
=
sim
.
SwitchNet
()
elif
net_type
==
'ns3'
:
# create a host
net
=
sim
.
NS3BridgeNet
()
servers
=
create_basic_hosts
(
e
,
1
,
'server'
,
net
,
nic_class
,
host_class
,
else
:
nc_class
,
node
.
IperfUDPServer
,
ip_start
=
2
)
raise
NameError
(
net_type
)
e
.
add_network
(
net
)
servers
[
0
].
node_config
.
nockp
=
1
servers
[
0
].
cpu_freq
=
'3GHz'
# host
# create a host
if
host_type
==
'qemu'
:
clients
=
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
nic_class
,
host_class
,
host_class
=
sim
.
QemuHost
nc_class
,
node
.
IperfUDPShortClient
,
ip_start
=
2
)
elif
host_type
==
'qt'
:
def
qemu_timing
():
h
=
sim
.
QemuHost
()
clients
[
0
].
cpu_freq
=
'3GHz'
h
.
sync
=
True
clients
[
0
].
node_config
.
cores
=
num_cores
return
h
clients
[
0
].
node_config
.
app
.
is_sleep
=
1
host_class
=
qemu_timing
clients
[
0
].
node_config
.
nockp
=
1
elif
host_type
==
'gt'
:
clients
[
0
].
node_config
.
app
.
is_last
=
True
host_class
=
sim
.
Gem5Host
clients
[
0
].
wait
=
True
e
.
checkpoint
=
True
else
:
print
(
e
.
name
)
raise
NameError
(
host_type
)
# nic
# add to experiments
if
nic_type
==
'ib'
:
experiments
.
append
(
e
)
nic_class
=
sim
.
I40eNIC
nc_class
=
node
.
I40eLinuxNode
elif
nic_type
==
'cb'
:
nic_class
=
sim
.
CorundumBMNIC
nc_class
=
node
.
CorundumLinuxNode
elif
nic_type
==
'cv'
:
nic_class
=
sim
.
CorundumVerilatorNIC
nc_class
=
node
.
CorundumLinuxNode
else
:
raise
NameError
(
nic_type
)
# create servers and clients
servers
=
create_basic_hosts
(
e
,
1
,
'server'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NetperfServer
)
clients
=
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NetperfClient
,
ip_start
=
2
)
for
c
in
clients
:
c
.
wait
=
True
c
.
node_config
.
app
.
server_ip
=
servers
[
0
].
node_config
.
ip
# add to experiments
experiments
.
append
(
e
)
experiments/simbricks/nodeconfig.py
View file @
53fa8c2d
...
@@ -61,13 +61,18 @@ class NodeConfig(object):
...
@@ -61,13 +61,18 @@ class NodeConfig(object):
"""App to be run on simulated host."""
"""App to be run on simulated host."""
mtu
=
1500
mtu
=
1500
"""Networking MTU."""
"""Networking MTU."""
nockp
=
0
"""Do not make checkpoint in Gem5."""
def
config_str
(
self
):
def
config_str
(
self
):
if
self
.
sim
==
'qemu'
:
if
self
.
sim
==
'qemu'
:
cp_es
=
[]
cp_es
=
[]
exit_es
=
[
'poweroff -f'
]
exit_es
=
[
'poweroff -f'
]
else
:
else
:
cp_es
=
[
'm5 checkpoint'
]
if
(
self
.
nockp
):
cp_es
=
[]
else
:
cp_es
=
[
'm5 checkpoint'
]
exit_es
=
[
'm5 exit'
]
exit_es
=
[
'm5 exit'
]
es
=
self
.
prepare_pre_cp
()
+
self
.
app
.
prepare_pre_cp
()
+
cp_es
+
\
es
=
self
.
prepare_pre_cp
()
+
self
.
app
.
prepare_pre_cp
()
+
cp_es
+
\
...
@@ -386,6 +391,22 @@ class IperfUDPClient(AppConfig):
...
@@ -386,6 +391,22 @@ class IperfUDPClient(AppConfig):
return
cmds
return
cmds
class
IperfUDPShortClient
(
AppConfig
):
server_ip
=
'10.0.0.1'
rate
=
'150m'
is_last
=
False
def
run_cmds
(
self
,
node
):
cmds
=
[
'sleep 1'
,
'iperf -c '
+
self
.
server_ip
+
' -u -n 1 '
]
if
self
.
is_last
:
cmds
.
append
(
'sleep 0.5'
)
else
:
cmds
.
append
(
'sleep 10'
)
return
cmds
class
IperfUDPClientSleep
(
AppConfig
):
class
IperfUDPClientSleep
(
AppConfig
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment