Skip to content

Add MPI.Win_allocate - #987

Open
jack-dunham wants to merge 1 commit into
JuliaParallel:masterfrom
jack-dunham:jd/Win_allocate
Open

jack-dunham wants to merge 1 commit into
JuliaParallel:masterfrom
jack-dunham:jd/Win_allocate

Conversation

@jack-dunham

Copy link
Copy Markdown

Wraps MPI_Win_allocate, the one window constructor in the standard that MPI.jl did not yet expose. API.MPI_Win_allocate is already generated in src/api/generated_api.jl; this adds the high-level interface beside its siblings in src/onesided.jl.

Full disclosure, I am not an expert in MPI, and this code was generated by Claude by pointing it to the existing MPI.Win_allocate_shared implementation, but the output seems reasonable to me. If it is not, consider this a feature request with a first attempt at a solution.

Comment thread src/onesided.jl
`disp_unit` is `sizeof(T)`, so the `disp` argument of [`MPI.Get!`](@ref) and
[`MPI.Put!`](@ref) counts elements.

`infokws` are info keys providing optimization hints.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We would still just call them kwargs...

Comment thread src/onesided.jl
Comment on lines +110 to +112
# the ptr may be invalid for a zero-size window, which will cause an error as
# unsafe_wrap checks the alignment of ptr, even for length 0
array = len > 0 ? unsafe_wrap(Array, ptr, dims) : Array{T}(undef, dims)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That error kind would also be true for Win_allocate_shared

Comment thread src/onesided.jl
# External links
$(_doc_external("MPI_Win_allocate"))
"""
function Win_allocate(::Type{Ptr{T}}, len::Integer, comm::Comm; infokws...) where T

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should check if T is pointerfree and inlinealloc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I.e. isbitstype(T) ?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants