Easy to understand profiling information

Hi,

Is there a way to get simple profiling information using pgf77?
What I would like is something as simple as a file that is created at the end of a run that says something like

subroutine A 200 seconds
subroutine C 80 seconds
subroutine D 20 seconds
subroutine A 180 seconds
etc etc

so I can see the flow of my program and how long it spends in each routine.
I’ve looked the docs for pgtools but trying to read it as a pdf makes it all look very very complicated whereas when I used to do this under xlf77 it was as simple as a command line switch. I don’t really want to use a gui because the network here is too slow of any fast response.

Many thanks
Jon

Hi Jon,

We do have many different options regarding profiling but the simplest method is to compile and link with “-Mprof=func”. After you run your application a “pgprof.out” file will contain the results of the profile.

To view the results using pgprof without the GUI, run pgprof with the “-text” flag and enter ‘print’ at the prompt. To have the results redirected to a file, enter ‘print > myfilename’. You can change the times listed to seconds by entering ‘times raw’ before the print.

mm5/Run% pgprof -text

PGPROF Rel 6.0-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.


Datafile  : pgprof.out
Processes : 1
Threads   : 1

pgprof> print

Profile output - Wed Aug 03 10:41:34 PDT 2005
Program                           : mm5.exe
Datafile                          : pgprof.out
Process                           : 0
Total Time for Process            : 180.901216 secs
Sort by max time
Select all


                            Routine              Source  Line
  Calls  Time(%)               Name                File   No.

    720       29              sound             sound.F     1
 32,220       21            exmoiss           exmoiss.F     1
    720       10              solve             solve.F     1
  2,315        7              lwrad             lwrad.F     1
 34,740        6             mrfpbl            mrfpbl.F     2
... cut here

If your prefer Gmon profiling, you can replace “-Mprof” with “-pg”. After the run a ‘gmon.out’ file will be created. You can view the results using gprof or pgprof. pgprof works as in the previous example except you need to launch using:

pgprof -text -exe exe.name gmon.out

Hope this helps,
Mat