Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docstrings for one-sided operations #466

Merged
merged 6 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/src/onesided.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
MPI.Win_create
MPI.Win_create_dynamic
MPI.Win_allocate_shared
MPI.Get
MPI.Put
MPI.Accumulate
MPI.Get_accumulate
```
2 changes: 1 addition & 1 deletion src/buffers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const IN_PLACE = InPlace()
MPI.Buffer

An MPI buffer for communication with a single rank. It is used for point-to-point
communication and some collective operations.
and one-sided operations, as well as some collective operations. Operations will implicitly construct a `Buffer` when required via the generic constructor, but it can be advantageous to manually construct `Buffer`s when doing so incurs additional overhead, for example when using a non-predefined [`MPI.Datatype`](@ref).

# Fields
$(DocStringExtensions.FIELDS)
Expand Down
47 changes: 47 additions & 0 deletions src/onesided.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ end

# TODO: add some sort of "remote buffer": a way to specify different datatypes/counts

"""
Get(origin, target_rank::Integer, [target_disp::Integer], win::Win)

Copies data from the memory window `win` on the remote rank `target_rank` into `origin`
(with diplacement `target_disp`) using remote memory access.
`origin` can be a [`Buffer`](@ref), or any object for which `Buffer(origin)` is defined.

# External links
$(_doc_external("MPI_Get"))
"""
function Get(origin_buf::Buffer, target_rank::Integer, target_disp::Integer, win::Win)
# int MPI_Get(void *origin_addr, int origin_count,
# MPI_Datatype origin_datatype, int target_rank,
Expand All @@ -161,6 +171,16 @@ Get(origin::Union{AbstractArray,Ref}, target_rank::Integer, target_disp::Integer
Get(origin, target_rank::Integer, win::Win) =
Get(origin, target_rank, 0, win)

"""
Put(origin, target_rank::Integer, [target_disp::Integer], win::Win)

Copies data from `origin` into memory window `win` on remote rank `target_rank`
(with diplacement `target_disp`) using remote memory access.
`origin` can be a [`Buffer`](@ref), or any object for which [`Buffer_send(origin)`](@ref) is defined.

# External links
$(_doc_external("MPI_Put"))
"""
function Put(origin_buf::Buffer, target_rank::Integer, target_disp::Integer, win::Win)
# int MPI_Put(const void *origin_addr, int origin_count,
# MPI_Datatype origin_datatype, int target_rank,
Expand Down Expand Up @@ -188,6 +208,19 @@ function Fetch_and_op(sourceval, returnval, target_rank::Integer, target_disp::I
sourceval, returnval, Datatype(T), target_rank, target_disp, op, win)
end

"""
Accumulate(origin, target_rank::Integer, target_disp::Integer, op::Op, win::Win)

Combine the content of the `origin` buffer into the target buffer (specified by `win` and
displacement `target_disp`) with reduction operator `op` on the remote rank
`target_rank` using remote memory access.

`origin` can be a [`Buffer`](@ref), or any object for which [`Buffer_send(origin)`](@ref) is defined.
`op` can be any predefined [`Op`](@ref) (custom operators are not supported).

# External links
$(_doc_external("MPI_Accumulate"))
"""
function Accumulate(origin_buf::Buffer, target_rank::Integer, target_disp::Integer, op::Op, win::Win)
# int MPI_Accumulate(const void *origin_addr, int origin_count,
# MPI_Datatype origin_datatype, int target_rank,
Expand All @@ -201,6 +234,20 @@ end
Accumulate(origin, target_rank::Integer, target_disp::Integer, op::Op, win::Win) =
Accumulate(Buffer(origin), target_rank, target_disp, op, win)

"""
Get_accumulate(origin, result, target_rank::Integer, target_disp::Integer, op::Op, win::Win)

Combine the content of the `origin` buffer into the target buffer (specified by `win` and
displacement `target_disp`) with reduction operator `op` on the remote
rank `target_rank` using remote memory access. `Get_accumulate` also returns the
content of the target buffer _before_ accumulation into the `result` buffer.

`origin` can be a [`Buffer`](@ref), or any object for which `Buffer_send(origin)` is defined, `result` can be a [`Buffer`](@ref), or any object for which `Buffer(result)` is defined.
`op` can be any predefined [`Op`](@ref) (custom operators are not supported).

# External links
$(_doc_external("MPI_Get_accumulate"))
"""
function Get_accumulate(origin_buf::Buffer, result_buf::Buffer, target_rank::Integer, target_disp::Integer, op::Op, win::Win)
# int MPI_Get_accumulate(const void *origin_addr, int origin_count,
# MPI_Datatype origin_datatype, void *result_addr,
Expand Down