diff options
author | Richard Warren <Richard.Warren@hdfgroup.org> | 2019-10-15 13:31:24 (GMT) |
---|---|---|
committer | Richard Warren <Richard.Warren@hdfgroup.org> | 2019-10-15 13:31:24 (GMT) |
commit | 4284401fdeb5621e00a8b218b06d49e107b8821c (patch) | |
tree | 06ffe34ad7336ae3b289a77db1c97166975b6453 /testpar | |
parent | d7f63be1ac635bd965f0975d9d64c0486647199d (diff) | |
download | hdf5-4284401fdeb5621e00a8b218b06d49e107b8821c.zip hdf5-4284401fdeb5621e00a8b218b06d49e107b8821c.tar.gz hdf5-4284401fdeb5621e00a8b218b06d49e107b8821c.tar.bz2 |
Initial 2GB port from develop to the 1_12 branch
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/t_bigio.c | 99 |
1 files changed, 78 insertions, 21 deletions
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 9ca077c..fe96c83 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -4,7 +4,8 @@ #include "H5Dprivate.h" /* For Chunk tests */ /* FILENAME and filenames must have the same number of names */ -const char *FILENAME[2]={ "bigio_test.h5", +const char *FILENAME[3]={ "bigio_test.h5", + "single_rank_independent_io.h5", NULL }; @@ -29,7 +30,8 @@ const char *FILENAME[2]={ "bigio_test.h5", #define DATASET5 "DSET5" #define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/ #define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */ -#define DXFER_BIGCOUNT 536870916 +#define DXFER_BIGCOUNT (1 < 29) +#define LARGE_DIM 1610612736 #define HYPER 1 #define POINT 2 @@ -40,7 +42,7 @@ typedef hsize_t B_DATATYPE; int facc_type = FACC_MPIO; /*Test file access type */ int dxfer_coll_type = DXFER_COLLECTIVE_IO; -size_t bigcount = DXFER_BIGCOUNT; +size_t bigcount = (size_t)DXFER_BIGCOUNT; int nerrors = 0; int mpi_size, mpi_rank; @@ -51,6 +53,8 @@ static void coll_chunktest(const char* filename, int chunk_factor, int select_fa int api_option, int file_selection, int mem_selection, int mode); hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type); +hsize_t H5_mpio_set_bigio_count(hsize_t new_count); + /* * Setup the coordinates for point selection. */ @@ -478,22 +482,19 @@ static void dataset_big_write(void) { - hid_t xfer_plist; /* Dataset transfer properties list */ - hid_t sid; /* Dataspace ID */ - hid_t file_dataspace; /* File dataspace ID */ - hid_t mem_dataspace; /* memory dataspace ID */ + hid_t xfer_plist; /* Dataset transfer properties list */ + hid_t sid; /* Dataspace ID */ + hid_t file_dataspace; /* File dataspace ID */ + hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset; - hid_t datatype; /* Datatype ID */ - hsize_t dims[RANK]; /* dataset dim sizes */ - hsize_t start[RANK]; /* for hyperslab setting */ - hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ - hsize_t block[RANK]; /* for hyperslab setting */ + hsize_t dims[RANK]; /* dataset dim sizes */ + hsize_t start[RANK]; /* for hyperslab setting */ + hsize_t count[RANK],stride[RANK]; /* for hyperslab setting */ + hsize_t block[RANK]; /* for hyperslab setting */ hsize_t *coords = NULL; - int i; - herr_t ret; /* Generic return value */ - hid_t fid; /* HDF5 file ID */ - hid_t acc_tpl; /* File access templates */ - hsize_t h; + herr_t ret; /* Generic return value */ + hid_t fid; /* HDF5 file ID */ + hid_t acc_tpl; /* File access templates */ size_t num_points; B_DATATYPE * wdata; @@ -806,8 +807,6 @@ dataset_big_read(void) hsize_t start[RANK]; /* for hyperslab setting */ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ - int i,j,k; - hsize_t h; size_t num_points; hsize_t *coords = NULL; herr_t ret; /* Generic return value */ @@ -1120,6 +1119,63 @@ dataset_big_read(void) } /* dataset_large_readAll */ +static void +single_rank_independent_io(void) +{ + if (mpi_rank == 0) + HDprintf("single_rank_independent_io\n"); + + if (MAINPROCESS) { + 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; + + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fapl_id >= 0), "H5P_FILE_ACCESS"); + + H5Pset_fapl_mpio(fapl_id, MPI_COMM_SELF, MPI_INFO_NULL); + file_id = H5Fcreate(FILENAME[1], H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); + VRFY((file_id >= 0), "H5Dcreate2 succeeded"); + + fspace_id = H5Screate_simple(1, dims, NULL); + VRFY((fspace_id >= 0), "H5Screate_simple fspace_id succeeded"); + + /* + * Create and write to a >2GB dataset from a single rank. + */ + dset_id = H5Dcreate2(file_id, "test_dset", H5T_NATIVE_INT, fspace_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + VRFY((dset_id >= 0), "H5Dcreate2 succeeded"); + + data = malloc(LARGE_DIM * sizeof(int)); + + if (mpi_rank == 0) + H5Sselect_all(fspace_id); + else + H5Sselect_none(fspace_id); + + dims[0] = LARGE_DIM; + mspace_id = H5Screate_simple(1, dims, NULL); + VRFY((mspace_id >= 0), "H5Screate_simple mspace_id succeeded"); + H5Dwrite(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); + + free(data); + H5Sclose(mspace_id); + H5Sclose(fspace_id); + H5Pclose(fapl_id); + H5Dclose(dset_id); + H5Fclose(file_id); + + HDremove(FILENAME[1]); + + } + MPI_Barrier(MPI_COMM_WORLD); +} /* * Create the appropriate File access property list @@ -1395,7 +1451,6 @@ coll_chunktest(const char* filename, size_t num_points; /* for point selection */ hsize_t *coords = NULL; /* for point selection */ - int i; /* Create the data space */ @@ -1873,7 +1928,7 @@ int main(int argc, char **argv) int ExpressMode = 0; hsize_t newsize = 1048576; /* Set the bigio processing limit to be 'newsize' bytes */ - hsize_t oldsize = H5S_mpio_set_bigio_count(newsize); + hsize_t oldsize = H5_mpio_set_bigio_count(newsize); /* Having set the bigio handling to a size that is managable, * we'll set our 'bigcount' variable to be 2X that limit so @@ -1918,6 +1973,8 @@ int main(int argc, char **argv) coll_chunk2(); MPI_Barrier(MPI_COMM_WORLD); coll_chunk3(); + MPI_Barrier(MPI_COMM_WORLD); + single_rank_independent_io(); } /* turn off alarm */ |