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

Differential code coverage

awa5114
Beginner
474 Views

I am interested in wielding the differential code coverage functionality in ifort. The documentation appears to address this thoroughly but I have failed to apply it to my reduced example. Heres what I have:

program test
	integer :: userinput
	print *, 'enter 1 or 0'
	read *, userinput
	
	if (userinput.eq.1) then
		print *, 'You have entered ONE'
	else
		print *, 'You have not entered ONE'
	end if
end program test

A simple program that can take one of two paths. If the user enters 1 then it goes into the if ... then statement, if the user enters 0 then it goes into the else... statement.

The goal of differential code coverage (as stated by intel docs) is as follows:

compare the profiles from two runs of an application: a reference run and a new run identifying the code that is covered by the new run but not covered by the reference run

So if we take a reference run where the user enters 0 and a new run where the user enters 1, the differential code coverage should be able to identify that the new run covers the if statement whereas the reference run does not (reference run goes into the else statement). I followed the docs as closely as possible. The source file is called test.f90. Here are the compile lines i'm using:

ifort test.f90 /Qcov-gen

Which generates PGOPTI.SPI, PGOPTI, test.exe and test.obj. I then run the executable and enter 0, I get the correct message "You have not entered ONE". This causes a .dyn file to be created (due to the Qcov-gen option). I then do the following:

profmerge

Which generates additional files pgopti.dpi, pgopti.dpi.lock. At this point I think I have enough material to generate my reference data. This I attempt using the following:

codecov -prj Project_Name -dpi pgopti.dpi -ref pgopti.dpi

Which generates html files similar to the ones displayed when code coverage is run in Visual Studio for Intel Fortran. I also get 100% code coverage which seems incorrect. The docs then show this command:

codecov -prj Project_Name -spi pgopti.spi -dpi pgopti.dpi 

Which does not appear to provide an opportunity for a new run. 

Could someone please explain how to do a simple differential code coverage on this particular example? I'm eventually trying to extrapolate this to a larger project but I'm trying to take baby steps to get there.

Thanks 

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
474 Views

I had never seen the part about differential coverage analysis. Normally one does all the runs and then uses profmerge. But when I look at the documentation for differential analysis, it does not show using profmerge.

The folks at Intel who do understand these tools don't follow the forums. I suggest entering a support request through the Online Service Portal and see if you can get more details.

View solution in original post

0 Kudos
3 Replies
awa5114
Beginner
474 Views

Could someone please provide a response to this? This feature is in the documentation and so should be possible to implement. Furthermore I am using it on a basic example so I don't really see why its not working.

0 Kudos
Steve_Lionel
Honored Contributor III
475 Views

I had never seen the part about differential coverage analysis. Normally one does all the runs and then uses profmerge. But when I look at the documentation for differential analysis, it does not show using profmerge.

The folks at Intel who do understand these tools don't follow the forums. I suggest entering a support request through the Online Service Portal and see if you can get more details.

0 Kudos
awa5114
Beginner
474 Views

Thanks for your response. I have created a new support ticket request (03078880) to address this. It would be good to know whether this capability is available in ifort...

0 Kudos
Reply