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
fd32e173
Commit
fd32e173
authored
Jan 28, 2024
by
Hejing Li
Browse files
add homa benchmark tcp
parent
d6f58633
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
67 deletions
+76
-67
experiments/pyexps/homa_simple_ping.py
experiments/pyexps/homa_simple_ping.py
+61
-57
experiments/simbricks/orchestration/nodeconfig.py
experiments/simbricks/orchestration/nodeconfig.py
+15
-10
No files found.
experiments/pyexps/homa_simple_ping.py
View file @
fd32e173
...
@@ -35,70 +35,74 @@ from simbricks.orchestration.simulators import QemuHost, Gem5Host, I40eNIC, Swit
...
@@ -35,70 +35,74 @@ from simbricks.orchestration.simulators import QemuHost, Gem5Host, I40eNIC, Swit
experiments
=
[]
experiments
=
[]
workload
=
[
1
,
2
,
3
,
4
,
5
]
workload
=
[
1
,
2
,
3
,
4
,
5
]
host_types
=
[
'qemu'
,
'gem5'
,
'qt'
]
host_types
=
[
'qemu'
,
'gem5'
,
'qt'
]
for
w
in
workload
:
protocol
=
[
'tcp'
,
'dctcp'
,
'homa'
]
for
host_type
in
host_types
:
for
p
in
protocol
:
for
w
in
workload
:
for
host_type
in
host_types
:
e
=
Experiment
(
f
'single_
homa
_w
{
w
}
_
'
+
host_type
)
e
=
Experiment
(
f
'single_
{
p
}
_w
{
w
}
_
{
host_type
}
'
)
e
.
checkpoint
=
False
# use checkpoint and restore to speed up simulation
e
.
checkpoint
=
False
# use checkpoint and restore to speed up simulation
# host
# host
if
host_type
==
'qemu'
:
if
host_type
==
'qemu'
:
HostClass
=
QemuHost
HostClass
=
QemuHost
elif
host_type
==
'qt'
:
elif
host_type
==
'qt'
:
def
qemu_timing
(
node_config
:
NodeConfig
):
def
qemu_timing
(
node_config
:
NodeConfig
):
h
=
QemuHost
(
node_config
)
h
=
QemuHost
(
node_config
)
h
.
sync
=
True
h
.
sync
=
True
return
h
return
h
HostClass
=
qemu_timing
HostClass
=
qemu_timing
elif
host_type
==
'gem5'
:
elif
host_type
==
'gem5'
:
HostClass
=
Gem5Host
HostClass
=
Gem5Host
e
.
checkpoint
=
True
e
.
checkpoint
=
True
else
:
else
:
raise
NameError
(
host_type
)
raise
NameError
(
host_type
)
# create client
# create client
client_config
=
I40eLinuxNode
()
# boot Linux with i40e NIC driver
client_config
=
I40eLinuxNode
()
# boot Linux with i40e NIC driver
client_config
.
disk_image
=
'homa'
client_config
.
disk_image
=
'homa'
client_config
.
ip
=
'10.0.0.1'
client_config
.
ip
=
'10.0.0.1'
client_config
.
app
=
HomaClientNode
()
client_config
.
app
=
HomaClientNode
()
client
=
HostClass
(
client_config
)
client_config
.
app
.
protocol
=
p
# client.sync = False
client
=
HostClass
(
client_config
)
client
.
name
=
'client'
# client.sync = False
client
.
wait
=
True
# wait for client simulator to finish execution
client
.
name
=
'client'
e
.
add_host
(
client
)
client
.
wait
=
True
# wait for client simulator to finish execution
e
.
add_host
(
client
)
# attach client's NIC
# attach client's NIC
client_nic
=
I40eNIC
()
client_nic
=
I40eNIC
()
e
.
add_nic
(
client_nic
)
e
.
add_nic
(
client_nic
)
client
.
add_nic
(
client_nic
)
client
.
add_nic
(
client_nic
)
# create server
# create server
server_config
=
I40eLinuxNode
()
# boot Linux with i40e NIC driver
server_config
=
I40eLinuxNode
()
# boot Linux with i40e NIC driver
server_config
.
disk_image
=
'homa'
server_config
.
disk_image
=
'homa'
server_config
.
ip
=
'10.0.0.2'
server_config
.
ip
=
'10.0.0.2'
server_config
.
app
=
HomaServerNode
()
server_config
.
app
=
HomaServerNode
()
server
=
HostClass
(
server_config
)
server_config
.
app
.
protocol
=
p
# server.sync = False
server
=
HostClass
(
server_config
)
server
.
name
=
'server'
# server.sync = False
# server.wait = True
server
.
name
=
'server'
e
.
add_host
(
server
)
# server.wait = True
e
.
add_host
(
server
)
# attach server's NIC
# attach server's NIC
server_nic
=
I40eNIC
()
server_nic
=
I40eNIC
()
e
.
add_nic
(
server_nic
)
e
.
add_nic
(
server_nic
)
server
.
add_nic
(
server_nic
)
server
.
add_nic
(
server_nic
)
# connect NICs over network
# connect NICs over network
network
=
SwitchNet
()
network
=
SwitchNet
()
e
.
add_network
(
network
)
e
.
add_network
(
network
)
client_nic
.
set_network
(
network
)
client_nic
.
set_network
(
network
)
server_nic
.
set_network
(
network
)
server_nic
.
set_network
(
network
)
# set more interesting link latencies than default
# set more interesting link latencies than default
eth_latency
=
500
# 500 us
eth_latency
=
500
# 500 us
network
.
eth_latency
=
eth_latency
network
.
eth_latency
=
eth_latency
client_nic
.
eth_latency
=
eth_latency
client_nic
.
eth_latency
=
eth_latency
server_nic
.
eth_latency
=
eth_latency
server_nic
.
eth_latency
=
eth_latency
experiments
.
append
(
e
)
experiments
.
append
(
e
)
experiments/simbricks/orchestration/nodeconfig.py
View file @
fd32e173
...
@@ -450,6 +450,7 @@ class HomaClientNode(AppConfig):
...
@@ -450,6 +450,7 @@ class HomaClientNode(AppConfig):
self
.
id
=
0
self
.
id
=
0
self
.
cluster_size
=
2
self
.
cluster_size
=
2
self
.
workload
=
2
self
.
workload
=
2
self
.
protocol
=
'homa'
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
return
super
().
prepare_post_cp
()
+
[
return
super
().
prepare_post_cp
()
+
[
...
@@ -465,15 +466,21 @@ class HomaClientNode(AppConfig):
...
@@ -465,15 +466,21 @@ class HomaClientNode(AppConfig):
cmd
.
append
(
'mount -t sysfs sysfs /sys'
)
cmd
.
append
(
'mount -t sysfs sysfs /sys'
)
cmd
.
append
(
'mount -t proc proc /proc'
)
cmd
.
append
(
'mount -t proc proc /proc'
)
cmd
.
append
(
'sleep 1'
)
cmd
.
append
(
'sleep 1'
)
cmd
.
append
(
f
'/root/homa/util/cp_node client --protocol homa --workload w
{
self
.
workload
}
&'
)
cmd
.
append
(
f
'/root/homa/util/cp_node client --protocol '
+
self
.
protocol
+
' &'
)
# cmd.append('sleep 2')
# cmd.append('touch /root/homa/util/client.tt')
# cmd.append('/root/homa/util/ttprint.py > /root/homa/util/client.tt')
cmd
.
append
(
'sleep 10'
)
cmd
.
append
(
'sleep 10'
)
cmd
.
append
(
'pkill cp_node'
)
cmd
.
append
(
'pkill cp_node'
)
# cmd.append('cat /root/homa/util/client.tt')
return
cmd
return
cmd
# 'touch /root/homa/util/client.tt'
# '/root/homa/util/ttprint.py > /root/homa/util/client.tt'
class
HomaServerNode
(
AppConfig
):
class
HomaServerNode
(
AppConfig
):
def
__init__
(
self
)
->
None
:
super
().
__init__
()
self
.
protocol
=
'homa'
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
return
super
().
prepare_post_cp
()
+
[
return
super
().
prepare_post_cp
()
+
[
'insmod homa.ko'
'insmod homa.ko'
...
@@ -487,16 +494,14 @@ class HomaServerNode(AppConfig):
...
@@ -487,16 +494,14 @@ class HomaServerNode(AppConfig):
cmd
=
[]
cmd
=
[]
cmd
.
append
(
'mount -t sysfs sysfs /sys'
)
cmd
.
append
(
'mount -t sysfs sysfs /sys'
)
cmd
.
append
(
'mount -t proc proc /proc'
)
cmd
.
append
(
'mount -t proc proc /proc'
)
cmd
.
append
(
'/root/homa/util/cp_node server --protocol homa &'
)
cmd
.
append
(
'/root/homa/util/cp_node server --protocol '
+
self
.
protocol
+
' &'
)
# cmd.append('sleep 2')
# cmd.append('touch /root/homa/util/server.tt')
# cmd.append('/root/homa/util/ttprint.py > /root/homa/util/server.tt')
cmd
.
append
(
'sleep 10'
)
cmd
.
append
(
'sleep 10'
)
cmd
.
append
(
'pkill cp_node'
)
cmd
.
append
(
'pkill cp_node'
)
# cmd.append('cat /root/homa/util/server.tt')
return
cmd
return
cmd
# 'sysctl -w .net.homa.poll_usecs=300000'
# 'sleep 1'
# 'touch /root/homa/util/server.tt'
# '/root/homa/util/ttprint.py > /root/homa/util/server.tt'
# 'cat /root/homa/util/server.tt'
class
IdleHost
(
AppConfig
):
class
IdleHost
(
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