Remove neighbour duplication#87
Open
TomMelt wants to merge 2 commits into
Open
Conversation
Previously, neighbours across periodic boundaries were tracked in separate data structures (_neighbours_p, _sendPos_p, _recvPos_p, _cornerNeighbours_p, _cornerSendPos_p) with a dedicated getNeighbourInfoPeriodic() method and separate NetCDF output paths. This change merges periodic neighbour info into the same maps used for non-periodic neighbours, removing redundant code and data structures: - Removed getNeighbourInfoPeriodic() entirely - Removed periodic dimension/variable definitions from saveMetadata() - Removed periodic data writes from saveMetadata() - Consolidated periodic and regular neighbours into _neighbours, _sendPos, _recvPos, _cornerNeighbours, _cornerSendPos
d7ac15e to
8a28401
Compare
…bdas - Replace duplicated edge/corner loop logic with templated compute_dims() - Introduce DimInfo struct to group neighbour dimension data - Add lambda helpers (def_dim, write_array, write_scalar) to reduce repetitive nc_* calls
8a28401 to
b154a94
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unify periodic and non-periodic neighbour info
Closes #84
Summary
Merged periodic neighbour tracking into the same data structures used for non-periodic neighbours. Since a neighbour cannot be both periodic and non-periodic at the same time, separate
_psuffixed maps were redundant.Changes
getNeighbourInfoPeriodic()and merged all periodic neighbour data (halo sizes, send/recv buffer positions, corner neighbours) into the existing_neighbours,_sendPos,_recvPos,_cornerNeighbours, and_cornerSendPosmaps._neighbours_p,_sendPos_p,_recvPos_p,_cornerNeighbours_p,_cornerSendPos_pmember variables and the periodic overload ofgetNeighbourInfoPeriodic().saveMetadata— replace duplicated edge/corner loops with a templatedcompute_dims()function; introduceDimInfostruct to group neighbour dimension data; use lambda helpers (def_dim,write_array,write_scalar) to reduce repetitivenc_*callsTests
Updated all reference CDL files to match the unified neighbour output (periodic neighbour IDs now appear in the standard (non-periodic) fields)
TODO