Page tree
Skip to end of metadata
Go to start of metadata

Gprof for Sequential Programs

The gprof profiler provides information on the most time-consuming subprograms in your code. Profiling the executable prog.exe will lead to profiling data being stored in gmon.out which can then be interpreted by gprof as follows:   

Usage

For the Intel compilers do:

ifort -p -o prog.exe prog.f
./prog.exe
gprof ./prog.exe gmon.out

For the GNU compilers do:

gfortran -pg -o prog.exe prog.f
gprof ./prog.exe gmon.out

Gprof For Parallel Programs

Usage

Compilation:    

mpif90 -pg -g -o prog.exe prog.f

PBS script:     

...
mpirun /apps/pgprof/parallel_gprof prog.exe

The code of parallel_gprof:

export GMON_OUT_PREFIX=gmon.out.$PBS_JOBID.$OMPI_COMM_WORLD_RANK
  • No labels