Coder Social home page Coder Social logo

ib_d3viz's Introduction

InfiniBand Visualization with D3.js
=====================================

v1.0 April 29, 2015

Copyright 2015 Blake Caldwell
Oak Ridge National Laboratory

This program is licensed under GNU GPLv3. Full license in LICENSE

=====================================
Example visualizations from University of Colorado JANUS Supercomputer:

http://bl.ocks.org/caldweba/ab08c6e78058fe2b7fcf
http://bl.ocks.org/caldweba/ab483405698b463d3a94

=====================================
Installation

1. Starting node js server

If you are doing development work locally, you'll want to start a node.js server. This simple
example starts serving the current directory on port 8080.

In server.js:

var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080);


2. Starting node web server

$ node server.js


3. D3.js binaries (optional)

In your html files, you can refer to the D3.js code from d3js.org or copy it locally. I chose to
copy it locally.

Remote (in html):
  <script src="http://d3js.org/d3.v3.js"></script>

Local:
mkdir d3 && cd d3
wget http://d3js.org/d3.v3.js

=====================================
Dependencies

Creating a dot visualization requires the following Python libraries:

pydot-1.0.28
https://pypi.python.org/pypi/pydot

pyparsing-1.5.7
https://pypi.python.org/pypi/pyparsing/1.5.7

Extract the tarballs in the same directory as ib_topology_graph.py

=====================================
Customization

1. Define string for leaf switches. For example:

"Infiniscale-IV Mellanox Technologies"

Then define the replacement string. The script uses:
"Mellanox TOR"


2. Regular expressions to identify line and spine modules
  in a chassis switched. For example:

core_pattern=".*MellanoxIS5600-([0-9])+.*"
spine_pattern=".*(MellanoxIS5600-[0-9]+).*\/S([0-9]+)\/.*"
line_pattern=".*(MellanoxIS5600-[0-9]+).*\/L([0-9]+)\/.*"


3. The --cluster option is not fully implemented, as it is site-specifc. You'll
  see in the code
        #    cluster_XXX=pydot.Cluster('yyyy',label="zzz")

You'll want to replace all XXX yyyy and zzz strings respectively in the code and uncomment
the lines. This hasn't been tested in recent versions, so please report any issues you
encounter


=====================================
Usage

Collect output from ibnetdiscover -p. Use --node-name-map for modifying the description
provided by the HC

$ ibnetdiscover -p --node-name-map > fabric_ibnetdisc.out
$ cat fabric_ibnetdisc.out 

CA   392  1 0x0002c90300086c07 4x QDR - SW  1495 36 0x0002c90200419bf0 ( 'node0570 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   379  1 0x0002c9030008561f 4x QDR - SW  1495 35 0x0002c90200419bf0 ( 'node0569 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   406  1 0x0002c90300085617 4x QDR - SW  1495 34 0x0002c90200419bf0 ( 'node0568 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   374  1 0x0002c90300085513 4x QDR - SW  1495 33 0x0002c90200419bf0 ( 'node0567 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   370  1 0x0002c903000855cf 4x QDR - SW  1495 32 0x0002c90200419bf0 ( 'node0566 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   355  1 0x0002c903000854b7 4x QDR - SW  1495 31 0x0002c90200419bf0 ( 'node0565 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   380  1 0x0002c9030008545b 4x QDR - SW  1495 30 0x0002c90200419bf0 ( 'node0564 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   396  1 0x0002c90300085af3 4x QDR - SW  1495 29 0x0002c90200419bf0 ( 'node0563 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA   378  1 0x0002c903000855d7 4x QDR - SW  1495 28 0x0002c90200419bf0 ( 'node0562 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
CA  1571  1 0x0002c90300086bbb 4x QDR - SW  1495 27 0x0002c90200419bf0 ( 'node0561 HCA-1' - 'Infiniscale-IV Mellanox Technologies' )
...

$ python ib_topology_graph.py --help
Couldn't import dot_parser, loading of dot files will not be possible.
Usage: ib_topology_graph.py [-pvh] [-c cluster] [-o output_dir] [-t tree_file] [-g graph_file] [-d dot_file] ibnetdiscover_file [ ibqueryerrors_file ]

Options:
  -h, --help            show this help message and exit
  -c CLUSTER, --cluster=CLUSTER
                        Color highlight a cluster
  -o OUTPUT, --output-dir=OUTPUT
                        Image output directory
  -d, --dot             Generate graphviz (DOT) diagram
  -t TREE, --tree=TREE  Generate JSON tree
  -g GRAPH, --graph=GRAPH
                        Generate JSON graph
  -p, --print           print topology to stdout
  -v, --verbose         Be verbose

$ python ib_topology_graph.py -t fabric_tree.out fabric_ibnetdisc.out
$ python ib_topology_graph.py -g fabric_graph.out fabric_ibnetdisc.out

ib_d3viz's People

Contributors

bacaldwell avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ib_d3viz's Issues

Update for python 3

Hi Blake,
Did you have any plans to update this for python 3?
I am not experienced with python, and I was looking to use this. In python 2 I found a minor bug which I was able to fix but trying to use python 3 seems a lot more work. I tried and seems like I was able to address the simple changes needed but not sure how to handle some complex items such as:
for index,myPort in sorted(self.switches[switch_guid].ports.items(),key=itemgetter(1),reverse=True):
Seems like comparison on dict type objects is significantly different and not in my ability. I'l be happy to share what I have done so far. P.S. My direct email is [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.