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
b33c5a01
Commit
b33c5a01
authored
Jan 22, 2024
by
Hejing Li
Browse files
add homa bigger scale experiment
parent
7060491d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
2 deletions
+143
-2
experiments/pyexps/homa.py
experiments/pyexps/homa.py
+94
-0
experiments/simbricks/orchestration/nodeconfig.py
experiments/simbricks/orchestration/nodeconfig.py
+49
-2
No files found.
experiments/pyexps/homa.py
0 → 100644
View file @
b33c5a01
# 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.
"""
Script for HOMA large scale benchmark. 40 hosts.
"""
import
simbricks.orchestration.experiments
as
exp
import
simbricks.orchestration.nodeconfig
as
node
import
simbricks.orchestration.simulators
as
sim
from
simbricks.orchestration.simulator_utils
import
create_basic_hosts
host_types
=
[
'qemu'
,
'gem5'
,
'qt'
]
net_types
=
[
'sw'
,
'ns3'
]
num_node
=
[
2
,
5
,
10
,
20
,
40
]
experiments
=
[]
# Create multiple experiments with different simulator permutations, which can
# be filtered later.
for
host_type
in
host_types
:
for
net_type
in
net_types
:
for
n
in
num_node
:
e
=
exp
.
Experiment
(
'homa-'
+
host_type
+
'-'
+
net_type
+
f
'-
{
n
}
'
)
# network
if
net_type
==
'sw'
:
net
=
sim
.
SwitchNet
()
elif
net_type
==
'ns3'
:
net
=
sim
.
NS3BridgeNet
()
else
:
raise
NameError
(
net_type
)
e
.
add_network
(
net
)
# host
if
host_type
==
'qemu'
:
HostClass
=
sim
.
QemuHost
elif
host_type
==
'qt'
:
def
qemu_timing
(
node_config
:
node
.
NodeConfig
):
h
=
sim
.
QemuHost
(
node_config
)
h
.
sync
=
True
return
h
HostClass
=
qemu_timing
elif
host_type
==
'gem5'
:
HostClass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
else
:
raise
NameError
(
host_type
)
# nic
NicClass
=
sim
.
I40eNIC
NcClass
=
node
.
I40eLinuxNode
# create servers and clients
nodes
=
create_basic_hosts
(
e
,
n
,
'node'
,
net
,
NicClass
,
HostClass
,
NcClass
,
node
.
HomaCluster
)
nodes
[
0
].
node_config
.
app
.
is_node_zero
=
True
for
c
in
nodes
:
c
.
node_config
.
disk_image
=
'homa'
c
.
wait
=
True
# add to experiments
experiments
.
append
(
e
)
experiments/simbricks/orchestration/nodeconfig.py
View file @
b33c5a01
...
@@ -395,6 +395,32 @@ class LinuxFEMUNode(NodeConfig):
...
@@ -395,6 +395,32 @@ class LinuxFEMUNode(NodeConfig):
return
super
().
prepare_post_cp
()
+
l
return
super
().
prepare_post_cp
()
+
l
class
HomaCluster
(
AppConfig
):
def
__init__
(
self
)
->
None
:
super
().
__init__
()
self
.
is_node_zero
=
False
self
.
cluster_size
=
2
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
return
super
().
prepare_post_cp
()
+
[
'insmod homa.ko'
]
# pylint: disable=consider-using-with
def
config_files
(
self
)
->
tp
.
Dict
[
str
,
tp
.
IO
]:
m
=
{
'homa.ko'
:
open
(
'../images/homa/homa.ko'
,
'rb'
)}
return
{
**
m
,
**
super
().
config_files
()}
def
run_cmds
(
self
,
node
:
NodeConfig
)
->
tp
.
List
[
str
]:
cmd
=
[
'mount -t sysfs sysfs /sys'
]
if
(
self
.
is_node_zero
):
cmd
.
append
(
f
'/root/homa/util/cp_vs_tcp -n
{
self
.
cluster_size
}
-w w4 -b 10 --protocol homa'
)
else
:
cmd
.
append
(
'service ssh restart'
)
cmd
.
append
(
'sleep infinity'
)
return
cmd
class
HomaClientNode
(
AppConfig
):
class
HomaClientNode
(
AppConfig
):
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
...
@@ -409,10 +435,21 @@ class HomaClientNode(AppConfig):
...
@@ -409,10 +435,21 @@ class HomaClientNode(AppConfig):
def
run_cmds
(
self
,
node
:
NodeConfig
)
->
tp
.
List
[
str
]:
def
run_cmds
(
self
,
node
:
NodeConfig
)
->
tp
.
List
[
str
]:
return
[
return
[
'echo "10.0.0.2 node1" >> /etc/hosts'
,
'echo "10.0.0.2 node1" >> /etc/hosts'
,
'mount -t sysfs sysfs /sys'
,
'mount -t proc proc /proc'
,
#'cat /etc/hosts',
#'cat /etc/hosts',
#'ping 10.0.0.2 -c 3',
#'ping 10.0.0.2 -c 3',
#'ping node1',
#'ping node1',
'/root/homa/util/cp_node client'
#'sysctl -w .net.homa.poll_usecs=300000',
'/root/homa/util/cp_node client --protocol homa'
,
# '/root/homa/util/cp_vs_tcp --help',
# 'sleep 1',
# 'touch /root/homa/util/client.tt',
# 'sleep 1',
# '/root/homa/util/ttprint.py > /root/homa/util/client.tt',
# 'pkill cp_node',
# 'cat /root/homa/util/client.tt'
# 'cat /proc/net/homa_metrics'
]
]
class
HomaServerNode
(
AppConfig
):
class
HomaServerNode
(
AppConfig
):
...
@@ -428,9 +465,19 @@ class HomaServerNode(AppConfig):
...
@@ -428,9 +465,19 @@ class HomaServerNode(AppConfig):
def
run_cmds
(
self
,
node
:
NodeConfig
)
->
tp
.
List
[
str
]:
def
run_cmds
(
self
,
node
:
NodeConfig
)
->
tp
.
List
[
str
]:
return
[
return
[
'/root/homa/util/cp_node server'
'mount -t proc proc /proc'
,
'mount -t sysfs sysfs /sys'
,
# 'sysctl -w .net.homa.poll_usecs=300000',
'/root/homa/util/cp_node server --protocol homa'
,
# 'sleep 1',
# 'touch /root/homa/util/server.tt',
# 'sleep 1',
# '/root/homa/util/ttprint.py > /root/homa/util/server.tt',
# 'pkill cp_node',
# 'cat /root/homa/util/server.tt'
]
]
class
IdleHost
(
AppConfig
):
class
IdleHost
(
AppConfig
):
def
run_cmds
(
self
,
node
:
NodeConfig
)
->
tp
.
List
[
str
]:
def
run_cmds
(
self
,
node
:
NodeConfig
)
->
tp
.
List
[
str
]:
...
...
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