Skip to content

mpi: Support data assignment to SparseFunctions from local array with different distribution#2951

Open
FabioLuporini wants to merge 7 commits into
mainfrom
sparse-data-mpi
Open

mpi: Support data assignment to SparseFunctions from local array with different distribution#2951
FabioLuporini wants to merge 7 commits into
mainfrom
sparse-data-mpi

Conversation

@FabioLuporini

Copy link
Copy Markdown
Contributor

No description provided.

@FabioLuporini FabioLuporini requested a review from mloubout June 18, 2026 15:29
@FabioLuporini FabioLuporini added the MPI mpi-related label Jun 18, 2026
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.44818% with 284 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.05%. Comparing base (58df797) to head (0b87d5d).

Files with missing lines Patch % Lines
devito/data/utils.py 21.67% 110 Missing and 2 partials ⚠️
tests/test_data.py 22.03% 92 Missing ⚠️
tests/test_mpi.py 11.84% 67 Missing ⚠️
devito/data/data.py 26.66% 9 Missing and 2 partials ⚠️
devito/types/dense.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2951      +/-   ##
==========================================
- Coverage   83.47%   83.05%   -0.43%     
==========================================
  Files         249      249              
  Lines       52276    52631     +355     
  Branches     4503     4531      +28     
==========================================
+ Hits        43638    43713      +75     
- Misses       7880     8157     +277     
- Partials      758      761       +3     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.34% <17.79%> (-0.26%) ⬇️
pytest-gpu-gcc- 77.82% <20.44%> (-0.40%) ⬇️
pytest-gpu-icx- 77.76% <20.44%> (-0.42%) ⬇️
pytest-gpu-nvc-nvidiaX 68.88% <17.79%> (-0.24%) ⬇️

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.

@FabioLuporini FabioLuporini force-pushed the sparse-data-mpi branch 2 times, most recently from 6ce82fb to 9a9b51c Compare June 19, 2026 08:29
Comment thread devito/data/data.py

def _mpi_advanced_1d_target(self, glb_idx, axis):
"""
Return the raw local ndarray addressed by ``glb_idx`` without

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.

Nitpick: This seems out of step with the function name?

Comment thread devito/data/utils.py
"""Raise the first error reported by any rank, on every rank."""
if data._distributor.nprocs > 1:
errors = data._distributor.comm.allgather(error)
error = next((i for i in errors if i is not None), None)

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.

Is it worth reporting the rank(s) that raised the error here?

Comment thread tests/test_mpi.py
assert trace_data.flags.f_contiguous

rec.data_local[:, :] = 0
rec.data[:, trace_index] = trace_data

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.

Can you do the same with rec.data.coordinates?

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.

you cannot use advanced indexing like this here in objects that have more than 1 distributed dimension (explained in the notebook it's a current limitation)

but what would it be for?

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.

2 participants