MetOffice / MetOffice/lfric_core

Support unset data for halos

Open
#322 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Fortran
Stars
26
Forks
73
Avg merge
1d 8h
Merged PRs (30d)
4

Description

Fields passed as `GH_INC` inputs to a kernel have their dof values updated by the kernel. The kernel will need to loop into the halo to ensure owned dofs that a rank shares with neighbours are set correctly. Looping into the halos means incrementing both the shared dofs and the dofs in the halos.

If the `GH_INC` field had previously been initialised using `setval_x`, its halo values would be uninitialised (and also its annexed dof values if PSyclone is not configured for redundant computation). If numerical checking is switched on this leads to the potential for numerical failures should such dofs contain junk. To avoid such problems, most applications need to use `set_val_c` to initialised fields, and to include a PSyclone transformation to force the `setval_c` to run into the halo.

(NB. A transformation to force `setval_x` to run into the halo is likely counterproductive, as it results in PSyclone generating more halo swaps).

Testing deeper levels of redundant computation would need deeper levels of setval_c initialisation to avoid computing with uninitialised data.

PSyclone and LFRic could instead be updated to support an additional state of the halo and annexed dofs of `unset`. GH_INC kernels could define a safe value to initialise the GH_INC halos that prevents calculations within the kernels generating numerical errors. PSyclone could generate code to initialise just the halos/annexed dofs where required. It would mean developers no longer needing to add `setval_c` calls to initialise `GH_INC` fields, which simplifies things for developers and should deliver a worthwhile if moderate performance benefit.

See associated issue: [​PSyclone issue 2076](https://github.com/stfc/PSyclone/issues/2076).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the associated PSyclone issue 2076 and tracing how GH_INC fields, setval_x, and setval_c currently handle halos and annexed dofs. The work is done when unset halo data can be safely handled without requiring developers to add setval_c initialization calls, with appropriate behavior for redundant computation levels.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
distributed-systems, hpc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.