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

Code Coverage tool with large project

Tom_R_
Beginner
392 Views

My code base is very large and uses many different module files.  I am trying to use the code coverage tool with intel 16.0.3.210 on linux to see how much of the code actually gets used.  My compile creates 6 different libraries (.a files) in 6 different folders, and then they are linked at the end.  When I compile using the option  "-prof-gen=srcpos", each folder has a single pgopti.spi and pgopti.spl file with all of the .o and .mod files. When everything is linked together, the executable is created but there is no pgopti.spi file in the executable directory.  I tried to run the program, and there was no .dyn file generated, so I can't use the code coverage tool.  

1.  Should I only get the single pgopti file in each folder, or am I just overwriting it with each new object file I compile?

2. Does the code coverage tool only work on a single file, or should I be able to use it with multiple module files?  If so, what step am I missing to get it to work?

3.  Does it work for static and/or dynamically linked executables?

 

Thanks for the help

0 Kudos
3 Replies
Kevin_D_Intel
Employee
392 Views

This should work for your app and static libs. When you build the static libs, I expect you already are, but make certain to use xiar and not the gnu ‘ar’.

The easiest method to make this work is to compile all your source files with at least these two options:

-prof-gen=srcpos   -prof-dir=<a-common-directory>

Where “<a-common-directory>” is a directory where the compiler can auto-concatenate the profile info into single .spi/.spl files for the complete application (including all the static libs).

Once the compilation is complete, run the executable the desired number of times to generate the .dyn files. These too will automatically collect in the directory specified by -prof-dir= option.

Next, “cd” (change directory) into the -prof-dir= directory, run profmerge followed by codecov. Now open the CODE_COVERAGE.HTML in the browser.

0 Kudos
Tom_R_
Beginner
392 Views

Using xiar and -prof-dir= were great suggestions and seemed to get it done.  It gave me a .dyn for each rank that ran.

0 Kudos
Kevin_D_Intel
Employee
392 Views

Glad to hear that.

0 Kudos
Reply