Skip to content

Halo add pb test for halo exchange#1044

Draft
TomMelt wants to merge 2 commits intodevelopfrom
halo-add-PB-test
Draft

Halo add pb test for halo exchange#1044
TomMelt wants to merge 2 commits intodevelopfrom
halo-add-PB-test

Conversation

@TomMelt
Copy link
Copy Markdown
Contributor

@TomMelt TomMelt commented Feb 16, 2026

Add periodic boundary test for Halo Exchange

Task List

  • Linked an issue above that captures the requirements of this PR
  • Defined the tests that specify a complete and functioning change
  • Implemented the source code change that satisfies the tests
  • Commented all code so that it can be understood without additional context
  • No new warnings are generated or they are mentioned below
  • The documentation has been updated (or an issue has been created to do so)
  • Relevant labels (e.g., enhancement, bug) have been applied to this PR
  • This change conforms to the conventions described in the README

Change Description

  • Adds a test for halo exchange with periodic boundaries

Test Description

HaloExchangePB_test.cpp

HaloExchangePB_test.cpp is based on HaloExchangeCB_test.cpp. It creates test data for all the array types:

  • HField
  • VertexField
  • DGField
  • DGVector
  • CGVector

They are created in such a way that the value of each cell can be calculated based on its indices. Therefore we can check after exchange that all of the cells have been exchanged successfully.

This would be a good PR for @niravshah241 to take over.

@TomMelt TomMelt added the enhancement New feature or request label Feb 16, 2026
@TomMelt TomMelt self-assigned this Feb 16, 2026
@TomMelt TomMelt mentioned this pull request Feb 16, 2026
8 tasks
@TomMelt TomMelt changed the title Halo add pb test Halo add pb test for halo exchange Feb 16, 2026
TomMelt added a commit that referenced this pull request Mar 16, 2026
# Add corner neighbours into halo exchange logic

### Task List
- [x] Linked an issue above that captures the requirements of this PR
- [x] Defined the tests that specify a complete and functioning change
- [x] Implemented the source code change that satisfies the tests
- [x] Commented all code so that it can be understood without additional
context
- [x] No new warnings are generated or they are mentioned below
- [x] The documentation has been updated (or an issue has been created
to do so)
- [x] Relevant labels (e.g., enhancement, bug) have been applied to this
PR
- [x] This change conforms to the conventions described in the README

---

# Change Description

This PR has the following key changes:

- adds support for corner neighbours to the existing halo exchange logic
(which previously just exchanged edges)
- add support for `CGVector` and `DGVectorHolder` exchange (this is
required for corners and edges)
- updates metadata tests and closed-boundary (CB) halo test to work with
corner neighbours
- removes the Periodic-Boundary (PB) halo exchange test for now, this
will be addressed in a subsequent PR #1044

---
# Test Description

### `HaloExchangePB_test.cpp`

`HaloExchangeCB_test.cpp` creates test data for all the array types:
- `HField`
- `VertexField`
- `DGField`
- `DGVector`
- `CGVector`

I modified the previous version, so that the model data are created in
such a way that the value of each cell can be calculated based on its
indices. Therefore we can check after exchange that all of the cells
have been exchanged successfully. This also now allows us to change the
number of ranks arbitrarily (assuming you also provide the appropriate
`partition_metadata` file.

### `ModelMetadataCB_test.cpp` and `ModelMetadataPB_test.cpp`

Small modifications have been made to the periodic and closed boundary
`ModelMetadata` tests.

The changes now add the additional corner neighbour metadata and check
that it is ready correctly.

### `partition_metadata_3_cb.cdl` and `partition_metadata_3_pb.cdl`

These files are now generated at compile time by running the `decomp`
tool on a new file `halo_test_mask.cdl`. This is in line with similar
changes introduced by @joewallwork on the XIOS tests.

---
# Other Details

* `domain_decop` git commit has now been bumped to the latest version on
main. This version of the decomp tool contains the corner neighbour
metadata.

### Further work

- Integrating halo exchange to nextsim is handled by PR #924
Base automatically changed from halo-add-corners to develop March 16, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants