Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[deps]
DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand All @@ -18,7 +17,6 @@ MPIPreferences = {path = "../lib/MPIPreferences"}
[compat]
AMDGPU = "0.6, 0.7, 0.8, 0.9, 1, 2"
CUDA = "3, 4, 5"
DoubleFloats = "1.4"
MPIPreferences = "0.1"
TOML = "< 0.0.1, 1.0"

Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ end
_, backend_name = parse_flags!(ARGS, "--backend"; default="CPU", typ=String)

# load test packages to trigger precompilation
Comment thread
nhz2 marked this conversation as resolved.
using DoubleFloats
@static if backend_name == "CUDA"
Pkg.add("CUDA")
ENV["JULIA_MPI_TEST_ARRAYTYPE"] = "CuArray"
Expand Down
11 changes: 8 additions & 3 deletions test/test_reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ const can_do_closures =
Sys.ARCH !== :aarch64 &&
!startswith(string(Sys.ARCH), "arm")

using DoubleFloats
# a non-builtin isbits type to test generic MPI.reduce
struct TestSum
hi::Float64
lo::Float64
end
Base.:+(a::TestSum, b::TestSum) = TestSum(a.hi + b.hi, a.lo + b.lo)

MPI.Init()

Expand Down Expand Up @@ -122,11 +127,11 @@ end

MPI.Barrier( MPI.COMM_WORLD )

send_arr = [Double64(i)/10 for i = 1:10]
send_arr = [TestSum(i, i/4) for i = 1:10]

result = MPI.Reduce(send_arr, +, MPI.COMM_WORLD; root=root)
if rank == root
@test result ≈ [Double64(sz*i)/10 for i = 1:10] rtol=sz*eps(Double64)
@test result == [TestSum(sz*i, sz*i/4) for i = 1:10]
else
@test result === nothing
end
Expand Down
Loading