Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
38
Issues
38
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
69d3afdc
Commit
69d3afdc
authored
Dec 18, 2018
by
Neil McGlohon
Committed by
Misbah Mubarak
Dec 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DFP Script Fixes
parent
62017faf
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
146 deletions
+157
-146
dragonfly-plus-random-topo-gen.py
scripts/dragonfly-plus/dragonfly-plus-random-topo-gen.py
+133
-122
dragonfly-plus-topo-gen-v2.py
scripts/dragonfly-plus/dragonfly-plus-topo-gen-v2.py
+24
-24
No files found.
scripts/dragonfly-plus/dragonfly-plus-random-topo-gen.py
View file @
69d3afdc
This diff is collapsed.
Click to expand it.
scripts/dragonfly-plus/dragonfly-plus-topo-gen-v2.py
View file @
69d3afdc
...
...
@@ -4,7 +4,7 @@
# In hindsight this was a lot more complicated than I intended. It was looking to solve a complex problem that turned out to be invalid from the beginning.
### USAGE ###
# Correct usage:
python3 script.py <num_groups> <num_spine_pg> <num_leaf_pg> <router_radix> <num_terminal_per_leaf
> <intra-file> <inter-file>
# Correct usage:
python3 dragonfly-plus-topo-gen-v2.py <router_radix> <num_gc_between_groups
> <intra-file> <inter-file>
### ###
import
sys
...
...
@@ -573,37 +573,37 @@ def mainV3():
print
(
A
.
astype
(
int
))
def
mainV2
():
if
(
len
(
argv
)
<
8
):
raise
Exception
(
"Correct usage: python
%
s <num_groups> <num_spine_pg> <num_leaf_pg> <router_radix> <terminals-per-leaf> <intra-file> <inter-file>"
%
sys
.
argv
[
0
])
#
def mainV2():
#
if(len(argv) < 8):
#
raise Exception("Correct usage: python %s <num_groups> <num_spine_pg> <num_leaf_pg> <router_radix> <terminals-per-leaf> <intra-file> <inter-file>" % sys.argv[0])
num_groups
=
int
(
argv
[
1
])
num_spine_pg
=
int
(
argv
[
2
])
num_leaf_pg
=
int
(
argv
[
3
])
router_radix
=
int
(
argv
[
4
])
term_per_leaf
=
int
(
argv
[
5
])
intra_filename
=
argv
[
6
]
inter_filename
=
argv
[
7
]
#
num_groups = int(argv[1])
#
num_spine_pg = int(argv[2])
#
num_leaf_pg = int(argv[3])
#
router_radix = int(argv[4])
#
term_per_leaf = int(argv[5])
#
intra_filename = argv[6]
#
inter_filename = argv[7]
parseOptionArguments
()
#
parseOptionArguments()
dfp_network
=
DragonflyPlusNetwork
(
num_groups
,
num_spine_pg
,
num_leaf_pg
,
router_radix
,
num_hosts_per_leaf
=
term_per_leaf
)
#
dfp_network = DragonflyPlusNetwork(num_groups, num_spine_pg, num_leaf_pg, router_radix, num_hosts_per_leaf=term_per_leaf)
if
not
DRYRUN
:
dfp_network
.
writeIntraconnectionFile
(
intra_filename
)
dfp_network
.
writeInterconnectionFile
(
inter_filename
)
#
if not DRYRUN:
#
dfp_network.writeIntraconnectionFile(intra_filename)
#
dfp_network.writeInterconnectionFile(inter_filename)
if
LOUDNESS
is
not
Loudness
.
QUIET
:
print
(
"
\n
NOTE: THIS STILL CAN'T DO THE MED-LARGE TOPOLOGY RIGHT
\n
"
)
#
if LOUDNESS is not Loudness.QUIET:
#
print("\nNOTE: THIS STILL CAN'T DO THE MED-LARGE TOPOLOGY RIGHT\n")
print
(
dfp_network
.
getSummary
())
#
print(dfp_network.getSummary())
if
SHOW_ADJACENCY
==
1
:
print
(
"
\n
Printing Adjacency Matrix:"
)
#
if SHOW_ADJACENCY == 1:
#
print("\nPrinting Adjacency Matrix:")
np
.
set_printoptions
(
linewidth
=
400
,
threshold
=
10000
,
edgeitems
=
200
)
A
=
dfp_network
.
getAdjacencyMatrix
(
AdjacencyType
.
ALL_CONNS
)
print
(
A
.
astype
(
int
))
#
np.set_printoptions(linewidth=400,threshold=10000,edgeitems=200)
#
A = dfp_network.getAdjacencyMatrix(AdjacencyType.ALL_CONNS)
#
print(A.astype(int))
if
__name__
==
'__main__'
:
mainV3
()
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