Skip to content

compiler: Fix MPI data distribution for free surface use cases - #3105

Open
FabioLuporini wants to merge 10 commits into
mainfrom
fix/mpi-runtime-correctness
Open

FabioLuporini wants to merge 10 commits into
mainfrom
fix/mpi-runtime-correctness

Conversation

@FabioLuporini

Copy link
Copy Markdown
Contributor

WIP

also a bunch of extra minor tweaks

@FabioLuporini FabioLuporini added the bug-C bug in the generated code label Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.82353% with 77 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.97%. Comparing base (22830c8) to head (9b1c076).

Files with missing lines Patch % Lines
tests/test_mpi.py 18.30% 58 Missing ⚠️
devito/types/sparse.py 11.76% 15 Missing ⚠️
devito/operations/interpolators.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3105      +/-   ##
==========================================
- Coverage   84.52%   83.97%   -0.56%     
==========================================
  Files         260      260              
  Lines       58599    58758     +159     
  Branches     4978     4988      +10     
==========================================
- Hits        49532    49343     -189     
- Misses       8240     8569     +329     
- Partials      827      846      +19     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX ?
pytest-gpu-gcc- 79.19% <57.75%> (+<0.01%) ⬆️
pytest-gpu-icx- 42.65% <25.13%> (-36.48%) ⬇️
pytest-gpu-nvc-nvidiaX 69.27% <46.00%> (-0.02%) ⬇️

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.

Comment thread devito/types/sparse.py Outdated
or len(np.unique(offsets, axis=0)) != len(offsets)):
return self.grid.distributor.glb_to_rank(self._support) or {}

# A tensor stencil intersects a Cartesian rank exactly when its

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given the condition above, this looks like a by hand "optimization" that i'm not sure warrants that much code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplified significantly

Comment thread devito/types/sparse.py Outdated
def _support_indices(self):
# Staggered tables may use a different base cell across an MPI
# boundary. Match their fp64 geometry and actual stencil support.
spacing = np.array([as_fp64_decimal(h) for h in self.grid.spacing])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should likely be grid properties

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, done

Comment thread devito/data/decomposition.py Resolved
Comment thread tests/test_mpi.py Outdated
@pytest.mark.parametrize('ndim', [1, 2, 3])
@pytest.mark.parametrize('interpolation,radius',
[('nearest', 0), ('linear', 1), ('sinc', 4)])
def test_tensor_support_rank_intersections(self, mode, ndim, interpolation, radius):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't understand what this actually ttests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed

@FabioLuporini
FabioLuporini force-pushed the fix/mpi-runtime-correctness branch from 8de2214 to 661aabc Compare November 5, 2026 17:25
Comment thread devito/types/sparse.py Resolved
Select overlap candidates through their nearest enclosing Iteration, keeping
exchanges outside loops synchronous. Replace the hand-built HaloSpot test
with Operator-based structure and numerical checks for all three overlap
modes on one and two ranks.
Extend the existing atomic_write helper with exclusive publication and use
binary mode when restoring shared libraries. Keep text and header writes
replacing by default, and cover cleanup and existing destinations.
Move both restoration regressions into TestLibraryPublication and remove the standalone module, preserving the existing assertions and fixtures.
Derive tensor support bounds directly from the radius and keep cell geometry in the interpolator. Preserve the interval optimization and test separate staggered support boxes.
@FabioLuporini
FabioLuporini force-pushed the fix/mpi-runtime-correctness branch from b1f8d3b to 9b1c076 Compare November 8, 2026 11:07

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

bug-C bug in the generated code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants