FCAT (FORTRAN Coverage Analysis Tool) is used for the Coverage Analysis of FORTRAN codes.
If you are a FORTRAN code developer: Finding out "cold-spot" is particularly useful for code developers during the test stage of their software in either eliminating these "cold-spot", or in designing more complete test suite to fully test these parts of the codes. Finding out "hot-spot" could be useful for developers in optimizing their code.
If you are a FORTRAN code user: both capabilities also help a user in the analysis and understanding of codes written by other people.
Suppose you have the following F90 code
module sub_mod contains subroutine sub1(j) integer j j = 1 end subroutine sub1 subroutine sub2(j) integer j j = 2 end subroutine sub2 end module sub_mod program junk use sub_mod integer i,j do i = 1, 100 if (i > 200) then call sub1(j) else call sub2(j) end if end do end program junk
Analysising this code with FCAT gives you the following report (unexcuted lines are marked with "*>". Number of excution counts are given for excuted lines):
module sub_mod contains subroutine sub1(j) integer j *> j = 1 end subroutine sub1 subroutine sub2(j) integer j 100 j = 2 end subroutine sub2 end module sub_mod program junk use sub_mod integer i,j 1 do i = 1, 100 100 if (i > 200) then *> call sub1(j) 100 else 100 call sub2(j) 100 end if 100 end do end program junk ========================================= FCAT SUMMARY REPORT Code a.f90 has 24 lines: 9 are executable lines of which 2 are not executed =========================================The above is just a simple example. It is easy to use FCAT for large codes by simple modifications to the makefile.
You can read the README file.
Thanks are due particularly to Dr. Robert Allan and Prof. John Reid, for testing this software and giving valuable comments.
|