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
3d7826bc
Commit
3d7826bc
authored
Jan 23, 2024
by
Antoine Kaufmann
Committed by
Hejing Li
Feb 01, 2024
Browse files
experiments: e2e partitioner now also returns dot rendering, e2e_bgsplit experiment saves it
parent
6b37db23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
experiments/pyexps/e2e_bgsplit.py
experiments/pyexps/e2e_bgsplit.py
+4
-1
experiments/simbricks/orchestration/e2e_partition.py
experiments/simbricks/orchestration/e2e_partition.py
+12
-11
No files found.
experiments/pyexps/e2e_bgsplit.py
View file @
3d7826bc
...
@@ -59,7 +59,7 @@ for N in splits:
...
@@ -59,7 +59,7 @@ for N in splits:
add_contig_bg
(
topology
)
add_contig_bg
(
topology
)
# Partition into N ns-3 processes
# Partition into N ns-3 processes
nets
=
e2e_part
.
partition
(
topology
,
N
)
nets
,
dot
=
e2e_part
.
partition
(
topology
,
N
)
for
net
in
nets
:
for
net
in
nets
:
net
.
e2e_global
.
stop_time
=
'1s'
net
.
e2e_global
.
stop_time
=
'1s'
net
.
opt
=
' '
.
join
([
f
'--
{
o
[
0
]
}
=
{
o
[
1
]
}
'
for
o
in
options
.
items
()])
net
.
opt
=
' '
.
join
([
f
'--
{
o
[
0
]
}
=
{
o
[
1
]
}
'
for
o
in
options
.
items
()])
...
@@ -67,4 +67,7 @@ for N in splits:
...
@@ -67,4 +67,7 @@ for N in splits:
e
.
add_network
(
net
)
e
.
add_network
(
net
)
net
.
init_network
()
net
.
init_network
()
with
open
(
f
'out/
{
e
.
name
}
.dot'
,
'w'
)
as
f
:
f
.
write
(
dot
)
experiments
.
append
(
e
)
experiments
.
append
(
e
)
experiments/simbricks/orchestration/e2e_partition.py
View file @
3d7826bc
...
@@ -94,16 +94,17 @@ def partition(topology, N):
...
@@ -94,16 +94,17 @@ def partition(topology, N):
node_partitions
[
p
].
append
(
i
)
node_partitions
[
p
].
append
(
i
)
# For debugging: print out dot representation of partition
# For debugging: print out dot representation of partition
#print('graph R {')
dot
=
'graph R {
\n
'
#for p in sorted(node_partitions.keys()):
for
p
in
sorted
(
node_partitions
.
keys
()):
# print(f'subgraph cluster{p} {{')
dot
+=
f
'subgraph cluster
{
p
}
{{
\n
'
# for n_i in node_partitions[p]:
dot
+=
f
'label = "netpart_
{
p
}
";
\n
'
# n = idmap.from_id(n_i)
for
n_i
in
node_partitions
[
p
]:
# print(f'n{n_i} [label="{n.id}"];')
n
=
idmap
.
from_id
(
n_i
)
# print('}')
dot
+=
f
'n
{
n_i
}
[label="
{
n
.
id
}
"];
\n
'
#for (s,d) in edges:
dot
+=
'}
\n
'
# print(f'n{s} -- n{d};')
for
(
s
,
d
)
in
edges
:
#print('}')
dot
+=
f
'n
{
s
}
-- n
{
d
}
;
\n
'
dot
+=
'}'
# create the networks
# create the networks
...
@@ -158,4 +159,4 @@ def partition(topology, N):
...
@@ -158,4 +159,4 @@ def partition(topology, N):
con_a
.
set_peer
(
lst_a
)
con_a
.
set_peer
(
lst_a
)
con
.
add_component
(
con_a
)
con
.
add_component
(
con_a
)
return
networks
return
(
networks
,
dot
)
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