Skip to content

Commit

Permalink
Merge pull request JuliaParallel#155 from JuliaParallel/eschnett/char
Browse files Browse the repository at this point in the history
Avoid comparing Char and Int
  • Loading branch information
eschnett committed Jun 3, 2016
2 parents cc185cf + 8f55009 commit 571ec62
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions test/test_allgather.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ comm = MPI.COMM_WORLD
for typ in MPI.MPIDatatype.types
A = typ[MPI.Comm_rank(comm) + 1]
C = allgather(A)
@test C == collect(1:MPI.Comm_size(comm))
@test typeof(C) === Vector{typ}
@test C == map(typ, collect(1:MPI.Comm_size(comm)))
A = convert(typ,MPI.Comm_rank(comm) + 1)
C = allgather(A)
@test C == collect(1:MPI.Comm_size(comm))
@test typeof(C) === Vector{typ}
@test C == map(typ, collect(1:MPI.Comm_size(comm)))
end

MPI.Finalize()
2 changes: 1 addition & 1 deletion test/test_allgatherv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Base.one(::Type{Char}) = '\01'
for typ in MPI.MPIDatatype.types

A = ones(typ, mod(rank,2) + 1)
counts = Cint[ mod(i,2) + 1 for i in 0:(size-1)]
counts = Cint[mod(i,2) + 1 for i in 0:(size-1)]
B = allgatherv_array(A, counts)
@test B == ones(typ, 3 * div(size,2) + mod(size,2))
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_exscan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ for typ in typs
val = convert(typ,rank+1)
B = MPI.Exscan(val, MPI.PROD, comm)
if rank > 0
@test_approx_eq B[1] factorial(rank)
@test B[1] === convert(typ, factorial(rank))
end
end

Expand Down
6 changes: 4 additions & 2 deletions test/test_gather.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ for typ in MPI.MPIDatatype.types
A = typ[MPI.Comm_rank(comm) + 1]
C = gather(A, root)
if MPI.Comm_rank(comm) == root
@test C == collect(1:MPI.Comm_size(comm))
@test typeof(C) === Vector{typ}
@test C == map(typ, collect(1:MPI.Comm_size(comm)))
end
A = convert(typ,MPI.Comm_rank(comm) + 1)
C = gather(A, root)
if MPI.Comm_rank(comm) == root
@test C == collect(1:MPI.Comm_size(comm))
@test typeof(C) === Vector{typ}
@test C == map(typ, collect(1:MPI.Comm_size(comm)))
end
end

Expand Down

0 comments on commit 571ec62

Please sign in to comment.