summaryrefslogtreecommitdiffstats
path: root/testpar/t_bigio.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-04-07 16:36:51 (GMT)
committerGitHub <noreply@github.com>2022-04-07 16:36:51 (GMT)
commit7df729bbf3e0f0b53dda73829f05fdf709993e4c (patch)
treef665f58f22b2d26cfae1138c9e38fea58a01ef9e /testpar/t_bigio.c
parenta4e833c50c002239af8c16667b1b072e6c6fa27f (diff)
downloadhdf5-7df729bbf3e0f0b53dda73829f05fdf709993e4c.zip
hdf5-7df729bbf3e0f0b53dda73829f05fdf709993e4c.tar.gz
hdf5-7df729bbf3e0f0b53dda73829f05fdf709993e4c.tar.bz2
1.12: Brings changes from testpar over from develop (#1614)
Diffstat (limited to 'testpar/t_bigio.c')
-rw-r--r--testpar/t_bigio.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index ed99fc4..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);
@@ -1331,7 +1354,7 @@ coll_chunk2(void)
*/
/* ------------------------------------------------------------------------
- * Descriptions for the selection: one singular selection accross many chunks
+ * Descriptions for the selection: one singular selection across many chunks
* Two dimensions, Num of chunks = 2* mpi_size
*
* dim1 = space_dim1*mpi_size
@@ -1840,7 +1863,7 @@ main(int argc, char **argv)
/* Set the bigio processing limit to be 'newsize' bytes */
hsize_t oldsize = H5_mpi_set_bigio_count(newsize);
- /* Having set the bigio handling to a size that is managable,
+ /* Having set the bigio handling to a size that is manageable,
* we'll set our 'bigcount' variable to be 2X that limit so
* that we try to ensure that our bigio handling is actually
* envoked and tested.
@@ -1861,7 +1884,7 @@ main(int argc, char **argv)
HDprintf("Failed to turn off atexit processing. Continue.\n");
/* set alarm. */
- ALARM_ON;
+ TestAlarmOn();
dataset_big_write();
MPI_Barrier(MPI_COMM_WORLD);
@@ -1878,7 +1901,7 @@ main(int argc, char **argv)
single_rank_independent_io();
/* turn off alarm */
- ALARM_OFF;
+ TestAlarmOff();
if (mpi_rank_g == 0)
HDremove(FILENAME[0]);