Skip to content

Commit f8d9cde

Browse files
authored
reenable Finalized tests (#316)
1 parent b4e4e47 commit f8d9cde

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/test_cart_create.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ periods = [0 1 0]
1010
dims = [0 0 0]
1111
MPI.Dims_create!(nnodes, dims)
1212

13+
@test prod(dims) == nnodes
14+
1315
cperiods = Cint.(periods[:])
1416
cdims = Cint.(dims[:])
1517
comm_cart = MPI.Cart_create(comm, ndims, cdims, cperiods, reorder)
@@ -25,8 +27,11 @@ comm_sub2 = MPI.Cart_sub(comm_cart, (true, false, true))
2527
@test MPI.Comm_size(comm_sub2) == div(nnodes, dims[2])
2628

2729
comm_sub3 = MPI.Cart_sub(comm_cart, (true, true, false))
28-
@test MPI.Comm_size(comm_sub2) == div(nnodes, dims[3])
30+
@test MPI.Comm_size(comm_sub3) == div(nnodes, dims[3])
31+
32+
comm_cart = comm_cart2 = comm_sub1 = comm_sub2 = comm_sub3 = nothing
2933

34+
GC.gc()
3035

3136
MPI.Finalize()
32-
#@test MPI.Finalized()
37+
@test MPI.Finalized()

test/test_cart_shift.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ disp = 1
1515

1616
for i in 0:2
1717
neighbors = MPI.Cart_shift(comm_cart, i, disp)
18-
@test all( ((neighbors .>= 0) .& (neighbors .< nnodes)) .| (neighbors .== MPI.MPI_PROC_NULL) )
18+
@test all(rank -> 0 <= rank < nnodes || rank == MPI.MPI_PROC_NULL, neighbors)
1919
end
2020

21+
comm_cart = nothing
22+
GC.gc()
23+
2124
MPI.Finalize()
22-
#@test MPI.Finalized()
25+
@test MPI.Finalized()

0 commit comments

Comments
 (0)