Skip to content

Commit d3cb5f1

Browse files
authored
fix Gather/Gatherv deprecations (#440)
1 parent be00b8a commit d3cb5f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/deprecated.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ import Base: @deprecate
4545
Scatterv!(nothing, similar(sendbuf, counts[Comm_rank(comm) + 1]), root, comm), false)
4646

4747
@deprecate(Gather!(sendbuf, recvbuf, count::Integer, root::Integer, comm::Comm),
48-
Gather!(sendbuf, UBuffer(recvbuf, count), root, comm), false)
48+
Gather!(sendbuf, MPI.Comm_rank(comm) == root ? UBuffer(recvbuf, count) : nothing, root, comm), false)
4949
@deprecate(Gather!(sendbuf::AbstractArray, recvbuf, count::Integer, root::Integer, comm::Comm),
50-
Gather!(view(sendbuf, 1:count), UBuffer(recvbuf, count), root, comm), false)
50+
Gather!(view(sendbuf, 1:count), MPI.Comm_rank(comm) == root ? UBuffer(recvbuf, count) : nothing, root, comm), false)
5151
@deprecate(Gather!(sendbuf::Nothing, recvbuf, count::Integer, root::Integer, comm::Comm),
5252
Gather!(MPI.IN_PLACE, UBuffer(recvbuf, count), root, comm), false)
5353
@deprecate(Gather!(sendbuf, recvbuf::Nothing, count::Integer, root::Integer, comm::Comm),
@@ -61,9 +61,9 @@ import Base: @deprecate
6161
Gather(view(sendbuf, 1:count), root, comm), false)
6262

6363
@deprecate(Gatherv!(sendbuf, recvbuf, counts::Vector{Cint}, root::Integer, comm::Comm),
64-
Gatherv!(sendbuf, VBuffer(recvbuf, counts), root, comm), false)
64+
Gatherv!(sendbuf, MPI.Comm_rank(comm) == root ? VBuffer(recvbuf, counts) : nothing, root, comm), false)
6565
@deprecate(Gatherv!(sendbuf::AbstractArray, recvbuf, counts::Vector{Cint}, root::Integer, comm::Comm),
66-
Gatherv!(view(sendbuf,1:counts[MPI.Comm_rank(comm)+1]), VBuffer(recvbuf, counts), root, comm), false)
66+
Gatherv!(view(sendbuf,1:counts[MPI.Comm_rank(comm)+1]), MPI.Comm_rank(comm) == root ? VBuffer(recvbuf, counts) : nothing, root, comm), false)
6767
@deprecate(Gatherv!(sendbuf::Nothing, recvbuf, counts::Vector{Cint}, root::Integer, comm::Comm),
6868
Gatherv!(MPI.IN_PLACE, VBuffer(recvbuf, counts), root, comm), false)
6969
@deprecate(Gatherv!(sendbuf, recvbuf::Nothing, counts::Vector{Cint}, root::Integer, comm::Comm),

0 commit comments

Comments
 (0)