Deprecated: please see new documentation site.

gprof is a standard profiling tool that provides statistics on function timing, number of calls, callers thereof. Gprof does not work with mpi jobs.

Using gprof

Step 1. Compile and link your code with profiling flags

  • For GNU compilers, the flag is -pg
  • For Intel compilers, the flag is -p -g
[user@machine]$ icc test.c -p -g -o app.ex

Step 2. Execute your program as normal

[user@machine]$ ./app.ex

Step 3. The profiling results should be stored in the file gmon.out. To view the results, you will need to use the tool gprof:

[user@machine]$ gprof app.ex
 Flat Profile:
 Each sample counts as 0.01 seconds.

Show Example Output

Additional Information

GNU gprof manual

Users may direct questions to

Powered by MediaWiki