valgrind script

I made a fancy bash script to run valgrind. Originally, I was just making this so that I could easily compile and run valgrind on any problem module since I am now the "valgrind czar". However, I have since added a lot of functionality so that this could perhaps become part of the test suite.

Basically, the script will compile astrobear, run valgrind, and then check the valgrind output for memory leaks specific to astrobear. The script will print the tracebacks for all the memory leaks that it finds to a file named astrobear_leaks.out. If that file does contain leak information, then a message will tell the user to check that file. If no leaks are found, that file should be empty, and a message will tell the user that no leaks were found. I implemented many checks and error messages to make the script fairly fool proof. There are also a handful of options the user can specify…

Usage: ./valgrind_leaks [OPTIONS] -m module

specified module must be in the modules directory

Options: -d code_dir

specify code directory (default is present working directory)

-sc —skipclean

skip clean, but still recompiles (use only if you have previously compiled with proper FFLAGS for valgrind, and you have not made changes to Makefile.inc or makefile)

-sm —skipmake

skip compiling completely if you just want to rerun

-sr —skiprun

skip running if you already ran valgrind and just want to check output

-np

choose number of processors to run on (default is 1)

The script is in /home/ehansen/astrobear_GVpp if anyone is curious. If anyone has any questions or comments, just post a comment to this blog post or email me.

Comments

No comments.