IDL routines dependencies map maker [message #79579] |
Mon, 12 March 2012 08:26 |
DavidPS
Messages: 10 Registered: December 2009
|
Junior Member |
|
|
Hello IDL-gurus,
I've been from time ago interested to find which routines are more critical than others in a library. In my case, I work with a huge library, and I'm certain that some routines are critical for the whole system. So, I've been thinking how to get that info, which procedures call what...
...after searching around I've found nothing (maybe because I'm looking for the wrong names). So I've decided to create my own mapper program for IDL routines.
I've done it using bash scripts (lots of sed, grep and awk) and surprisingly, though far from efficient, it works. It creates a graphivz file (dot), and it also tries to generate a png from it (this step fails sometimes).
So, if you want to test it, here it is:
https://github.com/dpshelio/IDL-mapper
follow the instructions and visualise the png (if it works) or use one of the tools in here:
http://www.graphviz.org/Resources.php
ZGRViewer is quite nice (http://zvtm.sourceforge.net/zgrviewer.html)
but Gephi(not listed above) is amazing!: http://gephi.org/
if you feel adventurous and want to improve it! please, do! My idea is to run it on that huge library (>3540 files), but I would be mad if I try this script on there...
If you are interested, this is (in short) how it works:
1) Search for any pro, function definition in all the files
2) Search for any call of these saved pro/functions in all the files
3) Generates the dot file using pygraphivz
Of course, the script is quite convoluted, and I'm sure there's better ways to do it, but my brain is a bit dry after all this weekend, so I would really appreciate some help, comments and suggestions.
Also, it's possible that there's a way to do so within IDL.. but I did not find it.
Cheers,
David
|
|
|