Skip to content

Commit 8899971

Browse files
* Fixed several issues related to the Exscan! API and implementation, (#396)
* Fixed several issues related to the Exscan! API and implementation, (#396) together with the typos described in #394 * Added two tests to test_exscan.jl in order to stress two untested overloaded variants of Exscan.
1 parent 76ec31d commit 8899971

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/collective.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -844,16 +844,16 @@ end
844844
function Exscan!(sendbuf, recvbuf, count::Integer, opfunc, comm::Comm)
845845
Exscan!(sendbuf, recvbuf, count, Op(opfunc, eltype(recvbuf)), comm)
846846
end
847-
function Exscan!(sendbuf::AbstractArray, recvbuf, op, comm::Comm)
847+
function Exscan!(sendbuf::AbstractArray, recvbuf::AbstractArray, op, comm::Comm)
848848
Exscan!(sendbuf, recvbuf, length(sendbuf), op, comm)
849849
end
850850

851851
# inplace
852852
function Exscan!(buf, count::Integer, opfunc, comm::Comm)
853-
Exscan!(MPI_IN_PLACE, buf, count, Op(opfunc, eltype(sendbuf)), comm)
853+
Exscan!(MPI_IN_PLACE, buf, count, Op(opfunc, eltype(buf)), comm)
854854
end
855-
function Exscan!(buf, opfunc, comm::Comm)
856-
Exscan!(buf, length(buf), Op(opfunc, eltype(sendbuf)), comm)
855+
function Exscan!(buf, op, comm::Comm)
856+
Exscan!(buf, length(buf), op, comm)
857857
end
858858

859859

test/test_exscan.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ for T in setdiff([Base.uniontypes(MPI.MPIDatatype)...], [Char, Int8, UInt8])
2626

2727
B = MPI.Exscan(A, *, comm)
2828
@test B isa ArrayType{T}
29+
30+
MPI.Exscan!(A, length(A), *, comm)
2931
if rank > 0
30-
@test B == ArrayType{T}(fill(T(prodrank), 4))
32+
@test A == ArrayType{T}(fill(T(prodrank), 4))
33+
end
34+
35+
A = ArrayType{T}(fill(T(rank+1), 4))
36+
MPI.Exscan!(A, *, comm)
37+
if rank > 0
38+
@test A == ArrayType{T}(fill(T(prodrank), 4))
3139
end
3240

3341
B = MPI.Exscan(T(rank+1), *, comm)

0 commit comments

Comments
 (0)