Difference between revisions of "HowTo Profiling"

From OpenFOAMWiki
(Created)
 
m (Wyldckat moved page Profiling to HowTo Profiling: it's similar to the "how-to debugging" page)
 
(No difference)

Latest revision as of 18:53, 16 November 2015

See http://lrm29.github.io/openfoam/programming/2010/09/02/profiling_cplusplus.html

Basically, use Callgrind, which is part of Valgrind. It’s executed using:

   valgrind --tool=callgrind <executableName>

Or for parallel runs:

   mpirun -np $nProc valgrind --tool=callgrind <executableName> -parallel

When the simulation is done you’ll see a callgrind file in the current directory. Opening it with kcachegrind allows you to easily trace through the functions that have been called. You can even generate nice looking call graphs to help you trace function calls.

There is also a script that might help with this in OpenFOAM/bin/mpirunDebug.