camfort / camfort

Light-weight verification and transformation tools for Fortran
https://camfort.github.io/
Other
122 stars 15 forks source link

stencils-check ignoring grouped stencils #87

Open GuiltyDolphin opened 7 years ago

GuiltyDolphin commented 7 years ago

For example, with the file failing.f90:

program failing
implicit none

integer i, n
parameter (n = 3)
real a(0:n)

do i = 0, n
 != stencil readOnce, atMost, (pointed(dim=1)) :: a
 != stencil readOnce, atMost, (forward(depth=4, dim=1)) :: a
 a(i) = a(i) + a(i+4)
end do

end program

Running camfort stencils-check failing.f90 we get:

Checking stencil specs for 'failing.f90'

failing.f90
(9:2)-(9:51)    Not well specified.
        Specification is:
                stencil readOnce, atMost, (pointed(dim=1)) :: a

        but at (11:2)-(11:21) the code behaves as
                stencil readOnce, atLeast, (pointed(dim=1)) :: a
stencil readOnce, atMost, (forward(depth=4, dim=1)) :: a

(10:2)-(10:60)    Correct.

Which ignores the fact the stencils are grouped, and if the user were to insert the suggested stencils they would end up with redundant stencils.

madgen commented 7 years ago

Yeah, but this should be very low priority in list of things to do.