Skip to content

Commit dd2c587

Browse files
authored
Allow Waitall! for an empty input reqs = [] (#458)
* Allow `Waitall!` for an empty input `reqs = []` * Add a test
1 parent 1655da9 commit dd2c587

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/pointtopoint.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ $(_doc_external("MPI_Waitall"))
447447
"""
448448
function Waitall!(reqs::Vector{Request})
449449
count = length(reqs)
450+
count == 0 && return Status[]
450451
reqvals = [reqs[i].val for i in 1:count]
451452
stats = fill(STATUS_EMPTY, count)
452453
# int MPI_Waitall(int count, MPI_Request array_of_requests[],

test/test_sendrecv.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,7 @@ MPI.Sendrecv!(a, dest_rank, 2,
132132

133133
@test b == [(comm_rank+1) % comm_size, (comm_rank+1) % comm_size, (comm_rank+1) % comm_size]
134134

135+
@test MPI.Waitall!(MPI.Request[]) == MPI.Status[]
136+
135137
MPI.Finalize()
136138
# @test MPI.Finalized()

0 commit comments

Comments
 (0)