Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4995 Discussions

Profiling Fortran code with VTune on Linux

Dny
Beginner
444 Views

Hello ,

I'm profiling a code in fortran 90 using VTune Performance Analyzer 9.1 for Linux* build 226 .

I have a file which has a subroutine (E.g. INNER_SUBROUTINE) defined inside another subroutine(E.g. OUTER_SUBROUTINE) and outer subroutine call to inner subroutine.
But when I goes down to function level in VTune it shows me different function name .

When I go down to see the source code vtune giving an error "Cannot open Source view data".

See the sample code below.

SUBROUTINE OUTER_SUBROUTINE(NM)
--------
--------
CALL INNER_SUBROUTINE (NM)
--------
--------

CONTAINS

SUBROUTINE INNER_SUBROUTINE (NM)
--------
--------
END SUBROUTINE INNER_SUBROUTINE

END SUBROUTINE OUTER_SUBROUTINE


Can you please tell me how I can drill down to source of hotspot function for fortran subroutine?

Thanking You,

Regards,
Dny
0 Kudos
6 Replies
Peter_W_Intel
Employee
444 Views
Hi Dny,

I just have one tip - if the useruses .F file in makefile and the compiler compiles it, the VTune Analyzer should make the .f (lower-case) post processed source files available. So you can copy the original .F file into a file named .f (lower-case) then try again in VTune Analyzer.If you aren't using .F file, please ignore this response.

Regards, Peter
0 Kudos
Dny
Beginner
444 Views
Hi Dny,

I just have one tip - if the user uses .F file in makefile and the compiler compiles it, the VTune Analyzer should make the .f (lower-case) post processed source files available. So you can copy the original .F file into a file named .f (lower-case) then try again in VTune Analyzer. If you aren't using .F file, please ignore this response.

Regards, Peter



Hello Peter,

All my file extension is .f90, so Can't use your tip :( .

Thanks ,
Dny
0 Kudos
Dny
Beginner
444 Views
Quoting - Dny



Hello Peter,

All my file extension is .f90, so Can't use your tip :( .

Thanks ,
Dny

Hello All,
I did not get suggession gor long time.
Does this mean that I cant use VTune for fortran code sampling ?

Thanking you,
Regards,
Dny
0 Kudos
TimP
Honored Contributor III
444 Views
Quoting - Dny
All my file extension is .f90, so Can't use your tip :( .

If you're not using pre-processing, the issue Peter is trying to help with is not present. If you do pre-process .F90 source files, the situation is exactly parallel to the one with .F file preprocessing.
The linker symbol name of a CONTAINS function has the name of the containing routine or module prepended. 11.0 compiler is more consistent about doing this, as the f2003 standard is more explicit about CONTAINS functions belonging (n so many words) to a separate namespace. So, if you want to refer to the contains function by name in debugger, you must figure out (or look up) the concatenated name.
0 Kudos
Dny
Beginner
444 Views
Quoting - tim18
If you're not using pre-processing, the issue Peter is trying to help with is not present. If you do pre-process .F90 source files, the situation is exactly parallel to the one with .F file preprocessing.
The linker symbol name of a CONTAINS function has the name of the containing routine or module prepended. 11.0 compiler is more consistent about doing this, as the f2003 standard is more explicit about CONTAINS functions belonging (n so many words) to a separate namespace. So, if you want to refer to the contains function by name in debugger, you must figure out (or look up) the concatenated name.

Hello Sir,
Thanks for your reply,
A you said I see the function name in VTune which is formed by module name , outer subsroutine name and inner subroutine name (I observe that it has format __ ). It means we cant find same function name in any of my source files , so VTune giving me error of not able to view data .
can you please guide me how should I compile (any specific flags to be used ) my application so that I can see the source code of hot spot function in VTune.

Thanking You,

Regards,
Dny.
0 Kudos
TimP
Honored Contributor III
444 Views
I don't think it's a question of compile flags. It would be worth while to try to find posts on the Fortran forums about debugging CONTAINS inernal functions; it's a similar issue, and something may have been said about how to deal with it. If not, it's enough of an inconvenience to merit filing an issue on your premier.intel.com account. It may be a combination Fortran compiler/debug/VTune issue, for all I know. You would have to choose whether to file against the compiler or against VTune; it would be worth while to point out that it could be the other, and give all your version information for both compiler and VTune.
0 Kudos
Reply