PSyclone
PSyclone copied to clipboard
GOcean accepts kernels that cannot be parallelised
In some tests it was discovered that gocean accepts kernels that cannot be parallelised (because of a stencil access, and a write statement to the same field): https://github.com/stfc/PSyclone/pull/2497/files#r1505787613
I have to admit I wasn't aware that this is a requirement, but I think it also needs to be stressed more in the documentation. ATM we only have (https://psyclone.readthedocs.io/en/latest/kernel_layer.html#kernel-layer):
The reason for doing this is that it gives the PSy layer the responsibility of calling the Kernel over the spatial domain which is where parallelism is typically exploited in finite element and finite difference codes. The PSy layer is therefore able to call the kernel layer in a flexible way (blocked and/or in parallel for example). Kernel code in the kernel layer is not allowed to include any parallelisation calls or directives and works on raw Fortran arrays (to allow the compiler to optimise the code).
Not sure if I've missed a stronger statement elsewhere.
TODO:
- Reject kernels that have read-write accesses to a field in a kernel (including checks for LFRic)
- Update the documentation if required.