diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2022-02-18 15:27:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 15:27:05 (GMT) |
commit | feda52b08488dbb3e5b2450f6cd63baa98b0e57e (patch) | |
tree | 4a1db23202b8b1e89c43e54ca69a3df3b2ee5487 /testpar | |
parent | cfe4198b6cb1e145e57bf8eed65c5f6ae68e896e (diff) | |
download | hdf5-feda52b08488dbb3e5b2450f6cd63baa98b0e57e.zip hdf5-feda52b08488dbb3e5b2450f6cd63baa98b0e57e.tar.gz hdf5-feda52b08488dbb3e5b2450f6cd63baa98b0e57e.tar.bz2 |
Implement support for big I/O for independent reads (#1446)
* Implement big I/O support for independent reads. Add test for this.
* Committing clang-format changes
* Update big I/O code in H5FD__mpio_write() to match that in
H5FD__mpio_read().
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/t_bigio.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 4df624b..0a971c5 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -1107,13 +1107,15 @@ single_rank_independent_io(void) HDprintf("\nSingle Rank Independent I/O\n"); if (MAIN_PROCESS) { - hsize_t dims[] = {LARGE_DIM}; - hid_t file_id = -1; - hid_t fapl_id = -1; - hid_t dset_id = -1; - hid_t fspace_id = -1; - hid_t mspace_id = -1; - void * data = NULL; + hsize_t dims[] = {LARGE_DIM}; + hid_t file_id = -1; + hid_t fapl_id = -1; + hid_t dset_id = -1; + hid_t fspace_id = -1; + hid_t mspace_id = -1; + herr_t ret; + int * data = NULL; + uint64_t i; fapl_id = H5Pcreate(H5P_FILE_ACCESS); VRFY_G((fapl_id >= 0), "H5P_FILE_ACCESS"); @@ -1135,6 +1137,10 @@ single_rank_independent_io(void) data = malloc(LARGE_DIM * sizeof(int)); + /* Initialize data */ + for (i = 0; i < LARGE_DIM; i++) + data[i] = (int)(i % (uint64_t)DXFER_BIGCOUNT); + if (mpi_rank_g == 0) H5Sselect_all(fspace_id); else @@ -1143,7 +1149,24 @@ single_rank_independent_io(void) dims[0] = LARGE_DIM; mspace_id = H5Screate_simple(1, dims, NULL); VRFY_G((mspace_id >= 0), "H5Screate_simple mspace_id succeeded"); + + /* Write data */ H5Dwrite(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); + VRFY_G((ret >= 0), "H5Dwrite succeeded"); + + /* Wipe buffer */ + HDmemset(data, 0, LARGE_DIM * sizeof(int)); + + /* Read data back */ + H5Dread(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); + VRFY_G((ret >= 0), "H5Dread succeeded"); + + /* Verify data */ + for (i = 0; i < LARGE_DIM; i++) + if (data[i] != (int)(i % (uint64_t)DXFER_BIGCOUNT)) { + HDfprintf(stderr, "verify failed\n"); + exit(1); + } free(data); H5Sclose(mspace_id); |