Skip to content

Commit 20c712d

Browse files
committed
Add a partitioning test
1 parent d609aed commit 20c712d

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

test/parallel/test_mpi.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ def test_mpi(input_path):
7171
parallel_assert(len(data) != 0)
7272

7373

74+
@pytest.mark.parallel(nprocs=4)
75+
def test_partitioning_includes_all(input_path):
76+
with oc.open(input_path) as f:
77+
tags = f.select("fof_halo_tag").data
78+
79+
comm = mpi4py.MPI.COMM_WORLD
80+
all_tags = comm.allgather(tags)
81+
all_tags = reduce(lambda left, right: left.union(set(right)), all_tags, set())
82+
83+
file = h5py.File(input_path)
84+
original_tags = set(file["data"]["fof_halo_tag"][:])
85+
86+
parallel_assert(all_tags == original_tags)
87+
88+
7489
@pytest.mark.parallel(nprocs=4)
7590
def test_take(input_path):
7691
ds = oc.open(input_path)

test/test_diffsky.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ def test_comoving_to_unitless(core_path_487):
3535
assert np.all(data[col].value == data_unitless[col].value)
3636

3737

38-
def test_open_multiple(core_path_487, core_path_475):
39-
ds = oc.open(core_path_487, core_path_475, synth_cores=True)
40-
assert len(ds.keys()) == 4
41-
ds = oc.open(core_path_487, core_path_475)
42-
assert len(ds.keys()) == 2
43-
z_range = ds.z_range
44-
assert z_range[1] - z_range[0] > 0.05
45-
46-
4738
def test_open_multiple_write(core_path_487, core_path_475, tmp_path):
4839
ds = oc.open(core_path_487, core_path_475, synth_cores=True)
4940
original_length = len(ds)

0 commit comments

Comments
 (0)