Log In | Users | Register
Edit | Attach | New | Raw | Diff | Print | | Tools
You are here: CM » DocTools » ToolsDbg » ToolPGProf

Profiling source code with pgprof

Which part of my code uses how much time?

This recipe works with the Portland Group pgf90 compiler. It most probably works for other Portland Group compilers as well.

  • Compile the source code with the compiler option -Mprof=func (note that this opion is needed for both the compilation and the link step)
  • Run the executable, this will produce a pgprof.out file.
  • Start the interactive profiler with pgprof pgprof.out -exe your_executable_name

The -Mprof=func gives timing and number of calls on the functions/subroutines level. A very detailed profile can be made with -Mprof=lines, but this is also very time consuming, so you don't want to use this from the start. spacer

This site is managed by the Center for Climate Systems Modeling (C2SM).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems? Send feedback!