Re: IDL routines dependencies map maker [message #79576 is a reply to message #79571] |
Mon, 12 March 2012 10:53  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 3/12/12 9:26 AM, DavidPS wrote:
> 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
Cool! I have the tool chain running and get a graph for the sample code:
http://michaelgalloy.com/wp-content/uploads/2012/03/map.png
Running on GPULib didn't take long (maybe a minute or so) and produced
useful results:
http://michaelgalloy.com/wp-content/uploads/2012/03/gpulib-d ependencies.png
I think this is a very useful project and have long thought about
including something like this in IDLdoc.
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
|
|
|