Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

compile optiion for profiling

yingwen
Beginner
2,064 Views
Hello,

I am asking for help of profileing optinion of Fortran comlier.
The version of my Fortran compiler is 11.1.058 and the version of MAC OS is Leopard.

I use the option '-pg' for finding out that the time performance of each subroutine.
A.out file made successfully but the gmon.out file can not be generated as well.
I know that Shark is also a useful tool for this profiling but I am not a MAC user and not familier to MAC system.
So the best choise for me is the "-pg" can be used in the machine that I am using rignt now.
(Because the same program will be run on other machine that not is MAC)

Pleasse give some hints to solve this problem. Thank you very much.
0 Kudos
7 Replies
TimP
Honored Contributor III
2,064 Views
When the a.out is correctly linked with -pg option, the gmon.out file is written in the current directory during normal termination when the a.out is executed. You're mighty short on hints as to whether you have even studied what you should be doing to make it work, or what you mean by "this problem."
You can't use it to profile ifort itself; you could do so for a compiler for which you have full source code.
0 Kudos
Kevin_D_Intel
Employee
2,064 Views

You are likely using Xcode 3.1.x. There was an earlier issue where no gmon.out is produced when using Leopard and Xcode 3.1.x. See the discussion (here). This was not an Intel compiler issue so to resolve this you must upgrade to at least Xcode 3.2.

Another option you will want to compile with is: -save-temps (Be sure to add this option to each ifort invocation if compiling multiple source files separately.)

An example complete command-line would be: ifort -pg -save-temps sample.f90
0 Kudos
yingwen
Beginner
2,064 Views
Thank you for your reply,

I have tryed the option "-save-temps" and I found it did not work.
When I use the "-save-temps" option, ".o" is generated but "gmon.out" is still not generated.

I am using Xcode 3.1 right now I will try to up grade the X code as soon as I can and try it again to see that if this problem will be solved.

Thank you very much.


Quoting - Kevin Davis (Intel)

You are likely using Xcode 3.1.x. There was an earlier issue where no gmon.out is produced when using Leopard and Xcode 3.1.x. See the discussion (here). This was not an Intel compiler issue so to resolve this you must upgrade to at least Xcode 3.2.

Another option you will want to compile with is: -save-temps (Be sure to add this option to each ifort invocation if compiling multiple source files separately.)

An example complete command-line would be: ifort -pg -save-temps sample.f90

0 Kudos
yingwen
Beginner
2,064 Views
Hello,

I have tried to up grade my Xcode to ver. 3.2, but I can not up grade it since I am using MAC OS 10.5.8.

Is there any other way to solve this profiling problem?

I checked the usage of Shark and I still think that the most appropriate tool for profiling my programs is the profiling option since I have to check the time that each subroutine takes and the times that every subroutine is called.
0 Kudos
Kevin_D_Intel
Employee
2,064 Views

I've never tried myself, but you might look into how to downgradeto Xcode 3.0 then. The bug you're hitting affects Xcode 3.1.x from what I understand. I can successfully use gprof profiling with the 11.1 compiler under Mac OS 10.5.7 and Xcode 3.0. The issue you're hitting is reproducible only with Xcode 3.1.x.

I haven't had occassion to toy around with Shark lately but it may satisfy your needs but I'm not an expert on the tool, sorry.
0 Kudos
yingwen
Beginner
2,064 Views
Thank you for your kind reply, Kelvin.

My group and I decide to use other way to see the performance of our programs.

Thank you for providing many possible way to solve this problem.

0 Kudos
Kevin_D_Intel
Employee
2,064 Views

You're welcome. Best wishes going forward.
0 Kudos
Reply