def container_on_disk(): fname = "tmp_test_memh5_select.h5" container = MemGroup() container.create_dataset("dset1", data=dset1.view()) container.create_dataset("dset2", data=dset2.view()) container.to_hdf5(fname) yield fname # tear down file_names = glob.glob(fname + "*") for fname in file_names: os.remove(fname)
def container_on_disk(): fname = "tmp_test_memh5_select_parallel.h5" if comm.rank == 0: m1 = mpiarray.MPIArray.wrap(dset1, axis=0, comm=MPI.COMM_SELF) m2 = mpiarray.MPIArray.wrap(dset2, axis=0, comm=MPI.COMM_SELF) container = MemGroup(distributed=True, comm=MPI.COMM_SELF) container.create_dataset("dset1", data=m1, distributed=True) container.create_dataset("dset2", data=m2, distributed=True) container.to_hdf5(fname) comm.Barrier() yield fname comm.Barrier() # tear down if comm.rank == 0: file_names = glob.glob(fname + "*") for fname in file_names: os.remove(fname)