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
40d7535c
"git@developer.sourcefind.cn:modelzoo/animatediff_pytorch.git" did not exist on "4cdc28906828bb751fef420fccce929c196eaa74"
Commit
40d7535c
authored
Feb 28, 2024
by
Marvin Meiers
Committed by
Antoine Kaufmann
May 08, 2024
Browse files
experiments: merge the NetIf and NicIf e2e classes into one class
parent
a91fd59c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
34 deletions
+38
-34
experiments/pyexps/e2e_split.py
experiments/pyexps/e2e_split.py
+4
-2
experiments/simbricks/orchestration/e2e_components.py
experiments/simbricks/orchestration/e2e_components.py
+26
-24
experiments/simbricks/orchestration/e2e_helpers.py
experiments/simbricks/orchestration/e2e_helpers.py
+4
-2
experiments/simbricks/orchestration/simulators.py
experiments/simbricks/orchestration/simulators.py
+3
-5
sims/external/ns-3
sims/external/ns-3
+1
-1
No files found.
experiments/pyexps/e2e_split.py
View file @
40d7535c
...
@@ -94,13 +94,15 @@ for congestion_control in types_of_congestion_control:
...
@@ -94,13 +94,15 @@ for congestion_control in types_of_congestion_control:
right_switch
.
mtu
=
f
'
{
mtu
-
52
}
'
right_switch
.
mtu
=
f
'
{
mtu
-
52
}
'
right_net
.
add_component
(
right_switch
)
right_net
.
add_component
(
right_switch
)
left_adapter
=
e2e
.
E2ESimbricks
NetworkNetIf
(
'left_adapter'
)
left_adapter
=
e2e
.
E2E
Network
Simbricks
(
'left_adapter'
)
left_adapter
.
eth_latency
=
f
'
{
link_latency
}
ns'
left_adapter
.
eth_latency
=
f
'
{
link_latency
}
ns'
left_adapter
.
simbricks_component
=
right_net
left_adapter
.
simbricks_component
=
right_net
left_adapter
.
listen
=
False
left_switch
.
add_component
(
left_adapter
)
left_switch
.
add_component
(
left_adapter
)
right_adapter
=
e2e
.
E2ESimbricks
NetworkNicIf
(
'right_adapter'
)
right_adapter
=
e2e
.
E2E
Network
Simbricks
(
'right_adapter'
)
right_adapter
.
eth_latency
=
f
'
{
link_latency
}
ns'
right_adapter
.
eth_latency
=
f
'
{
link_latency
}
ns'
right_adapter
.
simbricks_component
=
left_net
right_adapter
.
simbricks_component
=
left_net
right_adapter
.
listen
=
True
right_switch
.
add_component
(
right_adapter
)
right_switch
.
add_component
(
right_adapter
)
for
i
in
range
(
1
,
num_ns3_hosts
+
1
):
for
i
in
range
(
1
,
num_ns3_hosts
+
1
):
...
...
experiments/simbricks/orchestration/e2e_components.py
View file @
40d7535c
...
@@ -57,8 +57,10 @@ class CongestionControl(Enum):
...
@@ -57,8 +57,10 @@ class CongestionControl(Enum):
@
property
@
property
def
ns3
(
self
):
def
ns3
(
self
):
if
self
.
ns3_str
==
""
:
if
self
.
ns3_str
==
""
:
raise
AttributeError
(
f
"There is no ns3 implementation for "
raise
AttributeError
(
f
"
{
self
.
name
}
available"
)
f
"There is no ns3 implementation for "
f
"
{
self
.
name
}
available"
)
return
self
.
ns3_str
return
self
.
ns3_str
@
property
@
property
...
@@ -114,8 +116,7 @@ class E2EGlobalConfig(E2EBase):
...
@@ -114,8 +116,7 @@ class E2EGlobalConfig(E2EBase):
def
ns3_config
(
self
)
->
str
:
def
ns3_config
(
self
)
->
str
:
self
.
mapping
.
update
({
self
.
mapping
.
update
({
"StopTime"
:
self
.
stop_time
,
"StopTime"
:
self
.
stop_time
,
"MACStart"
:
self
.
mac_start
"MACStart"
:
self
.
mac_start
})
})
return
super
().
ns3_config
()
return
super
().
ns3_config
()
...
@@ -209,50 +210,51 @@ class E2ESimpleChannel(E2ETopologyChannel):
...
@@ -209,50 +210,51 @@ class E2ESimpleChannel(E2ETopologyChannel):
return
super
().
ns3_config
()
return
super
().
ns3_config
()
class
E2E
Simbricks
Network
(
E2EComponent
):
class
E2ENetwork
(
E2EComponent
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
def
__init__
(
self
,
idd
:
str
)
->
None
:
super
().
__init__
(
idd
)
super
().
__init__
(
idd
)
self
.
category
=
"Network"
self
.
category
=
"Network"
self
.
peer
=
None
def
set_peer
(
self
,
peer
:
E2ENetwork
):
self
.
peer
=
peer
peer
.
peer
=
self
class
E2ENetworkSimbricks
(
E2ENetwork
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
super
().
__init__
(
idd
)
self
.
type
=
"Simbricks"
self
.
adapter_type
=
SimbricksAdapterType
.
NETWORK
self
.
adapter_type
=
SimbricksAdapterType
.
NETWORK
self
.
unix_socket
=
""
self
.
unix_socket
=
""
self
.
sync_delay
=
""
self
.
sync_delay
=
""
self
.
poll_delay
=
""
self
.
poll_delay
=
""
self
.
eth_latency
=
""
self
.
eth_latency
=
""
self
.
peer
=
None
self
.
listen
:
tp
.
Optional
[
bool
]
=
None
self
.
shm_path
=
""
self
.
sync
:
SimbricksSyncMode
=
SimbricksSyncMode
.
SYNC_OPTIONAL
self
.
sync
:
SimbricksSyncMode
=
SimbricksSyncMode
.
SYNC_OPTIONAL
self
.
simbricks_component
=
None
self
.
simbricks_component
=
None
def
set_peer
(
self
,
peer
:
E2ESimbricksNetwork
):
self
.
peer
=
peer
peer
.
peer
=
self
def
ns3_config
(
self
)
->
str
:
def
ns3_config
(
self
)
->
str
:
if
self
.
listen
is
None
:
raise
AttributeError
(
f
"Listen mode not specified for simbricks adapter
{
self
.
id
}
"
)
self
.
mapping
.
update
({
self
.
mapping
.
update
({
"UnixSocket"
:
self
.
unix_socket
,
"UnixSocket"
:
self
.
unix_socket
,
"SyncDelay"
:
self
.
sync_delay
,
"SyncDelay"
:
self
.
sync_delay
,
"PollDelay"
:
self
.
poll_delay
,
"PollDelay"
:
self
.
poll_delay
,
"EthLatency"
:
self
.
eth_latency
,
"EthLatency"
:
self
.
eth_latency
,
"Listen"
:
"true"
if
self
.
listen
else
"false"
,
"ShmPath"
:
self
.
shm_path
,
"Sync"
:
""
if
self
.
sync
is
None
else
f
"
{
self
.
sync
.
value
}
"
,
"Sync"
:
""
if
self
.
sync
is
None
else
f
"
{
self
.
sync
.
value
}
"
,
})
})
return
super
().
ns3_config
()
return
super
().
ns3_config
()
class
E2ESimbricksNetworkNetIf
(
E2ESimbricksNetwork
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
super
().
__init__
(
idd
)
self
.
type
=
"NetIf"
class
E2ESimbricksNetworkNicIf
(
E2ESimbricksNetwork
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
super
().
__init__
(
idd
)
self
.
type
=
"NicIf"
class
E2EHost
(
E2EComponent
):
class
E2EHost
(
E2EComponent
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
def
__init__
(
self
,
idd
:
str
)
->
None
:
...
...
experiments/simbricks/orchestration/e2e_helpers.py
View file @
40d7535c
...
@@ -80,12 +80,14 @@ class E2ELinkAssigner():
...
@@ -80,12 +80,14 @@ class E2ELinkAssigner():
right_switch
=
link
[
"right"
]
right_switch
=
link
[
"right"
]
link_type
=
link
[
"type"
]
link_type
=
link
[
"type"
]
if
link_type
==
E2ELinkType
.
SIMBRICKS
:
if
link_type
==
E2ELinkType
.
SIMBRICKS
:
left_adapter
=
e2e
.
E2ESimbricksNetworkNetIf
(
f
"_
{
idd
}
_left_adapter"
)
left_adapter
=
e2e
.
E2ENetworkSimbricks
(
f
"_
{
idd
}
_left_adapter"
)
left_adapter
.
listen
=
False
left_switch
.
add_component
(
left_adapter
)
left_switch
.
add_component
(
left_adapter
)
link
[
"left_adapter"
]
=
left_adapter
link
[
"left_adapter"
]
=
left_adapter
right_adapter
=
e2e
.
E2ESimbricks
NetworkNicIf
(
right_adapter
=
e2e
.
E2E
Network
Simbricks
(
f
"_
{
idd
}
_right_adapter"
f
"_
{
idd
}
_right_adapter"
)
)
right_adapter
.
listen
=
True
right_switch
.
add_component
(
right_adapter
)
right_switch
.
add_component
(
right_adapter
)
link
[
"right_adapter"
]
=
right_adapter
link
[
"right_adapter"
]
=
right_adapter
elif
link_type
==
E2ELinkType
.
NS3_SIMPLE_CHANNEL
:
elif
link_type
==
E2ELinkType
.
NS3_SIMPLE_CHANNEL
:
...
...
experiments/simbricks/orchestration/simulators.py
View file @
40d7535c
...
@@ -961,7 +961,7 @@ class NS3E2ENet(NetSim):
...
@@ -961,7 +961,7 @@ class NS3E2ENet(NetSim):
# add all connected networks
# add all connected networks
for
c
in
component
.
components
:
for
c
in
component
.
components
:
if
isinstance
(
c
,
e2e
.
E2ESimbricks
NetworkNetIf
)
:
if
isinstance
(
c
,
e2e
.
E2E
Network
Simbricks
)
and
not
c
.
listen
:
p_suf
=
''
p_suf
=
''
if
c
.
peer
:
if
c
.
peer
:
p_suf
=
min
(
c
.
name
,
c
.
peer
.
name
)
p_suf
=
min
(
c
.
name
,
c
.
peer
.
name
)
...
@@ -975,10 +975,8 @@ class NS3E2ENet(NetSim):
...
@@ -975,10 +975,8 @@ class NS3E2ENet(NetSim):
for
c
in
component
.
components
:
for
c
in
component
.
components
:
if
isinstance
(
c
,
e2e
.
E2ESimbricksHost
):
if
isinstance
(
c
,
e2e
.
E2ESimbricksHost
):
self
.
resolve_socket_paths
(
env
,
c
)
self
.
resolve_socket_paths
(
env
,
c
)
elif
isinstance
(
c
,
e2e
.
E2ESimbricksNetworkNetIf
):
elif
isinstance
(
c
,
e2e
.
E2ENetworkSimbricks
):
self
.
resolve_socket_paths
(
env
,
c
)
self
.
resolve_socket_paths
(
env
,
c
,
c
.
listen
)
elif
isinstance
(
c
,
e2e
.
E2ESimbricksNetworkNicIf
):
self
.
resolve_socket_paths
(
env
,
c
,
True
)
params
:
tp
.
List
[
str
]
=
[]
params
:
tp
.
List
[
str
]
=
[]
params
.
append
(
self
.
e2e_global
.
ns3_config
())
params
.
append
(
self
.
e2e_global
.
ns3_config
())
...
...
ns-3
@
968e0ed2
Compare
60ee4197
...
968e0ed2
Subproject commit
60ee4197f52aad9ca4005195a1ae95a4c4016566
Subproject commit
968e0ed2b2a1ef5303975e836481298e4ac60295
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