mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Wed Aug 03, 2005 10:59 am Post subject: |
|
|
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.
| Code: | 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:
| Code: | | pgprof -text -exe exe.name gmon.out |
Hope this helps,
Mat |
|