def test_save_2d(self): d = Distribution.from_shape(comm=self.comm, shape=(11, 15)) la = LocalArray(d) np_arr = numpy.random.random(la.local_shape) la.ndarray = np_arr save_hdf5(self.output_path, la, key=self.key, mode='w') with self.h5py.File(self.output_path, 'r', driver='mpio', comm=self.comm) as fp: for i, v in ndenumerate(la): self.assertEqual(v, fp[self.key][i])
def _local_save_dnpy(filename, local_arr, key, mode): from distarray.localapi import save_hdf5 save_hdf5(filename, local_arr, key, mode)