Adding function to read xml file to dot file, along with a topology.x…#31
Adding function to read xml file to dot file, along with a topology.x…#31sappyb wants to merge 3 commits intohpcgroup:developfrom sappyb:graphXml
Conversation
…ml file which is a quartz topology and test.xml which is a small topology for testing
|
@Saptarshibh these files are not in the right place. The script and test topology file should be under utils/. The full quartz topology file shouldn't be checked in. Can you make that change? |
|
Sure, I am making the changes asap.
…On Tue, Jun 18, 2019 at 9:06 AM Abhinav Bhatele ***@***.***> wrote:
@Saptarshibh <https://github.com/Saptarshibh> these files are not in the
right place. The script and test topology file should be under utils/. The
full quartz topology file shouldn't be checked in. Can you make that change?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#31>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIATY3NFDKKOWQX6ANAWNQ3P3EBZZANCNFSM4HYBQMGQ>
.
|
…a test script to run the file
| def writeDot(self, switchRadix=48, nodeTags='FIs', switchTags='Switches', write=True, **kwargs): | ||
| tree = ET.parse(self.fullFilePath) | ||
| root = tree.getroot() | ||
| terminalIndex = 274877906944 |
There was a problem hiding this comment.
Change to hex and add a comment on the format
| tree = ET.parse(self.fullFilePath) | ||
| root = tree.getroot() | ||
| terminalIndex = 274877906944 | ||
| switchIndex = 12884901888 |
There was a problem hiding this comment.
Change to hex and add a comment on the format
| self.levelsOfSwitches = None | ||
| self.fullFilePath = fullFilePath | ||
|
|
||
| def writeDot(self, switchRadix=48, nodeTags='FIs', switchTags='Switches', write=True, **kwargs): |
There was a problem hiding this comment.
Should switchRadix be using a default value?
|
Hi, added some comments in file. Also, does the implementation handle any arbitrary graph or is it only for fat-tree variants? |
|
I kept it 48 for now, as a default, for nikhil said to keep it as a default
48 for now.
…On Tue, Jun 18, 2019 at 11:27 AM Giorgis Georgakoudis < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In utils/graphXmlDot.py
<#31 (comment)>:
> +
+class graphXml():
+ def __init__(self, fullFilePath, **kwargs):
+ print('This is a small module to read an xml file into a graph.')
+ print('To create the dot file call the function writeDot().')
+ print('To draw the graph call function draw().')
+ self.graphObj = None # Object For holding the NetworkX Graph
+ self.dictOfNodes = None
+ self.listOfTerminals = None
+ self.levelsOfSwitches = None
+ self.fullFilePath = fullFilePath
+
+ def writeDot(self, switchRadix=48, nodeTags='FIs', switchTags='Switches', write=True, **kwargs):
+ tree = ET.parse(self.fullFilePath)
+ root = tree.getroot()
+ terminalIndex = 274877906944
Change to hex and add a comment on the format
------------------------------
In utils/graphXmlDot.py
<#31 (comment)>:
> +class graphXml():
+ def __init__(self, fullFilePath, **kwargs):
+ print('This is a small module to read an xml file into a graph.')
+ print('To create the dot file call the function writeDot().')
+ print('To draw the graph call function draw().')
+ self.graphObj = None # Object For holding the NetworkX Graph
+ self.dictOfNodes = None
+ self.listOfTerminals = None
+ self.levelsOfSwitches = None
+ self.fullFilePath = fullFilePath
+
+ def writeDot(self, switchRadix=48, nodeTags='FIs', switchTags='Switches', write=True, **kwargs):
+ tree = ET.parse(self.fullFilePath)
+ root = tree.getroot()
+ terminalIndex = 274877906944
+ switchIndex = 12884901888
Change to hex and add a comment on the format
------------------------------
In utils/graphXmlDot.py
<#31 (comment)>:
> + portsUsed += 1
+ return links, portsUsed
+
+
+class graphXml():
+ def __init__(self, fullFilePath, **kwargs):
+ print('This is a small module to read an xml file into a graph.')
+ print('To create the dot file call the function writeDot().')
+ print('To draw the graph call function draw().')
+ self.graphObj = None # Object For holding the NetworkX Graph
+ self.dictOfNodes = None
+ self.listOfTerminals = None
+ self.levelsOfSwitches = None
+ self.fullFilePath = fullFilePath
+
+ def writeDot(self, switchRadix=48, nodeTags='FIs', switchTags='Switches', write=True, **kwargs):
Should switchRadix be using a default value?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#31>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIATY3NLVEYFTAIVJUXJ3YDP3ESIPANCNFSM4HYBQMGQ>
.
|
|
I am changing the number to hex
…On Tue, Jun 18, 2019 at 11:28 AM Giorgis Georgakoudis < ***@***.***> wrote:
Hi, added some comments in file. Also, does the implementation handle any
arbitrary graph or is it only for fat-tree variants?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#31>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIATY3NFERWJZOGSCM6FTULP3ESLHANCNFSM4HYBQMGQ>
.
|
|
I tested it only for fat tree, it should be able to handle other graphs but
i have not tested it with any.It is able to handle fat tree variants.
…On Tue, Jun 18, 2019 at 11:29 AM Sap BH ***@***.***> wrote:
I am changing the number to hex
On Tue, Jun 18, 2019 at 11:28 AM Giorgis Georgakoudis <
***@***.***> wrote:
> Hi, added some comments in file. Also, does the implementation handle any
> arbitrary graph or is it only for fat-tree variants?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#31>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AIATY3NFERWJZOGSCM6FTULP3ESLHANCNFSM4HYBQMGQ>
> .
>
|
|
Saptarshi, next time, it would be helpful to answer the comments in code in their chat window. Could you document what tests you did? Do those tests cover most/all of the expected functionality? Could you try a non fat-tree topology? |
…ml file which is a quartz topology and test.xml which is a small topology for testing