Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

How to profile Fortran pgm?

AONym
New Contributor II
1,543 Views

I want to profile a large Fortran project. It runs on Windows XP, using Visual Studio 2005 and Intel Visual Fortran 9.1.

The information I am trying to get is the amount of time spent in each subroutine; then, for selected subroutines, the time spent on each line.

The subroutines are compiled with full optimization, into a DLL (library).

I cannot find anything in the Intel Fortran documentation on how to do this. Note that I am not interested in using VTune, nor any other product.

Anyone know how to do this?

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,543 Views
The compiler product does not include profiling functionality. We recommend Intel VTune for this.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,543 Views

>> Note that I am not interested in using VTune, nor any other product.

Is it that you are not interested in purchasing a profiling product?

-- Or --

Is it that you are not interested in using a profiling product to obtain profiling information?

If the latter then maybe there is a psychic profiler in your vicinity.

If the former, then check out CodeAnalyst at AMD.com - it's free.

You will not be able to use the Event Profiling as the event instructions are different on AMD processors.

However, you can use the timer based profiling to do statistical sampling. Compile with full optimizations and full debug information (will not affect performance). I have not used CA to profile DLL's only static libraries.

When full optimizations are enabled then it is difficult for the debug information to properly synchronize with the code produced. So expect some difficulty in interpreting the statistics by line number.

Jim Dempsey

0 Kudos
AONym
New Contributor II
1,544 Views
Ok, I have downloaded CodeAnalyst. Now I have two questions:

1) The docs say it works with all AMD processors. I am using an Intel machine. Will I still be able to do anything useful?

2) From a quick look at the docs I have no idea how to profile a set of Fortran pgms compiled as a DLL. Is there any information on how to actually do this? Or is this part of the documentation psychic?
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,544 Views

Code Analyst can run the Timer BasedProfiling just fine on an Intel processor. I do this all the tim. This method of test performs a statistical sampling and is quite suitable for locating hot spots in your program. A typical timer interval is 1ms so your runtime for test should be 1 or more minutes in order to get sufficient number of samples.

Code Analyst will not be able to run the Event Based Profiling unless you have AMD processor. Event based profiling is useful when you wish to inspect cache events.

I have not performed profiling with a DLL.

But I do know that the profiler will profile your program including calls tothe system libraries which are DLL's and I can open up disassembly windows and see where the hot spots are. The documentation may provide information as to how to associate the sample data to an execuitable (.EXE)which in turn has the debug info necessary to locate your source files. In your case you may be able to specify the DLL (which was built with the Debug Information) with the hopt that CA will find the source files.

Perfoming help search on DLL I find:

Toggle icon on system data and system graph views that toggle between PID and .DLL files

So you may have some success.

Jim Dempsey

0 Kudos
AONym
New Contributor II
1,544 Views
I understand the processor issue. My other question is something much more basic: I have no idea how to take the profile measurements. I am compiling under VS2005 using IVF 9.1, creating a DLL which is linked with my C++ objects. The compilation is done using full optimization and debugging info. Now I have an executable; how do I profile it?
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,544 Views

The following may work for you

Start | All Programs | AMD | CodeAnalyst | CodeAnalyst.exe
File | New
(You get warning about no on-chip apic, click OK)
General Tab
Project Directory: xxx (I browse for the application folder)
Project Name: xxx (I use application name)
(note, the Projects above are for profiling projects but I use the app folder)

Working Directory: xxx (application .exe folder)
Launch App: project folderDebugxxx.exe (application)
(add any command line args if needed)
Session Type (o) Timer Trigger
Profile Information
The settings for this section depends on the nature of your applicaion.
If on start of your applicaion you need to enter test parameters then consider starting with profile paused.
And set duration to something long (10000 seconds)
After entering the test parameters then click on the right triangle in main window for Go.
Check Stop on app exit or you can press the square box button in main window for stop.
Or use Pause || if you have an input/output section that you want to skip over for sampling.
On the timer tab you can adjust the timer polling interval.
If you have problems you can also check Terminate App box but set an absurdly large duration (ther is an upper limit)
Ignore Error about a project exists in that directory by clicking on Yes
Click Go button (right triangle)
On termination some processing will occur then main window will eventualy show tab with System Data.
The System Data window shows everything running on your system.

Locate your application and double click on it.
This will open a window to your application's profile infomation
All the routiens will be listed.
Click on the [+] to expand for a routine of interest.
Double click on line of interest and source window will open.
In the source window you can click on the [+] to get the dissassembly for the source line if you are interested
clicking on [-] collapses
Play with the column headers to sort by different columns.
This should get you going.
The project configurator is not as intuitive as I would like.
Once your project is configured you can reselect it from the File Window.
Note, the source files are not preserved. As you make edits then the
older profile line numbers will not align with the new line numbers.
Have fun.
Jim Dempsey

					
				
			
			
				
			
			
			
			
			
			
			
		
0 Kudos
Reply