Skip to content

mpi: Localise SubDimension thicknesses covering a whole rank exactly - #3068

Draft
ggorman wants to merge 1 commit into
mainfrom
fix-subdomain-thickness
Draft

ggorman wants to merge 1 commit into
mainfrom
fix-subdomain-thickness

Conversation

@ggorman

@ggorman ggorman commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

index_glb_to_loc(offset, side) returned one past the last local index when the offset covered the whole local subdomain, so a rank lying entirely in a left/right boundary layer got a thickness one larger than its extent and the loop ran past its data: with 4 ranks x 16 points and a 20-point layer, rank 0 and rank 3 got 17, corrupting the heap.

The function now always returns an index, as asked on #2993, and the callers convert it to a count (left, right and middle alike; middle was already correct on main). #3034's call-site clamp also fixes the left/right symptom; this is the alternative that keeps the function's contract, and #3034's tests pass on top of it without the clamp.

Tests: a serial index case in test_data.py; test_mpi.py::TestOperatorAdvanced::test_thickness_covering_ranks[left|right|middle] (4 ranks). With the whole fix reverted the three MPI cases fail; with only the conversion reverted, middle fails (15 != 16).

Refs #2993, #3034.

🤖 Generated with Claude Code

`index_glb_to_loc(offset, side)` returned one past the last local index
when the offset covered the whole local subdomain, so the thickness of a
rank lying entirely in a left or right boundary layer exceeded its extent
by one, and the boundary loop ran past the rank's data. Return the last
index instead, and convert it to a count in the same way for left, right
and middle SubDimensions
@ggorman ggorman added the MPI mpi-related label Oct 16, 2026
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.21%. Comparing base (2707ac9) to head (22fdd71).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_mpi.py 13.04% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3068      +/-   ##
==========================================
- Coverage   84.23%   84.21%   -0.02%     
==========================================
  Files         258      258              
  Lines       57070    57091      +21     
  Branches     4874     4874              
==========================================
+ Hits        48072    48079       +7     
- Misses       8170     8188      +18     
+ Partials      828      824       -4     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.51% <60.00%> (+<0.01%) ⬆️
pytest-gpu-gcc- 79.00% <33.33%> (-0.01%) ⬇️
pytest-gpu-icx- 78.90% <33.33%> (-0.02%) ⬇️
pytest-gpu-nvc-nvidiaX 69.08% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MPI mpi-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant