Add runtime checks for accesses beyond the maximum depth of a halo

Open
#64 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
fortran, python
Domain
compilers, hpc

Research direction

Start with the existing internal check in the halo_exchange routine, then trace how PSyclone generates PSy-layer code for loops using redundant computation. Compare the existing read checks with generated write accesses and determine where checks should be inserted before such loops. Done means writes beyond the maximum halo depth are detected at runtime, with coverage for the stated stencil and redundant-computation cases.

Written by the indexing model from the issue text.

Description

LFRic

It is possible to specify a stencil extent, or redundant computation in the halo, or a combination of the two, that causes the code to try to access data that is beyond the maximum halo depth.

The halo exchange code has an internal check for this issue which covers all reads to fields. However, writes to fields are not covered. Therefore PSyclone should add appropriate checking code (re-using or copying the code implemented in the halo_exchange routine) that ensures that write accesses do not go beyond the maximum halo depth.

The simplest way to do this would be before any loop that has redundant computation. A more sophisticated solution would attempt to minimize these checks in any multi-loop PSy-layer subroutines. The simplest option is probably what we should start with. However, looking longer term, we may need the latter solution if we are working towards support for a two-tiered PSy-layer (to help support PGI + OpenACC as well as (potentially) improving performance on other compilers).

Dominant language
Python
Stars
137
Forks
36
Avg merge
6d 16h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stfc/PSyclone

All issues in stfc/PSyclone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.