How to use Valgrind

Using Valgrind tool is very helpful in finding bugs and memory leaks.

valgrind -v --leak-check=full \
            --leak-resolution=high \
            --show-reachable=yes \
            ./coolfluid-solver --scase path/to/testcases/whatever/test.CFcase

For the profiling to be effective and to take broader conclusions you should run the profiling on a statically-compiled executable. For that, consult the appropriate tutorial.

Profiling with Valgrind

There is a Valgrind skin (plug-in) called callgrind which can be very useful as well, specially for profiling purposes. You can run it with:

valgrind --tool=callgrind --trace-children=yes ./coolfluid-solver --scase path/to/testcases/whatever/test.CFcase

Options of interest specific to callgrind are, for example, '--dump-instr=yes' and '--trace-jump=yes'. Use 'callgrind --help' for more information. There is a very nice KDE frontend for it called 'kcachegrind' which can help you browse all the information generated by Valgrind.

Advanced use

You can use the '--trace-children=yes' option to trace children processes also.

valgrind --trace-children=yes ./coolfluid-solver --scase path/to/testcases/whatever/test.CFcase