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

code coverage: Execution count for all lines in program

awa5114
Beginner
576 Views

In the gfortran compiler gcov allows the developer to determine how many times each line has executed in a program. For instance if i have a do loop, the instrumented code run shows me how many times the lines within the loop have been executed.

Is it possible to do the same in ifort? I get the color coded coverage and that's nice, but I need quantitative information about how many times all my lines have run, and then I'd like to sift through them to see which ones are running the most times.

Also, is it possible to instrument code such that I can query it after a run? I've heard code coverage outputs html and xml files. Is it possible to query, for instance, the xml file to do some proper reflection/instrospection/code analysis? Like for example returning all derived types in my code, all global variables, lines which have run above a certain number of times etc.

0 Kudos
2 Replies
awa5114
Beginner
576 Views

Allright so I figured out how to include execution count information under Tools>Intel Composer > Settings> Show Execution Counts to TRUE

I still don't understand the numbers that are coming up on my coverage report. Here's some sample code

 

Do i=1,LT
              ^ 8,842 (2/3)
   264)         C=Tmp(i:i)
                ^ 16,916 (2/3)
                  ^ 59,206 (7/14)
   265)         j=ichar(c)
                ^ 8,458 
   266)         If (j.Ge.97.And.j.Le.122) Then 
                ^ 8,458 (1/2)
   267)           Tmp(i:i)=Char(j-32)
                  ^ 0 (13) ^ 0 (3)
   268)         End If
   269)       End Do

 

What do the numbers mean? Specifically the number after the ^ symbol and the numbers in parentheses. Why are the numbers in parentheses sometimes fractions?

0 Kudos
awa5114
Beginner
576 Views

Also what is the difference between a function and a block?

0 Kudos
Reply