3

I have a project that I compile with the intel toolchain. All the .f90 files are compiled to corresponding .o files in the bin directory. When I use the codecov utility I get an HTML with the list of covered files. However that list is missing a bunch of files which should be eligible for coverage. Some of the modules contained in those files are even used during the runs.

What could be a reason for these files to be missing from the coverage report?

EDIT

Running the binary with a debugger I noticed something which might be a clue.

If I try to set a breakpoint in the files that are not covered gdb throws an error:

No line xxx in file "disturb_coms.f90".

However disturb_coms.f90 is in the bin folder:

manfredo@cave05:build$ ll bin-dbg-A/disturb*
-rw-r--r--  1 manfredo  staff    15K Jun 29 10:41 bin-dbg-A/disturb_coms.f90
-rw-r--r--  1 manfredo  staff   3.9K Jun 29 10:41 bin-dbg-A/disturb_coms.mod
-rw-r--r--  1 manfredo  staff   4.9K Jun 29 10:41 bin-dbg-A/disturb_coms.o
-rw-r--r--  1 manfredo  staff   221K Jun 29 10:43 bin-dbg-A/disturbance.f90
-rw-r--r--  1 manfredo  staff   4.1M Jun 29 10:43 bin-dbg-A/disturbance.o
-rw-r--r--  1 manfredo  staff   3.2M Jun 29 10:43 bin-dbg-A/disturbance_utils.mod

and was compiled with:

ifort -c -FR -CB -O0 -check -g -prof-gen=srcpos -debug full -debug-parameters all -fpe0 -traceback -ftrapuv -fp-stack-check -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces -I../../src/include -I/usr/local/hdf5_mio/include disturb_coms.f90

Furthermore a file called disturbance.f90 contains the following lines:

module disturbance_utils

   contains

  subroutine apply_disturbances(cgrid)
...  
      use disturb_coms , only : treefall_disturbance_rate ! ! intent(in)
...   
           cpoly%disturbance_rates(2,2,isi) = treefall_disturbance_rate  
...

end subroutine apply_disturbances

end module disturbance_utils

where disturb_coms is used, and the file disturbance is actually covered.

EDIT

By adding a write instruction inside disturb_coms.f90 and trying to compile I get the following error:

disturb_coms.f90(44): error #6274: This statement must not appear in the specification part of a module.
write(*,*) "try"
^

I don't have much experience with Fortran but it looks to me as if that module is a kind of c-equivalent header file. Would there still be a possibility to cover that file as well? Like just checking that the definitions contained there are used elsewhere?

Manfredo
  • 1,760
  • 4
  • 25
  • 53
  • Maybe show some example? It is really hard to guess what could be going on on someone's computer. – Vladimir F Героям слава Jun 28 '17 at 20:19
  • There's not much I can give as example since the `codecov` utility is kind of a blackbox. To put it with numbers out of the 110 object files that I have in the bin folder only 91 are evaluated (covered + uncovered). For at least some of the missing I can clearly see that the corresponding modules are used in active pieces of the code. – Manfredo Jun 28 '17 at 20:59
  • Are all files compiled with the codecoverage options and are there no old files lying around (please remove all generated files and rebuild, checking the options of on the command lines of the, missing, files). – albert Jun 29 '17 at 05:17
  • I cleaned the project and made a fresh installation. I also checked that all the files including the one that are not show in the coverage report are compiled with `-prof-gen=srcpos`. Nothing changed so far. – Manfredo Jun 29 '17 at 09:03
  • The error says that you cannot just put a write statement ino a module, it is like putting a printf before int main. you put it into some procedure. Modules are not aomething executable. – Vladimir F Героям слава Jun 29 '17 at 12:47

0 Answers0