diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2021-10-29 22:10:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-29 22:10:31 (GMT) |
commit | 111c7ae9ac2efc29e8b399e6951253af9110b81a (patch) | |
tree | f69fa03253bdab97d7cf3615baff02cd936323f9 /testpar/t_prop.c | |
parent | db30c2da68ece4a155e9e50c28ec16d6057509b2 (diff) | |
download | hdf5-hdf5-1_10_8.zip hdf5-hdf5-1_10_8.tar.gz hdf5-hdf5-1_10_8.tar.bz2 |
Merge hdf5 1 10 8 (#1154)hdf5-1_10_8
Merge HDF5 1.10.8 release files to 1.10/master
Diffstat (limited to 'testpar/t_prop.c')
-rw-r--r-- | testpar/t_prop.c | 183 |
1 files changed, 83 insertions, 100 deletions
diff --git a/testpar/t_prop.c b/testpar/t_prop.c index 4fdcf47..518fec6 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -6,7 +6,7 @@ * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -23,13 +23,13 @@ static int test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) { MPI_Request req[2]; - MPI_Status status; - hid_t pl; /* Decoded property list */ - size_t buf_size = 0; - void *sbuf = NULL; - herr_t ret; /* Generic return value */ + MPI_Status status; + hid_t pl; /* Decoded property list */ + size_t buf_size = 0; + void * sbuf = NULL; + herr_t ret; /* Generic return value */ - if(mpi_rank == 0) { + if (mpi_rank == 0) { int send_size = 0; /* first call to encode returns only the size of the buffer needed */ @@ -48,13 +48,13 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) MPI_Isend(sbuf, send_size, MPI_BYTE, recv_proc, 124, MPI_COMM_WORLD, &req[1]); } /* end if */ - if(mpi_rank == recv_proc) { - int recv_size; + if (mpi_rank == recv_proc) { + int recv_size; void *rbuf; MPI_Recv(&recv_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status); - buf_size = recv_size; - rbuf = (uint8_t *)HDmalloc(buf_size); + buf_size = (size_t)recv_size; + rbuf = (uint8_t *)HDmalloc(buf_size); MPI_Recv(rbuf, recv_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status); pl = H5Pdecode(rbuf); @@ -65,89 +65,88 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) ret = H5Pclose(pl); VRFY((ret >= 0), "H5Pclose succeeded"); - if(NULL != rbuf) + if (NULL != rbuf) HDfree(rbuf); } /* end if */ - if(0 == mpi_rank) + if (0 == mpi_rank) MPI_Waitall(2, req, MPI_STATUSES_IGNORE); - if(NULL != sbuf) + if (NULL != sbuf) HDfree(sbuf); MPI_Barrier(MPI_COMM_WORLD); - return(0); + return (0); } void test_plist_ed(void) { - hid_t dcpl; /* dataset create prop. list */ - hid_t dapl; /* dataset access prop. list */ - hid_t dxpl; /* dataset transfer prop. list */ - hid_t gcpl; /* group create prop. list */ - hid_t lcpl; /* link create prop. list */ - hid_t lapl; /* link access prop. list */ - hid_t ocpypl; /* object copy prop. list */ - hid_t ocpl; /* object create prop. list */ - hid_t fapl; /* file access prop. list */ - hid_t fcpl; /* file create prop. list */ - hid_t strcpl; /* string create prop. list */ - hid_t acpl; /* attribute create prop. list */ + hid_t dcpl; /* dataset create prop. list */ + hid_t dapl; /* dataset access prop. list */ + hid_t dxpl; /* dataset transfer prop. list */ + hid_t gcpl; /* group create prop. list */ + hid_t lcpl; /* link create prop. list */ + hid_t lapl; /* link access prop. list */ + hid_t ocpypl; /* object copy prop. list */ + hid_t ocpl; /* object create prop. list */ + hid_t fapl; /* file access prop. list */ + hid_t fcpl; /* file create prop. list */ + hid_t strcpl; /* string create prop. list */ + hid_t acpl; /* attribute create prop. list */ int mpi_size, mpi_rank, recv_proc; - hsize_t chunk_size = 16384; /* chunk size */ - double fill = 2.7f; /* Fill value */ - size_t nslots = 521*2; - size_t nbytes = 1048576 * 10; - double w0 = 0.5f; - unsigned max_compact; - unsigned min_dense; - hsize_t max_size[1]; /*data space maximum size */ - const char* c_to_f = "x+32"; - H5AC_cache_config_t my_cache_config = { - H5AC__CURR_CACHE_CONFIG_VERSION, - TRUE, - FALSE, - FALSE, - "temp", - TRUE, - FALSE, - ( 2 * 2048 * 1024), - 0.3f, - (64 * 1024 * 1024), - (4 * 1024 * 1024), - 60000, - H5C_incr__threshold, - 0.8f, - 3.0f, - TRUE, - (8 * 1024 * 1024), - H5C_flash_incr__add_space, - 2.0f, - 0.25f, - H5C_decr__age_out_with_threshold, - 0.997f, - 0.8f, - TRUE, - (3 * 1024 * 1024), - 3, - FALSE, - 0.2f, - (256 * 2048), - H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; - - herr_t ret; /* Generic return value */ - - if(VERBOSE_MED) - HDprintf("Encode/Decode DCPLs\n"); + hsize_t chunk_size = 16384; /* chunk size */ + double fill = 2.7; /* Fill value */ + size_t nslots = 521 * 2; + size_t nbytes = 1048576 * 10; + double w0 = 0.5; + unsigned max_compact; + unsigned min_dense; + hsize_t max_size[1]; /*data space maximum size */ + const char * c_to_f = "x+32"; + H5AC_cache_config_t my_cache_config = {H5AC__CURR_CACHE_CONFIG_VERSION, + TRUE, + FALSE, + FALSE, + "temp", + TRUE, + FALSE, + (2 * 2048 * 1024), + 0.3, + (64 * 1024 * 1024), + (4 * 1024 * 1024), + 60000, + H5C_incr__threshold, + 0.8, + 3.0, + TRUE, + (8 * 1024 * 1024), + H5C_flash_incr__add_space, + 2.0, + 0.25, + H5C_decr__age_out_with_threshold, + 0.997, + 0.8, + TRUE, + (3 * 1024 * 1024), + 3, + FALSE, + 0.2, + (256 * 2048), + H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; + + herr_t ret; /* Generic return value */ + + if (VERBOSE_MED) + HDprintf("Encode/Decode DCPLs\n"); /* set up MPI parameters */ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - if(mpi_size == 1) + if (mpi_size == 1) recv_proc = 0; else recv_proc = 1; @@ -162,21 +161,17 @@ test_plist_ed(void) VRFY((ret >= 0), "H5Pset_alloc_time succeeded"); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill); - VRFY((ret>=0), "set fill-value succeeded"); + VRFY((ret >= 0), "set fill-value succeeded"); max_size[0] = 100; - ret = H5Pset_external(dcpl, "ext1.data", (off_t)0, - (hsize_t)(max_size[0] * sizeof(int)/4)); - VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext2.data", (off_t)0, - (hsize_t)(max_size[0] * sizeof(int)/4)); - VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext3.data", (off_t)0, - (hsize_t)(max_size[0] * sizeof(int)/4)); - VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext4.data", (off_t)0, - (hsize_t)(max_size[0] * sizeof(int)/4)); - VRFY((ret>=0), "set external succeeded"); + ret = H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4)); + VRFY((ret >= 0), "set external succeeded"); + ret = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4)); + VRFY((ret >= 0), "set external succeeded"); + ret = H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4)); + VRFY((ret >= 0), "set external succeeded"); + ret = H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4)); + VRFY((ret >= 0), "set external succeeded"); ret = test_encode_decode(dcpl, mpi_rank, recv_proc); VRFY((ret >= 0), "test_encode_decode succeeded"); @@ -184,7 +179,6 @@ test_plist_ed(void) ret = H5Pclose(dcpl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE DAPLS *****/ dapl = H5Pcreate(H5P_DATASET_ACCESS); VRFY((dapl >= 0), "H5Pcreate succeeded"); @@ -198,7 +192,6 @@ test_plist_ed(void) ret = H5Pclose(dapl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE OCPLS *****/ ocpl = H5Pcreate(H5P_OBJECT_CREATE); VRFY((ocpl >= 0), "H5Pcreate succeeded"); @@ -218,7 +211,6 @@ test_plist_ed(void) ret = H5Pclose(ocpl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE DXPLS *****/ dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), "H5Pcreate succeeded"); @@ -256,7 +248,6 @@ test_plist_ed(void) ret = H5Pclose(dxpl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE GCPLS *****/ gcpl = H5Pcreate(H5P_GROUP_CREATE); VRFY((gcpl >= 0), "H5Pcreate succeeded"); @@ -283,12 +274,11 @@ test_plist_ed(void) ret = H5Pclose(gcpl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE LCPLS *****/ lcpl = H5Pcreate(H5P_LINK_CREATE); VRFY((lcpl >= 0), "H5Pcreate succeeded"); - ret= H5Pset_create_intermediate_group(lcpl, TRUE); + ret = H5Pset_create_intermediate_group(lcpl, TRUE); VRFY((ret >= 0), "H5Pset_create_intermediate_group succeeded"); ret = test_encode_decode(lcpl, mpi_rank, recv_proc); @@ -297,7 +287,6 @@ test_plist_ed(void) ret = H5Pclose(lcpl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE LAPLS *****/ lapl = H5Pcreate(H5P_LINK_ACCESS); VRFY((lapl >= 0), "H5Pcreate succeeded"); @@ -330,7 +319,6 @@ test_plist_ed(void) ret = H5Pclose(lapl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE OCPYPLS *****/ ocpypl = H5Pcreate(H5P_OBJECT_COPY); VRFY((ocpypl >= 0), "H5Pcreate succeeded"); @@ -350,7 +338,6 @@ test_plist_ed(void) ret = H5Pclose(ocpypl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE FAPLS *****/ fapl = H5Pcreate(H5P_FILE_ACCESS); VRFY((fapl >= 0), "H5Pcreate succeeded"); @@ -397,7 +384,6 @@ test_plist_ed(void) ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE FCPLS *****/ fcpl = H5Pcreate(H5P_FILE_CREATE); VRFY((fcpl >= 0), "H5Pcreate succeeded"); @@ -414,7 +400,7 @@ test_plist_ed(void) ret = H5Pset_shared_mesg_nindexes(fcpl, 8); VRFY((ret >= 0), "H5Pset_shared_mesg_nindexes succeeded"); - ret = H5Pset_shared_mesg_index(fcpl, 1, H5O_SHMESG_SDSPACE_FLAG, 32); + ret = H5Pset_shared_mesg_index(fcpl, 1, H5O_SHMESG_SDSPACE_FLAG, 32); VRFY((ret >= 0), "H5Pset_shared_mesg_index succeeded"); ret = H5Pset_shared_mesg_phase_change(fcpl, 60, 20); @@ -429,7 +415,6 @@ test_plist_ed(void) ret = H5Pclose(fcpl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE STRCPLS *****/ strcpl = H5Pcreate(H5P_STRING_CREATE); VRFY((strcpl >= 0), "H5Pcreate succeeded"); @@ -443,7 +428,6 @@ test_plist_ed(void) ret = H5Pclose(strcpl); VRFY((ret >= 0), "H5Pclose succeeded"); - /******* ENCODE/DECODE ACPLS *****/ acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE); VRFY((acpl >= 0), "H5Pcreate succeeded"); @@ -457,4 +441,3 @@ test_plist_ed(void) ret = H5Pclose(acpl); VRFY((ret >= 0), "H5Pclose succeeded"); } - |