How do I use gprof to profile Fluidity?

Created by Tim Greaves on on 2013-03-01

Here is a very quick tutorial to get you started using gprof to profile fluidity runs.

*** Step 0:

Compile a profile-enabled version of fluidity:

     ./configure --enable-profiling
    make clean

*** Step 1:

Run the profile-enabled version of fluidity.

You should make sure that the run finishes normally (i.e. it doesn't crash, nor get interrupted), otherwise it will not create the important gmon.out file when it ends.

*** Step 2:

Use gprof with the special debug symbols file from fluidity to examine the resulting gmon.out:

     gprof /usr/lib/debug/usr/bin/fluidity gmon.out >

*** Step 3:

Take a look at the file in a text editor - there is loads of information in there, but, to get you started, the first few lines provide information about how long it spent in various fluidity subroutines.

For a more comprehensive guide, and to find out about all the other things in the file you've just created, check out the gprof manual online at