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
b94393cf
Commit
b94393cf
authored
Feb 28, 2024
by
Marvin Meiers
Committed by
Antoine Kaufmann
May 08, 2024
Browse files
experiments: make python linter and typechecker happy
parent
40d7535c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
19 deletions
+20
-19
experiments/pyexps/e2e_automatic_split.py
experiments/pyexps/e2e_automatic_split.py
+1
-4
experiments/simbricks/orchestration/e2e_components.py
experiments/simbricks/orchestration/e2e_components.py
+1
-1
experiments/simbricks/orchestration/runners.py
experiments/simbricks/orchestration/runners.py
+5
-5
experiments/simbricks/orchestration/runtime/common.py
experiments/simbricks/orchestration/runtime/common.py
+1
-1
experiments/simbricks/orchestration/simulators.py
experiments/simbricks/orchestration/simulators.py
+12
-8
No files found.
experiments/pyexps/e2e_automatic_split.py
View file @
b94393cf
...
...
@@ -139,10 +139,7 @@ for link_type in (E2ELinkType.NS3_SIMPLE_CHANNEL, E2ELinkType.SIMBRICKS):
component
.
data_rate
=
f
'
{
link_rate
}
Mbps'
component
.
queue_size
=
f
'
{
queue_size
}
B'
component
.
delay
=
f
'
{
link_latency
}
ns'
elif
isinstance
(
component
,
(
e2e
.
E2ESimbricksNetworkNetIf
,
e2e
.
E2ESimbricksNetworkNicIf
)
):
elif
isinstance
(
component
,
(
e2e
.
E2ENetworkSimbricks
)):
component
.
eth_latency
=
f
'
{
link_latency
}
ns'
# simbricks host
...
...
experiments/simbricks/orchestration/e2e_components.py
View file @
b94393cf
...
...
@@ -116,7 +116,7 @@ class E2EGlobalConfig(E2EBase):
def
ns3_config
(
self
)
->
str
:
self
.
mapping
.
update
({
"StopTime"
:
self
.
stop_time
,
"MACStart"
:
self
.
mac_start
"StopTime"
:
self
.
stop_time
,
"MACStart"
:
str
(
self
.
mac_start
)
})
return
super
().
ns3_config
()
...
...
experiments/simbricks/orchestration/runners.py
View file @
b94393cf
...
...
@@ -187,7 +187,7 @@ class ExperimentBaseRunner(ABC):
assert
self
.
profile_int
while
True
:
await
asyncio
.
sleep
(
self
.
profile_int
)
for
(
sim
,
sc
)
in
self
.
running
:
for
(
_
,
sc
)
in
self
.
running
:
await
sc
.
sigusr1
()
async
def
run
(
self
)
->
ExpOutput
:
...
...
@@ -225,10 +225,10 @@ class ExperimentBaseRunner(ABC):
traceback
.
print_exc
()
if
profiler_task
:
try
:
profiler_task
.
cancel
()
except
asyncio
.
CancelledError
:
pass
try
:
profiler_task
.
cancel
()
except
asyncio
.
CancelledError
:
pass
# The bare except above guarantees that we always execute the following
# code, which terminates all simulators and produces a proper output
# file.
...
...
experiments/simbricks/orchestration/runtime/common.py
View file @
b94393cf
...
...
@@ -111,4 +111,4 @@ class Runtime(metaclass=ABCMeta):
self
.
interrupt_handler
()
def
enable_profiler
(
self
,
profile_int
:
int
)
->
None
:
self
.
profile_int
=
profile_int
\ No newline at end of file
self
.
profile_int
=
profile_int
experiments/simbricks/orchestration/simulators.py
View file @
b94393cf
...
...
@@ -190,10 +190,10 @@ class NetSim(Simulator):
self
.
eth_latency
=
500
"""Ethernet latency in nanoseconds from this network to connected
components."""
self
.
nics
:
l
ist
[
NICSim
]
=
[]
self
.
hosts_direct
:
l
ist
[
HostSim
]
=
[]
self
.
net_listen
:
list
[(
NetSim
,
str
)
]
=
[]
self
.
net_connect
:
list
[(
NetSim
,
str
)
]
=
[]
self
.
nics
:
tp
.
L
ist
[
NICSim
]
=
[]
self
.
hosts_direct
:
tp
.
L
ist
[
HostSim
]
=
[]
self
.
net_listen
:
tp
.
List
[
tp
.
Tuple
[
NetSim
,
str
]
]
=
[]
self
.
net_connect
:
tp
.
List
[
tp
.
Tuple
[
NetSim
,
str
]
]
=
[]
self
.
wait
=
False
def
full_name
(
self
)
->
str
:
...
...
@@ -219,12 +219,12 @@ class NetSim(Simulator):
def
listen_sockets
(
self
,
env
:
ExpEnv
)
->
tp
.
List
[
tp
.
Tuple
[
NetSim
,
str
]]:
listens
=
[]
for
(
net
,
suffix
)
in
self
.
net_listen
:
for
(
net
,
suffix
)
in
self
.
net_listen
:
listens
.
append
((
net
,
env
.
n2n_eth_path
(
self
,
net
,
suffix
)))
return
listens
def
dependencies
(
self
)
->
tp
.
List
[
Simulator
]:
return
self
.
nics
+
self
.
hosts_direct
+
[
n
for
n
,
_
in
self
.
net_connect
]
return
self
.
nics
+
self
.
hosts_direct
+
[
n
for
n
,
_
in
self
.
net_connect
]
def
sockets_cleanup
(
self
,
env
:
ExpEnv
)
->
tp
.
List
[
str
]:
return
[
s
for
(
_
,
s
)
in
self
.
listen_sockets
(
env
)]
...
...
@@ -232,7 +232,7 @@ class NetSim(Simulator):
def
sockets_wait
(
self
,
env
:
ExpEnv
)
->
tp
.
List
[
str
]:
return
[
s
for
(
_
,
s
)
in
self
.
listen_sockets
(
env
)]
def
wait_terminate
(
self
)
->
B
ool
:
def
wait_terminate
(
self
)
->
b
ool
:
return
self
.
wait
def
init_network
(
self
)
->
None
:
...
...
@@ -925,7 +925,7 @@ class NS3E2ENet(NetSim):
def
resolve_socket_paths
(
self
,
env
:
ExpEnv
,
e2e_sim
:
tp
.
Union
[
e2e
.
E2ESimbricks
Network
,
e2e
.
E2ESimbricksHost
],
e2e_sim
:
tp
.
Union
[
e2e
.
E2E
Network
Simbricks
,
e2e
.
E2ESimbricksHost
],
listen
:
bool
=
False
)
->
None
:
if
e2e_sim
.
simbricks_component
is
None
:
...
...
@@ -935,6 +935,10 @@ class NS3E2ENet(NetSim):
if
e2e_sim
.
adapter_type
==
e2e
.
SimbricksAdapterType
.
NIC
:
e2e_sim
.
unix_socket
=
env
.
nic_eth_path
(
e2e_sim
.
simbricks_component
)
elif
e2e_sim
.
adapter_type
==
e2e
.
SimbricksAdapterType
.
NETWORK
:
if
not
isinstance
(
e2e_sim
,
e2e
.
E2ENetworkSimbricks
):
raise
RuntimeError
(
f
'Expected
{
e2e_sim
.
id
}
to be of type E2ENetworkSimbricks'
)
p_suf
=
''
if
e2e_sim
.
peer
:
p_suf
=
min
(
e2e_sim
.
name
,
e2e_sim
.
peer
.
name
)
...
...
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