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

Profiling

cvpsmith
Beginner
1,200 Views
Am I to understand that Intel Visual Fortran has no built-in profiling tools (i.e. the ability to profile the percentage of time spent in each subroutine)? This was built-in with Compaq Visual Fortran, and the only thing I've been able to find RE profiling with IVF is the VTune addon. Unfortunately, the EDU version of the profiler costs as much as IVF itself! Please tell me there is another way...
0 Kudos
9 Replies
rase
New Contributor I
1,200 Views
It may sound like a sacrilege in this forum, but why don't you try AMD's CodeAnalyst profiler? As far as I know it works ok with Intel processors as well. And it's for free.
The download page: http://developer.amd.com/CPU/CODEANALYST/Pages/default.aspx
0 Kudos
cvpsmith
Beginner
1,200 Views
Quoting - rase
It may sound like a sacrilege in this forum, but why don't you try AMD's CodeAnalyst profiler? As far as I know it works ok with Intel processors as well. And it's for free.
The download page: http://developer.amd.com/CPU/CODEANALYST/Pages/default.aspx

Thanks for the link! I'll try it!!
0 Kudos
TimP
Honored Contributor III
1,200 Views
Quoting - rase
why don't you try AMD's CodeAnalyst profiler?
CodeAnalyst should perform the basic functions requested in the original post, although it doesn't deal with Intel hardware counters.
As to the profiling tool which was in CVF, my understanding is that it counted frequencies of execution, but didn't measure performance. The prof_gen option of ifort has some similar capability, in addition to the compiler feedback. We were using VTune with CVF before that compiler was discontinued.
The support of gprof in gfortran is a huge advantage, but it's not available for mingw. There again, the choice is CodeAnalyst or VTune/PTU.
0 Kudos
cvpsmith
Beginner
1,200 Views
Quoting - tim18
Quoting - rase
why don't you try AMD's CodeAnalyst profiler?
CodeAnalyst should perform the basic functions requested in the original post, although it doesn't deal with Intel hardware counters.
As to the profiling tool which was in CVF, my understanding is that it counted frequencies of execution, but didn't measure performance. The prof_gen option of ifort has some similar capability, in addition to the compiler feedback. We were using VTune with CVF before that compiler was discontinued.
The support of gprof in gfortran is a huge advantage, but it's not available for mingw. There again, the choice is CodeAnalyst or VTune/PTU.

I'm not sure that this CodeAnalyst software will do exactly what I am needing though. I actually need a profiler that will tell me what percentage of total runtime (or time) is spent in each subroutine, i.e.:

MAIN 100%

Subroutine_A 60%

Subroutine_B 40%

... etc.

I don't see a way to do this in CodeAnalyst...


0 Kudos
gib
New Contributor II
1,200 Views
Quoting - cvpsmith

I'm not sure that this CodeAnalyst software will do exactly what I am needing though. I actually need a profiler that will tell me what percentage of total runtime (or time) is spent in each subroutine, i.e.:

MAIN 100%

Subroutine_A 60%

Subroutine_B 40%

... etc.

I don't see a way to do this in CodeAnalyst...


I'll follow responses to your post with interest, because I haven't seen how to do it either.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,200 Views
Quoting - gib
I'll follow responses to your post with interest, because I haven't seen how to do it either.

Hm, I find it straightforward. For each run, CodeAnalyst generates a TBP session, accessible from the left pane. When you double-click it, you get a list of modules (exes and dlls), and when you double-click yours, you get the list of routines sorted by execution time in a new window. You can double-click each in turn...

You do have to do a build with debug information though.
0 Kudos
gib
New Contributor II
1,200 Views
Quoting - Jugoslav Dujic

Hm, I find it straightforward. For each run, CodeAnalyst generates a TBP session, accessible from the left pane. When you double-click it, you get a list of modules (exes and dlls), and when you double-click yours, you get the list of routines sorted by execution time in a new window. You can double-click each in turn...

You do have to do a build with debug information though.
Ah, debug info!
Thanks
0 Kudos
gib
New Contributor II
1,200 Views
For anyone not sure about this, you just need (in VS):
Linker | Debug | Generate Debug Info | Yes

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,200 Views

The problem you may encounter is

Main calls A
Main calls B
A calls B

Usually the counting only ticks the counter of the current routine instead of ticking the counters of all the routines in the call stack. The profiler may have an option to do that but I have not used that and have found little use for that.

The typical way it works is on a clock interrupt the IP of the app is recorded to a log file. On first detection the counter is set to 1, on subsequent detections the counter is incremented. On end of test run the addresses are corrilated with the debug info to locate the functions in which the save IP was at and a proper report is produced relating counts to source code.

What you are asking for is on tick, not only enter the count for the IP, but also examine the VM and unwind the stack and add a tick count to the function call (for all levels of call). I believe you can select this type of logging. The profiling will take longer when you do it this way. The resultant report may be interesting but not necessarily as useful as the time spent executing code in the routine (as opposed to including the time spent in routines called by the routine).

What good does it tell you when you see main consuming 100% all the time.

Jim Dempsey
0 Kudos
Reply