PGPROF Profiling

PGPROF is the code profiling utility for the Portland Group (PGI) compiling suite. The PGPROF tool is enabled by setting a profiling flag while compiling with the PGI compiler. Executables are then run normally.  Upon program completion, the PGPROF tool prints profiling statistics which can be viewed graphically with the "pgprof" program. PGPROF is available for use with C, C++, or Fortran code compiled with the PGI pgcc, pgCC, or pgf90 compilers.

Please follow the steps below to acquaint yourself with the PGPROF tool.  Users seeking additional information, such as how to produce other kinds of profiling output, may refer to the official PGPROF Profiler Guide.

1. Load the PrgEnv-pgi module.

2. Add the "-Mprof=func" flag to your normal PGI compilation statement.  Your particular build approach may vary.  For example you might need to pass the flag through a configure script option instead of directly stating the flag on the command line.

3. Submit your job to the batch scheduler with adequate walltime.  With the additional PGPROF layer added onto your executable, the job should finish in about the same amount of time.  Note that if your batch job is killed abnormally, the profiling data files will be generated in an unexpected location.

4. Following program completion, many timing and statistics files will appear in the program's current working directory along with a file named "pgprof.out".  Open this file with the command "pgprof pgprof.out". You should see a window like this:

If you receive the message "Can't determine executable for file 'pgprof.out'" then you need to use the menu option "File >> Open Profile..." to set the path to your program executable.

If you receive the error "pgprof-Error-Cannot open X DISPLAY", this means your X11 forwarding (graphical interface) connection to the remote system is missing.   Please read the knowledge base article Running X Windows Applications Remotely to learn how to set up a remote connection with graphical viewing capabilities enabled.

Back to Top