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
Changes from 1 commit
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
49 changes: 49 additions & 0 deletions src/onesided.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ 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.
It is strongly encouraged to use the [`Buffer`](@ref) interface by passing an
instance of [`Buffer`](@ref) for `origin`,
but `origin` can also be an [`AbstractArray`](@ref) or [`Ref`](@ref).
joachimbrand marked this conversation as resolved.
Show resolved Hide resolved

# 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 +173,18 @@ 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.
It is strongly encouraged to use the [`Buffer`](@ref) interface by passing an
instance of [`Buffer`](@ref) for `origin`,
but `origin` can also be an [`AbstractArray`](@ref) or [`Ref`](@ref).
joachimbrand marked this conversation as resolved.
Show resolved Hide resolved

# 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 +212,18 @@ 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` (see [`Op`](@ref)) on the remote
rank `target_rank` using remote memory access.
It is strongly encouraged to use the [`Buffer`](@ref) interface by passing an
instance of [`Buffer`](@ref) for `origin`.
joachimbrand marked this conversation as resolved.
Show resolved Hide resolved

# 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 +237,19 @@ 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` (see [`Op`](@ref)) on the remote
rank `target_rank` using remote memory access. `Get_accumulate` also returns the
content of the target buffer before accumulation in the buffer `result`.
It is strongly encouraged to use the [`Buffer`](@ref) interface by passing
instances of [`Buffer`](@ref) for `origin` and for `result`.
joachimbrand marked this conversation as resolved.
Show resolved Hide resolved

# 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