PSyclone
PSyclone copied to clipboard
Re-evaluate stencil declaration
Now that we have the ability to parse code (including kernels), we should re-evaluate the need to declare stencial accesses in the meta-data, since we might be able to determine the actual stencil based on the code.
Complications:
- Calling other subroutines would either require the follow the whole call tree (which we can do in most cases, except for usage of function pointers - but it will be quite expensive due to the fparser overhead)
- Even if no subroutine is called, the access pattern could be hidden:
ip = i+1
im = i-1
...
a(ip, j) = a(im,j)
etc.
The same could also be done for LFRic, though due to the indirect addressing that might be impossible to do statically.
Potential outcomes:
- We make the stencil declaration optional
- We use the stencil meta data for verification (potentially at run time, i.e. a debug option that could be enabled?)
I believe that it is best to keep the stencil metadata - it makes it explicit to everyone what is going on. However, I do really like the idea of being able to verify it. (As an aside, we should make it possible to disable such verification as there are times when I've found it useful that PSyclone doesn't check things - it lets us try things out.)