Repository navigation
Refactor MPIPtr cconvert to support Julia 1.14 - #941
Conversation
|
One of the main features of |
|
I've added some comments using Claude Code |
|
Thanks! The description sounds correct, and I like the ASCII art. |
|
Bump |
|
Bump, would be nice to have this fixed (+ new release if possible). |
|
I believe we'd need some help with the review, none of us is particularly familiar with what's the intended way to go about it. I definitely prefer this kind of approach over #935 because that felt too ad hoc, but the need for CConvWrapper here is also odd. |
|
We need to support OpenAPI as well. |
What do you mean by this? |
I think we might need to change these lines as well Lines 7 to 21 in 61cc82e |
|
I've updated OneAPIExt.jl and added an intermediate pointer type trait function |
|
There is an error in the documentation. Can you add Alternatively, if this function should be private and not be mentioned in the docs, then convert its docstring to a plain comment. After this change I think this is good to go. I'm really looking forward to see |
|
I've made the function private. |
|
@nhz2 thank you for all your work! |
On Julia v1.14, `Base.cconvert(Ptr{T}, ::SubArray)` returns a
`Base.OffsetCConvert`, which MPI.jl v0.20.27 cannot convert to an `MPIPtr`,
so views of any array (not only `FixedSizeArray`s) fail there. This is fixed
in MPI.jl by JuliaParallel/MPI.jl#941. Detect this by probing a view of an
`Array` and skip the tests of views if it fails.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MEJYUviAUshj5fZt8LTe8A
MPI.jl v0.20.28 (JuliaParallel/MPI.jl#941) converts any `AbstractArray` to an `MPIPtr`, including `Memory` and `SubArray`s on Julia v1.14+, so the host-memory `cconvert`/`unsafe_convert` methods and the view-support probe in the tests are no longer needed. Delegating `cconvert` to the parent is kept so that GPU-backed `FixedSizeArray`s use MPI.jl's pointer type for their storage. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Add package extension for MPI.jl Define `MPI.Buffer(::FixedSizeArray)` and the conversion to `MPI.MPIPtr`, so that `FixedSizeArray`s, and `SubArray`s of them that MPI.jl stores via their parent, can be used as communication buffers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MEJYUviAUshj5fZt8LTe8A * Add PR number to changelog entry Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MEJYUviAUshj5fZt8LTe8A * Skip MPI tests of views when MPI.jl cannot communicate `SubArray`s On Julia v1.14, `Base.cconvert(Ptr{T}, ::SubArray)` returns a `Base.OffsetCConvert`, which MPI.jl v0.20.27 cannot convert to an `MPIPtr`, so views of any array (not only `FixedSizeArray`s) fail there. This is fixed in MPI.jl by JuliaParallel/MPI.jl#941. Detect this by probing a view of an `Array` and skip the tests of views if it fails. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MEJYUviAUshj5fZt8LTe8A * Require MPI.jl v0.20.28 and rely on its generic `MPIPtr` conversion MPI.jl v0.20.28 (JuliaParallel/MPI.jl#941) converts any `AbstractArray` to an `MPIPtr`, including `Memory` and `SubArray`s on Julia v1.14+, so the host-memory `cconvert`/`unsafe_convert` methods and the view-support probe in the tests are no longer needed. Delegating `cconvert` to the parent is kept so that GPU-backed `FixedSizeArray`s use MPI.jl's pointer type for their storage. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Alternative to #935
CC @eschnett @giordano @vchuravy