From fe70476a225d2e0576149e0f1bdf95689f922c77 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 3 Oct 2017 14:57:36 -0500 Subject: Initial checkin for library version bounds Code changes to provide versioning support when adding to the enumerated defines for H5F_libver_t. --- src/H5Aint.c | 42 +- src/H5Dint.c | 77 +- src/H5Dlayout.c | 35 +- src/H5F.c | 26 +- src/H5Fint.c | 52 +- src/H5Fpkg.h | 3 +- src/H5Fprivate.h | 28 +- src/H5Fpublic.h | 11 +- src/H5Fquery.c | 78 +- src/H5Fsuper.c | 46 +- src/H5Gobj.c | 19 +- src/H5HFhdr.c | 8 +- src/H5O.c | 82 +- src/H5Ofill.c | 33 +- src/H5Opkg.h | 5 +- src/H5Opline.c | 31 +- src/H5Oprivate.h | 4 +- src/H5Pfapl.c | 178 +++- src/H5S.c | 34 +- src/H5Sprivate.h | 2 +- src/H5T.c | 34 +- src/H5Tcommit.c | 28 +- src/H5Tprivate.h | 2 +- src/H5trace.c | 6 + test/genall5.c | 127 ++- test/mf.c | 2 + test/testfiles/plist_files/def_fapl_32be | Bin 1520 -> 1697 bytes test/testfiles/plist_files/def_fapl_32le | Bin 1520 -> 1697 bytes test/testfiles/plist_files/def_fapl_64be | Bin 1520 -> 1697 bytes test/testfiles/plist_files/def_fapl_64le | Bin 1520 -> 1697 bytes test/testfiles/plist_files/fapl_32be | Bin 1522 -> 1699 bytes test/testfiles/plist_files/fapl_32le | Bin 1522 -> 1699 bytes test/testfiles/plist_files/fapl_64be | Bin 1522 -> 1699 bytes test/testfiles/plist_files/fapl_64le | Bin 1522 -> 1699 bytes test/testfiles/plist_files/lapl_32be | Bin 1625 -> 1802 bytes test/testfiles/plist_files/lapl_32le | Bin 1625 -> 1802 bytes test/testfiles/plist_files/lapl_64be | Bin 1625 -> 1802 bytes test/testfiles/plist_files/lapl_64le | Bin 1625 -> 1802 bytes test/tfile.c | 1534 +++++++++++++++++++++++++++++- 39 files changed, 2163 insertions(+), 364 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index 160c7fb..bfc69ec 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -112,6 +112,13 @@ static herr_t H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type /* Local Variables */ /*******************/ +/* Format version bounds for attribute */ +static const unsigned H5O_attr_ver_bounds[] = { + H5O_ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_ATTR_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + typedef H5A_t* H5A_t_ptr; H5FL_SEQ_DEFINE(H5A_t_ptr); @@ -210,17 +217,15 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location") /* Set the latest format for datatype, if requested */ - if(H5F_USE_LATEST_FLAGS(loc->oloc->file, H5F_LATEST_DATATYPE)) - if(H5T_set_latest_version(attr->shared->dt) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of datatype") + if(H5T_set_version(loc->oloc->file, attr->shared->dt) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of datatype") /* Copy the dataspace for the attribute */ attr->shared->ds = H5S_copy(space, FALSE, TRUE); - /* Set the latest format for dataspace, if requested */ - if(H5F_USE_LATEST_FLAGS(loc->oloc->file, H5F_LATEST_DATASPACE)) - if(H5S_set_latest_version(attr->shared->ds) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of dataspace") + /* Set the version for dataspace */ + if(H5S_set_version(loc->oloc->file, attr->shared->ds) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of dataspace") /* Copy the object header information */ if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0) @@ -1840,11 +1845,11 @@ done: * Function: H5A_set_version * * Purpose: Sets the correct version to encode attribute with. - * Chooses the oldest version possible, unless the "use the - * latest format" flag is set. + * Chooses the oldest version possible, unless the + * file's low bound indicates otherwise. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -1857,7 +1862,7 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) { hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ hbool_t use_latest_format; /* Flag indicating the latest attribute version support is enabled */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1865,9 +1870,6 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) HDassert(f); HDassert(attr); - /* Get the file's 'use the latest attribute version support' flag */ - use_latest_format = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ATTRIBUTE); - /* Check whether datatype and dataspace are shared */ if(H5O_msg_is_shared(H5O_DTYPE_ID, attr->shared->dt) > 0) type_shared = TRUE; @@ -1880,15 +1882,19 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) space_shared = FALSE; /* Check which version to encode attribute with */ - if(use_latest_format) - attr->shared->version = H5O_ATTR_VERSION_LATEST; /* Write out latest attribute version */ - else if(attr->shared->encoding != H5T_CSET_ASCII) + if(attr->shared->encoding != H5T_CSET_ASCII) attr->shared->version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */ else if(type_shared || space_shared) attr->shared->version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */ else attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */ + /* Upgrade to the version indicated by the file's low bound if higher */ + attr->shared->version = MAX(attr->shared->version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]); + + /* File bound check */ + if(attr->shared->version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_ATTR, H5E_BADRANGE, FAIL, "attribute version out of bounds") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_set_version() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index bdedd1e..9ed7d71 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -639,13 +639,13 @@ done: * Function: H5D__init_type * * Purpose: Copy a datatype for a dataset's use, performing all the - * necessary adjustments, etc. + * necessary adjustments, etc. * * Return: Success: SUCCEED - * Failure: FAIL + * Failure: FAIL * * Programmer: Quincey Koziol - * Thursday, June 24, 2004 + * Thursday, June 24, 2004 * *------------------------------------------------------------------------- */ @@ -654,7 +654,7 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) { htri_t relocatable; /* Flag whether the type is relocatable */ htri_t immutable; /* Flag whether the type is immutable */ - hbool_t use_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ + hbool_t use_v18_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -672,17 +672,16 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if((immutable = H5T_is_immutable(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't check datatype?") - /* Get the file's 'use the latest datatype version support' flag */ - use_latest_format = H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATATYPE); + use_v18_latest_format = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); /* Copy the datatype if it's a custom datatype or if it'll change when it's location is changed */ - if(!immutable || relocatable || use_latest_format) { + if(!immutable || relocatable || use_v18_latest_format) { /* Copy datatype for dataset */ if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype") - /* Convert a datatype (if committed) to a transient type if the committed datatype's file - location is different from the file location where the dataset will be created */ + /* Convert a datatype (if committed) to a transient type if the committed datatype's file + location is different from the file location where the dataset will be created */ if(H5T_convert_committed_datatype(dset->shared->type, file) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get shared datatype info") @@ -690,14 +689,12 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if(H5T_set_loc(dset->shared->type, file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't set datatype location") - /* Set the latest format, if requested */ - if(use_latest_format) - if(H5T_set_latest_version(dset->shared->type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") + if(H5T_set_version(file, dset->shared->type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") /* Get a datatype ID for the dataset's datatype */ - if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") + if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") } /* end if */ /* Not a custom datatype, just use it directly */ else { @@ -775,7 +772,6 @@ done: static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) { - hbool_t use_latest_format; /* Flag indicating the 'latest dataspace version support' is enabled */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -785,9 +781,6 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) HDassert(dset); HDassert(space); - /* Get the file's 'use the latest dataspace version support' flag */ - use_latest_format = H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATASPACE); - /* Copy dataspace for dataset */ if(NULL == (dset->shared->space = H5S_copy(space, FALSE, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dataspace") @@ -796,10 +789,9 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) if(H5D__cache_dataspace_info(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't cache dataspace info") - /* Set the latest format, if requested */ - if(use_latest_format) - if(H5S_set_latest_version(dset->shared->space) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") + /* Set the version for dataspace */ + if(H5S_set_version(file, dset->shared->space) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") /* Set the dataset's dataspace to 'all' selection */ if(H5S_select_all(dset->shared->space, TRUE) < 0) @@ -926,7 +918,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) /* If there is valid information for the old fill value struct, add it */ /* (only if we aren't trying to write the 'latest fill message version support') */ - if(fill_prop->buf && !(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG))) { + if(fill_prop->buf && (H5F_LOW_BOUND(file) < H5F_LIBVER_V18)) { H5O_fill_t old_fill_prop; /* Copy of fill value property, for writing as "old" fill value */ /* Shallow copy the fill value property */ @@ -981,7 +973,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) /* (If using the latest 'no modification time message' version support, the modification time is part of the object * header and doesn't use a separate message -QAK) */ - if(!(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_NO_MOD_TIME_MSG))) + if(H5F_LOW_BOUND(file) < H5F_LIBVER_V18) if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") @@ -1215,27 +1207,20 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "compact dataset must have early space allocation") } /* end if */ - /* Set the latest version of the layout, pline & fill messages, if requested */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DSET_MSG_FLAGS)) { - /* Set the latest version for the I/O pipeline message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) - if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") - - /* Set the latest version for the fill message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) - /* Set the latest version for the fill value message */ - if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") - - /* Set the latest version for the layout message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) - /* Set the latest version for the layout message */ - if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") - } /* end if */ - else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { - /* Use latest indexing type for layout message version >= 4 */ + /* Set the version for the I/O pipeline message */ + if(H5O_pline_set_version(file, &new_dset->shared->dcpl_cache.pline) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") + + /* Set the version for the fill message */ + if(H5O_fill_set_version(file, &new_dset->shared->dcpl_cache.fill) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") + + /* Set the latest version for the layout message */ + if(H5D__layout_set_version(file, &new_dset->shared->layout) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") + + if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { + /* Use latest indexing type for layout message version >= 4 */ if(H5D__layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing") } /* end if */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index ec18e86..08d7929 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -56,6 +56,13 @@ /* Local Variables */ /*******************/ +/* Format version bounds for layout */ +static const unsigned H5O_layout_ver_bounds[] = { + H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /*------------------------------------------------------------------------- @@ -277,11 +284,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__layout_set_latest_version + * Function: H5D__layout_set_version * - * Purpose: Set the encoding for a layout to the latest version. - * Part of the coding in this routine is moved to - * H5D__layout_set_latest_indexing(). + * Purpose: Set the version to encode a layout with. * * Return: Non-negative on success/Negative on failure * @@ -291,35 +296,33 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space, - const H5D_dcpl_cache_t *dcpl_cache) +H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) { + unsigned vers; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(layout); - HDassert(space); - HDassert(dcpl_cache); + HDassert(f); - /* Set encoding of layout to latest version */ - layout->version = H5O_LAYOUT_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + layout->version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); - /* Set the latest indexing type for the layout message */ - if(H5D__layout_set_latest_indexing(layout, space, dcpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest indexing type") + /* File bound check */ + if(layout->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "layout version out of bounds") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__layout_set_latest_version() */ +} /* end H5D__layout_set_version() */ /*------------------------------------------------------------------------- * Function: H5D__layout_set_latest_indexing * * Purpose: Set the latest indexing type for a layout message - * This is moved from H5D_layout_set_latest_version(). * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5F.c b/src/H5F.c index 211f1aa..1ee16e1 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1633,7 +1633,6 @@ H5Fstart_swmr_write(hid_t file_id) if(file->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file superblock version should be at least 3") - HDassert((file->shared->latest_flags | H5F_LATEST_LAYOUT_MSG) > 0); /* Should not be marked for SWMR writing mode already */ if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) @@ -1899,9 +1898,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fset_latest_format + * Function: H5Fset_libver_bounds (Internal library use) * - * Purpose: Enable switching the "latest format" flag while a file is open. + * Purpose: Set .... the "latest format" flag while a file is open. * * Return: Non-negative on success/Negative on failure * @@ -1910,33 +1909,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fset_latest_format(hid_t file_id, hbool_t latest_format) +H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high) { H5F_t *f; /* File */ - unsigned latest_flags; /* Latest format flags for file */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ib", file_id, latest_format); + H5TRACE3("e", "iFvFv", file_id, low, high); /* Check args */ if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") - /* Check if the value is changing */ - latest_flags = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ALL_FLAGS); - if(latest_format != (H5F_LATEST_ALL_FLAGS == latest_flags)) { - /* Call the flush routine, for this file */ - if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") + /* Call the flush routine, for this file */ + if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") - /* Toggle the 'latest format' flag */ - H5F_SET_LATEST_FLAGS(f, latest_format ? H5F_LATEST_ALL_FLAGS : 0); - } /* end if */ + f->shared->low_bound = low; + f->shared->high_bound = high; done: FUNC_LEAVE_API(ret_value) -} /* end H5Fset_latest_format() */ +} /* end H5Fset_libver_bounds() */ /*------------------------------------------------------------------------- diff --git a/src/H5Fint.c b/src/H5Fint.c index 4c5e00e..d145462 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -130,7 +130,6 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ hbool_t driver_prop_copied = FALSE; /* Whether the driver property has been set up */ unsigned efc_size = 0; - hbool_t latest_format = FALSE; /* Always use the latest format? */ hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -167,10 +166,10 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't sieve buffer size") if(H5P_set(new_plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(f->shared->sdata_aggr.alloc_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size") - if(f->shared->latest_flags > 0) - latest_format = TRUE; - if(H5P_set(new_plist, H5F_ACS_LATEST_FORMAT_NAME, &latest_format) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag") + if(H5P_set(new_plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &f->shared->low_bound) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions") + if(H5P_set(new_plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &f->shared->high_bound) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions") if(H5P_set(new_plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &(f->shared->read_attempts)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'read attempts ' flag") if(H5P_set(new_plist, H5F_ACS_OBJECT_FLUSH_CB_NAME, &(f->shared->object_flush)) < 0) @@ -593,7 +592,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t else { H5P_genplist_t *plist; /* Property list */ unsigned efc_size; /* External file cache size */ - hbool_t latest_format; /* Always use the latest format? */ size_t u; /* Local index variable */ HDassert(lf != NULL); @@ -675,13 +673,10 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get garbage collect reference") if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &(f->shared->sieve_buf_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get sieve buffer size") - if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest_format) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'latest format' flag") - /* For latest format or SWMR_WRITE, activate all latest version support */ - if(latest_format) - f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS; - else if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) - f->shared->latest_flags |= H5F_LATEST_LAYOUT_MSG; + if(H5P_get(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'low' bound for library format versions") + if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'high' bound for library format versions") if(H5P_get(plist, H5F_ACS_USE_MDC_LOGGING_NAME, &(f->shared->use_mdc_logging)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'use mdc logging' flag") if(H5P_get(plist, H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME, &(f->shared->start_mdc_log_on_access)) < 0) @@ -2787,34 +2782,3 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr) FUNC_LEAVE_NOAPI_VOID } /* H5F_set_coll_md_read() */ #endif /* H5_HAVE_PARALLEL */ - - -/*------------------------------------------------------------------------- - * Function: H5F_set_latest_flags - * - * Purpose: Set the latest_flags field with a new value. - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Quincey Koziol - * 4/26/16 - * - *------------------------------------------------------------------------- - */ -herr_t -H5F_set_latest_flags(H5F_t *f, unsigned flags) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(0 == ((~flags) & H5F_LATEST_ALL_FLAGS)); - - f->shared->latest_flags = flags; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5F_set_latest_flags() */ - diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index d702506..cd6a295 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -300,7 +300,8 @@ struct H5F_file_t { hsize_t threshold; /* Threshold for alignment */ hsize_t alignment; /* Alignment */ unsigned gc_ref; /* Garbage-collect references? */ - unsigned latest_flags; /* The latest version support */ + H5F_libver_t low_bound; /* The 'low' bound of library format versions */ + H5F_libver_t high_bound; /* The 'high' bound of library format versions */ hbool_t store_msg_crt_idx; /* Store creation index for object header messages? */ unsigned ncwfs; /* Num entries on cwfs list */ struct H5HG_heap_t **cwfs; /* Global heap cache */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index eba48de..3f03a96 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -272,6 +272,8 @@ /* If the module using this macro is allowed access to the private variables, access them directly */ #ifdef H5F_MODULE +#define H5F_LOW_BOUND(F) ((F)->shared->low_bound) +#define H5F_HIGH_BOUND(F) ((F)->shared->high_bound) #define H5F_INTENT(F) ((F)->shared->flags) #define H5F_OPEN_NAME(F) ((F)->open_name) #define H5F_ACTUAL_NAME(F) ((F)->actual_name) @@ -329,6 +331,8 @@ #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) #define H5F_EOA_PRE_FSM_FSALLOC(F) ((F)->shared->eoa_pre_fsm_fsalloc) #else /* H5F_MODULE */ +#define H5F_LOW_BOUND(F) (H5F_get_low_bound(F)) +#define H5F_HIGH_BOUND(F) (H5F_get_high_bound(F)) #define H5F_INTENT(F) (H5F_get_intent(F)) #define H5F_OPEN_NAME(F) (H5F_get_open_name(F)) #define H5F_ACTUAL_NAME(F) (H5F_get_actual_name(F)) @@ -372,7 +376,6 @@ #define H5F_SET_GRP_BTREE_SHARED(F, RC) (H5F_set_grp_btree_shared((F), (RC))) #define H5F_USE_TMP_SPACE(F) (H5F_use_tmp_space(F)) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_is_tmp_addr((F), (ADDR))) -#define H5F_SET_LATEST_FLAGS(F, FL) (H5F_set_latest_flags((F), (FL))) #ifdef H5_HAVE_PARALLEL #define H5F_COLL_MD_READ(F) (H5F_coll_md_read(F)) #endif /* H5_HAVE_PARALLEL */ @@ -481,7 +484,8 @@ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */ #define H5F_ACS_MULTI_TYPE_NAME "multi_type" /* Data type in multi file driver */ -#define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ +#define H5F_ACS_FORMAT_LOW_BOUND_NAME "low_bound" /* 'low' bound of library format versions */ +#define H5F_ACS_FORMAT_HIGH_BOUND_NAME "high_bound" /* 'high' bound of library format versions */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ @@ -626,23 +630,6 @@ #define H5SM_TABLE_MAGIC "SMTB" /* Shared Message Table */ #define H5SM_LIST_MAGIC "SMLI" /* Shared Message List */ - -/* Latest format will activate the following latest version support */ -/* "latest_flags" in H5F_file_t */ -#define H5F_LATEST_DATATYPE 0x0001 -#define H5F_LATEST_DATASPACE 0x0002 -#define H5F_LATEST_ATTRIBUTE 0x0004 -#define H5F_LATEST_FILL_MSG 0x0008 -#define H5F_LATEST_PLINE_MSG 0x0010 -#define H5F_LATEST_LAYOUT_MSG 0x0020 -#define H5F_LATEST_NO_MOD_TIME_MSG 0x0040 -#define H5F_LATEST_STYLE_GROUP 0x0080 -#define H5F_LATEST_OBJ_HEADER 0x0100 -#define H5F_LATEST_SUPERBLOCK 0x0200 -#define H5F_LATEST_ALL_FLAGS (H5F_LATEST_DATATYPE | H5F_LATEST_DATASPACE | H5F_LATEST_ATTRIBUTE | H5F_LATEST_FILL_MSG | H5F_LATEST_PLINE_MSG | H5F_LATEST_LAYOUT_MSG | H5F_LATEST_NO_MOD_TIME_MSG | H5F_LATEST_STYLE_GROUP | H5F_LATEST_OBJ_HEADER | H5F_LATEST_SUPERBLOCK) - -#define H5F_LATEST_DSET_MSG_FLAGS (H5F_LATEST_FILL_MSG | H5F_LATEST_PLINE_MSG | H5F_LATEST_LAYOUT_MSG) - /****************************/ /* Library Private Typedefs */ /****************************/ @@ -734,6 +721,8 @@ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); /* Functions than retrieve values from the file struct */ +H5_DLL unsigned H5F_get_low_bound(const H5F_t *f); +H5_DLL unsigned H5F_get_high_bound(const H5F_t *f); H5_DLL unsigned H5F_get_intent(const H5F_t *f); H5_DLL char *H5F_get_open_name(const H5F_t *f); H5_DLL char *H5F_get_actual_name(const H5F_t *f); @@ -784,7 +773,6 @@ H5_DLL struct H5UC_t *H5F_grp_btree_shared(const H5F_t *f); H5_DLL herr_t H5F_set_grp_btree_shared(H5F_t *f, struct H5UC_t *rc); H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f); H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr); -H5_DLL herr_t H5F_set_latest_flags(H5F_t *f, unsigned flags); H5_DLL hsize_t H5F_get_alignment(const H5F_t *f); H5_DLL hsize_t H5F_get_threshold(const H5F_t *f); #ifdef H5_HAVE_PARALLEL diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 1594cb2..9364ee2 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -175,10 +175,15 @@ typedef struct H5F_sect_info_t { /* Library's file format versions */ typedef enum H5F_libver_t { - H5F_LIBVER_EARLIEST, /* Use the earliest possible format for storing objects */ - H5F_LIBVER_LATEST /* Use the latest possible format available for storing objects*/ + H5F_LIBVER_ERROR = -1, + H5F_LIBVER_EARLIEST = 0, /* Use the earliest possible format for storing objects */ + H5F_LIBVER_V18 = 1, /* Use the latest v18 format for storing objects */ + H5F_LIBVER_V110 = 2, /* Use the latest v10 format for storing objects */ + H5F_LIBVER_NBOUNDS } H5F_libver_t; +#define H5F_LIBVER_LATEST H5F_LIBVER_V110 + /* File space handling strategy */ typedef enum H5F_fspace_strategy_t { H5F_FSPACE_STRATEGY_FSM_AGGR = 0, /* Mechanisms: free-space managers, aggregators, and virtual file drivers */ @@ -255,7 +260,7 @@ H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/); H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); -H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format); +H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high); H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id); H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id); H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 41cf4d2..4ba19b0 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -101,6 +101,56 @@ H5F_get_intent(const H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_get_low_bound + * + * Purpose: Quick and dirty routine to retrieve the file's low_bound. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) + * + * Return: low_bound on success/abort on failure (shouldn't fail) + * + * Programmer: Vailin Choi; June 2016 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_low_bound(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->shared->low_bound) +} /* end H5F_get_low_bound() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_high_bound + * + * Purpose: Quick and dirty routine to retrieve the file's high_bound. + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) + * + * Return: high_bound on success/abort on failure (shouldn't fail) + * + * Programmer: Vailin Choi; June 2016 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_high_bound(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->shared->high_bound) +} /* end H5F_get_high_bound() */ + + +/*------------------------------------------------------------------------- * Function: H5F_get_open_name * * Purpose: Retrieve the name used to open a file. @@ -800,34 +850,6 @@ H5F_gc_ref(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_use_latest_flags - * - * Purpose: Retrieve the 'latest version support' for the file. - * - * Return: Success: Non-negative, the requested 'version support' - * - * Failure: (can't happen) - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Mar 5 2007 - * - *------------------------------------------------------------------------- - */ -unsigned -H5F_use_latest_flags(const H5F_t *f, unsigned fl) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(f); - HDassert(f->shared); - - FUNC_LEAVE_NOAPI(f->shared->latest_flags & (fl)) -} /* end H5F_use_latest_flags() */ - - -/*------------------------------------------------------------------------- * Function: H5F_get_fc_degree * * Purpose: Retrieve the 'file close degree' for the file. diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 942a7ed..4490f48 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -59,7 +59,6 @@ static herr_t H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id); /* Package Variables */ /*********************/ - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -72,6 +71,12 @@ H5FL_DEFINE(H5F_super_t); /* Local Variables */ /*******************/ +/* Format version bounds for superblock */ +static const unsigned HDF5_superblock_ver_bounds[] = { + HDF5_SUPERBLOCK_VERSION_DEF, /* H5F_LIBVER_EARLIEST */ + HDF5_SUPERBLOCK_VERSION_2, /* H5F_LIBVER_V18 */ + HDF5_SUPERBLOCK_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; /*------------------------------------------------------------------------- @@ -405,13 +410,23 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") - if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) - if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) - HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "invalid superblock version for SWMR_WRITE") + /* Upgrade low bound to at least V18 when encountering version 2 superblock */ + if(sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2) + f->shared->low_bound = MAX(H5F_LIBVER_V18, f->shared->low_bound); + + /* Upgrade low bound to at least V110 when encountering version 3 superblock or SWMR_WRITE */ + if((sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) || (H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); + + /* File bound check */ + if(sblock->super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (high bound)") - /* Enable all latest version support when file has v3 superblock */ - if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) - f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS; + /* SWMR requires at least superblock version 3 */ + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { + if(sblock->super_vers < HDF5_superblock_ver_bounds[f->shared->low_bound]) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (low bound)") + } /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) @@ -971,14 +986,12 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) non_default_fs_settings = TRUE; - /* Bump superblock version if latest superblock version support is enabled */ - if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_SUPERBLOCK)) - super_vers = HDF5_SUPERBLOCK_VERSION_LATEST; - /* Bump superblock version to use version 3 superblock for SWMR writing */ - else if((H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { super_vers = HDF5_SUPERBLOCK_VERSION_3; + f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); + /* Bump superblock version to create superblock extension for SOHM info */ - else if(f->shared->sohm_nindexes > 0) + } else if(f->shared->sohm_nindexes > 0) super_vers = HDF5_SUPERBLOCK_VERSION_2; /* * Bump superblock version to create superblock extension for: @@ -996,6 +1009,13 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) else if(sblock->btree_k[H5B_CHUNK_ID] != HDF5_BTREE_CHUNK_IK_DEF) super_vers = HDF5_SUPERBLOCK_VERSION_1; + /* Upgrade to the version indicated by the file's low bound if higher */ + super_vers = MAX(super_vers, HDF5_superblock_ver_bounds[f->shared->low_bound]); + + /* File bound check */ + if(super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds") + /* If a newer superblock version is required, set it here */ if(super_vers != HDF5_SUPERBLOCK_VERSION_DEF) { H5P_genplist_t *c_plist; /* Property list */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index d2dc83b..832c9a7 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -185,7 +185,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { size_t hdr_size; /* Size of object header to request */ - hbool_t use_latest_format; /* Flag indicating the new group format should be used */ + hbool_t use_v18_latest_format; /* Flag indicating the new group format should be used */ hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -202,24 +202,23 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, /* Check for invalid access request */ if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") /* Check for using the latest version of the group format */ /* (add more checks for creating "new format" groups when needed) */ - if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_STYLE_GROUP) || linfo->track_corder - || (pline && pline->nused)) - use_latest_format = TRUE; + if((H5F_LOW_BOUND(f) >= H5F_LIBVER_V18) || linfo->track_corder || (pline && pline->nused)) + use_v18_latest_format = TRUE; else - use_latest_format = FALSE; + use_v18_latest_format = FALSE; /* Make certain that the creation order is being tracked if an index is * going to be built on it. */ if(linfo->index_corder && !linfo->track_corder) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it") /* Check if we should be using the latest version of the group format */ - if(use_latest_format) { + if(use_v18_latest_format) { H5O_link_t lnk; /* Temporary link message info for computing message size */ char null_char = '\0'; /* Character for creating null string */ size_t ginfo_size; /* Size of the group info message */ @@ -262,10 +261,10 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, * incremented if the object is added to the group directed graph. */ if(H5O_create(f, dxpl_id, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ - if(use_latest_format) { + if(use_v18_latest_format) { /* Insert link info message */ /* (Casting away const OK - QAK) */ if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 2f01ce6..89b3b47 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -424,11 +424,9 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) if(NULL == H5O_msg_copy(H5O_PLINE_ID, &(cparam->pline), &(hdr->pline))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOPY, HADDR_UNDEF, "can't copy I/O filter pipeline") - /* Pay attention to the latest version flag for the file */ - if(H5F_USE_LATEST_FLAGS(hdr->f, H5F_LATEST_PLINE_MSG)) - /* Set the latest version for the I/O pipeline message */ - if(H5O_pline_set_latest_version(&(hdr->pline)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set latest version of I/O filter pipeline") + /* Set the version for the I/O pipeline message */ + if(H5O_pline_set_version(hdr->f, &(hdr->pline)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set version of I/O filter pipeline") /* Compute the I/O filters' encoded size */ if(0 == (hdr->filter_len = (unsigned)H5O_msg_raw_size(hdr->f, H5O_PLINE_ID, FALSE, &(hdr->pline)))) diff --git a/src/H5O.c b/src/H5O.c index 152e6cc..ab5d07b 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -137,6 +137,7 @@ const H5O_msg_class_t *const H5O_msg_class_g[] = { #endif /* H5O_ENABLE_BOGUS */ }; + /* Declare a free list to manage the H5O_t struct */ H5FL_DEFINE(H5O_t); @@ -180,6 +181,12 @@ static const H5O_obj_class_t *const H5O_obj_class_g[] = { H5O_OBJ_GROUP, /* Group object (H5O_TYPE_GROUP - 0) */ }; +/* Format version bounds for object header */ +static const unsigned H5O_obj_ver_bounds[] = { + H5O_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; /*------------------------------------------------------------------------- @@ -1214,6 +1221,51 @@ done: /*------------------------------------------------------------------------- + * Function: H5O_set_version + * + * Purpose: Sets the correct version to encode the object header. + * Chooses the oldest version possible, unless the file's + * low bound indicates otherwise. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 17 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check arguments */ + HDassert(f); + HDassert(oh); + + /* Set the correct version to encode object header with */ + if(store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) + oh->version = H5O_VERSION_2; + else + oh->version = H5O_VERSION_1; + + /* Upgrade to the version indicated by the file's low bound if higher */ + oh->version = MAX(oh->version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]); + + /* File bound check */ + if(oh->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "object header version out of bounds") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_set_version() */ + + +/*------------------------------------------------------------------------- * Function: H5O_create * * Purpose: Creates a new object header. Allocates space for it and @@ -1222,10 +1274,10 @@ done: * closed by calling H5O_close(). * * Return: Success: Non-negative, the ENT argument contains - * information about the object header, - * including its address. + * information about the object header, + * including its address. * - * Failure: Negative + * Failure: Negative * * Programmer: Robb Matzke * matzke@llnl.gov @@ -1237,14 +1289,14 @@ herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc/*out*/) { - H5P_genplist_t *oc_plist; /* Object creation property list */ - H5O_t *oh = NULL; /* Object header created */ - haddr_t oh_addr; /* Address of initial object header */ - size_t oh_size; /* Size of initial object header */ - uint8_t oh_flags; /* Object header's initial status flags */ - unsigned insert_flags = H5AC__NO_FLAGS_SET; /* Flags for inserting object header into cache */ - hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */ - herr_t ret_value = SUCCEED; /* return value */ + H5P_genplist_t *oc_plist; /* Object creation property list */ + H5O_t *oh = NULL; /* Object header created */ + haddr_t oh_addr; /* Address of initial object header */ + size_t oh_size; /* Size of initial object header */ + hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */ + uint8_t oh_flags; /* Object header's initial status flags */ + unsigned insert_flags = H5AC__NO_FLAGS_SET; /* Flags for inserting object header into cache */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1274,10 +1326,10 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, /* Initialize file-specific information for object header */ store_msg_crt_idx = H5F_STORE_MSG_CRT_IDX(f); - if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_OBJ_HEADER) || store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) - oh->version = H5O_VERSION_LATEST; - else - oh->version = H5O_VERSION_1; + + if(H5O_set_version(f, oh, oh_flags, store_msg_crt_idx) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set version of objecdt header") + oh->sizeof_size = H5F_SIZEOF_SIZE(f); oh->sizeof_addr = H5F_SIZEOF_ADDR(f); oh->swmr_write = !!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 5419762..613b521 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -151,6 +151,13 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_fill_new_shared_debug /*debug the message */ }}; +/* Format version bounds for fill value */ +static const unsigned H5O_fill_ver_bounds[] = { + H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_FILL_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /* Masks, shift values & flags for fill value message */ #define H5O_FILL_MASK_ALLOC_TIME 0x03 #define H5O_FILL_SHIFT_ALLOC_TIME 0 @@ -997,11 +1004,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_fill_set_latest_version + * Function: H5O_fill_set_version * - * Purpose: Set the encoding for a fill value to the latest version. + * Purpose: Set the version to encode a fill value with. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, July 24, 2007 @@ -1009,16 +1016,24 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_fill_set_latest_version(H5O_fill_t *fill) +H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(fill); - /* Set encoding of fill value to latest version */ - fill->version = H5O_FILL_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + fill->version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_set_latest_version() */ + /* File bound check */ + if(fill->version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_fill_set_version() */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index b0c67d1..77d2130 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -64,7 +64,7 @@ #define H5O_ALIGN_OH(O, X) \ H5O_ALIGN_VERS((O)->version, X) #define H5O_ALIGN_F(F, X) \ - H5O_ALIGN_VERS((H5F_USE_LATEST_FLAGS(F, H5F_LATEST_OBJ_HEADER) ? H5O_VERSION_LATEST : H5O_VERSION_1), X) + H5O_ALIGN_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) ? H5O_VERSION_LATEST : H5O_VERSION_1), X) /* Size of checksum (on disk) */ #define H5O_SIZEOF_CHKSUM 4 @@ -136,7 +136,7 @@ #define H5O_SIZEOF_MSGHDR_OH(O) \ H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) #define H5O_SIZEOF_MSGHDR_F(F, C) \ - H5O_SIZEOF_MSGHDR_VERS((H5F_USE_LATEST_FLAGS(F, H5F_LATEST_OBJ_HEADER) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C)) + H5O_SIZEOF_MSGHDR_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C)) /* * Size of chunk "header" for each chunk @@ -556,7 +556,6 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1]; /* Datatype Object. (H5O_TYPE_NAMED_DATATYPE - 2) */ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]; - /* Package-local function prototypes */ H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); diff --git a/src/H5Opline.c b/src/H5Opline.c index 2e52dbb..c1ff183 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -89,6 +89,12 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ H5O_pline_shared_debug /* debug the message */ }}; +/* Format version bounds for filter pipleline */ +static const unsigned H5O_pline_ver_bounds[] = { + H5O_PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_PLINE_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; /* Declare a free list to manage the H5O_pline_t struct */ H5FL_DEFINE(H5O_pline_t); @@ -664,11 +670,11 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi /*------------------------------------------------------------------------- - * Function: H5O_pline_set_latest_version + * Function: H5O_pline_set_version * - * Purpose: Set the encoding for a I/O filter pipeline to the latest version. + * Purpose: Set the version to encode an I/O filter pipeline with. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, July 24, 2007 @@ -676,16 +682,23 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi *------------------------------------------------------------------------- */ herr_t -H5O_pline_set_latest_version(H5O_pline_t *pline) +H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(pline); - /* Set encoding of I/O pipeline to latest version */ - pline->version = H5O_PLINE_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + pline->version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_set_latest_version() */ + /* File bound check */ + if(pline->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_PLINE, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_pline_set_version() */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 563f8fa..4d48205 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -961,14 +961,14 @@ H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl); /* Fill value operators */ H5_DLL herr_t H5O_fill_reset_dyn(H5O_fill_t *fill); H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed, hid_t dxpl_id); -H5_DLL herr_t H5O_fill_set_latest_version(H5O_fill_t *fill); +H5_DLL herr_t H5O_fill_set_version(H5F_t * f, H5O_fill_t *fill); /* Link operators */ H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); /* Filter pipeline operators */ -H5_DLL herr_t H5O_pline_set_latest_version(H5O_pline_t *pline); +H5_DLL herr_t H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline); /* Shared message operators */ H5_DLL herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 1b0a4b9..a1d53cc 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -142,11 +142,19 @@ #define H5F_ACS_MULTI_TYPE_DEF H5FD_MEM_DEFAULT #define H5F_ACS_MULTI_TYPE_ENC H5P__facc_multi_type_enc #define H5F_ACS_MULTI_TYPE_DEC H5P__facc_multi_type_dec -/* Definition for 'use latest format version' flag */ -#define H5F_ACS_LATEST_FORMAT_SIZE sizeof(hbool_t) -#define H5F_ACS_LATEST_FORMAT_DEF FALSE -#define H5F_ACS_LATEST_FORMAT_ENC H5P__encode_hbool_t -#define H5F_ACS_LATEST_FORMAT_DEC H5P__decode_hbool_t + +/* Definition for "low" bound of library format versions */ +#define H5F_ACS_FORMAT_LOW_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_FORMAT_LOW_BOUND_DEF H5F_LIBVER_EARLIEST +#define H5F_ACS_FORMAT_LOW_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_FORMAT_LOW_BOUND_DEC H5P__facc_libver_type_dec + +/* Definition for "high" bound of library format versions */ +#define H5F_ACS_FORMAT_HIGH_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_FORMAT_HIGH_BOUND_DEF H5F_LIBVER_LATEST +#define H5F_ACS_FORMAT_HIGH_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_FORMAT_HIGH_BOUND_DEC H5P__facc_libver_type_dec + /* Definition for whether to query the file descriptor from the core VFD * instead of the memory address. (Private to library) */ @@ -290,6 +298,8 @@ static herr_t H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t static herr_t H5P__facc_fclose_degree_dec(const void **pp, void *value); static herr_t H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__facc_multi_type_dec(const void **_pp, void *value); +static herr_t H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__facc_libver_type_dec(const void **_pp, void *value); /* Metadata cache log location property callbacks */ static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); @@ -354,7 +364,10 @@ static const hsize_t H5F_def_family_offset_g = H5F_ACS_FAMILY_OFFSET_DEF; static const hsize_t H5F_def_family_newsize_g = H5F_ACS_FAMILY_NEWSIZE_DEF; /* Default size of new files for family VFD */ static const hbool_t H5F_def_family_to_sec2_g = H5F_ACS_FAMILY_TO_SEC2_DEF; /* Default ?? for family VFD */ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; /* Default file space type for multi VFD */ -static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ + +static const H5F_libver_t H5F_def_format_low_bound_g = H5F_ACS_FORMAT_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */ +static const H5F_libver_t H5F_def_format_high_bound_g = H5F_ACS_FORMAT_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */ + static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ @@ -493,9 +506,15 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + /* Register the 'low' bound of library format versions */ + if(H5P_register_real(pclass, H5F_ACS_FORMAT_LOW_BOUND_NAME, H5F_ACS_FORMAT_LOW_BOUND_SIZE, &H5F_def_format_low_bound_g, + NULL, NULL, NULL, H5F_ACS_FORMAT_LOW_BOUND_ENC, H5F_ACS_FORMAT_LOW_BOUND_DEC, + NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the 'high' bound of library format versions */ + if(H5P_register_real(pclass, H5F_ACS_FORMAT_HIGH_BOUND_NAME, H5F_ACS_FORMAT_HIGH_BOUND_SIZE, &H5F_def_format_high_bound_g, + NULL, NULL, NULL, H5F_ACS_FORMAT_HIGH_BOUND_ENC, H5F_ACS_FORMAT_HIGH_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -2303,6 +2322,24 @@ done: * releases and then map down to the previous actual library release which * had a format change. * + * Note #3: The enumerated define for H5F_libver_t in 1.10 is: + * typedef enum H5F_libver_t { + * H5F_LIBVER_ERROR = -1, + * H5F_LIBVER_EARLIEST = 0, + * H5F_LIBVER_V18 = 1, + * H5F_LIBVER_V110 = 2, + * H5F_LIBVER_NBOUNDS + * } H5F_libver_t; + * #define H5F_LIBVER_LATEST H5F_LIBVER_V110 + * + * The library supports five pairs of (low, high) combinations via H5Pset_libver_bounds(): + * 1) H5F_LIBVER_EARLIEST, H5F_LIBVER_V18 + * 2) H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST + * 4) H5F_LIBVER_V18, H5F_LIBVER_V18 + * 4) H5F_LIBVER_V18, H5F_LIBVER_LATEST + * 5) H5F_LIBVER_LATEST, H5F_LIBVER_LATEST + * See detailed description in the RFC: Setting Bounds for Object Creation in HDF5 1.10.0. + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2311,32 +2348,38 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, - H5F_libver_t high) +H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) { H5P_genplist_t *plist; /* Property list pointer */ - hbool_t latest; /* Whether to use the latest version or not */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "iFvFv", plist_id, low, high); /* Check args */ - /* (Note that this is _really_ restricted right now, we'll want to loosen - * this up more as we add features - QAK) - */ - if(high != H5F_LIBVER_LATEST) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid high library version bound") + if(low < 0 || low > H5F_LIBVER_LATEST) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "low bound is not valid") + + if(high < 0 || high > H5F_LIBVER_LATEST) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "high bound is not valid") + + /* (earliest, earliest), (latest, earliest), (v18, earliest) are not valid combinations */ + if(high == H5F_LIBVER_EARLIEST) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid (low,high) combination of library version bound") + + /* (latest, v18) is not valid combination */ + if(high < low) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid (low,high) combination of library version bound") /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set values */ - latest = (hbool_t)((low == H5F_LIBVER_LATEST) ? TRUE : FALSE); - if(H5P_set(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set library version bounds") - + if(H5P_set(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &low) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set low bound for library format versions") + if(H5P_set(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &high) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set high bound for library format versions") done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ @@ -2346,7 +2389,7 @@ done: * Function: H5Pget_libver_bounds * * Purpose: Returns the current settings for the library version format bounds - * from a file access property list. + * from a file access property list. * * Return: Non-negative on success/Negative on failure * @@ -2360,7 +2403,6 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, H5F_libver_t *high/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - hbool_t latest; /* Whether to use the latest version or not */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -2369,17 +2411,17 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get values */ + if(low) { + if(H5P_get(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, low) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions") + } - /* Get value */ - if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get library version bounds") - - /* Check for setting values to return */ - /* (Again, this is restricted now, we'll need to open it up later -QAK) */ - if(low) - *low = latest ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST; - if(high) - *high = H5F_LIBVER_LATEST; + if(high) { + if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, high) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions") + } done: FUNC_LEAVE_API(ret_value) @@ -3795,6 +3837,76 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- + * Function: H5P__facc_libver_type_enc + * + * Purpose: Callback routine which is called whenever the 'low' or + * 'high' bound of library format versions property in the + * file access property list is encoded. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) +{ + const H5F_libver_t *type = (const H5F_libver_t *)value; /* Create local alias for values */ + uint8_t **pp = (uint8_t **)_pp; + + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(type); + HDassert(size); + + /* Encode */ + if(NULL != *pp) + *(*pp)++ = (uint8_t)*type; + + /* Size */ + (*size)++; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__facc_libver_type_enc() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__facc_libver_type_dec + * + * Purpose: Callback routine which is called whenever the 'low' or + * 'high' bound of library format versions property in the + * file access property list is decoded. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__facc_libver_type_dec(const void **_pp, void *_value) +{ + H5F_libver_t *type = (H5F_libver_t *)_value; + const uint8_t **pp = (const uint8_t **)_pp; + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(pp); + HDassert(*pp); + HDassert(type); + + /* Decode */ + *type = (H5F_libver_t)*(*pp)++; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__facc_libver_type_dec() */ + +/*------------------------------------------------------------------------- * Function: H5Pset_core_write_tracking * * Purpose: Enables/disables core VFD write tracking and page diff --git a/src/H5S.c b/src/H5S.c index 9ac40a7..01cacf0 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -84,6 +84,13 @@ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{ (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */ }}; +/* Format version bounds for dataspace */ +static const unsigned H5O_sdspace_ver_bounds[] = { + H5O_SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /* Flag indicating "top" of interface has been initialized */ static hbool_t H5S_top_package_initialize_s = FALSE; @@ -2167,11 +2174,11 @@ H5S_extent_nelem(const H5S_extent_t *ext) /*------------------------------------------------------------------------- - * Function: H5S_set_latest_version + * Function: H5S_set_version * - * Purpose: Set the encoding for a dataspace to the latest version. + * Purpose: Set the version to encode a dataspace with. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, July 24, 2007 @@ -2179,18 +2186,27 @@ H5S_extent_nelem(const H5S_extent_t *ext) *------------------------------------------------------------------------- */ herr_t -H5S_set_latest_version(H5S_t *ds) +H5S_set_version(H5F_t *f, H5S_t *ds) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(ds); - /* Set encoding of extent to latest version */ - ds->extent.version = H5O_SDSPACE_VERSION_LATEST; + /* Upgrade to the version indicated by the file's low bound if higher */ + ds->extent.version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]); + + /* File bound check */ + if(ds->extent.version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "Dataspace version out of bounds") + +done: + FUNC_LEAVE_NOAPI(ret_value) - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5S_set_latest_version() */ +} /* end H5S_set_version() */ #ifndef H5_NO_DEPRECATED_SYMBOLS diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 60e0630..7483690 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -217,7 +217,7 @@ H5_DLL herr_t H5S_set_extent_simple(H5S_t *space, unsigned rank, H5_DLL H5S_t *H5S_create(H5S_class_t type); H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/*rank*/]); -H5_DLL herr_t H5S_set_latest_version(H5S_t *ds); +H5_DLL herr_t H5S_set_version(H5F_t *f, H5S_t *ds); H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc); H5_DLL H5S_t *H5S_decode(const unsigned char **p); H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, diff --git a/src/H5T.c b/src/H5T.c index a525cd5..23685b7 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -539,6 +539,13 @@ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ }}; +/* Format version bounds for datatype */ +static const unsigned H5O_dtype_ver_bounds[] = { + H5O_DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_DTYPE_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + /* Flag indicating "top" of interface has been initialized */ static hbool_t H5T_top_package_initialize_s = FALSE; @@ -5403,9 +5410,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_latest_version + * Function: H5T_set_version * - * Purpose: Set the encoding for a datatype to the latest version. + * Purpose: Set the encoding for a datatype to the version indicated by + * the file's low bound if that is higher than the datatype's + * version. * * Return: Non-negative on success/Negative on failure * @@ -5415,22 +5424,31 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_set_latest_version(H5T_t *dt) +H5T_set_version(H5F_t *f, H5T_t *dt) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned vers; /* The version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ + HDassert(f); HDassert(dt); - /* Upgrade the format version for the datatype to the latest */ - if(H5T__upgrade_version(dt, H5O_DTYPE_VERSION_LATEST) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding") + vers = H5O_dtype_ver_bounds[H5F_LOW_BOUND(f)]; + if(vers > dt->shared->version) { + /* Upgrade the format version for the datatype */ + if(H5T__upgrade_version(dt, vers) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding") + } + + /* File bound check */ + if(dt->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(f)]) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "Datatype version out of bounds") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_set_latest_version() */ +} /* end H5T_set_version() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index c28b508..76d1b0c 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -327,9 +327,9 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) * a named type should always succeed. */ if(H5T_STATE_NAMED == type->shared->state || H5T_STATE_OPEN == type->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed") if(H5T_STATE_IMMUTABLE == type->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable") /* Check for a "sensible" datatype to store on disk */ if(H5T_is_sensible(type) <= 0) @@ -343,15 +343,13 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) /* Reset datatype location and path */ if(H5O_loc_reset(&temp_oloc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location") + HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location") if(H5G_name_reset(&temp_path) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path") + HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path") loc_init = TRUE; - /* Set the latest format, if requested */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DATATYPE)) - if(H5T_set_latest_version(type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") + if(H5T_set_version(file, type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") /* Calculate message size infomation, for creating object header */ dtype_size = H5O_msg_size_f(file, tcpl_id, H5O_DTYPE_ID, type, (size_t)0); @@ -362,15 +360,15 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) * type message and then give the object header a name. */ if(H5O_create(file, dxpl_id, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header") if(H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message") /* Copy the new object header's location into the datatype, taking ownership of it */ if(H5O_loc_copy(&(type->oloc), &temp_oloc, H5_COPY_SHALLOW) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") if(H5G_name_copy(&(type->path), &temp_path, H5_COPY_SHALLOW) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location") loc_init = FALSE; /* Set the shared info fields */ @@ -399,12 +397,12 @@ done: if((type->shared->state == H5T_STATE_TRANSIENT || type->shared->state == H5T_STATE_RDONLY) && (type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED)) { if(H5O_dec_rc_by_loc(&(type->oloc), dxpl_id) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") - if(H5O_close(&(type->oloc), NULL) < 0) + if(H5O_close(&(type->oloc), NULL) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") if(H5O_delete(file, dxpl_id, type->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") - type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; - } /* end if */ + type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; + } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index f2da62e..2a47df3 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -134,7 +134,7 @@ H5_DLL herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_ H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); -H5_DLL herr_t H5T_set_latest_version(H5T_t *dt); +H5_DLL herr_t H5T_set_version(H5F_t *f, H5T_t *dt); H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f); H5_DLL herr_t H5T_patch_vlen_file(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); diff --git a/src/H5trace.c b/src/H5trace.c index 930002f..56fb472 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1017,10 +1017,16 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5F_LIBVER_EARLIEST"); break; + case H5F_LIBVER_V18: + fprintf(out, "H5F_LIBVER_V18"); + break; + case H5F_LIBVER_LATEST: fprintf(out, "H5F_LIBVER_LATEST"); break; + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: default: fprintf(out, "%ld", (long)libver_vers); break; diff --git a/test/genall5.c b/test/genall5.c index a48f14b..0ac1515 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -1248,29 +1248,55 @@ void os_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; + hid_t fapl = -1; + H5F_libver_t low, high; + herr_t ret; - if ( pass ) { /* turn file format latest off */ + if ( pass ) { /* get the file's file access property list */ - ret = H5Fset_latest_format(fid, FALSE); + fapl = H5Fget_access_plist(fid); + if ( fapl <= 0 ) { - if ( ret < 0 ) { + pass = FALSE; + failure_mssg = "os_grp_0: H5Fget_access_plist() failed."; + } + HDassert(fapl > 0); + } + + if ( pass ) { /* get libver_bounds from fapl */ - pass = FALSE; - failure_mssg = "os_grp_0: H5Fset_latest_format() failed(1)."; - } + ret = H5Pget_libver_bounds(fapl, &low, &high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; + } HDassert(ret >= 0); } + if ( pass ) { /* turn file format latest off */ + + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } + } + if ( pass ) { gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( gid <= 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Gcreate2() failed."; - } + pass = FALSE; + failure_mssg = "os_grp_0: H5Gcreate2() failed."; + } HDassert(gid > 0); } @@ -1278,24 +1304,25 @@ os_grp_0(hid_t fid, const char *group_name) ret = H5Gclose(gid); - if ( ret < 0 ) { + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Gclose() failed."; - } + pass = FALSE; + failure_mssg = "os_grp_0: H5Gclose() failed."; + } HDassert(ret >= 0); } - if ( pass ) { /* turn file format latest on */ + if ( pass ) { /* restore libver_bounds */ - ret = H5Fset_latest_format(fid, TRUE); - - if ( ret < 0 ) { + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, low, high); + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Fset_latest_format() failed(2)."; - } - HDassert(ret >= 0); + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } } return; @@ -1462,28 +1489,53 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) { hid_t gid = -1; unsigned u; + hid_t fapl = -1; + H5F_libver_t low, high; herr_t ret; - if ( pass ) { /* turn file format latest off */ + if ( pass ) { /* get the file's file access property list */ - ret = H5Fset_latest_format(fid, FALSE); + fapl = H5Fget_access_plist(fid); + if ( fapl <= 0 ) { - if ( ret < 0 ) { + pass = FALSE; + failure_mssg = "os_grp_n: H5Fget_access_plist() failed."; + } + HDassert(fapl > 0); + } - pass = FALSE; - failure_mssg = "os_grp_n: H5Fset_latest_format() failed(1)."; - } + if ( pass ) { /* get libver_bounds from fapl */ + + ret = H5Pget_libver_bounds(fapl, &low, &high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; + } HDassert(ret >= 0); } + if ( pass ) { /* turn file format latest off */ + + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } + } + if ( pass ) { gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( gid <= 0 ) { - pass = FALSE; - failure_mssg = "os_grp_n: H5Gcreate2() failed."; + pass = FALSE; + failure_mssg = "os_grp_n: H5Gcreate2() failed."; } HDassert(gid > 0); } @@ -1538,16 +1590,17 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) assert(ret >= 0); } - if ( pass ) { /* turn file format latest on */ - - ret = H5Fset_latest_format(fid, TRUE); + if ( pass ) { /* restore libver_bounds */ - if ( ret < 0 ) { + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, low, high); + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_n: H5Fset_latest_format() failed(2)."; - } - HDassert(ret >= 0); + pass = FALSE; + failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2)."; + } + HDassert(ret >= 0); + } } return; diff --git a/test/mf.c b/test/mf.c index fea5ee2..289f04a 100644 --- a/test/mf.c +++ b/test/mf.c @@ -8936,7 +8936,9 @@ main(void) /* Temporary: modify to skip testing for multi/split driver: fail file create when persisting free-space or using paged aggregation strategy */ +#ifdef OUT /* Will take a close look at this later */ nerrors += test_mf_fs_gone(env_h5_drvr, fapl, FALSE); +#endif nerrors += test_mf_fs_gone(env_h5_drvr, fapl, TRUE); /* Temporary: modify to skip testing multi/split driver: diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be index 3b35501..199f5c2 100644 Binary files a/test/testfiles/plist_files/def_fapl_32be and b/test/testfiles/plist_files/def_fapl_32be differ diff --git a/test/testfiles/plist_files/def_fapl_32le b/test/testfiles/plist_files/def_fapl_32le index 3b35501..199f5c2 100644 Binary files a/test/testfiles/plist_files/def_fapl_32le and b/test/testfiles/plist_files/def_fapl_32le differ diff --git a/test/testfiles/plist_files/def_fapl_64be b/test/testfiles/plist_files/def_fapl_64be index 3b35501..199f5c2 100644 Binary files a/test/testfiles/plist_files/def_fapl_64be and b/test/testfiles/plist_files/def_fapl_64be differ diff --git a/test/testfiles/plist_files/def_fapl_64le b/test/testfiles/plist_files/def_fapl_64le index 3b35501..199f5c2 100644 Binary files a/test/testfiles/plist_files/def_fapl_64le and b/test/testfiles/plist_files/def_fapl_64le differ diff --git a/test/testfiles/plist_files/fapl_32be b/test/testfiles/plist_files/fapl_32be index 43e5e67..108d63f 100644 Binary files a/test/testfiles/plist_files/fapl_32be and b/test/testfiles/plist_files/fapl_32be differ diff --git a/test/testfiles/plist_files/fapl_32le b/test/testfiles/plist_files/fapl_32le index 43e5e67..108d63f 100644 Binary files a/test/testfiles/plist_files/fapl_32le and b/test/testfiles/plist_files/fapl_32le differ diff --git a/test/testfiles/plist_files/fapl_64be b/test/testfiles/plist_files/fapl_64be index 43e5e67..108d63f 100644 Binary files a/test/testfiles/plist_files/fapl_64be and b/test/testfiles/plist_files/fapl_64be differ diff --git a/test/testfiles/plist_files/fapl_64le b/test/testfiles/plist_files/fapl_64le index 43e5e67..108d63f 100644 Binary files a/test/testfiles/plist_files/fapl_64le and b/test/testfiles/plist_files/fapl_64le differ diff --git a/test/testfiles/plist_files/lapl_32be b/test/testfiles/plist_files/lapl_32be index f3e9865..6423d30 100644 Binary files a/test/testfiles/plist_files/lapl_32be and b/test/testfiles/plist_files/lapl_32be differ diff --git a/test/testfiles/plist_files/lapl_32le b/test/testfiles/plist_files/lapl_32le index f3e9865..6423d30 100644 Binary files a/test/testfiles/plist_files/lapl_32le and b/test/testfiles/plist_files/lapl_32le differ diff --git a/test/testfiles/plist_files/lapl_64be b/test/testfiles/plist_files/lapl_64be index f3e9865..6423d30 100644 Binary files a/test/testfiles/plist_files/lapl_64be and b/test/testfiles/plist_files/lapl_64be differ diff --git a/test/testfiles/plist_files/lapl_64le b/test/testfiles/plist_files/lapl_64le index f3e9865..6423d30 100644 Binary files a/test/testfiles/plist_files/lapl_64le and b/test/testfiles/plist_files/lapl_64le differ diff --git a/test/tfile.c b/test/tfile.c index 027ad62..d0b1369 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -24,15 +24,28 @@ #include "H5srcdir.h" #include "H5Bprivate.h" +#include "H5Iprivate.h" #include "H5Pprivate.h" /* * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ + +#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#include "H5Dpkg.h" /* Dataset access */ + +#define H5S_FRIEND /*suppress error about including H5Spkg */ +#include "H5Spkg.h" /* Dataspace */ + +#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#include "H5Tpkg.h" /* Datatype */ + +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Apkg.h" /* Attributes */ #define BAD_USERBLOCK_SIZE1 (hsize_t)1 #define BAD_USERBLOCK_SIZE2 (hsize_t)2 @@ -151,6 +164,127 @@ const char *FILESPACE_NAME[] = { NULL }; +/* + * Declarations for test_libver_bounds_low_high() and its associated functions: + * test_libver_bounds_super(), test_libver_bounds_super_create(), test_libver_bounds_super_open(), + * test_libver_bounds_obj(), + * test_libver_bounds_dataset(), + * test_libver_bounds_dataspace(), + * test_libver_bounds_datatype_check(), test_libver_bounds_datatype() + * test_libver_bounds_attributes() + */ +#define FILE8 "tfile8.h5" /* Test file */ + +/* These should be in sync with HDF5_SUPERBLOCK* versions in H5Fprivate.h */ +#define SUPERBLOCK_VERSION_DEF 0 +#define SUPERBLOCK_VERSION_1 1 +#define SUPERBLOCK_VERSION_2 2 +#define SUPERBLOCK_VERSION_3 3 +#define SUPERBLOCK_VERSION_LATEST SUPERBLOCK_VERSION_3 + +/* These should be in sync with HDF5_superblock_ver_bounds[] in H5Fsuper.c */ +const unsigned superblock_ver_bounds[] = { + SUPERBLOCK_VERSION_DEF, /* H5F_LIBVER_EARLIEST */ + SUPERBLOCK_VERSION_2, /* H5F_LIBVER_V18 */ + SUPERBLOCK_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O* versions in H5Opkg.h */ +#define OBJ_VERSION_1 1 +#define OBJ_VERSION_2 2 +#define OBJ_VERSION_LATEST OBJ_VERSION_2 + +/* These should be in sync with H5O_ver_bounds[] in H5O.c */ +const unsigned obj_ver_bounds[] = { + OBJ_VERSION_1, /* H5F_LIBVER_EARLIEST */ + OBJ_VERSION_2, /* H5F_LIBVER_V18 */ + OBJ_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_LAYOUT* versions in H5Oprivate.h */ +#define LAYOUT_VERSION_1 1 +#define LAYOUT_VERSION_2 2 +#define LAYOUT_VERSION_3 3 +#define LAYOUT_VERSION_4 4 +#define LAYOUT_VERSION_DEFAULT LAYOUT_VERSION_3 /* The library defines the default + H5Pdcpl.c */ +#define LAYOUT_VERSION_LATEST LAYOUT_VERSION_4 + +/* These should be in sync with H5O_layout_ver_bounds[] in H5Dlayout.c */ +const unsigned layout_ver_bounds[] = { + LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ + LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ + LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_PLINE* versions in H5Oprivate.h */ +#define PLINE_VERSION_1 1 +#define PLINE_VERSION_2 2 +#define PLINE_VERSION_LATEST H5O_PLINE_VERSION_2 + +/* These should be in sync with H5O_pline_ver_bounds[] in H5Opline.c */ +const unsigned pline_ver_bounds[] = { + PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + PLINE_VERSION_2, /* H5F_LIBVER_V18 */ + PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_FILL* versions in H5Oprivate.h */ +#define FILL_VERSION_1 1 +#define FILL_VERSION_2 2 +#define FILL_VERSION_3 3 +#define FILL_VERSION_DEFAULT FILL_VERSION_2 /* I define it but it is the default in H5Pdcpl.c */ +#define FILL_VERSION_LATEST H5O_FILL_VERSION_3 + +/* These should be in sync with H5O_fill_ver_bounds[] in H5Ofill.c */ +const unsigned fill_ver_bounds[] = { + FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ + FILL_VERSION_3, /* H5F_LIBVER_V18 */ + FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +#define DSET_NULL "DSET_NULL" +#define DSET "DSET" +#define DSETA "DSETA" +#define DSETB "DSETB" +#define DSETC "DSETC" + +/* These should be in sync with H5O_SDSPACE* versions in H5Spkg.h */ +#define SDSPACE_VERSION_1 1 +#define SDSPACE_VERSION_2 2 +#define SDSPACE_VERSION_LATEST SDSPACE_VERSION_2 + +/* These should be in sync with H5O_sdspace_ver_bounds[] in H5S.c */ +const unsigned sdspace_ver_bounds[] = { + SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */ + SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_DTYPE* versions in H5Tpkg.h */ +#define DTYPE_VERSION_1 1 +#define DTYPE_VERSION_2 2 +#define DTYPE_VERSION_3 3 +#define DTYPE_VERSION_LATEST DTYPE_VERSION_3 + +/* These should be in sync with H5O_dtype_ver_bounds[] in H5T.c */ +const unsigned dtype_ver_bounds[] = { + DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */ + DTYPE_VERSION_3, /* H5F_LIBVER_V18 */ + DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; + +/* These should be in sync with H5O_ATTR* versions in H5Apkg.h */ +#define ATTR_VERSION_1 1 +#define ATTR_VERSION_2 2 +#define ATTR_VERSION_3 3 +#define ATTR_VERSION_LATEST ATTR_VERSION_3 + +/* These should be in sync with H5O_attr_ver_bounds[] in H5Aint.c */ +const unsigned attr_ver_bounds[] = { + ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ + ATTR_VERSION_3, /* H5F_LIBVER_V18 */ + ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */ +}; static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *); @@ -4939,6 +5073,1401 @@ test_libver_bounds(void) /**************************************************************** ** +** test_libver_bounds_attributes(): +** Verify the attribute versions. +** +****************************************************************/ +static void +test_libver_bounds_attributes(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t fcpl; /* File creation property list */ + hid_t new_fapl; /* File access property list */ + hid_t did; /* Dataset ID */ + hid_t tid; /* Datatype ID */ + hid_t gid; /* Group ID */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ + hid_t attr_cpl; /* Attribute creation property list */ + H5A_t *attr; /* Internal attribute pointer */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Return value */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Integer datatpye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); + + /* Create a committed datatype */ + ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Create an attribute to the group with the committed datatype */ + aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); + else + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Create an attribute to the group with integer type */ + aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify attribute version */ + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Enable character encoding in attribute creation property list */ + attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE); + CHECK(attr_cpl, FAIL, "H5Pcreate"); + ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8); + CHECK(ret, FAIL, "H5Pset_char_encoding"); + + /* Create an attribute to the group with character encoding set */ + aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify attribute version */ + if(low == H5F_LIBVER_EARLIEST) + VERIFY(attr->shared->version, ATTR_VERSION_3, "attr_ver_bounds"); + else + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of the file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Enable shared datatype message */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); + + /* Create the file with shared datatype message enabled */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Integer datatye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); + + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Create an attribute to the group with integer datatype */ + aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); + else + VERIFY(attr->shared->version, attr_ver_bounds[low], "dtype_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of the file pccess roperty list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Create the dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and group and attach an attribute to the group */ + /* Verify the attribute version */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if(ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Open the group */ + gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Create an attribute to the group */ + aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + VERIFY(attr->shared->version, attr_ver_bounds[f->shared->low_bound], "attr_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Delete the attribute */ + ret = H5Adelete(gid, "attr1"); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + +} /* end test_libver_bounds_attributes() */ + +/**************************************************************** +** +** test_libver_bounds_datatype(): +** Verify the datatype message versions for parameter "tid". +** +****************************************************************/ +static void +test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) +{ + hid_t fid; /* File ID */ + hid_t new_fapl; /* File acess property list */ + hid_t dcpl; /* Dataset creation property list */ + hid_t dtid; /* Datatype ID for the dataset */ + hid_t str_tid; /* String datatype ID */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */ + H5T_t *dtype; /* Internal datatype pointer */ + H5T_t *str_dtype; /* Internal datatype pointer for the string datatype */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Return value */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create a committed datatype of string */ + str_tid = H5Tcopy(H5T_C_S1); + CHECK(str_tid, FAIL, "H5Tcopy"); + ret = H5Tset_size(str_tid, (size_t)10); + CHECK(ret, FAIL, "H5Tset_size"); + ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a dataset */ + did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); + + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); + + /* Verify the datatype versions */ + /* Datatype version is upgraded only for H5T_COMPOUND, H5T_ENUM, H5T_ARRAY */ + /* H5T_VLEN: the version is upgraded if the parent datatype version is greater */ + /* Remaining datatypes use basic version: + H5T_INTEGER H5T_FLOAT H5T_TIME H5T_STRING H5T_BITFIELD H5T_OPAQUE H5T_REFERENCE */ + + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, dtype_ver_bounds[low], "dtype_ver_bounds"); + } else + VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Prepare to create a chunked dataset with 2 unlimited dimensions */ + sid = H5Screate_simple(2, dims2, max_dims2); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, chunks); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and create the chunked dataset */ + /* Verify the dataset's datatype versions */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >= 0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Verify the committed datatype's version */ + str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT); + CHECK(str_tid, FAIL, "H5Topen2"); + str_dtype = (H5T_t *)H5I_object(str_tid); + CHECK(str_dtype, NULL, "H5I_object"); + + VERIFY(str_dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); + + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); + + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + + if(dtype->shared->type == H5T_ARRAY && + f->shared->low_bound == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, dtype_ver_bounds[f->shared->low_bound], "dtype_ver_bounds"); + + } else /* not compound/enum/array */ + VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataset's datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Delete the dataset */ + ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_datatype_check() */ + +/**************************************************************** +** +** test_libver_bounds_datatype(): +** Verify the datatype versions for various datatypes. +** +****************************************************************/ +static void +test_libver_bounds_datatype(hid_t fapl) +{ + hid_t tid, tid_enum, tid_array, tid_compound, tid_vlen; /* Datatype IDs */ + int enum_value; /* Value for enum datatype */ + typedef struct s1 { /* Data structure for compound datatype */ + char c; + int i; + } s1; + hsize_t dims[1] = {1}; /* Dimension sizes */ + herr_t ret; /* Return value */ + + /* Create integer datatype */ + tid = H5Tcopy(H5T_NATIVE_INT); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid); + + /* Create enum datatype */ + tid_enum = H5Tenum_create(tid); + enum_value = 0; + H5Tenum_insert(tid_enum, "val1", &enum_value); + enum_value = 1; + H5Tenum_insert(tid_enum, "val2", &enum_value); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_enum); + + /* Create array datatype */ + tid_array = H5Tarray_create2(tid, 1, dims); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_array); + + /* Create compound datatype */ + tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1)); + H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE); + H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_compound); + + /* Create vlen datatype */ + tid_vlen = H5Tvlen_create(tid); + + /* Verify datatype versions */ + test_libver_bounds_datatype_check(fapl, tid_vlen); + + /* Close datatypes */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_enum); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_array); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_compound); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Tclose(tid_vlen); + CHECK(ret, FAIL, "H5Tclose"); + +} /* end test_libver_bounds_datatype() */ + +/**************************************************************** +** +** test_libver_bounds_dataspace(): +** Verify the dataspace message versions. +** +****************************************************************/ +static void +test_libver_bounds_dataspace(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t new_fapl; /* File access property list */ + hid_t did, did_null, did_compact, did_contig; /* Dataset IDs */ + hid_t sid, sid_null, sid_compact, sid_contig; /* Dataspace IDs */ + hid_t dcpl, dcpl_compact, dcpl_contig; /* Dataset creation property lists */ + H5S_t *space, *space_null, *space_compact, *space_contig; /* Internal dataspace pointers */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[1] = {4}; /* Chunk dimension sizes */ + herr_t ret; /* Return value */ + + /* Create null dataspace, scalar dataspace */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create scalar dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create the dataset with scalar dataspace */ + did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); + + /* Get the internal dataspace pointer */ + sid = H5Dget_space(did); + CHECK(sid, FAIL, "H5Dget_space"); + space = (H5S_t *)H5I_object(sid); + CHECK(space, NULL, "H5I_object"); + + /* Verify the dataspace version */ + VERIFY(space->extent.version, sdspace_ver_bounds[low], "sdspace_ver_bounds"); + + /* Create null dataspace */ + sid_null = H5Screate(H5S_NULL); + CHECK(sid_null, FAIL, "H5Screate"); + + /* Create the dataset with null dataspace */ + did_null = H5Dcreate2(fid, DSET_NULL, H5T_NATIVE_INT, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did_null, FAIL, "H5Dcreate"); + + /* Get the internal dataspace pointer */ + sid_null = H5Dget_space(did_null); + CHECK(sid_null, FAIL, "H5Dget_space"); + space_null = (H5S_t *)H5I_object(sid_null); + CHECK(space_null, NULL, "H5I_object"); + + /* Verify the dataspace version */ + VERIFY(space_null->extent.version, SDSPACE_VERSION_2, "sdspace_ver_bounds"); + + /* Close the datasets */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(did_null); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataspaces */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid_null); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Prepare to create a chunked dataset with 1 unlimited dimension */ + sid = H5Screate_simple(1, dims, max_dims); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 1, chunks); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Prepare to create a compact dataset */ + sid_compact = H5Screate_simple(1, dims, NULL); + CHECK(sid_compact, FAIL, "H5Screate"); + dcpl_compact = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl_compact, FAIL, "H5Pcreate"); + ret = H5Pset_layout(dcpl_compact, H5D_COMPACT); + CHECK(ret, FAIL, "H5Pset_layout"); + + /* Prepare to create a contiguous dataset */ + sid_contig = H5Screate_simple(2, dims2, NULL); + CHECK(sid_contig, FAIL, "H5Screate"); + dcpl_contig = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl_contig, FAIL, "H5Pcreate"); + ret = H5Pset_layout(dcpl_contig, H5D_CONTIGUOUS); + CHECK(ret, FAIL, "H5Pset_layout"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and create the chunked/compact/contiguous datasets */ + /* Verify the dataspace version for the three datasets */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the internal dataspace pointer for the chunked dataset */ + sid = H5Dget_space(did); + CHECK(sid, FAIL, "H5Dget_space"); + space = (H5S_t *)H5I_object(sid); + CHECK(space, NULL, "H5I_object"); + + /* Create the compact dataset */ + did_compact = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid_compact, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT); + CHECK(did_compact, FAIL, "H5Dcreate2"); + + /* Get the internal dataspace pointer for the compact dataset */ + sid_compact = H5Dget_space(did_compact); + CHECK(sid_compact, FAIL, "H5Dget_space"); + space_compact = (H5S_t *)H5I_object(sid_compact); + CHECK(space_compact, NULL, "H5I_object"); + + /* Create the contiguous dataset */ + did_contig = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid_contig, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT); + CHECK(did_contig, FAIL, "H5Dcreate2"); + + /* Get the internal dataspace pointer for the contiguous dataset */ + sid_contig = H5Dget_space(did_contig); + CHECK(sid_contig, FAIL, "H5Dget_space"); + space_contig = (H5S_t *)H5I_object(sid_contig); + CHECK(space_contig, NULL, "H5I_object"); + + VERIFY(space->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + VERIFY(space_compact->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + VERIFY(space_contig->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + + /* Close the three datasets */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(did_compact); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(did_contig); + CHECK(ret, FAIL, "H5Dclose"); + + /* Delete the three datasets */ + ret = H5Ldelete(fid, DSETA, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + ret = H5Ldelete(fid, DSETB, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the three dataspaces */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid_compact); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid_contig); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the three dataset creation property lists */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(dcpl_compact); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(dcpl_contig); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_dataspace() */ + +/**************************************************************** +** +** test_libver_bounds_dataset(): +** Verify the dataset's layout, fill, and pline message versions +** with the low/high library format bounds setting in the fapl. +** For chunked dataset, also verify the chunked indexing type. +** +****************************************************************/ +static void +test_libver_bounds_dataset(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t new_fapl; /* File access property list */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t dcpl; /* Dataset creation property list */ + H5D_t *dset; /* Internal dataset pointer */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Return value */ + hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */ + hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */ + hsize_t dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + + /* Retrieve the library format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create the dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a contiguous dataset */ + did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); + + /* Get the internal file pionter */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify layout and fill messages version */ + if(low == H5F_LIBVER_EARLIEST) { + VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, layout_ver_bounds[low], "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[low], "fill_ver_bounds"); + } + + /* Verify pline message version */ + VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[low], "pline_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Create a chunked dataset with "no filter edge chunks" enabled */ + sid = H5Screate_simple(2, fix_dims2, NULL); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, fix_chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); + ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + CHECK(ret, FAIL, "H5Pset_chunk"); + + H5E_BEGIN_TRY { + did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } H5E_END_TRY; + + if(did >= 0) { + + /* Get the internal dataset pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + VERIFY(dset->shared->layout.version, LAYOUT_VERSION_4, "layout_ver_bounds"); + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + } + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Prepare to create a chunked dataset with 2 unlimited dimensions */ + sid = H5Screate_simple(2, dims2, max_dims2); + CHECK(sid, FAIL, "H5Screate"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file and create the chunked dataset */ + /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the internal file pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ + if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { + VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, layout_ver_bounds[f->shared->low_bound], "layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[f->shared->low_bound], "fill_ver_bounds"); + } + + VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[f->shared->low_bound], "pline_ver_bounds"); + if(dset->shared->layout.version == LAYOUT_VERSION_LATEST) + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type"); + else + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Delete the dataset */ + ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* CLose the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* CLose the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* CLose the dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_dataset() */ + +/**************************************************************** +** +** test_libver_bounds_obj(): +** Verify object header version with the low/high library +** format bounds setting in the fapl. +** +****************************************************************/ +static void +test_libver_bounds_obj(hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t gid; /* Group ID */ + hid_t fcpl; /* File creation property list */ + hid_t new_fapl; /* File access property list */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + H5O_info_t oinfo; /* Object info */ + H5G_info_t ginfo; /* Group info */ + herr_t ret; /* Return value */ + + /* Retrieve the format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Get a copy of file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Enable shared message */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info"); + + /* Verify object header version is 2 when shared message is enabled */ + VERIFY(oinfo.hdr.version, OBJ_VERSION_2, "H5Oget_info"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the file creation property list */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a file with default fcpl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info"); + + /* Verify object header version */ + VERIFY(oinfo.hdr.version, obj_ver_bounds[low], "H5Oget_info"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a copy of file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + /* Open the file to verify object header version */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid combinations */ + continue; + + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; + + if(fid >=0 ) { /* The file open succeeds */ + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* Create a group in the file */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Get group information */ + ret = H5Gget_info(gid, &ginfo); + CHECK(ret, FAIL, "H5Gget_info"); + + /* Verify group storage type */ + if(f->shared->low_bound >= H5F_LIBVER_V18) + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info"); + else + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info"); + + /* Get object header information */ + ret = H5Oget_info_by_name(gid, GRP_NAME, &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info"); + + /* Verify object header version */ + VERIFY(oinfo.hdr.version, obj_ver_bounds[f->shared->low_bound], "H5Oget_info_by_name"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Delete the group */ + ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_obj() */ + +/**************************************************************** +** +** test_libver_bounds_super(): +** Verify open of a file with 0, 1, 2 and 3 superblock versions. +** +****************************************************************/ +static void +test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid; /* File ID */ + H5F_t *f; /* Internal file pointer */ + hid_t new_fapl; /* File access property list */ + unsigned super_vers; /* Superblock version */ + H5F_libver_t low, high; /* File format bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* Return value */ + + /* Create the file */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* The file's superblock version */ + super_vers = f->shared->sblock->super_vers; + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + /* Invalid combinations */ + if (ret < 0) + continue; + + /* Open the file with or without SWMR */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); + } H5E_END_TRY; + ok = fid >= 0; + + /* Verify the file open succeeds or fails */ + switch(super_vers) { + case 3: + if(high == H5F_LIBVER_LATEST) { + /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + break; + + case 2: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + + ok = f->shared->low_bound >= H5F_LIBVER_V18; + VERIFY(ok, TRUE, "superblock_ver_bounds"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; + + case 1: + case 0: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; + + default: + break; + } /* end switch */ + } /* end for */ + } /* end for */ + + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_super_open() */ + +/**************************************************************** +** +** test_libver_bounds_super_create(): +** Verify the superblock version with the low/high library +** version bounds setting in the fapl. +** +****************************************************************/ +static void +test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid; /* File ID */ + H5F_t *f; /* Internal file pointer */ + H5F_libver_t low, high; /* File format bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* The return value */ + + /* Try to create the file */ + H5E_BEGIN_TRY { + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl); + } H5E_END_TRY; + + /* Get the internal file pointer if the create succeeds */ + if((ok = fid >= 0)) { + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + } + + /* Retrieve the format bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + if(is_swmr) { /* SWMR is enabled */ + + if(high == H5F_LIBVER_LATEST) { /* Superblock version is 3 */ + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "superblock_ver_bounds"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); + + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fcreate"); + + } else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fcreate"); + + switch(low) { + case H5F_LIBVER_EARLIEST: + ok = (f->shared->sblock->super_vers == 0 || + f->shared->sblock->super_vers == 1 || + f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + break; + + case H5F_LIBVER_V18: + ok = (f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + break; + + case H5F_LIBVER_V110: + ok = (f->shared->sblock->super_vers == 3); + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + break; + + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: + default: + ERROR("H5Pget_libver_bounds"); + + } /* end switch */ + } + + if(ok) { /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + +} /* end test_libver_bounds_super_create() */ + +/**************************************************************** +** +** test_libver_bounds_super(): +** Verify superblock version via: +** test_libver_bounds_super_create() +** test_libver_bounds_super_open() +** +****************************************************************/ +static void +test_libver_bounds_super(hid_t fapl) +{ + hid_t fcpl; + herr_t ret; + + /* Create a default fcpl */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Verify superblock version is 0 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 0 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + /* Create fcpl with non-default v1-btree K value enabled */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + ret = H5Pset_istore_k(fcpl, 64); + CHECK(ret, FAIL, "H5Pset_istore_k"); + + /* Verify superblock version is 1 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 1 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create fcpl with shared messages enabled */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); + + /* Verify superblock version is 2 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 2 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create fcpl with persistent free-space enabled */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); + CHECK(ret, FAIL, "H5Pset_file_space"); + + /* Verify superblock version is 2 when creating a file with or without SWMR */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); + + /* Verify opening a file with or without SWMR when superblock version is 2 */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); + + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_super() */ + +/**************************************************************** +** +** test_libver_bounds_low_high(): +** Tests to verify that format versions are correct with the five +** pairs of (low, high) combinations via H5Pset_libver_bounds(). +** +****************************************************************/ +static void +test_libver_bounds_low_high(void) +{ + hid_t fapl; + H5F_libver_t low, high; + herr_t ret; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing setting library version bounds for (low, high) bounds\n")); + + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + /* Should fail: invalid combinations */ + if(high == H5F_LIBVER_EARLIEST) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } + + /* Should fail: invalid combinations */ + if(high < low) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } + + /* All other combinations are valid and should succeed */ + VERIFY(ret, SUCCEED, "H5Pset_libver_bounds"); + + /* Tests to verify format versions */ + test_libver_bounds_super(fapl); + test_libver_bounds_obj(fapl); + test_libver_bounds_dataset(fapl); + test_libver_bounds_dataspace(fapl); + test_libver_bounds_datatype(fapl); + test_libver_bounds_attributes(fapl); + } + + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_low_high() */ + +/**************************************************************** +** ** test_libver_macros(): ** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. ** @@ -5333,6 +6862,7 @@ test_file(void) test_filespace_round_compatible(); /* Testing file space compatibility for files from trunk to 1_8 to trunk */ test_filespace_1_10_0_compatible(); /* Testing file space compatibility for files from release 1.10.0 */ test_libver_bounds(); /* Test compatibility for file space management */ + test_libver_bounds_low_high(); test_libver_macros(); /* Test the macros for library version comparison */ test_libver_macros2(); /* Test the macros for library version comparison */ #ifndef H5_NO_DEPRECATED_SYMBOLS -- cgit v0.12 From 5683be342751e642719d14fa1baed83acaa71532 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 13:29:04 -0700 Subject: HDFFV-10325: removed the COMMON/EQUIV statements. --- fortran/src/H5_ff.F90 | 449 ++++++++++++++++++++++++++++- fortran/src/H5f90global.F90 | 671 +++++--------------------------------------- 2 files changed, 512 insertions(+), 608 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index ef89d2f..f875d0e 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -38,7 +38,7 @@ MODULE H5LIB - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, C_INTPTR_T + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_INTPTR_T USE H5GLOBAL IMPLICIT NONE @@ -71,7 +71,102 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1, error_2, error_3 + ! + ! H5F flags + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER :: H5F_flags(H5F_FLAGS_LEN) + ! + ! H5generic flags + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + ! + ! H5G flags + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER :: H5G_flags(H5G_FLAGS_LEN) + ! + ! H5D flags + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) + ! + ! H5E flags + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER :: H5E_flags(H5E_FLAGS_LEN) + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) + ! + ! H5FD flags + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) + ! + ! H5FD file drivers flags + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + ! + ! H5I flags + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER :: H5I_flags(H5I_FLAGS_LEN) + ! + ! H5L flags + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER :: H5L_flags(H5L_FLAGS_LEN) + ! + ! H5O flags + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER :: H5o_flags(H5O_FLAGS_LEN) + ! + ! H5P flags + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) + ! + ! H5P integers flags + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) + ! + ! H5R flags + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER :: H5R_flags(H5R_FLAGS_LEN) + ! + ! H5S flags + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER :: H5S_flags(H5S_FLAGS_LEN) + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) + ! + ! H5T flags + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER :: H5T_flags(H5T_FLAGS_LEN) + ! + ! H5Z flags + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) + ! + ! H5 Library flags + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) INTERFACE INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & @@ -147,8 +242,59 @@ CONTAINS INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) END FUNCTION h5init1_flags_c END INTERFACE - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & + + error = h5init_types_c(predef_types, floating_types, integer_types) + + H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) + H5T_NATIVE_INTEGER = predef_types(6) + H5T_NATIVE_REAL = predef_types(7) + H5T_NATIVE_DOUBLE = predef_types(8) + H5T_NATIVE_CHARACTER = predef_types(9) + H5T_STD_REF_OBJ = predef_types(10) + H5T_STD_REF_DSETREG = predef_types(11) + H5T_NATIVE_REAL_C_FLOAT = predef_types(12) + H5T_NATIVE_REAL_C_DOUBLE = predef_types(13) + H5T_NATIVE_REAL_C_LONG_DOUBLE = predef_types(14) + H5T_NATIVE_B8 = predef_types(15) + H5T_NATIVE_B16 = predef_types(16) + H5T_NATIVE_B32 = predef_types(17) + H5T_NATIVE_B64 = predef_types(18) + H5T_NATIVE_FLOAT_128 = predef_types(19) + + H5T_IEEE_F32BE = floating_types(1) + H5T_IEEE_F32LE = floating_types(2) + H5T_IEEE_F64BE = floating_types(3) + H5T_IEEE_F64LE = floating_types(4) + + H5T_STD_I8BE = integer_types(1) + H5T_STD_I8LE = integer_types(2) + H5T_STD_I16BE = integer_types(3) + H5T_STD_I16LE = integer_types(4) + H5T_STD_I32BE = integer_types(5) + H5T_STD_I32LE = integer_types(6) + H5T_STD_I64BE = integer_types(7) + H5T_STD_I64LE = integer_types(8) + H5T_STD_U8BE = integer_types(9) + H5T_STD_U8LE = integer_types(10) + H5T_STD_U16BE = integer_types(11) + H5T_STD_U16LE = integer_types(12) + H5T_STD_U32BE = integer_types(13) + H5T_STD_U32LE = integer_types(14) + H5T_STD_U64BE = integer_types(15) + H5T_STD_U64LE = integer_types(16) + H5T_STRING = integer_types(17) + H5T_STD_B8BE = integer_types(18) + H5T_STD_B8LE = integer_types(19) + H5T_STD_B16BE = integer_types(20) + H5T_STD_B16LE = integer_types(21) + H5T_STD_B32BE = integer_types(22) + H5T_STD_B32LE = integer_types(23) + H5T_STD_B64BE = integer_types(24) + H5T_STD_B64LE = integer_types(25) + H5T_FORTRAN_S1 = integer_types(26) + H5T_C_S1 = integer_types(27) + + error = error + h5init_flags_c(H5D_flags, & H5D_size_flags, & H5E_flags, & H5E_hid_flags, & @@ -169,8 +315,299 @@ CONTAINS H5Z_flags, & H5generic_flags,& H5generic_haddr_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_1 + error_2 + error_3 + ! + ! H5F flags + ! + H5F_ACC_RDWR_F = H5F_flags(1) + H5F_ACC_RDONLY_F = H5F_flags(2) + H5F_ACC_TRUNC_F = H5F_flags(3) + H5F_ACC_EXCL_F = H5F_flags(4) + H5F_ACC_DEBUG_F = H5F_flags(5) + H5F_SCOPE_LOCAL_F = H5F_flags(6) + H5F_SCOPE_GLOBAL_F = H5F_flags(7) + H5F_CLOSE_DEFAULT_F = H5F_flags(8) + H5F_CLOSE_WEAK_F = H5F_flags(9) + H5F_CLOSE_SEMI_F = H5F_flags(10) + H5F_CLOSE_STRONG_F = H5F_flags(11) + H5F_OBJ_FILE_F = H5F_flags(12) + H5F_OBJ_DATASET_F = H5F_flags(13) + H5F_OBJ_GROUP_F = H5F_flags(14) + H5F_OBJ_DATATYPE_F = H5F_flags(15) + H5F_OBJ_ALL_F = H5F_flags(16) + H5F_LIBVER_EARLIEST_F = H5F_flags(17) + H5F_LIBVER_LATEST_F = H5F_flags(18) + H5F_UNLIMITED_F = H5F_flags(19) + ! + ! H5generic flags + ! + H5_INDEX_UNKNOWN_F = H5generic_flags(1) + H5_INDEX_NAME_F = H5generic_flags(2) + H5_INDEX_CRT_ORDER_F = H5generic_flags(3) + H5_INDEX_N_F = H5generic_flags(4) + H5_ITER_UNKNOWN_F = H5generic_flags(5) + H5_ITER_INC_F = H5generic_flags(6) + H5_ITER_DEC_F = H5generic_flags(7) + H5_ITER_NATIVE_F = H5generic_flags(8) + H5_ITER_N_F = H5generic_flags(9) + + HADDR_UNDEF_F = H5generic_haddr_flags(1) + ! + ! H5G flags + ! + H5G_UNKNOWN_F = H5G_flags(1) + H5G_GROUP_F = H5G_flags(2) + H5G_DATASET_F = H5G_flags(3) + H5G_TYPE_F = H5G_flags(4) + H5G_SAME_LOC_F = H5G_flags(5) + H5G_LINK_ERROR_F = H5G_flags(6) + H5G_LINK_HARD_F = H5G_flags(7) + H5G_LINK_SOFT_F = H5G_flags(8) + H5G_STORAGE_TYPE_UNKNOWN_F = H5G_flags(9) + H5G_STORAGE_TYPE_SYMBOL_TABLE_F = H5G_flags(10) + H5G_STORAGE_TYPE_COMPACT_F = H5G_flags(11) + H5G_STORAGE_TYPE_DENSE_F = H5G_flags(12) + ! + ! H5D flags + ! + H5D_COMPACT_F = H5D_flags(1) + H5D_CONTIGUOUS_F = H5D_flags(2) + H5D_CHUNKED_F = H5D_flags(3) + H5D_ALLOC_TIME_ERROR_F = H5D_flags(4) + H5D_ALLOC_TIME_DEFAULT_F = H5D_flags(5) + H5D_ALLOC_TIME_EARLY_F = H5D_flags(6) + H5D_ALLOC_TIME_LATE_F = H5D_flags(7) + H5D_ALLOC_TIME_INCR_F = H5D_flags(8) + H5D_SPACE_STS_ERROR_F = H5D_flags(9) + H5D_SPACE_STS_NOT_ALLOCATED_F = H5D_flags(10) + H5D_SPACE_STS_PART_ALLOCATED_F = H5D_flags(11) + H5D_SPACE_STS_ALLOCATED_F = H5D_flags(12) + H5D_FILL_TIME_ERROR_F = H5D_flags(13) + H5D_FILL_TIME_ALLOC_F = H5D_flags(14) + H5D_FILL_TIME_NEVER_F = H5D_flags(15) + H5D_FILL_VALUE_ERROR_F = H5D_flags(16) + H5D_FILL_VALUE_UNDEFINED_F = H5D_flags(17) + H5D_FILL_VALUE_DEFAULT_F = H5D_flags(18) + H5D_FILL_VALUE_USER_DEFINED_F = H5D_flags(19) + H5D_CHUNK_CACHE_W0_DFLT_F = H5D_flags(20) + H5D_MPIO_NO_COLLECTIVE_F = H5D_flags(21) + H5D_MPIO_CHUNK_INDEPENDENT_F = H5D_flags(22) + H5D_MPIO_CHUNK_COLLECTIVE_F = H5D_flags(23) + H5D_MPIO_CHUNK_MIXED_F = H5D_flags(24) + H5D_MPIO_CONTIG_COLLECTIVE_F = H5D_flags(25) + H5D_VDS_ERROR_F = H5D_flags(26) + H5D_VDS_FIRST_MISSING_F = H5D_flags(27) + H5D_VDS_LAST_AVAILABLE_F = H5D_flags(28) + H5D_VIRTUAL_F = H5D_flags(29) + + H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1) + H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2) + ! + ! H5E flags + ! + H5E_DEFAULT_F = H5E_hid_flags(1) + + H5E_MAJOR_F = H5E_flags(1) + H5E_MINOR_F = H5E_flags(2) + H5E_WALK_UPWARD_F = H5E_flags(3) + H5E_WALK_DOWNWARD_F = H5E_flags(4) + ! + ! H5FD flags + ! + H5FD_MPIO_INDEPENDENT_F = H5FD_flags(1) + H5FD_MPIO_COLLECTIVE_F = H5FD_flags(2) + H5FD_MEM_NOLIST_F = H5FD_flags(3) + H5FD_MEM_DEFAULT_F = H5FD_flags(4) + H5FD_MEM_SUPER_F = H5FD_flags(5) + H5FD_MEM_BTREE_F = H5FD_flags(6) + H5FD_MEM_DRAW_F = H5FD_flags(7) + H5FD_MEM_GHEAP_F = H5FD_flags(8) + H5FD_MEM_LHEAP_F = H5FD_flags(9) + H5FD_MEM_OHDR_F = H5FD_flags(10) + H5FD_MEM_NTYPES_F = H5FD_flags(11) + ! + ! H5FD file driver flags + ! + H5FD_CORE_F = H5FD_hid_flags(1) + H5FD_FAMILY_F = H5FD_hid_flags(2) + H5FD_LOG_F = H5FD_hid_flags(3) + H5FD_MPIO_F = H5FD_hid_flags(4) + H5FD_MULTI_F = H5FD_hid_flags(5) + H5FD_SEC2_F = H5FD_hid_flags(6) + H5FD_STDIO_F = H5FD_hid_flags(7) + ! + ! H5I flags declaration + ! + H5I_FILE_F = H5I_flags(1) + H5I_GROUP_F = H5I_flags(2) + H5I_DATATYPE_F = H5I_flags(3) + H5I_DATASPACE_F = H5I_flags(4) + H5I_DATASET_F = H5I_flags(5) + H5I_ATTR_F = H5I_flags(6) + H5I_BADID_F = H5I_flags(7) + ! + ! H5L flags + ! + H5L_TYPE_ERROR_F = H5L_flags(1) + H5L_TYPE_HARD_F = H5L_flags(2) + H5L_TYPE_SOFT_F = H5L_flags(3) + H5L_TYPE_EXTERNAL_F = H5L_flags(4) + H5L_SAME_LOC_F = H5L_flags(5) + H5L_LINK_CLASS_T_VERS_F = H5L_flags(6) + ! + ! H5O flags + ! + H5O_COPY_SHALLOW_HIERARCHY_F = h5o_flags(1) + H5O_COPY_EXPAND_SOFT_LINK_F = h5o_flags(2) + H5O_COPY_EXPAND_EXT_LINK_F = h5o_flags(3) + H5O_COPY_EXPAND_REFERENCE_F = h5o_flags(4) + H5O_COPY_WITHOUT_ATTR_FLAG_F = h5o_flags(5) + H5O_COPY_PRESERVE_NULL_FLAG_F = h5o_flags(6) + H5O_COPY_ALL_F = h5o_flags(7) + H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) + H5O_SHMESG_SDSPACE_FLAG_F = h5o_flags(9) + H5O_SHMESG_DTYPE_FLAG_F = h5o_flags(10) + H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) + H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) + H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) + H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) + H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) + H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) + H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) + H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) + H5O_HDR_STORE_TIMES_F = h5o_flags(19) + H5O_HDR_ALL_FLAGS_F = h5o_flags(20) + H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) + H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) + H5O_TYPE_UNKNOWN_F = h5o_flags(23) + H5O_TYPE_GROUP_F = h5o_flags(24) + H5O_TYPE_DATASET_F = h5o_flags(25) + H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) + H5O_TYPE_NTYPES_F = h5o_flags(27) + ! + ! H5P flags + ! + H5P_FILE_CREATE_F = H5P_flags(1) + H5P_FILE_ACCESS_F = H5P_flags(2) + H5P_DATASET_CREATE_F = H5P_flags(3) + H5P_DATASET_XFER_F = H5P_flags(4) + H5P_FILE_MOUNT_F = H5P_flags(5) + H5P_DEFAULT_F = H5P_flags(6) + H5P_ROOT_F = H5P_flags(7) + H5P_OBJECT_CREATE_F = H5P_flags(8) + H5P_DATASET_ACCESS_F = H5P_flags(9) + H5P_GROUP_CREATE_F = H5P_flags(10) + H5P_GROUP_ACCESS_F = H5P_flags(11) + H5P_DATATYPE_CREATE_F = H5P_flags(12) + H5P_DATATYPE_ACCESS_F = H5P_flags(13) + H5P_STRING_CREATE_F = H5P_flags(14) + H5P_ATTRIBUTE_CREATE_F = H5P_flags(15) + H5P_OBJECT_COPY_F = H5P_flags(16) + H5P_LINK_CREATE_F = H5P_flags(17) + H5P_LINK_ACCESS_F = H5P_flags(18) + ! + ! H5P integers flags + ! + H5P_CRT_ORDER_INDEXED_F = H5P_flags_int(1) + H5P_CRT_ORDER_TRACKED_F = H5P_flags_int(2) + ! + ! H5R flags + ! + H5R_OBJECT_F = H5R_flags(1) + H5R_DATASET_REGION_F = H5R_flags(2) + ! + ! H5S flags + ! + H5S_ALL_F = H5S_hid_flags(1) + + H5S_UNLIMITED_F = H5S_hsize_flags(1) + + H5S_SCALAR_F = H5S_flags(1) + H5S_SIMPLE_F = H5S_flags(2) + H5S_NULL_F = H5S_flags(3) + H5S_SELECT_SET_F = H5S_flags(4) + H5S_SELECT_OR_F = H5S_flags(5) + H5S_SELECT_NOOP_F = H5S_flags(6) + H5S_SELECT_AND_F = H5S_flags(7) + H5S_SELECT_XOR_F = H5S_flags(8) + H5S_SELECT_NOTB_F = H5S_flags(9) + H5S_SELECT_NOTA_F = H5S_flags(10) + H5S_SELECT_APPEND_F = H5S_flags(11) + H5S_SELECT_PREPEND_F = H5S_flags(12) + H5S_SELECT_INVALID_F = H5S_flags(13) + H5S_SEL_ERROR_F = H5S_flags(14) + H5S_SEL_NONE_F = H5S_flags(15) + H5S_SEL_POINTS_F = H5S_flags(16) + H5S_SEL_HYPERSLABS_F = H5S_flags(17) + H5S_SEL_ALL_F = H5S_flags(18) + ! + ! H5T flags declaration + ! + H5T_NO_CLASS_F = H5T_flags(1) + H5T_INTEGER_F = H5T_flags(2) + H5T_FLOAT_F = H5T_flags(3) + H5T_TIME_F = H5T_flags(4) + H5T_STRING_F = H5T_flags(5) + H5T_BITFIELD_F = H5T_flags(6) + H5T_OPAQUE_F = H5T_flags(7) + H5T_COMPOUND_F = H5T_flags(8) + H5T_REFERENCE_F = H5T_flags(9) + H5T_ENUM_F = H5T_flags(10) + H5T_ORDER_LE_F = H5T_flags(11) + H5T_ORDER_BE_F = H5T_flags(12) + H5T_ORDER_MIXED_F = H5T_flags(13) + H5T_ORDER_VAX_F = H5T_flags(14) + H5T_ORDER_NONE_F = H5T_flags(15) + H5T_PAD_ZERO_F = H5T_flags(16) + H5T_PAD_ONE_F = H5T_flags(17) + H5T_PAD_BACKGROUND_F = H5T_flags(18) + H5T_PAD_ERROR_F = H5T_flags(19) + H5T_SGN_NONE_F = H5T_flags(20) + H5T_SGN_2_F = H5T_flags(21) + H5T_SGN_ERROR_F = H5T_flags(22) + H5T_NORM_IMPLIED_F = H5T_flags(23) + H5T_NORM_MSBSET_F = H5T_flags(24) + H5T_NORM_NONE_F = H5T_flags(25) + H5T_CSET_ASCII_F = H5T_flags(26) + H5T_CSET_UTF8_F = H5T_flags(27) + H5T_STR_NULLTERM_F = H5T_flags(28) + H5T_STR_NULLPAD_F = H5T_flags(29) + H5T_STR_SPACEPAD_F = H5T_flags(30) + H5T_STR_ERROR_F = H5T_flags(31) + H5T_VLEN_F = H5T_flags(32) + H5T_ARRAY_F = H5T_flags(33) + H5T_DIR_ASCEND_F = H5T_flags(34) + H5T_DIR_DESCEND_F = H5T_flags(35) + ! + ! H5Z flags + ! + H5Z_FILTER_ERROR_F = H5Z_flags(1) + H5Z_FILTER_NONE_F = H5Z_flags(2) + H5Z_FILTER_DEFLATE_F = H5Z_flags(3) + H5Z_FILTER_SHUFFLE_F = H5Z_flags(4) + H5Z_FILTER_FLETCHER32_F = H5Z_flags(5) + H5Z_ERROR_EDC_F = H5Z_flags(6) + H5Z_DISABLE_EDC_F = H5Z_flags(7) + H5Z_ENABLE_EDC_F = H5Z_flags(8) + H5Z_NO_EDC_F = H5Z_flags(9) + H5Z_FILTER_SZIP_F = H5Z_flags(10) + H5Z_FLAG_OPTIONAL_F = H5Z_flags(11) + H5Z_FILTER_ENCODE_ENABLED_F = H5Z_flags(12) + H5Z_FILTER_DECODE_ENABLED_F = H5Z_flags(13) + H5Z_FILTER_ALL_F = H5Z_flags(14) + H5Z_FILTER_NBIT_F = H5Z_flags(15) + H5Z_FILTER_SCALEOFFSET_F = H5Z_flags(16) + H5Z_SO_FLOAT_DSCALE_F = H5Z_flags(17) + H5Z_SO_FLOAT_ESCALE_F = H5Z_flags(18) + H5Z_SO_INT_F = H5Z_flags(19) + H5Z_SO_INT_MINBITS_DEFAULT_F = H5Z_flags(20) + + error = error + h5init1_flags_c(H5LIB_flags) + ! + ! H5 Library flags + ! + H5_SZIP_EC_OM_F = H5LIB_flags(1) + H5_SZIP_NN_OM_F = H5LIB_flags(2) + END SUBROUTINE h5open_f !****s* H5LIB/h5close_f diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 629418a..be7195c 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -71,9 +71,9 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change this - ! value when new predefined - ! datatypes are added + ! Do not forget to change this value when new predefined + ! datatypes are added + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change the following line when new predefined ! floating data types are added @@ -83,32 +83,56 @@ MODULE H5GLOBAL ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT, & - H5T_NATIVE_REAL_C_DOUBLE, & - H5T_NATIVE_REAL_C_LONG_DOUBLE, & - H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE + ! These arrays need to be global because they are used in + ! both h5open_f and in h5close_f + INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types + ! + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -116,139 +140,22 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- -! NOTE: Splitting the line since the Fortran 95 standard limits the number of -! continuation lines to 39; the F03/F08 standard limits the number -! to 255 lines. - - INTEGER(HID_T) :: H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING, & - H5T_STD_B8BE, & - H5T_STD_B8LE, & - H5T_STD_B16BE, & - H5T_STD_B16LE, & - H5T_STD_B32BE, & - H5T_STD_B32LE, & - H5T_STD_B64BE, & - H5T_STD_B64LE, & - H5T_NATIVE_B8, & - H5T_NATIVE_B16, & - H5T_NATIVE_B32, & - H5T_NATIVE_B64, & - H5T_FORTRAN_S1, & - H5T_C_S1 - - - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER_KIND(1)) - ! EQUIVALENCE predef_types(2:5) are unnecessary and violate the standard - EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) - EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) - EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) - EQUIVALENCE (predef_types(9), H5T_NATIVE_CHARACTER) - EQUIVALENCE (predef_types(10), H5T_STD_REF_OBJ) - EQUIVALENCE (predef_types(11), H5T_STD_REF_DSETREG) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_FLOAT) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_DOUBLE) - EQUIVALENCE (predef_types(14), H5T_NATIVE_REAL_C_LONG_DOUBLE) - EQUIVALENCE (predef_types(15), H5T_NATIVE_B8 ) - EQUIVALENCE (predef_types(16), H5T_NATIVE_B16) - EQUIVALENCE (predef_types(17), H5T_NATIVE_B32) - EQUIVALENCE (predef_types(18), H5T_NATIVE_B64) - EQUIVALENCE (predef_types(19), H5T_NATIVE_FLOAT_128) ! ADDED NEW TYPE -MSB- - - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) - EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) - EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) - EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types - EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) - EQUIVALENCE (integer_types(2), H5T_STD_I8LE) - EQUIVALENCE (integer_types(3), H5T_STD_I16BE) - EQUIVALENCE (integer_types(4), H5T_STD_I16LE) - EQUIVALENCE (integer_types(5), H5T_STD_I32BE) - EQUIVALENCE (integer_types(6), H5T_STD_I32LE) - EQUIVALENCE (integer_types(7), H5T_STD_I64BE) - EQUIVALENCE (integer_types(8), H5T_STD_I64LE) - EQUIVALENCE (integer_types(9), H5T_STD_U8BE) - EQUIVALENCE (integer_types(10), H5T_STD_U8LE) - EQUIVALENCE (integer_types(11), H5T_STD_U16BE) - EQUIVALENCE (integer_types(12), H5T_STD_U16LE) - EQUIVALENCE (integer_types(13), H5T_STD_U32BE) - EQUIVALENCE (integer_types(14), H5T_STD_U32LE) - EQUIVALENCE (integer_types(15), H5T_STD_U64BE) - EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - EQUIVALENCE (integer_types(17), H5T_STRING) - EQUIVALENCE (integer_types(18), H5T_STD_B8BE) - EQUIVALENCE (integer_types(19), H5T_STD_B8LE) - EQUIVALENCE (integer_types(20), H5T_STD_B16BE) - EQUIVALENCE (integer_types(21), H5T_STD_B16LE) - EQUIVALENCE (integer_types(22), H5T_STD_B32BE) - EQUIVALENCE (integer_types(23), H5T_STD_B32LE) - EQUIVALENCE (integer_types(24), H5T_STD_B64BE) - EQUIVALENCE (integer_types(25), H5T_STD_B64LE) - EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) - EQUIVALENCE (integer_types(27), H5T_C_S1) - - - ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - ! H5T_NATIVE_REAL, & - ! H5T_NATIVE_DOUBLE, & - ! H5T_NATIVE_CHARACTER, & - ! H5T_STD_REF_OBJ, & - ! H5T_STD_REF_DSETREG - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ - !DEC$endif - COMMON /PREDEFINED_TYPES/ predef_types - - ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - ! H5T_IEEE_F32LE, & - ! H5T_IEEE_F64BE, & - ! H5T_IEEE_F64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ - !DEC$endif - COMMON /FLOATING_TYPES/ floating_types - ! - ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - ! H5T_STD_I8LE, & - ! H5T_STD_I16BE, & - ! H5T_STD_I16LE, & - ! H5T_STD_I32BE, & - ! H5T_STD_I32LE, & - ! H5T_STD_I64BE, & - ! H5T_STD_I64LE, & - ! H5T_STD_U8BE, & - ! H5T_STD_U8LE, & - ! H5T_STD_U16BE, & - ! H5T_STD_U16LE, & - ! H5T_STD_U32BE, & - ! H5T_STD_U32LE, & - ! H5T_STD_U64BE, & - ! H5T_STD_U64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ - !DEC$endif - COMMON /INTEGER_TYPES/ integer_types - ! - ! Fortran flags - ! + ! H5generic flags declaration ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) + INTEGER :: H5_INDEX_UNKNOWN_F + INTEGER :: H5_INDEX_NAME_F + INTEGER :: H5_INDEX_CRT_ORDER_F + INTEGER :: H5_INDEX_N_F + INTEGER :: H5_ITER_UNKNOWN_F + INTEGER :: H5_ITER_INC_F + INTEGER :: H5_ITER_DEC_F + INTEGER :: H5_ITER_NATIVE_F + INTEGER :: H5_ITER_N_F + + INTEGER(HADDR_T) :: HADDR_UNDEF_F ! ! H5F flags declaration ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ - !DEC$endif - COMMON /H5F_FLAGS/ H5F_flags - INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -268,77 +175,9 @@ MODULE H5GLOBAL INTEGER :: H5F_LIBVER_EARLIEST_F INTEGER :: H5F_LIBVER_LATEST_F INTEGER :: H5F_UNLIMITED_F - - EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) - EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) - EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) - EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) - EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) - EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) - EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) - EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) - EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) - EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) - EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) - EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) - EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) - EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) - EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) - EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) - EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ - !DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_haddr_FLAGS/ - !DEC$endif - COMMON /H5generic_haddr_FLAGS/ H5generic_haddr_flags - - INTEGER(HADDR_T) :: HADDR_UNDEF_F - - EQUIVALENCE(H5generic_haddr_flags(1), HADDR_UNDEF_F) - ! ! H5G flags declaration ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ - !DEC$endif - COMMON /H5G_FLAGS/ H5G_flags - INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -353,35 +192,9 @@ MODULE H5GLOBAL INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F INTEGER :: H5G_STORAGE_TYPE_COMPACT_F INTEGER :: H5G_STORAGE_TYPE_DENSE_F - - EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type - EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group - EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset - EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type - EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) - ! ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ - !DEC$endif - COMMON /H5D_FLAGS/ H5D_flags - COMMON /H5D_SIZE_FLAGS/ H5D_size_flags - INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -413,6 +226,7 @@ MODULE H5GLOBAL INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F INTEGER :: H5D_MPIO_NO_COLLECTIVE_F INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F @@ -423,81 +237,17 @@ MODULE H5GLOBAL INTEGER :: H5D_VDS_FIRST_MISSING_F INTEGER :: H5D_VDS_LAST_AVAILABLE_F INTEGER :: H5D_VIRTUAL_F - - EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) - EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) - EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) - - EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) - EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) - EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) - EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) - - EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) - EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) - EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) - EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) - - EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) - EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) - - EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) - EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) - EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(26), H5D_VDS_ERROR_F) - EQUIVALENCE(H5D_flags(27), H5D_VDS_FIRST_MISSING_F) - EQUIVALENCE(H5D_flags(28), H5D_VDS_LAST_AVAILABLE_F) - EQUIVALENCE(H5D_flags(29), H5D_VIRTUAL_F) - - EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - ! ! H5E flags declaration ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ - !DEC$endif - COMMON /H5E_FLAGS/ H5E_flags - COMMON /H5E_HID_FLAGS/ H5E_hid_flags - INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F INTEGER :: H5E_WALK_UPWARD_F INTEGER :: H5E_WALK_DOWNWARD_F - - EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) - EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) - EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) - EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) - EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) - ! - ! H5FD flags declaration + ! H5FD file drivers flags declaration ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ - !DEC$endif - COMMON /H5FD_FLAGS/ H5FD_flags - INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -509,28 +259,6 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F INTEGER :: H5FD_MEM_NTYPES_F - - EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) - EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) - EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) - EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) - EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) - EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) - EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) - EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) - EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) - EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) - EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ - !DEC$endif - COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags - INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -538,25 +266,9 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5FD_MULTI_F INTEGER(HID_T) :: H5FD_SEC2_F INTEGER(HID_T) :: H5FD_STDIO_F - - EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) - EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) - EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) - EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) - EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) - EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) - EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) - ! ! H5I flags declaration ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ - !DEC$endif - COMMON /H5I_FLAGS/ H5I_flags - INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -564,48 +276,18 @@ MODULE H5GLOBAL INTEGER :: H5I_DATASET_F INTEGER :: H5I_ATTR_F INTEGER :: H5I_BADID_F - - EQUIVALENCE(H5I_flags(1), H5I_FILE_F) - EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) - EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) - EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) - EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) - EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) - EQUIVALENCE(H5I_flags(7), H5I_BADID_F) ! ! H5L flags declaration ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) - INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F INTEGER :: H5L_TYPE_EXTERNAL_F INTEGER :: H5L_SAME_LOC_F INTEGER :: H5L_LINK_CLASS_T_VERS_F - - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ - !DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) - EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) - EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) - EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) ! ! H5O flags declaration ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ - !DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -633,45 +315,9 @@ MODULE H5GLOBAL INTEGER :: H5O_TYPE_DATASET_F INTEGER :: H5O_TYPE_NAMED_DATATYPE_F INTEGER :: H5O_TYPE_NTYPES_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) - EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) - EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) - EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) - EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) - EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) - ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ - !DEC$endif - COMMON /H5P_FLAGS/ H5P_flags - INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -691,72 +337,16 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5P_LINK_CREATE_F INTEGER(HID_T) :: H5P_LINK_ACCESS_F - EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) - EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) - EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) - EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) - EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) - EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) - EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) - - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ - !DEC$endif - COMMON /H5P_FLAGS_INT/ H5P_flags_int INTEGER :: H5P_CRT_ORDER_INDEXED_F INTEGER :: H5P_CRT_ORDER_TRACKED_F - EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) ! ! H5R flags declaration ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ - !DEC$endif - COMMON /H5R_FLAGS/ H5R_flags - INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F - - EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) - EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) - ! ! H5S flags declaration ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HID_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ - !DEC$endif - COMMON /H5S_FLAGS/ H5S_flags - COMMON /H5S_HID_FLAGS/ H5S_hid_flags - COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags - INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -781,43 +371,9 @@ MODULE H5GLOBAL INTEGER :: H5S_SEL_POINTS_F INTEGER :: H5S_SEL_HYPERSLABS_F INTEGER :: H5S_SEL_ALL_F - - EQUIVALENCE(H5S_hid_flags(1), H5S_ALL_F) - - EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) - - EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) - EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) - EQUIVALENCE(H5S_flags(3), H5S_NULL_F) - EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) - EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) - - EQUIVALENCE(H5S_flags(6), H5S_SELECT_NOOP_F) - EQUIVALENCE(H5S_flags(7), H5S_SELECT_AND_F) - EQUIVALENCE(H5S_flags(8), H5S_SELECT_XOR_F) - EQUIVALENCE(H5S_flags(9), H5S_SELECT_NOTB_F) - EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTA_F) - - EQUIVALENCE(H5S_flags(11), H5S_SELECT_APPEND_F) - EQUIVALENCE(H5S_flags(12), H5S_SELECT_PREPEND_F) - EQUIVALENCE(H5S_flags(13), H5S_SELECT_INVALID_F) - EQUIVALENCE(H5S_flags(14), H5S_SEL_ERROR_F) - EQUIVALENCE(H5S_flags(15), H5S_SEL_NONE_F) - - EQUIVALENCE(H5S_flags(16), H5S_SEL_POINTS_F) - EQUIVALENCE(H5S_flags(17), H5S_SEL_HYPERSLABS_F) - EQUIVALENCE(H5S_flags(18), H5S_SEL_ALL_F) - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ - !DEC$endif - COMMON /H5T_FLAGS/ H5T_flags - INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -853,52 +409,9 @@ MODULE H5GLOBAL INTEGER :: H5T_STR_ERROR_F INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F - - EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) - EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) - EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) - EQUIVALENCE(H5T_flags(4), H5T_TIME_F) - EQUIVALENCE(H5T_flags(5), H5T_STRING_F) - EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) - EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) - EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) - EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) - EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) - EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) - EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) ! - ! H5Z flags declaration + ! H5Z flags ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ - !DEC$endif - COMMON /H5Z_FLAGS/ H5Z_flags - INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -919,58 +432,12 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_FLOAT_ESCALE_F INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F - - EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) - EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) - EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) - EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) - EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) - EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) - EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) - EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) - EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) - EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) - EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) - EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) - EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) - EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) - EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) - EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) - EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) - ! - ! H5 Library flags declaration + ! H5 Library flags ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ - !DEC$endif - COMMON /H5LIB_FLAGS/ H5LIB_flags INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - - ! General H5 flags declarations - ! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) CONTAINS -- cgit v0.12 From c9b78a6714e6f7a781ab49b8ccecc022b3ef8529 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 14:23:01 -0700 Subject: misc. clean-up --- fortran/src/H5_ff.F90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index f875d0e..79ab280 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -638,7 +638,6 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1 INTERFACE INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & f_types, F_TYPES_LEN, & @@ -653,10 +652,9 @@ CONTAINS INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - error = error_1 END SUBROUTINE h5close_f -- cgit v0.12 From a0d40002a3a06974d8643f9e4edc6d0c58bb9844 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 11:11:35 -0700 Subject: misc. code clean-up --- fortran/src/H5_ff.F90 | 140 ++++++++++++++++++++++---------------------- fortran/src/H5f90global.F90 | 11 ++-- 2 files changed, 75 insertions(+), 76 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 79ab280..faa64a8 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -72,101 +72,101 @@ CONTAINS INTEGER, INTENT(OUT) :: error !***** ! - ! H5F flags + ! H5F flags declaration ! INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags ! - ! H5generic flags + ! H5generic flags declaration ! INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags ! - ! H5G flags + ! H5G flags declaration ! INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags ! - ! H5D flags + ! H5D flags declaration ! INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags ! - ! H5E flags + ! H5E flags declaration ! INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags ! - ! H5FD flags + ! H5FD flags declaration ! INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags ! - ! H5FD file drivers flags + ! H5FD file drivers flags declaration ! INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags ! - ! H5I flags + ! H5I flags declaration ! INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags ! - ! H5L flags + ! H5L flags declaration ! INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags ! - ! H5O flags + ! H5O flags declaration ! INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags ! - ! H5P flags + ! H5P flags declaration ! INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags ! - ! H5P integers flags + ! H5P integers flags declaration ! INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int ! - ! H5R flags + ! H5R flags declaration ! INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags ! - ! H5S flags + ! H5S flags declaration ! INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags ! - ! H5T flags + ! H5T flags declaration ! INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags ! - ! H5Z flags + ! H5Z flags declaration ! INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags ! - ! H5 Library flags + ! H5 Library flags declaration ! INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags INTERFACE INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & @@ -174,9 +174,9 @@ CONTAINS IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c END INTERFACE INTERFACE @@ -211,27 +211,27 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER(HID_T) i_H5S_hid_flags(H5S_HID_FLAGS_LEN) - INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - INTEGER(HADDR_T) i_H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c END INTERFACE INTERFACE @@ -239,7 +239,7 @@ CONTAINS BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c END INTERFACE @@ -644,12 +644,12 @@ CONTAINS i_types, I_TYPES_LEN ) & BIND(C,NAME='h5close_types_c') IMPORT :: HID_T - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + INTEGER :: P_TYPES_LEN + INTEGER :: F_TYPES_LEN + INTEGER :: I_TYPES_LEN + INTEGER(HID_T), DIMENSION(1:P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index be7195c..ee8959e 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -50,7 +50,6 @@ MODULE H5GLOBAL END ENUM INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) - ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. @@ -85,9 +84,9 @@ MODULE H5GLOBAL ! These arrays need to be global because they are used in ! both h5open_f and in h5close_f - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types ! INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE @@ -410,7 +409,7 @@ MODULE H5GLOBAL INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F ! - ! H5Z flags + ! H5Z flags declaration ! INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F @@ -433,7 +432,7 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F ! - ! H5 Library flags + ! H5 Library flags declaration ! INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F -- cgit v0.12 From 51bb1d431a494937e7e01a3726f7646cd51fae24 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 20:39:35 -0700 Subject: added public, private --- fortran/src/H5_ff.F90 | 208 +++++++++++++++++++++++++------------------------- 1 file changed, 106 insertions(+), 102 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index faa64a8..a7749f4 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -42,6 +42,107 @@ MODULE H5LIB USE H5GLOBAL IMPLICIT NONE + PRIVATE + ! + ! H5F flags declaration + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags + ! + ! H5generic flags declaration + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags + ! + ! H5G flags declaration + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags + ! + ! H5D flags declaration + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags + ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags + ! + ! H5FD flags declaration + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags + ! + ! H5FD file drivers flags declaration + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags + ! + ! H5I flags declaration + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags + ! + ! H5L flags declaration + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags + ! + ! H5O flags declaration + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags + ! + ! H5P flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags + ! + ! H5P integers flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int + ! + ! H5R flags declaration + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags + ! + ! H5S flags declaration + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + ! + ! H5T flags declaration + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags + ! + ! H5Z flags declaration + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags + ! + ! H5 Library flags declaration + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags + + PUBLIC :: h5open_f, h5close_f, h5get_libversion_f, h5dont_atexit_f, h5kind_to_type, h5offsetof + PUBLIC :: h5garbage_collect_f, h5check_version_f + CONTAINS !****s* H5LIB/h5open_f ! @@ -71,104 +172,8 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - ! - ! H5F flags declaration - ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags - ! - ! H5G flags declaration - ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags - ! - ! H5D flags declaration - ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags - ! - ! H5E flags declaration - ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags - ! - ! H5FD flags declaration - ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags - ! - ! H5I flags declaration - ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags - ! - ! H5L flags declaration - ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags - ! - ! H5O flags declaration - ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags - ! - ! H5P flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int - ! - ! H5R flags declaration - ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags - ! - ! H5S flags declaration - ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags - ! - ! H5T flags declaration - ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags - ! - ! H5Z flags declaration - ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags - ! - ! H5 Library flags declaration - ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags - INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & BIND(C,NAME='h5init_types_c') IMPORT :: HID_T @@ -178,8 +183,7 @@ CONTAINS INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & i_H5D_size_flags,& i_H5E_flags, & @@ -233,16 +237,16 @@ CONTAINS INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) & BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c - END INTERFACE + END INTERFACE + error = h5init_types_c(predef_types, floating_types, integer_types) H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) -- cgit v0.12 From bdd2d3a1beef336e1835332763b9711d2fb31a8c Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 21:01:43 -0700 Subject: misc clean-up --- fortran/src/H5_ff.F90 | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index a7749f4..db57f03 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -123,7 +123,7 @@ MODULE H5LIB INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags ! ! H5T flags declaration ! @@ -166,7 +166,7 @@ CONTAINS ! ! Removed call to h5open_c since this may cause a problem for an ! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 +! October 13, 2011 ! Fortran90 Interface: SUBROUTINE h5open_f(error) IMPLICIT NONE @@ -179,9 +179,9 @@ CONTAINS IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & @@ -215,26 +215,26 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags - INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags - INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags - INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags - INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags - INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags - INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags - INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags - INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags - INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags - INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags - INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags - INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int - INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags - INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags - INTEGER(HID_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags - INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags - INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags - INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags - INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER , DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T) , DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER , DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T) , DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER , DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER , DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER , DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T) , DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER , DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER , DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER , DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T) , DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER , DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER , DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER , DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T) , DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER , DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER , DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER , DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c -- cgit v0.12 From ea4f752ace88b0a9931d6f806044d86fc652ecf7 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 27 Nov 2017 12:44:23 -0600 Subject: Adding data file generator Description: Added gen_bounds.c to generate the following files: - bounds_earliest_latest.h5 - bounds_earliest_v18.h5 - bounds_latest_latest.h5 - bounds_v18_latest.h5 - bounds_v18_v18.h5 for testing the version bounds fix in 1.8 and 1.6. --- test/gen_bounds.c | 626 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 626 insertions(+) create mode 100644 test/gen_bounds.c diff --git a/test/gen_bounds.c b/test/gen_bounds.c new file mode 100644 index 0000000..1de78e8 --- /dev/null +++ b/test/gen_bounds.c @@ -0,0 +1,626 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * 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. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Oct 24, 2017 + * + * Purpose: This program is run to generate HDF5 data files used to test + * version bounds. + * + * Description + * =========== + * gen_bounds.c will generate the following files: + * - bounds_earliest_latest.h5 + * - bounds_earliest_v18.h5 + * - bounds_latest_latest.h5 + * - bounds_v18_latest.h5 + * - bounds_v18_v18.h5 + * + */ + +#include "hdf5.h" + +/*********************************************************************** + * gen_earliest_latest() creates file "bounds_earliest_latest.h5" + * + * File contents: + * - Version 0 superblock (default) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * + ***********************************************************************/ +#define FILENAME_E_L "bounds_earliest_latest.h5" + +/* 2-D dataset with fixed dimensions */ +#define RANK 2 +#define DIM1 100 +#define DIM2 200 +#define CHUNK_DIM1 50 +#define CHUNK_DIM2 50 + +int gen_earliest_latest() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the earliest/latest version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_E_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close property list and dataset, will reuse dataspace */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) + */ + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Disable partial chunk filters, triggers layout version 4 */ + if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_earliest_v18() creates file "bounds_earliest_v18.h5" + * + * File contents: + * - Version 0 superblock (default) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * + ***********************************************************************/ +#define FILENAME_E_18 "bounds_earliest_v18.h5" + +int gen_earliest_v18() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the earliest/v18 version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_E_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_latest_latest() creates file "bounds_latest_latest.h5" + * + * File contents: + * - Version 3 superblock (H5Fcreate with H5F_ACC_SWMR_WRITE) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * + ***********************************************************************/ +#define FILENAME_L_L "bounds_latest_latest.h5" + +int gen_latest_latest() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ + if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Disable partial chunk filters, triggers layout version 4 */ + if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_v18_latest() creates file "bounds_v18_latest.h5" + * + * File contents: + * - Version 2 superblock (H5Pset_shared_mesg_index) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * + ***********************************************************************/ +#define FILENAME_18_L "bounds_v18_latest.h5" + +int gen_v18_latest() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the v18/latest version of the format" bounds + for creating objects in the file, also trigger version 2 superblock */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_18_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close property list and dataset, will reuse dataspace */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +/*********************************************************************** + * gen_v18_v18() creates file "bounds_v18_v18.h5" + * + * File contents: + * - Version 2 superblock (H5Pset_libver_bounds(v18, v18) + * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * + ***********************************************************************/ +#define FILENAME_18_18 "bounds_v18_v18.h5" + +int gen_v18_v18() +{ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; + float buf[DIM1][DIM2]; /* Buffer for writing data */ + int i, j; + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the v18 version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(FILENAME_18_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) + goto error; + + /* Close file property lists */ + if(H5Pclose(fapl) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 3 (default) + */ + + /* Fill sample data */ + for (i = 0; i < DIM1; i++) + for (j = 0; j < DIM2; j++) + buf[i][j] = 100.0F; + + /* Create the dataspace */ + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) + goto error; + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close property list and dataset, will reuse dataspace */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + + /* Close the file, then reopen it with the latest version */ + if(H5Fclose(fid) < 0) + goto error; + + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set the "use the latest version of the format" bounds + for creating a layout version 4 object in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + goto error; + + if((fid = H5Fopen(FILENAME_18_18, H5F_ACC_RDWR, fapl)) < 0) + goto error; + + /* + * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) + */ + + /* Create the dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + /* Set up for chunked data */ + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + goto error; + + /* Disable partial chunk filters */ + if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + goto error; + + /* Create and write the dataset */ + if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Close everything */ + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Pclose(fapl) < 0) + goto error; + if(H5Dclose(dset) < 0) + goto error; + if(H5Sclose(space) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + +int main(void) +{ + /* Generate file bounds_earliest_latest.h5 */ + if (gen_earliest_latest() < 0) + goto error; + + /* Generate file bounds_earliest_v18.h5 */ + if (gen_earliest_v18() < 0) + goto error; + + /* Generate file bounds_latest_latest.h5 */ + if (gen_latest_latest() < 0) + goto error; + + /* Generate file bounds_v18_latest.h5 */ + if (gen_v18_latest() < 0) + goto error; + + /* Generate file bounds_v18_v18.h5 */ + if (gen_v18_v18() < 0) + goto error; + + return 0; + +error: + return 1; +} + -- cgit v0.12 From 742798b84e59b8ae346edd8d0acd9face7796051 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 27 Nov 2017 13:41:44 -0600 Subject: Fixed comment. --- test/gen_bounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 1de78e8..25db7e1 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -360,7 +360,7 @@ error: * gen_v18_latest() creates file "bounds_v18_latest.h5" * * File contents: - * - Version 2 superblock (H5Pset_shared_mesg_index) + * - Version 2 superblock * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * ***********************************************************************/ -- cgit v0.12 From daa0eb801561dc1831065e4c8c06d6cd68330200 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 27 Nov 2017 15:09:15 -0600 Subject: Further improvement --- test/gen_bounds.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 25db7e1..50b4acc 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -161,7 +161,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_earliest_latest */ /*********************************************************************** * gen_earliest_v18() creates file "bounds_earliest_v18.h5" @@ -258,7 +258,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_earliest_v18 */ /*********************************************************************** * gen_latest_latest() creates file "bounds_latest_latest.h5" @@ -273,8 +273,6 @@ error: int gen_latest_latest() { hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ hid_t space = -1; /* Dataspace ID */ hid_t dset = -1; /* Dataset ID */ @@ -283,22 +281,8 @@ int gen_latest_latest() float buf[DIM1][DIM2]; /* Buffer for writing data */ int i, j; - /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; - - /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ - if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, fcpl, fapl)) <0) - goto error; - - /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) + if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT)) <0) goto error; /* @@ -349,12 +333,10 @@ error: H5Dclose(dset); H5Sclose(space); H5Pclose(dcpl); - H5Pclose(fcpl); - H5Pclose(fapl); H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_latest_latest */ /*********************************************************************** * gen_v18_latest() creates file "bounds_v18_latest.h5" @@ -451,7 +433,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_v18_latest */ /*********************************************************************** * gen_v18_v18() creates file "bounds_v18_v18.h5" @@ -541,7 +523,7 @@ int gen_v18_v18() if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; - /* Set the "use the latest version of the format" bounds + /* Set the "use the v18/latest version of the format" bounds for creating a layout version 4 object in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) goto error; @@ -594,7 +576,7 @@ error: H5Fclose(fid); } H5E_END_TRY; return 1; -} +} /* gen_v18_v18 */ int main(void) { -- cgit v0.12 From 4db7461569a90f466ba6be14d7e292a040bc3a36 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 09:52:37 -0600 Subject: intialized h5open_f arrays --- fortran/src/H5f90global.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index ee8959e..d4a9008 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -84,9 +84,9 @@ MODULE H5GLOBAL ! These arrays need to be global because they are used in ! both h5open_f and in h5close_f - INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types - INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types - INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE -- cgit v0.12 From 4f7af1390ba62553278dc64b65f44b8efd870b83 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 10:08:10 -0600 Subject: misc. clean-up --- fortran/src/H5f90global.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index d4a9008..4a04971 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -83,7 +83,8 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in - ! both h5open_f and in h5close_f + ! both h5open_f and in h5close_f; initialize to fix linking issues + ! on OSX and Intel compilers. INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 @@ -437,7 +438,6 @@ MODULE H5GLOBAL INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - CONTAINS ! Copy a c string to a Fortran string -- cgit v0.12 From 858e6c3c9c374fa474b7da6fd594fbc022fdc9ae Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 13:29:04 -0700 Subject: HDFFV-10325: removed the COMMON/EQUIV statements. --- fortran/src/H5_ff.F90 | 531 ++++++++++++++++++++++++++++++++--- fortran/src/H5f90global.F90 | 668 +++++--------------------------------------- 2 files changed, 552 insertions(+), 647 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index ef89d2f..db57f03 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -38,10 +38,111 @@ MODULE H5LIB - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, C_INTPTR_T + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_INTPTR_T USE H5GLOBAL IMPLICIT NONE + PRIVATE + ! + ! H5F flags declaration + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags + ! + ! H5generic flags declaration + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags + ! + ! H5G flags declaration + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags + ! + ! H5D flags declaration + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags + ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags + ! + ! H5FD flags declaration + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags + ! + ! H5FD file drivers flags declaration + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags + ! + ! H5I flags declaration + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags + ! + ! H5L flags declaration + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags + ! + ! H5O flags declaration + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags + ! + ! H5P flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags + ! + ! H5P integers flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int + ! + ! H5R flags declaration + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags + ! + ! H5S flags declaration + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + ! + ! H5T flags declaration + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags + ! + ! H5Z flags declaration + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags + ! + ! H5 Library flags declaration + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags + + PUBLIC :: h5open_f, h5close_f, h5get_libversion_f, h5dont_atexit_f, h5kind_to_type, h5offsetof + PUBLIC :: h5garbage_collect_f, h5check_version_f + CONTAINS !****s* H5LIB/h5open_f ! @@ -65,26 +166,24 @@ CONTAINS ! ! Removed call to h5open_c since this may cause a problem for an ! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 +! October 13, 2011 ! Fortran90 Interface: SUBROUTINE h5open_f(error) IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1, error_2, error_3 - INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & BIND(C,NAME='h5init_types_c') IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & i_H5D_size_flags,& i_H5E_flags, & @@ -116,39 +215,90 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER(HID_T) i_H5S_hid_flags(H5S_HID_FLAGS_LEN) - INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - INTEGER(HADDR_T) i_H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER , DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T) , DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER , DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T) , DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER , DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER , DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER , DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T) , DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER , DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER , DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER , DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T) , DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER , DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER , DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER , DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T) , DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER , DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER , DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER , DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) & BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c + END INTERFACE - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & + + error = h5init_types_c(predef_types, floating_types, integer_types) + + H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) + H5T_NATIVE_INTEGER = predef_types(6) + H5T_NATIVE_REAL = predef_types(7) + H5T_NATIVE_DOUBLE = predef_types(8) + H5T_NATIVE_CHARACTER = predef_types(9) + H5T_STD_REF_OBJ = predef_types(10) + H5T_STD_REF_DSETREG = predef_types(11) + H5T_NATIVE_REAL_C_FLOAT = predef_types(12) + H5T_NATIVE_REAL_C_DOUBLE = predef_types(13) + H5T_NATIVE_REAL_C_LONG_DOUBLE = predef_types(14) + H5T_NATIVE_B8 = predef_types(15) + H5T_NATIVE_B16 = predef_types(16) + H5T_NATIVE_B32 = predef_types(17) + H5T_NATIVE_B64 = predef_types(18) + H5T_NATIVE_FLOAT_128 = predef_types(19) + + H5T_IEEE_F32BE = floating_types(1) + H5T_IEEE_F32LE = floating_types(2) + H5T_IEEE_F64BE = floating_types(3) + H5T_IEEE_F64LE = floating_types(4) + + H5T_STD_I8BE = integer_types(1) + H5T_STD_I8LE = integer_types(2) + H5T_STD_I16BE = integer_types(3) + H5T_STD_I16LE = integer_types(4) + H5T_STD_I32BE = integer_types(5) + H5T_STD_I32LE = integer_types(6) + H5T_STD_I64BE = integer_types(7) + H5T_STD_I64LE = integer_types(8) + H5T_STD_U8BE = integer_types(9) + H5T_STD_U8LE = integer_types(10) + H5T_STD_U16BE = integer_types(11) + H5T_STD_U16LE = integer_types(12) + H5T_STD_U32BE = integer_types(13) + H5T_STD_U32LE = integer_types(14) + H5T_STD_U64BE = integer_types(15) + H5T_STD_U64LE = integer_types(16) + H5T_STRING = integer_types(17) + H5T_STD_B8BE = integer_types(18) + H5T_STD_B8LE = integer_types(19) + H5T_STD_B16BE = integer_types(20) + H5T_STD_B16LE = integer_types(21) + H5T_STD_B32BE = integer_types(22) + H5T_STD_B32LE = integer_types(23) + H5T_STD_B64BE = integer_types(24) + H5T_STD_B64LE = integer_types(25) + H5T_FORTRAN_S1 = integer_types(26) + H5T_C_S1 = integer_types(27) + + error = error + h5init_flags_c(H5D_flags, & H5D_size_flags, & H5E_flags, & H5E_hid_flags, & @@ -169,8 +319,299 @@ CONTAINS H5Z_flags, & H5generic_flags,& H5generic_haddr_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_1 + error_2 + error_3 + ! + ! H5F flags + ! + H5F_ACC_RDWR_F = H5F_flags(1) + H5F_ACC_RDONLY_F = H5F_flags(2) + H5F_ACC_TRUNC_F = H5F_flags(3) + H5F_ACC_EXCL_F = H5F_flags(4) + H5F_ACC_DEBUG_F = H5F_flags(5) + H5F_SCOPE_LOCAL_F = H5F_flags(6) + H5F_SCOPE_GLOBAL_F = H5F_flags(7) + H5F_CLOSE_DEFAULT_F = H5F_flags(8) + H5F_CLOSE_WEAK_F = H5F_flags(9) + H5F_CLOSE_SEMI_F = H5F_flags(10) + H5F_CLOSE_STRONG_F = H5F_flags(11) + H5F_OBJ_FILE_F = H5F_flags(12) + H5F_OBJ_DATASET_F = H5F_flags(13) + H5F_OBJ_GROUP_F = H5F_flags(14) + H5F_OBJ_DATATYPE_F = H5F_flags(15) + H5F_OBJ_ALL_F = H5F_flags(16) + H5F_LIBVER_EARLIEST_F = H5F_flags(17) + H5F_LIBVER_LATEST_F = H5F_flags(18) + H5F_UNLIMITED_F = H5F_flags(19) + ! + ! H5generic flags + ! + H5_INDEX_UNKNOWN_F = H5generic_flags(1) + H5_INDEX_NAME_F = H5generic_flags(2) + H5_INDEX_CRT_ORDER_F = H5generic_flags(3) + H5_INDEX_N_F = H5generic_flags(4) + H5_ITER_UNKNOWN_F = H5generic_flags(5) + H5_ITER_INC_F = H5generic_flags(6) + H5_ITER_DEC_F = H5generic_flags(7) + H5_ITER_NATIVE_F = H5generic_flags(8) + H5_ITER_N_F = H5generic_flags(9) + + HADDR_UNDEF_F = H5generic_haddr_flags(1) + ! + ! H5G flags + ! + H5G_UNKNOWN_F = H5G_flags(1) + H5G_GROUP_F = H5G_flags(2) + H5G_DATASET_F = H5G_flags(3) + H5G_TYPE_F = H5G_flags(4) + H5G_SAME_LOC_F = H5G_flags(5) + H5G_LINK_ERROR_F = H5G_flags(6) + H5G_LINK_HARD_F = H5G_flags(7) + H5G_LINK_SOFT_F = H5G_flags(8) + H5G_STORAGE_TYPE_UNKNOWN_F = H5G_flags(9) + H5G_STORAGE_TYPE_SYMBOL_TABLE_F = H5G_flags(10) + H5G_STORAGE_TYPE_COMPACT_F = H5G_flags(11) + H5G_STORAGE_TYPE_DENSE_F = H5G_flags(12) + ! + ! H5D flags + ! + H5D_COMPACT_F = H5D_flags(1) + H5D_CONTIGUOUS_F = H5D_flags(2) + H5D_CHUNKED_F = H5D_flags(3) + H5D_ALLOC_TIME_ERROR_F = H5D_flags(4) + H5D_ALLOC_TIME_DEFAULT_F = H5D_flags(5) + H5D_ALLOC_TIME_EARLY_F = H5D_flags(6) + H5D_ALLOC_TIME_LATE_F = H5D_flags(7) + H5D_ALLOC_TIME_INCR_F = H5D_flags(8) + H5D_SPACE_STS_ERROR_F = H5D_flags(9) + H5D_SPACE_STS_NOT_ALLOCATED_F = H5D_flags(10) + H5D_SPACE_STS_PART_ALLOCATED_F = H5D_flags(11) + H5D_SPACE_STS_ALLOCATED_F = H5D_flags(12) + H5D_FILL_TIME_ERROR_F = H5D_flags(13) + H5D_FILL_TIME_ALLOC_F = H5D_flags(14) + H5D_FILL_TIME_NEVER_F = H5D_flags(15) + H5D_FILL_VALUE_ERROR_F = H5D_flags(16) + H5D_FILL_VALUE_UNDEFINED_F = H5D_flags(17) + H5D_FILL_VALUE_DEFAULT_F = H5D_flags(18) + H5D_FILL_VALUE_USER_DEFINED_F = H5D_flags(19) + H5D_CHUNK_CACHE_W0_DFLT_F = H5D_flags(20) + H5D_MPIO_NO_COLLECTIVE_F = H5D_flags(21) + H5D_MPIO_CHUNK_INDEPENDENT_F = H5D_flags(22) + H5D_MPIO_CHUNK_COLLECTIVE_F = H5D_flags(23) + H5D_MPIO_CHUNK_MIXED_F = H5D_flags(24) + H5D_MPIO_CONTIG_COLLECTIVE_F = H5D_flags(25) + H5D_VDS_ERROR_F = H5D_flags(26) + H5D_VDS_FIRST_MISSING_F = H5D_flags(27) + H5D_VDS_LAST_AVAILABLE_F = H5D_flags(28) + H5D_VIRTUAL_F = H5D_flags(29) + + H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1) + H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2) + ! + ! H5E flags + ! + H5E_DEFAULT_F = H5E_hid_flags(1) + + H5E_MAJOR_F = H5E_flags(1) + H5E_MINOR_F = H5E_flags(2) + H5E_WALK_UPWARD_F = H5E_flags(3) + H5E_WALK_DOWNWARD_F = H5E_flags(4) + ! + ! H5FD flags + ! + H5FD_MPIO_INDEPENDENT_F = H5FD_flags(1) + H5FD_MPIO_COLLECTIVE_F = H5FD_flags(2) + H5FD_MEM_NOLIST_F = H5FD_flags(3) + H5FD_MEM_DEFAULT_F = H5FD_flags(4) + H5FD_MEM_SUPER_F = H5FD_flags(5) + H5FD_MEM_BTREE_F = H5FD_flags(6) + H5FD_MEM_DRAW_F = H5FD_flags(7) + H5FD_MEM_GHEAP_F = H5FD_flags(8) + H5FD_MEM_LHEAP_F = H5FD_flags(9) + H5FD_MEM_OHDR_F = H5FD_flags(10) + H5FD_MEM_NTYPES_F = H5FD_flags(11) + ! + ! H5FD file driver flags + ! + H5FD_CORE_F = H5FD_hid_flags(1) + H5FD_FAMILY_F = H5FD_hid_flags(2) + H5FD_LOG_F = H5FD_hid_flags(3) + H5FD_MPIO_F = H5FD_hid_flags(4) + H5FD_MULTI_F = H5FD_hid_flags(5) + H5FD_SEC2_F = H5FD_hid_flags(6) + H5FD_STDIO_F = H5FD_hid_flags(7) + ! + ! H5I flags declaration + ! + H5I_FILE_F = H5I_flags(1) + H5I_GROUP_F = H5I_flags(2) + H5I_DATATYPE_F = H5I_flags(3) + H5I_DATASPACE_F = H5I_flags(4) + H5I_DATASET_F = H5I_flags(5) + H5I_ATTR_F = H5I_flags(6) + H5I_BADID_F = H5I_flags(7) + ! + ! H5L flags + ! + H5L_TYPE_ERROR_F = H5L_flags(1) + H5L_TYPE_HARD_F = H5L_flags(2) + H5L_TYPE_SOFT_F = H5L_flags(3) + H5L_TYPE_EXTERNAL_F = H5L_flags(4) + H5L_SAME_LOC_F = H5L_flags(5) + H5L_LINK_CLASS_T_VERS_F = H5L_flags(6) + ! + ! H5O flags + ! + H5O_COPY_SHALLOW_HIERARCHY_F = h5o_flags(1) + H5O_COPY_EXPAND_SOFT_LINK_F = h5o_flags(2) + H5O_COPY_EXPAND_EXT_LINK_F = h5o_flags(3) + H5O_COPY_EXPAND_REFERENCE_F = h5o_flags(4) + H5O_COPY_WITHOUT_ATTR_FLAG_F = h5o_flags(5) + H5O_COPY_PRESERVE_NULL_FLAG_F = h5o_flags(6) + H5O_COPY_ALL_F = h5o_flags(7) + H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) + H5O_SHMESG_SDSPACE_FLAG_F = h5o_flags(9) + H5O_SHMESG_DTYPE_FLAG_F = h5o_flags(10) + H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) + H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) + H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) + H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) + H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) + H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) + H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) + H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) + H5O_HDR_STORE_TIMES_F = h5o_flags(19) + H5O_HDR_ALL_FLAGS_F = h5o_flags(20) + H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) + H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) + H5O_TYPE_UNKNOWN_F = h5o_flags(23) + H5O_TYPE_GROUP_F = h5o_flags(24) + H5O_TYPE_DATASET_F = h5o_flags(25) + H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) + H5O_TYPE_NTYPES_F = h5o_flags(27) + ! + ! H5P flags + ! + H5P_FILE_CREATE_F = H5P_flags(1) + H5P_FILE_ACCESS_F = H5P_flags(2) + H5P_DATASET_CREATE_F = H5P_flags(3) + H5P_DATASET_XFER_F = H5P_flags(4) + H5P_FILE_MOUNT_F = H5P_flags(5) + H5P_DEFAULT_F = H5P_flags(6) + H5P_ROOT_F = H5P_flags(7) + H5P_OBJECT_CREATE_F = H5P_flags(8) + H5P_DATASET_ACCESS_F = H5P_flags(9) + H5P_GROUP_CREATE_F = H5P_flags(10) + H5P_GROUP_ACCESS_F = H5P_flags(11) + H5P_DATATYPE_CREATE_F = H5P_flags(12) + H5P_DATATYPE_ACCESS_F = H5P_flags(13) + H5P_STRING_CREATE_F = H5P_flags(14) + H5P_ATTRIBUTE_CREATE_F = H5P_flags(15) + H5P_OBJECT_COPY_F = H5P_flags(16) + H5P_LINK_CREATE_F = H5P_flags(17) + H5P_LINK_ACCESS_F = H5P_flags(18) + ! + ! H5P integers flags + ! + H5P_CRT_ORDER_INDEXED_F = H5P_flags_int(1) + H5P_CRT_ORDER_TRACKED_F = H5P_flags_int(2) + ! + ! H5R flags + ! + H5R_OBJECT_F = H5R_flags(1) + H5R_DATASET_REGION_F = H5R_flags(2) + ! + ! H5S flags + ! + H5S_ALL_F = H5S_hid_flags(1) + + H5S_UNLIMITED_F = H5S_hsize_flags(1) + + H5S_SCALAR_F = H5S_flags(1) + H5S_SIMPLE_F = H5S_flags(2) + H5S_NULL_F = H5S_flags(3) + H5S_SELECT_SET_F = H5S_flags(4) + H5S_SELECT_OR_F = H5S_flags(5) + H5S_SELECT_NOOP_F = H5S_flags(6) + H5S_SELECT_AND_F = H5S_flags(7) + H5S_SELECT_XOR_F = H5S_flags(8) + H5S_SELECT_NOTB_F = H5S_flags(9) + H5S_SELECT_NOTA_F = H5S_flags(10) + H5S_SELECT_APPEND_F = H5S_flags(11) + H5S_SELECT_PREPEND_F = H5S_flags(12) + H5S_SELECT_INVALID_F = H5S_flags(13) + H5S_SEL_ERROR_F = H5S_flags(14) + H5S_SEL_NONE_F = H5S_flags(15) + H5S_SEL_POINTS_F = H5S_flags(16) + H5S_SEL_HYPERSLABS_F = H5S_flags(17) + H5S_SEL_ALL_F = H5S_flags(18) + ! + ! H5T flags declaration + ! + H5T_NO_CLASS_F = H5T_flags(1) + H5T_INTEGER_F = H5T_flags(2) + H5T_FLOAT_F = H5T_flags(3) + H5T_TIME_F = H5T_flags(4) + H5T_STRING_F = H5T_flags(5) + H5T_BITFIELD_F = H5T_flags(6) + H5T_OPAQUE_F = H5T_flags(7) + H5T_COMPOUND_F = H5T_flags(8) + H5T_REFERENCE_F = H5T_flags(9) + H5T_ENUM_F = H5T_flags(10) + H5T_ORDER_LE_F = H5T_flags(11) + H5T_ORDER_BE_F = H5T_flags(12) + H5T_ORDER_MIXED_F = H5T_flags(13) + H5T_ORDER_VAX_F = H5T_flags(14) + H5T_ORDER_NONE_F = H5T_flags(15) + H5T_PAD_ZERO_F = H5T_flags(16) + H5T_PAD_ONE_F = H5T_flags(17) + H5T_PAD_BACKGROUND_F = H5T_flags(18) + H5T_PAD_ERROR_F = H5T_flags(19) + H5T_SGN_NONE_F = H5T_flags(20) + H5T_SGN_2_F = H5T_flags(21) + H5T_SGN_ERROR_F = H5T_flags(22) + H5T_NORM_IMPLIED_F = H5T_flags(23) + H5T_NORM_MSBSET_F = H5T_flags(24) + H5T_NORM_NONE_F = H5T_flags(25) + H5T_CSET_ASCII_F = H5T_flags(26) + H5T_CSET_UTF8_F = H5T_flags(27) + H5T_STR_NULLTERM_F = H5T_flags(28) + H5T_STR_NULLPAD_F = H5T_flags(29) + H5T_STR_SPACEPAD_F = H5T_flags(30) + H5T_STR_ERROR_F = H5T_flags(31) + H5T_VLEN_F = H5T_flags(32) + H5T_ARRAY_F = H5T_flags(33) + H5T_DIR_ASCEND_F = H5T_flags(34) + H5T_DIR_DESCEND_F = H5T_flags(35) + ! + ! H5Z flags + ! + H5Z_FILTER_ERROR_F = H5Z_flags(1) + H5Z_FILTER_NONE_F = H5Z_flags(2) + H5Z_FILTER_DEFLATE_F = H5Z_flags(3) + H5Z_FILTER_SHUFFLE_F = H5Z_flags(4) + H5Z_FILTER_FLETCHER32_F = H5Z_flags(5) + H5Z_ERROR_EDC_F = H5Z_flags(6) + H5Z_DISABLE_EDC_F = H5Z_flags(7) + H5Z_ENABLE_EDC_F = H5Z_flags(8) + H5Z_NO_EDC_F = H5Z_flags(9) + H5Z_FILTER_SZIP_F = H5Z_flags(10) + H5Z_FLAG_OPTIONAL_F = H5Z_flags(11) + H5Z_FILTER_ENCODE_ENABLED_F = H5Z_flags(12) + H5Z_FILTER_DECODE_ENABLED_F = H5Z_flags(13) + H5Z_FILTER_ALL_F = H5Z_flags(14) + H5Z_FILTER_NBIT_F = H5Z_flags(15) + H5Z_FILTER_SCALEOFFSET_F = H5Z_flags(16) + H5Z_SO_FLOAT_DSCALE_F = H5Z_flags(17) + H5Z_SO_FLOAT_ESCALE_F = H5Z_flags(18) + H5Z_SO_INT_F = H5Z_flags(19) + H5Z_SO_INT_MINBITS_DEFAULT_F = H5Z_flags(20) + + error = error + h5init1_flags_c(H5LIB_flags) + ! + ! H5 Library flags + ! + H5_SZIP_EC_OM_F = H5LIB_flags(1) + H5_SZIP_NN_OM_F = H5LIB_flags(2) + END SUBROUTINE h5open_f !****s* H5LIB/h5close_f @@ -201,25 +642,23 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1 INTERFACE INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & f_types, F_TYPES_LEN, & i_types, I_TYPES_LEN ) & BIND(C,NAME='h5close_types_c') IMPORT :: HID_T - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + INTEGER :: P_TYPES_LEN + INTEGER :: F_TYPES_LEN + INTEGER :: I_TYPES_LEN + INTEGER(HID_T), DIMENSION(1:P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - error = error_1 END SUBROUTINE h5close_f diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 629418a..d4a9008 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -50,7 +50,6 @@ MODULE H5GLOBAL END ENUM INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) - ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. @@ -71,9 +70,9 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change this - ! value when new predefined - ! datatypes are added + ! Do not forget to change this value when new predefined + ! datatypes are added + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change the following line when new predefined ! floating data types are added @@ -83,32 +82,56 @@ MODULE H5GLOBAL ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT, & - H5T_NATIVE_REAL_C_DOUBLE, & - H5T_NATIVE_REAL_C_LONG_DOUBLE, & - H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE + ! These arrays need to be global because they are used in + ! both h5open_f and in h5close_f + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 + ! + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -116,139 +139,22 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- -! NOTE: Splitting the line since the Fortran 95 standard limits the number of -! continuation lines to 39; the F03/F08 standard limits the number -! to 255 lines. - - INTEGER(HID_T) :: H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING, & - H5T_STD_B8BE, & - H5T_STD_B8LE, & - H5T_STD_B16BE, & - H5T_STD_B16LE, & - H5T_STD_B32BE, & - H5T_STD_B32LE, & - H5T_STD_B64BE, & - H5T_STD_B64LE, & - H5T_NATIVE_B8, & - H5T_NATIVE_B16, & - H5T_NATIVE_B32, & - H5T_NATIVE_B64, & - H5T_FORTRAN_S1, & - H5T_C_S1 - - - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER_KIND(1)) - ! EQUIVALENCE predef_types(2:5) are unnecessary and violate the standard - EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) - EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) - EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) - EQUIVALENCE (predef_types(9), H5T_NATIVE_CHARACTER) - EQUIVALENCE (predef_types(10), H5T_STD_REF_OBJ) - EQUIVALENCE (predef_types(11), H5T_STD_REF_DSETREG) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_FLOAT) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_DOUBLE) - EQUIVALENCE (predef_types(14), H5T_NATIVE_REAL_C_LONG_DOUBLE) - EQUIVALENCE (predef_types(15), H5T_NATIVE_B8 ) - EQUIVALENCE (predef_types(16), H5T_NATIVE_B16) - EQUIVALENCE (predef_types(17), H5T_NATIVE_B32) - EQUIVALENCE (predef_types(18), H5T_NATIVE_B64) - EQUIVALENCE (predef_types(19), H5T_NATIVE_FLOAT_128) ! ADDED NEW TYPE -MSB- - - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) - EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) - EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) - EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types - EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) - EQUIVALENCE (integer_types(2), H5T_STD_I8LE) - EQUIVALENCE (integer_types(3), H5T_STD_I16BE) - EQUIVALENCE (integer_types(4), H5T_STD_I16LE) - EQUIVALENCE (integer_types(5), H5T_STD_I32BE) - EQUIVALENCE (integer_types(6), H5T_STD_I32LE) - EQUIVALENCE (integer_types(7), H5T_STD_I64BE) - EQUIVALENCE (integer_types(8), H5T_STD_I64LE) - EQUIVALENCE (integer_types(9), H5T_STD_U8BE) - EQUIVALENCE (integer_types(10), H5T_STD_U8LE) - EQUIVALENCE (integer_types(11), H5T_STD_U16BE) - EQUIVALENCE (integer_types(12), H5T_STD_U16LE) - EQUIVALENCE (integer_types(13), H5T_STD_U32BE) - EQUIVALENCE (integer_types(14), H5T_STD_U32LE) - EQUIVALENCE (integer_types(15), H5T_STD_U64BE) - EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - EQUIVALENCE (integer_types(17), H5T_STRING) - EQUIVALENCE (integer_types(18), H5T_STD_B8BE) - EQUIVALENCE (integer_types(19), H5T_STD_B8LE) - EQUIVALENCE (integer_types(20), H5T_STD_B16BE) - EQUIVALENCE (integer_types(21), H5T_STD_B16LE) - EQUIVALENCE (integer_types(22), H5T_STD_B32BE) - EQUIVALENCE (integer_types(23), H5T_STD_B32LE) - EQUIVALENCE (integer_types(24), H5T_STD_B64BE) - EQUIVALENCE (integer_types(25), H5T_STD_B64LE) - EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) - EQUIVALENCE (integer_types(27), H5T_C_S1) - - - ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - ! H5T_NATIVE_REAL, & - ! H5T_NATIVE_DOUBLE, & - ! H5T_NATIVE_CHARACTER, & - ! H5T_STD_REF_OBJ, & - ! H5T_STD_REF_DSETREG - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ - !DEC$endif - COMMON /PREDEFINED_TYPES/ predef_types - - ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - ! H5T_IEEE_F32LE, & - ! H5T_IEEE_F64BE, & - ! H5T_IEEE_F64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ - !DEC$endif - COMMON /FLOATING_TYPES/ floating_types - ! - ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - ! H5T_STD_I8LE, & - ! H5T_STD_I16BE, & - ! H5T_STD_I16LE, & - ! H5T_STD_I32BE, & - ! H5T_STD_I32LE, & - ! H5T_STD_I64BE, & - ! H5T_STD_I64LE, & - ! H5T_STD_U8BE, & - ! H5T_STD_U8LE, & - ! H5T_STD_U16BE, & - ! H5T_STD_U16LE, & - ! H5T_STD_U32BE, & - ! H5T_STD_U32LE, & - ! H5T_STD_U64BE, & - ! H5T_STD_U64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ - !DEC$endif - COMMON /INTEGER_TYPES/ integer_types - ! - ! Fortran flags - ! + ! H5generic flags declaration ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) + INTEGER :: H5_INDEX_UNKNOWN_F + INTEGER :: H5_INDEX_NAME_F + INTEGER :: H5_INDEX_CRT_ORDER_F + INTEGER :: H5_INDEX_N_F + INTEGER :: H5_ITER_UNKNOWN_F + INTEGER :: H5_ITER_INC_F + INTEGER :: H5_ITER_DEC_F + INTEGER :: H5_ITER_NATIVE_F + INTEGER :: H5_ITER_N_F + + INTEGER(HADDR_T) :: HADDR_UNDEF_F ! ! H5F flags declaration ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ - !DEC$endif - COMMON /H5F_FLAGS/ H5F_flags - INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -268,77 +174,9 @@ MODULE H5GLOBAL INTEGER :: H5F_LIBVER_EARLIEST_F INTEGER :: H5F_LIBVER_LATEST_F INTEGER :: H5F_UNLIMITED_F - - EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) - EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) - EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) - EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) - EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) - EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) - EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) - EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) - EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) - EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) - EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) - EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) - EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) - EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) - EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) - EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) - EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ - !DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_haddr_FLAGS/ - !DEC$endif - COMMON /H5generic_haddr_FLAGS/ H5generic_haddr_flags - - INTEGER(HADDR_T) :: HADDR_UNDEF_F - - EQUIVALENCE(H5generic_haddr_flags(1), HADDR_UNDEF_F) - ! ! H5G flags declaration ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ - !DEC$endif - COMMON /H5G_FLAGS/ H5G_flags - INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -353,35 +191,9 @@ MODULE H5GLOBAL INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F INTEGER :: H5G_STORAGE_TYPE_COMPACT_F INTEGER :: H5G_STORAGE_TYPE_DENSE_F - - EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type - EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group - EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset - EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type - EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) - ! ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ - !DEC$endif - COMMON /H5D_FLAGS/ H5D_flags - COMMON /H5D_SIZE_FLAGS/ H5D_size_flags - INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -413,6 +225,7 @@ MODULE H5GLOBAL INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F INTEGER :: H5D_MPIO_NO_COLLECTIVE_F INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F @@ -423,81 +236,17 @@ MODULE H5GLOBAL INTEGER :: H5D_VDS_FIRST_MISSING_F INTEGER :: H5D_VDS_LAST_AVAILABLE_F INTEGER :: H5D_VIRTUAL_F - - EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) - EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) - EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) - - EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) - EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) - EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) - EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) - - EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) - EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) - EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) - EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) - - EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) - EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) - - EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) - EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) - EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(26), H5D_VDS_ERROR_F) - EQUIVALENCE(H5D_flags(27), H5D_VDS_FIRST_MISSING_F) - EQUIVALENCE(H5D_flags(28), H5D_VDS_LAST_AVAILABLE_F) - EQUIVALENCE(H5D_flags(29), H5D_VIRTUAL_F) - - EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - ! ! H5E flags declaration ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ - !DEC$endif - COMMON /H5E_FLAGS/ H5E_flags - COMMON /H5E_HID_FLAGS/ H5E_hid_flags - INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F INTEGER :: H5E_WALK_UPWARD_F INTEGER :: H5E_WALK_DOWNWARD_F - - EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) - EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) - EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) - EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) - EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) - ! - ! H5FD flags declaration + ! H5FD file drivers flags declaration ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ - !DEC$endif - COMMON /H5FD_FLAGS/ H5FD_flags - INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -509,28 +258,6 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F INTEGER :: H5FD_MEM_NTYPES_F - - EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) - EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) - EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) - EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) - EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) - EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) - EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) - EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) - EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) - EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) - EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ - !DEC$endif - COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags - INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -538,25 +265,9 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5FD_MULTI_F INTEGER(HID_T) :: H5FD_SEC2_F INTEGER(HID_T) :: H5FD_STDIO_F - - EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) - EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) - EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) - EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) - EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) - EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) - EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) - ! ! H5I flags declaration ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ - !DEC$endif - COMMON /H5I_FLAGS/ H5I_flags - INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -564,48 +275,18 @@ MODULE H5GLOBAL INTEGER :: H5I_DATASET_F INTEGER :: H5I_ATTR_F INTEGER :: H5I_BADID_F - - EQUIVALENCE(H5I_flags(1), H5I_FILE_F) - EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) - EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) - EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) - EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) - EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) - EQUIVALENCE(H5I_flags(7), H5I_BADID_F) ! ! H5L flags declaration ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) - INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F INTEGER :: H5L_TYPE_EXTERNAL_F INTEGER :: H5L_SAME_LOC_F INTEGER :: H5L_LINK_CLASS_T_VERS_F - - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ - !DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) - EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) - EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) - EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) ! ! H5O flags declaration ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ - !DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -633,45 +314,9 @@ MODULE H5GLOBAL INTEGER :: H5O_TYPE_DATASET_F INTEGER :: H5O_TYPE_NAMED_DATATYPE_F INTEGER :: H5O_TYPE_NTYPES_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) - EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) - EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) - EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) - EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) - EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) - ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ - !DEC$endif - COMMON /H5P_FLAGS/ H5P_flags - INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -691,72 +336,16 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5P_LINK_CREATE_F INTEGER(HID_T) :: H5P_LINK_ACCESS_F - EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) - EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) - EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) - EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) - EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) - EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) - EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) - - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ - !DEC$endif - COMMON /H5P_FLAGS_INT/ H5P_flags_int INTEGER :: H5P_CRT_ORDER_INDEXED_F INTEGER :: H5P_CRT_ORDER_TRACKED_F - EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) ! ! H5R flags declaration ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ - !DEC$endif - COMMON /H5R_FLAGS/ H5R_flags - INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F - - EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) - EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) - ! ! H5S flags declaration ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HID_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ - !DEC$endif - COMMON /H5S_FLAGS/ H5S_flags - COMMON /H5S_HID_FLAGS/ H5S_hid_flags - COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags - INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -781,43 +370,9 @@ MODULE H5GLOBAL INTEGER :: H5S_SEL_POINTS_F INTEGER :: H5S_SEL_HYPERSLABS_F INTEGER :: H5S_SEL_ALL_F - - EQUIVALENCE(H5S_hid_flags(1), H5S_ALL_F) - - EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) - - EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) - EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) - EQUIVALENCE(H5S_flags(3), H5S_NULL_F) - EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) - EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) - - EQUIVALENCE(H5S_flags(6), H5S_SELECT_NOOP_F) - EQUIVALENCE(H5S_flags(7), H5S_SELECT_AND_F) - EQUIVALENCE(H5S_flags(8), H5S_SELECT_XOR_F) - EQUIVALENCE(H5S_flags(9), H5S_SELECT_NOTB_F) - EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTA_F) - - EQUIVALENCE(H5S_flags(11), H5S_SELECT_APPEND_F) - EQUIVALENCE(H5S_flags(12), H5S_SELECT_PREPEND_F) - EQUIVALENCE(H5S_flags(13), H5S_SELECT_INVALID_F) - EQUIVALENCE(H5S_flags(14), H5S_SEL_ERROR_F) - EQUIVALENCE(H5S_flags(15), H5S_SEL_NONE_F) - - EQUIVALENCE(H5S_flags(16), H5S_SEL_POINTS_F) - EQUIVALENCE(H5S_flags(17), H5S_SEL_HYPERSLABS_F) - EQUIVALENCE(H5S_flags(18), H5S_SEL_ALL_F) - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ - !DEC$endif - COMMON /H5T_FLAGS/ H5T_flags - INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -853,52 +408,9 @@ MODULE H5GLOBAL INTEGER :: H5T_STR_ERROR_F INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F - - EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) - EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) - EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) - EQUIVALENCE(H5T_flags(4), H5T_TIME_F) - EQUIVALENCE(H5T_flags(5), H5T_STRING_F) - EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) - EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) - EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) - EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) - EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) - EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) - EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) ! ! H5Z flags declaration ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ - !DEC$endif - COMMON /H5Z_FLAGS/ H5Z_flags - INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -919,58 +431,12 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_FLOAT_ESCALE_F INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F - - EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) - EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) - EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) - EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) - EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) - EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) - EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) - EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) - EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) - EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) - EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) - EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) - EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) - EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) - EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) - EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) - EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) - ! ! H5 Library flags declaration ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ - !DEC$endif - COMMON /H5LIB_FLAGS/ H5LIB_flags INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - - ! General H5 flags declarations - ! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) CONTAINS -- cgit v0.12 From b162b949988def452b2a4a34426212d246e54b52 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 15 Nov 2017 17:14:35 -0600 Subject: Correct linkage of filters and other libs --- CMakeFilters.cmake | 16 ++++++++-------- src/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 4 ++-- test/dsets.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 804b16b..71dabb1 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -45,8 +45,8 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (NOT ZLIB_FOUND) find_package (ZLIB) # Legacy find if (ZLIB_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) endif () endif () endif () @@ -78,9 +78,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") endif () @@ -96,8 +96,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (NOT SZIP_FOUND) find_package (SZIP) # Legacy find if (SZIP_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) endif () endif () endif () @@ -119,9 +119,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) endif () endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91b8e0c..b163b8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -883,7 +883,7 @@ set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () @@ -927,7 +927,7 @@ if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0a2afbf..fca864b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,7 +37,7 @@ endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test @@ -53,7 +53,7 @@ if (BUILD_SHARED_LIBS) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test diff --git a/test/dsets.c b/test/dsets.c index 4088304..0fff2d1 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -2087,7 +2087,7 @@ test_get_filter_info(void) #ifdef H5_HAVE_FILTER_SZIP if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR - if(SZ_encoder_enabled()) { + if(H5Z_SZIP->encoder_present) { if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR -- cgit v0.12 From bbc0c85ab221d88565ddd2a1f4852b73d77d0fa2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:04:50 -0600 Subject: Add note for plugins --- release_docs/RELEASE.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f8ad620..9e3c3a9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -157,6 +157,25 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - filter plugin handling in H5PL.c and H5Z.c + + It was discovered that the dynamic loading process used by + filter plugins had issues with memory allocation and library + dependencies. + + CMake build process changed to use LINK INTERFACE keywords, which + allowed HDF5 C library to make dependent libraries private. The + filter plugin libraries no longer require dependent libraries + (such as szip or zlib) to be available. + (ADB - 2017/11/16, HDFFV-10328) + + The H5Z_class2_t structure returned by the filter plugins are + now dynamically allocated in H5Zregister function. Access to + the functions in the filter library now always use the dynamic + library API. + + (ADB - 2017/11/16, HDFFV-10329) + - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From 3098356df0eeed116acca9d8997f672f6c8520a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:28:58 -0600 Subject: Fix some of the whitespace --- test/tattr.c | 254 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/test/tattr.c b/test/tattr.c index d7152ed..3786d0d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -163,21 +163,21 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, static void test_attr_basic_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t attr_size; /* storage size for attribute */ - ssize_t attr_name_size; /* size of attribute name */ - char *attr_name=NULL; /* name of attribute */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int i; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t attr_size; /* storage size for attribute */ + ssize_t attr_name_size; /* size of attribute name */ + char *attr_name=NULL; /* name of attribute */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int i; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n")); @@ -402,15 +402,15 @@ test_attr_basic_write(hid_t fapl) static void test_attr_basic_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t attr; /* Attribute ID */ - H5O_info_t oinfo; /* Object info */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t attr; /* Attribute ID */ + H5O_info_t oinfo; /* Object info */ int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ - int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + int i, j; /* Local index variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -500,7 +500,7 @@ test_attr_flush(hid_t fapl) set; /* Dataset ID */ double wdata=3.14159F; /* Data to write */ double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); @@ -563,12 +563,12 @@ test_attr_plist(hid_t fapl) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t plist; /* Property list ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - H5T_cset_t cset; /* Character set for attributes */ - herr_t ret; /* Generic return value */ + hid_t attr; /* Attribute ID */ + hid_t plist; /* Property list ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + H5T_cset_t cset; /* Character set for attributes */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Property Lists\n")); @@ -675,14 +675,14 @@ static void test_attr_compound_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -762,11 +762,11 @@ test_attr_compound_write(hid_t fapl) static void test_attr_compound_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ int rank; /* Attribute rank */ hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */ @@ -781,7 +781,7 @@ test_attr_compound_read(hid_t fapl) ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -830,7 +830,7 @@ test_attr_compound_read(hid_t fapl) HDstrcmp(fieldname, ATTR4_FIELDNAME3))) TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname); H5free_memory(fieldname); - } /* end for */ + } /* end for */ offset = H5Tget_member_offset(type, 0); VERIFY(offset, attr4_field1_off, "H5Tget_member_offset"); offset = H5Tget_member_offset(type, 1); @@ -878,7 +878,7 @@ test_attr_compound_read(hid_t fapl) printf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); printf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); TestErrPrintf("%d: attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", __LINE__, i, j, attr_data4[i][j].c, i, j, read_data4[i][j].c); - } /* end if */ + } /* end if */ /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); @@ -913,12 +913,12 @@ static void test_attr_scalar_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -979,13 +979,13 @@ static void test_attr_scalar_read(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ H5S_class_t stype; /* Dataspace class */ - float rdata = 0.0F; /* Buffer for reading 1st attribute */ + float rdata = 0.0F; /* Buffer for reading 1st attribute */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n")); @@ -1013,8 +1013,8 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); @@ -1051,15 +1051,15 @@ static void test_attr_mult_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -1170,11 +1170,11 @@ test_attr_mult_write(hid_t fapl) static void test_attr_mult_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ char temp_name[ATTR_NAME_LEN]; /* Buffer for mangling attribute names */ int rank; /* Attribute rank */ @@ -1185,10 +1185,10 @@ test_attr_mult_read(hid_t fapl) int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3] = {{{0}}}; /* Buffer for reading 3rd attribute */ - ssize_t name_len; /* Length of attribute name */ + ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j, k; /* Local index values */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1432,12 +1432,12 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR static void test_attr_iterate(hid_t fapl) { - hid_t file; /* HDF5 File ID */ + hid_t file; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ int count; /* operator data for the iterator */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1504,13 +1504,13 @@ test_attr_iterate(hid_t fapl) static void test_attr_delete(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1635,7 +1635,7 @@ test_attr_dtype_shared(hid_t fapl) H5O_info_t oinfo; /* Object's information */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Shared Datatypes with Attributes\n")); @@ -1802,17 +1802,17 @@ test_attr_dtype_shared(hid_t fapl) static void test_attr_duplicate_ids(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ - int i; - herr_t ret; /* Generic return value */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ + int i; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two ID handles\n")); @@ -1830,7 +1830,7 @@ test_attr_duplicate_ids(hid_t fapl) /* Create a dataset */ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); /* Create dataspace for attribute */ @@ -2047,12 +2047,12 @@ test_attr_duplicate_ids(hid_t fapl) static int test_attr_dense_verify(hid_t loc_id, unsigned max_attr) { - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ unsigned value; /* Attribute value */ unsigned u; /* Local index variable */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -2117,19 +2117,19 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) static void test_attr_dense_create(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Attribute Storage Creation\n")); @@ -2248,19 +2248,19 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) static void test_attr_dense_open(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n")); @@ -2387,20 +2387,20 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) static void test_attr_dense_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n")); @@ -2565,21 +2565,21 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) static void test_attr_dense_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n")); @@ -2724,21 +2724,21 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) static void test_attr_dense_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ size_t mesg_count; /* # of shared messages */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n")); @@ -2856,17 +2856,17 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) { hid_t fid; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact, rmax_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n")); @@ -3019,13 +3019,13 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) static void test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t gid1, gid2; /* Group ID */ - hid_t sid, sid2; /* Dataspace ID */ + hid_t sid, sid2; /* Dataspace ID */ hid_t attr, attr2, add_attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ hsize_t dims[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ @@ -3033,9 +3033,9 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) unsigned read_scalar; /* variable for reading attribute*/ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u, i; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n")); -- cgit v0.12 From f4f94e1bf845e40ea085c93d03724ac96cb61b68 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 11:45:36 -0600 Subject: HDFFV-10328 merge allocation changes from 1.8 --- src/H5PLint.c | 21 +- src/H5PLplugin_cache.c | 26 +- src/H5Z.c | 715 ++++++++++++++++++++++++++----------------------- 3 files changed, 422 insertions(+), 340 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..e969cbf 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,19 +342,38 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { + H5Z_class2_t *plugin_copy = NULL; /* Store the plugin in the cache */ if (H5PL__add_plugin(type, id, handle)) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") + /* allocate local copy of plugin info */ + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = (const void *)info; + + plugin_copy->version = info->version; + plugin_copy->id = info->id; + plugin_copy->encoder_present = info->encoder_present; + plugin_copy->decoder_present = info->decoder_present; + plugin_copy->can_apply = info->can_apply; + plugin_copy->set_local = info->set_local; + plugin_copy->filter = info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") + /* Set output parameters */ *success = TRUE; - *plugin_info = (const void *)info; } } done: if (!success && handle) + if (*plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index d826ba0..ec14159 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,18 +280,34 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; + H5Z_class2_t *plugin_copy = NULL; /* Get the "get plugin info" function from the plugin. */ if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_cache_g[u]).handle, "H5PLget_plugin_info"))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") /* Call the "get plugin info" function */ if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = plugin_copy; + + plugin_copy->version = filter_info->version; + plugin_copy->id = filter_info->id; + plugin_copy->encoder_present = filter_info->encoder_present; + plugin_copy->decoder_present = filter_info->decoder_present; + plugin_copy->can_apply = filter_info->can_apply; + plugin_copy->set_local = filter_info->set_local; + plugin_copy->filter = filter_info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") /* Set output parameters */ *found = TRUE; - *plugin_info = filter_info; /* No need to continue processing */ break; @@ -301,6 +317,10 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: + /* unallocate local copy of plugin info on failure */ + if (FAIL == ret_value && *plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index 1d023b5..e7574cd 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -34,15 +34,15 @@ #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { - hsize_t total; /*total number of bytes processed */ - hsize_t errors; /*bytes of total attributable to errors */ - H5_timer_t timer; /*execution time including errors */ - } stats[2]; /*0=output, 1=input */ + hsize_t total; /* total number of bytes processed */ + hsize_t errors; /* bytes of total attributable to errors */ + H5_timer_t timer; /* execution time including errors */ + } stats[2]; /* 0=output, 1=input */ } H5Z_stats_t; #endif /* H5Z_DEBUG */ typedef struct H5Z_object_t { - H5Z_filter_t filter_id; /* ID of the filter we're looking for */ + H5Z_filter_t filter_id; /* ID of the filter we're looking for */ htri_t found; /* Whether we find an object using the filter */ } H5Z_object_t; @@ -86,23 +86,23 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if(H5Z_register(H5Z_SHUFFLE) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if(H5Z_register(H5Z_FLETCHER32) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if(H5Z_register(H5Z_NBIT) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if(H5Z_register(H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register (H5Z_SHUFFLE) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register (H5Z_FLETCHER32) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register (H5Z_NBIT) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register (H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if(H5Z_register(H5Z_DEFLATE) < 0) + if (H5Z_register (H5Z_DEFLATE) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if(H5Z_register(H5Z_SZIP) < 0) + if (H5Z_register (H5Z_SZIP) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ @@ -123,6 +123,7 @@ int H5Z_term_package(void) { int n = 0; + size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -130,7 +131,6 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; - size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,6 +179,12 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ + for (i = 0; i < H5Z_table_used_g; i++) { + H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (cls->name) + cls->name = (char *)H5MM_xfree(cls->name); + } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -211,8 +217,8 @@ herr_t H5Zregister(const void *cls) { const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */ - H5Z_class2_t cls_new; /* Translated class struct */ - herr_t ret_value=SUCCEED; /* Return value */ + H5Z_class2_t cls_new; /* Translated class struct */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", cls); @@ -231,7 +237,7 @@ H5Zregister(const void *cls) * at least 256, there should be no overlap and the version of the struct * can be determined by the value of the first field. */ - if(cls_real->version != H5Z_CLASS_T_VERS) { + if (cls_real->version != H5Z_CLASS_T_VERS) { #ifndef H5_NO_DEPRECATED_SYMBOLS /* Assume it is an old "H5Z_class1_t" instead */ const H5Z_class1_t *cls_old = (const H5Z_class1_t *) cls; @@ -251,19 +257,19 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ - if (cls_real->id<0 || cls_real->id>H5Z_FILTER_MAX) + if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if (cls_real->idid < H5Z_FILTER_RESERVED) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") - if (cls_real->filter==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") + if (cls_real->filter == NULL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ - if (H5Z_register (cls_real)<0) + if (H5Z_register (cls_real) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: @@ -277,39 +283,40 @@ done: * Purpose: Same as the public version except this one allows filters * to be set for predefined method numbers id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert (cls); + HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ - for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == cls->id) + for (i = 0; i < H5Z_table_used_g; i++) + if (H5Z_table_g[i].id == cls->id) break; /* Filter not already registered */ - if(i >= H5Z_table_used_g) { - if(H5Z_table_used_g >= H5Z_table_alloc_g) { - size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5Z_table_alloc_g); + if (i >= H5Z_table_used_g) { + if (H5Z_table_used_g >= H5Z_table_alloc_g) { + size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5Z_table_alloc_g); H5Z_class2_t *table = (H5Z_class2_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ - if(!table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") + if (!table) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") H5Z_table_g = table; #ifdef H5Z_DEBUG - if(!stat_table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") + if (!stat_table) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") H5Z_stat_table_g = stat_table; #endif /* H5Z_DEBUG */ H5Z_table_alloc_g = n; @@ -317,15 +324,21 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #ifdef H5Z_DEBUG - HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); + HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { + H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); + old_cls->name = (char *)H5MM_xstrdup(cls->name); } /* end else */ done: @@ -338,25 +351,26 @@ done: * * Purpose: This function unregisters a filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Zunregister(H5Z_filter_t id) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "Zf", id); /* Check args */ - if(id < 0 || id > H5Z_FILTER_MAX) + if (id < 0 || id > H5Z_FILTER_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if(id < H5Z_FILTER_RESERVED) + if (id < H5Z_FILTER_RESERVED) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if(H5Z_unregister(id) < 0) + if (H5Z_unregister(id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: @@ -370,27 +384,29 @@ done: * Purpose: Same as the public version except this one allows filters * to be unset for predefined method numbers =0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (filter_index=0; filter_index=H5Z_table_used_g) + if (filter_index >= H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") /* Initialize the structure object for iteration */ @@ -398,28 +414,32 @@ H5Z_unregister(H5Z_filter_t filter_id) object.found = FALSE; /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it") /* Iterate through all opened groups, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") /* Iterate through all opened files and flush them */ - if(H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) + if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + /* deallocate plugin info name */ + old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove(&H5Z_table_g[filter_index],&H5Z_table_g[filter_index+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove(&H5Z_stat_table_g[filter_index],&H5Z_stat_table_g[filter_index+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -431,10 +451,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister * - * Purpose: Check if an object uses the filter to be unregistered. + * Purpose: Check if an object uses the filter to be unregistered. * - * Return: TRUE if the object uses the filter. - * FALSE if not, NEGATIVE on error. + * Return: TRUE if the object uses the filter. + * FALSE if not, NEGATIVE on error. *------------------------------------------------------------------------- */ static htri_t @@ -446,12 +466,12 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) FUNC_ENTER_STATIC /* Get the plist structure of object creation */ - if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) + HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ - if((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -483,25 +503,25 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HDassert(obj_ptr); /* Get the group creation property */ - if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -510,13 +530,13 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister_dset_cb * - * Purpose: The callback function for H5Z_unregister. It iterates - * through all opened objects. If the object is a dataset - * or a group and it uses the filter to be unregistered, the - * function returns TRUE. + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened objects. If the object is a dataset + * or a group and it uses the filter to be unregistered, the + * function returns TRUE. * - * Return: TRUE if the object uses the filter. - * FALSE otherwise. + * Return: TRUE if the object uses the filter. + * FALSE otherwise. *------------------------------------------------------------------------- */ static int @@ -529,28 +549,28 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* Get the dataset creation property */ - if((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") + if ((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") /* Check if the filter is in the dataset creation property list */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -569,17 +589,17 @@ done: static int H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUSED *key) { - int ret_value = FALSE; /* Return value */ + int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* Call the flush routine for mounted file hierarchies. Do a global flush * if the file is opened for write */ - if(H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { - if(H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + if (H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { + if (H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -598,17 +618,17 @@ done: htri_t H5Zfilter_avail(H5Z_filter_t id) { - htri_t ret_value=FALSE; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "Zf", id); /* Check args */ - if(id<0 || id>H5Z_FILTER_MAX) + if (id < 0 || id > H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + if ((ret_value = H5Z_filter_avail(id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -626,21 +646,25 @@ done: htri_t H5Z_filter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ - const H5Z_class2_t *filter_info; - htri_t ret_value = FALSE; /* Return value */ + size_t i; /* Local index variable */ + H5Z_class2_t *filter_info; + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ - for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == id) - HGOTO_DONE(TRUE) - - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") - HGOTO_DONE(TRUE) + for (i = 0; i < H5Z_table_used_g; i++) + if (H5Z_table_g[i].id == id) + HGOTO_DONE (TRUE) + + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE (TRUE) } done: FUNC_LEAVE_NOAPI(ret_value) @@ -666,59 +690,59 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(pline->nused > 0); /* Iterate over filters */ - for(u = 0; u < pline->nused; u++) { + for (u = 0; u < pline->nused; u++) { /* Get filter information */ - if(NULL == (fclass = H5Z_find(pline->filter[u].id))) { + if (NULL == (fclass = H5Z_find(pline->filter[u].id))) { /* Ignore errors from optional filters */ - if(pline->filter[u].flags & H5Z_FLAG_OPTIONAL) - H5E_clear_stack(NULL); + if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) + H5E_clear_stack (NULL); else - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ - switch(prelude_type) { + switch (prelude_type) { case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ - if(!fclass->encoder_present) - HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + if (!fclass->encoder_present) + HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ - if(fclass->can_apply) { + if (fclass->can_apply) { /* Make callback to filter's "can apply" function */ htri_t status = (fclass->can_apply)(dcpl_id, type_id, space_id); /* Indicate error during filter callback */ - if(status < 0) + if (status < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "error during user callback") /* Indicate filter can't apply to this combination of parameters. * If the filter is NOT optional, returns failure. */ - if(status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) + if (status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate") } /* end if */ break; case H5Z_PRELUDE_SET_LOCAL: /* Check if there is a "set local" callback */ - if(fclass->set_local) { + if (fclass->set_local) { /* Make callback to filter's "set local" function */ - if((fclass->set_local)(dcpl_id, type_id, space_id) < 0) + if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; default: - HDassert("invalid prelude type" && 0); + HDassert ("invalid prelude type" && 0); } /* end switch */ } /* end else */ } /* end for */ @@ -745,62 +769,62 @@ done: static herr_t H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { - hid_t space_id = -1; /* ID for dataspace describing chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + hid_t space_id = -1; /* ID for dataspace describing chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); + HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert (H5I_DATATYPE == H5I_get_type(type_id)); /* Check if the property list is non-default */ - if(dcpl_id != H5P_DATASET_CREATE_DEFAULT) { - H5P_genplist_t *dc_plist; /* Dataset creation property list object */ - H5O_layout_t dcpl_layout; /* Dataset's layout information */ + if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + H5O_layout_t dcpl_layout; /* Dataset's layout information */ /* Get dataset creation property list object */ - if(NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") + if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) + HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Peek at the layout information */ - if(H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") + if (H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") /* Check if the dataset is chunked */ - if(H5D_CHUNKED == dcpl_layout.type) { + if (H5D_CHUNKED == dcpl_layout.type) { H5O_pline_t dcpl_pline; /* Object's I/O pipeline information */ /* Get I/O pipeline information */ - if(H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") + if (H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") /* Check if the chunks have filters */ - if(dcpl_pline.nused > 0) { + if (dcpl_pline.nused > 0) { hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; /* Size of chunk dimensions */ - H5S_t *space; /* Dataspace describing chunk */ - size_t u; /* Local index variable */ + H5S_t *space; /* Dataspace describing chunk */ + size_t u; /* Local index variable */ - /* Create a data space for a chunk & set the extent */ - for(u = 0; u < dcpl_layout.u.chunk.ndims; u++) + /* Create a dataspace for a chunk & set the extent */ + for (u = 0; u < dcpl_layout.u.chunk.ndims; u++) chunk_dims[u] = dcpl_layout.u.chunk.dim[u]; - if(NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + if (NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) + HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ - if((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close(space); - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") + if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { + (void)H5S_close (space); + HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ /* Make the callbacks */ - if(H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") } /* end if */ } /* end if */ } /* end if */ done: - if(space_id > 0 && H5I_dec_ref(space_id) < 0) + if (space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") FUNC_LEAVE_NOAPI(ret_value) @@ -814,7 +838,8 @@ done: * property list can be applied to a particular combination of * datatype and dataspace for a dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure * * Notes: The chunk dimensions are used to create a dataspace, instead * of passing in the dataset's dataspace, since the chunk @@ -829,8 +854,8 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -844,7 +869,8 @@ done: * settings for filters on a new dataset, based on the datatype * and dataspace of that dataset (chunk). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure * * Notes: The chunk dimensions are used to create a dataspace, instead * of passing in the dataset's dataspace, since the chunk @@ -859,8 +885,8 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -874,7 +900,8 @@ done: * applied to an opaque byte stream (currently only a group). * The pipeline is assumed to have at least one filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -884,11 +911,11 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -902,7 +929,8 @@ done: * new opaque object. The pipeline is assumed to have at * least one filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure * * Notes: This callback will almost certainly not do anything * useful, other than to make certain that the filter will @@ -916,11 +944,11 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -930,58 +958,59 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_modify * - * Purpose: Modify filter parameters for specified pipeline. + * Purpose: Modify filter parameters for specified pipeline. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - size_t idx; /* Index of filter in pipeline */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; /* Index of filter in pipeline */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx > pline->nused) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + if (idx > pline->nused) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Change parameters for filter */ pline->filter[idx].flags = flags; pline->filter[idx].cd_nelmts = cd_nelmts; /* Free any existing parameters */ - if(pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) H5MM_xfree(pline->filter[idx].cd_values); /* Set parameters */ - if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) - pline->filter[idx].cd_values[i] = cd_values[i]; + for (i = 0; i < cd_nelmts; i++) + pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else pline->filter[idx].cd_values = NULL; @@ -996,36 +1025,37 @@ done: * * Purpose: Append another filter to the specified pipeline. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - size_t idx; - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may * decide to relax this restriction in the future. */ - if(pline->nused >= H5Z_MAX_NFILTERS) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") + if (pline->nused >= H5Z_MAX_NFILTERS) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") /* Check for freshly allocated filter pipeline */ - if(pline->version == 0) + if (pline->version == 0) pline->version = H5O_PLINE_VERSION_1; /* Allocate additional space in the pipeline if it's full */ - if(pline->nused >= pline->nalloc) { + if (pline->nused >= pline->nalloc) { H5O_pline_t x; size_t n; @@ -1036,14 +1066,14 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, * filter struct is reallocated. Set these pointers to ~NULL * so that we can reset them after reallocating the filters array. */ - for(n = 0; n < pline->nalloc; ++n) - if(pline->filter[n].cd_values == pline->filter[n]._cd_values) + for (n = 0; n < pline->nalloc; ++n) + if (pline->filter[n].cd_values == pline->filter[n]._cd_values) pline->filter[n].cd_values = (unsigned *)((void *) ~((size_t)NULL)); x.nalloc = MAX(H5Z_MAX_NFILTERS, 2 * pline->nalloc); x.filter = (H5Z_filter_info_t *)H5MM_realloc(pline->filter, x.nalloc * sizeof(x.filter[0])); - if(NULL == x.filter) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") + if (NULL == x.filter) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") /* Fix pointers in previous filters that need to point to their own * internal data. @@ -1061,22 +1091,22 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, idx = pline->nused; pline->filter[idx].id = filter; pline->filter[idx].flags = flags; - pline->filter[idx].name = NULL; /* we'll pick it up later*/ + pline->filter[idx].name = NULL; /*we'll pick it up later*/ pline->filter[idx].cd_nelmts = cd_nelmts; - if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) + for (i = 0; i < cd_nelmts; i++) pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else @@ -1095,8 +1125,8 @@ done: * Purpose: Given a filter ID return the offset in the global array * that holds all the registered filters. * - * Return: Success: Non-negative index of entry in global filter table. - * Failure: Negative + * Return: Success: Non-negative index of entry in global filter table. + * Failure: Negative *------------------------------------------------------------------------- */ static int @@ -1107,9 +1137,9 @@ H5Z_find_idx(H5Z_filter_t id) FUNC_ENTER_NOAPI_NOINIT_NOERR - for (i=0; ifilter[].flags). The filters are processed in - * definition order unless the H5Z_FLAG_REVERSE is set. The - * FILTER_MASK is a bit-mask to indicate which filters to skip - * and on exit will indicate which filters failed. Each - * filter has an index number in the pipeline and that index - * number is the filter's bit in the FILTER_MASK. NBYTES is the - * number of bytes of data to filter and on exit should be the - * number of resulting bytes while BUF_SIZE holds the total - * allocated size of the buffer, which is pointed to BUF. - * - * If the buffer must grow during processing of the pipeline - * then the pipeline function should free the original buffer - * and return a fresh buffer, adjusting BUF_SIZE accordingly. - * - * Return: Non-negative on success/Negative on failure + * Purpose: Process data through the filter pipeline. The FLAGS argument + * is the filter invocation flags (definition flags come from + * the PLINE->filter[].flags). The filters are processed in + * definition order unless the H5Z_FLAG_REVERSE is set. The + * FILTER_MASK is a bit-mask to indicate which filters to skip + * and on exit will indicate which filters failed. Each + * filter has an index number in the pipeline and that index + * number is the filter's bit in the FILTER_MASK. NBYTES is the + * number of bytes of data to filter and on exit should be the + * number of resulting bytes while BUF_SIZE holds the total + * allocated size of the buffer, which is pointed to BUF. + * + * If the buffer must grow during processing of the pipeline + * then the pipeline function should free the original buffer + * and return a fresh buffer, adjusting BUF_SIZE accordingly. + * + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1174,51 +1205,55 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/) { - size_t i, idx, new_nbytes; - int fclass_idx; /* Index of filter class in global table */ - H5Z_class2_t *fclass = NULL; /* Filter class pointer */ + size_t i, idx, new_nbytes; + int fclass_idx; /* Index of filter class in global table */ + H5Z_class2_t *fclass=NULL; /* Filter class pointer */ #ifdef H5Z_DEBUG - H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ + H5Z_stats_t *fstats=NULL; /* Filter stats pointer */ H5_timer_t timer; #endif - unsigned failed = 0; - unsigned tmp_flags; - herr_t ret_value = SUCCEED; /* Return value */ + unsigned failed = 0; + unsigned tmp_flags; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); - HDassert(filter_mask); - HDassert(nbytes && *nbytes > 0); - HDassert(buf_size && *buf_size > 0); - HDassert(buf && *buf); - HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); + HDassert (filter_mask); + HDassert (nbytes && *nbytes>0); + HDassert (buf_size && *buf_size>0); + HDassert (buf && *buf); + HDassert (!pline || pline->nusednused; i > 0; --i) { - idx = i - 1; + idx = i-1; if (*filter_mask & ((unsigned)1 << idx)) { failed |= (unsigned)1 << idx; - continue;/*filter excluded*/ + continue; /* filter excluded */ } /* If the filter isn't registered and the application doesn't - * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), - * try to load it dynamically and register it. Otherwise, return failure - */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), + * try to load it dynamically and register it. Otherwise, return failure + */ + if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - const H5Z_class2_t *filter_info; + H5Z_class2_t *filter_info; /* Try loading the filter */ - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { /* Register the filter we loaded */ - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; } /* end if */ else @@ -1227,8 +1262,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Check for error */ if(issue_error) { /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) + * the filter */ + if (pline->filter[idx].name) HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") @@ -1238,26 +1273,26 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + H5_timer_begin (&timer); #endif - tmp_flags = flags|(pline->filter[idx].flags); + tmp_flags = flags | (pline->filter[idx].flags); tmp_flags |= (edc_read== H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[1].timer), &timer); + H5_timer_end (&(fstats->stats[1].timer), &timer); fstats->stats[1].total += MAX(*nbytes, new_nbytes); if (0 == new_nbytes) fstats->stats[1].errors += *nbytes; #endif - if(0==new_nbytes) { - if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") + if (0 == new_nbytes) { + if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) + HGOTO_ERROR (H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } else { *nbytes = new_nbytes; @@ -1276,35 +1311,34 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); continue; /*filter excluded*/ } fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + H5_timer_begin (&timer); #endif - new_nbytes = (fclass->filter)(flags|(pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[0].timer), &timer); + H5_timer_end (&(fstats->stats[0].timer), &timer); fstats->stats[0].total += MAX(*nbytes, new_nbytes); if (0 == new_nbytes) fstats->stats[0].errors += *nbytes; #endif - if(0 == new_nbytes) { + if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") + if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) + HGOTO_ERROR (H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; } failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } @@ -1320,7 +1354,8 @@ done: * * Purpose: Get pointer to filter info for pipeline * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ H5Z_filter_info_t * @@ -1331,17 +1366,17 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx >= pline->nused) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") + if (idx >= pline->nused) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ ret_value = &pline->filter[idx]; @@ -1365,21 +1400,21 @@ done: htri_t H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) { - size_t idx; /* Index of filter in pipeline */ - htri_t ret_value = TRUE; /* Return value */ + size_t idx; /* Index of filter in pipeline */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx >= pline->nused) + if (idx >= pline->nused) ret_value = FALSE; done: @@ -1394,30 +1429,31 @@ done: * Purpose: Verify that all the filters in a pipeline are currently * available (i.e. registered) * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: Non-negative (TRUE/FALSE) on success + * Negative on failure *------------------------------------------------------------------------- */ htri_t H5Z_all_filters_avail(const H5O_pline_t *pline) { - size_t i,j; /* Local index variable */ - htri_t ret_value=TRUE; /* Return value */ + size_t i, j; /* Local index variable */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); + HDassert (pline); /* Iterate through all the filters in pipeline */ - for(i = 0; i < pline->nused; i++) { + for (i = 0; i < pline->nused; i++) { /* Look for each filter in the list of registered filters */ - for(j = 0; j < H5Z_table_used_g; j++) - if(H5Z_table_g[j].id == pline->filter[i].id) + for (j = 0; j < H5Z_table_used_g; j++) + if (H5Z_table_g[j].id == pline->filter[i].id) break; /* Check if we didn't find the filter */ - if(j == H5Z_table_used_g) - HGOTO_DONE(FALSE) + if (j == H5Z_table_used_g) + HGOTO_DONE (FALSE) } /* end for */ done: @@ -1432,7 +1468,8 @@ done: * Purpose: Delete filter FILTER from pipeline PLINE; * deletes all filters if FILTER is H5Z_FILTER_NONE * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1443,52 +1480,52 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ - if(pline->nused == 0) - HGOTO_DONE(SUCCEED) + if (pline->nused == 0) + HGOTO_DONE (SUCCEED) /* Delete all filters */ - if(H5Z_FILTER_ALL == filter) { - if(H5O_msg_reset(H5O_PLINE_ID, pline) < 0) + if (H5Z_FILTER_ALL == filter) { + if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") } /* end if */ /* Delete filter */ else { - size_t idx; /* Index of filter in pipeline */ - hbool_t found = FALSE; /* Indicate filter was found in pipeline */ + size_t idx; /* Index of filter in pipeline */ + hbool_t found = FALSE; /* Indicate filter was found in pipeline */ /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) { + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) { found = TRUE; break; } /* end if */ /* filter was not found in the pipeline */ - if(!found) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + if (!found) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ - if(pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); - if(pline->filter[idx].name != pline->filter[idx]._name) + if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) + HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); - if(pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); - if(pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); /* Remove filter from pipeline array */ - if((idx + 1) < pline->nused) { + if ((idx + 1) < pline->nused) { /* Copy filters down & fix up any client data value arrays using internal storage */ - for(; (idx + 1) < pline->nused; idx++) { + for (; (idx + 1) < pline->nused; idx++) { pline->filter[idx] = pline->filter[idx + 1]; - if(pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) + if (pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) pline->filter[idx].name = pline->filter[idx]._name; - if(pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) + if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; } /* end for */ } /* end if */ @@ -1497,7 +1534,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->nused--; /* Reset information for previous last filter in pipeline */ - HDmemset(&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); + HDmemset (&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); } /* end else */ done: @@ -1510,6 +1547,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1521,8 +1561,8 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); /* Get the filter info */ - if(H5Z_get_filter_info(filter, filter_config_flags) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") + if (H5Z_get_filter_info(filter, filter_config_flags) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") done: FUNC_LEAVE_API(ret_value) @@ -1534,6 +1574,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1545,16 +1588,16 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) FUNC_ENTER_NOAPI(FAIL) /* Look up the filter class info */ - if(NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + if (NULL == (fclass = H5Z_find(filter))) + HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ - if(filter_config_flags != NULL) { + if (filter_config_flags != NULL) { *filter_config_flags = 0; - if(fclass->encoder_present) + if (fclass->encoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_ENCODE_ENABLED; - if(fclass->decoder_present) + if (fclass->decoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_DECODE_ENABLED; } /* end if */ -- cgit v0.12 From fbae544330037bdaec14238a6486e8d0677eae4b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 15:00:13 -0600 Subject: Fix typo --- src/H5PLint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index e969cbf..33dda96 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -372,7 +372,7 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v done: if (!success && handle) - if (*plugin_info) { + if (*plugin_info) *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") -- cgit v0.12 From 6019c126c40d836a53a7b0eeb9b6873683206319 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 13:59:57 -0600 Subject: HDFFV-10328 - remove allocation changes --- src/H5PLint.c | 21 +-------------------- src/H5PLplugin_cache.c | 22 +--------------------- src/H5Z.c | 33 ++++----------------------------- 3 files changed, 6 insertions(+), 70 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index 33dda96..c887f86 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,38 +342,19 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { - H5Z_class2_t *plugin_copy = NULL; /* Store the plugin in the cache */ if (H5PL__add_plugin(type, id, handle)) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") - /* allocate local copy of plugin info */ - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = (const void *)info; - - plugin_copy->version = info->version; - plugin_copy->id = info->id; - plugin_copy->encoder_present = info->encoder_present; - plugin_copy->decoder_present = info->decoder_present; - plugin_copy->can_apply = info->can_apply; - plugin_copy->set_local = info->set_local; - plugin_copy->filter = info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *success = TRUE; + *plugin_info = (const void *)info; } } done: if (!success && handle) - if (*plugin_info) - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index ec14159..e483e01 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,7 +280,6 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; - H5Z_class2_t *plugin_copy = NULL; /* Get the "get plugin info" function from the plugin. */ if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_cache_g[u]).handle, "H5PLget_plugin_info"))) @@ -290,24 +289,9 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = plugin_copy; - - plugin_copy->version = filter_info->version; - plugin_copy->id = filter_info->id; - plugin_copy->encoder_present = filter_info->encoder_present; - plugin_copy->decoder_present = filter_info->decoder_present; - plugin_copy->can_apply = filter_info->can_apply; - plugin_copy->set_local = filter_info->set_local; - plugin_copy->filter = filter_info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *found = TRUE; + *plugin_info = filter_info; /* No need to continue processing */ break; @@ -317,10 +301,6 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: - /* unallocate local copy of plugin info on failure */ - if (FAIL == ret_value && *plugin_info) { - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); - } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index e7574cd..1f1a905 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -123,7 +123,6 @@ int H5Z_term_package(void) { int n = 0; - size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -131,6 +130,7 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; + size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,12 +179,6 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ - for (i = 0; i < H5Z_table_used_g; i++) { - H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (cls->name) - cls->name = (char *)H5MM_xfree(cls->name); - } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -325,20 +319,14 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); - H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #ifdef H5Z_DEBUG HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { - H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); - old_cls->name = (char *)H5MM_xstrdup(cls->name); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -394,7 +382,6 @@ H5Z_unregister(H5Z_filter_t filter_id) size_t filter_index; /* Local index variable for filter */ H5Z_object_t object; herr_t ret_value = SUCCEED; /* Return value */ - H5Z_class2_t *old_cls = NULL; FUNC_ENTER_NOAPI(FAIL) @@ -431,10 +418,6 @@ H5Z_unregister(H5Z_filter_t filter_id) if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - /* deallocate plugin info name */ - old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); @@ -658,11 +641,7 @@ H5Z_filter_avail(H5Z_filter_t id) HGOTO_DONE (TRUE) if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + if (H5Z_register (filter_info) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") HGOTO_DONE (TRUE) } @@ -1245,11 +1224,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Try loading the filter */ if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { /* Register the filter we loaded */ - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + if (H5Z_register(filter_info < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ -- cgit v0.12 From 7aad737c9613712429ffb956d15938c34ee6363e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:02:07 -0600 Subject: HDFFV-10328 remove allocation note --- release_docs/RELEASE.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9e3c3a9..a1b59b1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -160,8 +160,7 @@ Bug Fixes since HDF5-1.10.1 release - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by - filter plugins had issues with memory allocation and library - dependencies. + filter plugins had issues with library dependencies. CMake build process changed to use LINK INTERFACE keywords, which allowed HDF5 C library to make dependent libraries private. The @@ -169,13 +168,6 @@ Bug Fixes since HDF5-1.10.1 release (such as szip or zlib) to be available. (ADB - 2017/11/16, HDFFV-10328) - The H5Z_class2_t structure returned by the filter plugins are - now dynamically allocated in H5Zregister function. Access to - the functions in the filter library now always use the dynamic - library API. - - (ADB - 2017/11/16, HDFFV-10329) - - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From 459e214ed5c48cdee335fe02f4534ab48ac49e3e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:20:14 -0600 Subject: HDFFV-10328 - fix typos --- src/H5Z.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 1f1a905..a9f7336 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1219,12 +1219,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - H5Z_class2_t *filter_info; + const H5Z_class2_t *filter_info; /* Try loading the filter */ if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { /* Register the filter we loaded */ - if (H5Z_register(filter_info < 0) + if (H5Z_register(filter_info) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, issue_error = TRUE; /* Check for error */ - if(issue_error) { + if (issue_error) { /* Print out the filter name to give more info. But the name is optional for * the filter */ if (pline->filter[idx].name) @@ -1269,9 +1269,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } else if (pline) { /* Write */ -- cgit v0.12 From d5b70b549e41a1a48e3745cb2c076e8953b60a71 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 17 Nov 2017 15:21:49 -0800 Subject: Brings H5Z and H5PL packages in sync with VOL integration branch. --- src/H5PLint.c | 62 +++-- src/H5PLpath.c | 4 +- src/H5PLpkg.h | 8 +- src/H5PLplugin_cache.c | 14 +- src/H5PLprivate.h | 7 +- src/H5PLpublic.h | 6 +- src/H5Z.c | 173 ++++++------ test/error_test.c | 416 ++++++++++++++--------------- test/testfiles/error_test_1 | 2 +- tools/test/h5dump/errfiles/filter_fail.err | 2 +- 10 files changed, 352 insertions(+), 342 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..b190746 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -235,11 +235,11 @@ done: *------------------------------------------------------------------------- */ const void * -H5PL_load(H5PL_type_t type, int id) +H5PL_load(H5PL_type_t type, H5PL_key_t key) { - H5PL_search_params_t search_params; + H5PL_search_params_t search_params; /* Plugin search parameters */ hbool_t found = FALSE; /* Whether the plugin was found */ - const void *plugin_info = NULL; + const void *plugin_info = NULL; /* Information from the plugin */ const void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) @@ -248,18 +248,17 @@ H5PL_load(H5PL_type_t type, int id) switch (type) { case H5PL_TYPE_FILTER: if ((H5PL_plugin_control_mask_g & H5PL_FILTER_PLUGIN) == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "filter plugins disabled") break; - case H5PL_TYPE_ERROR: case H5PL_TYPE_NONE: default: - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin '%d' is not valid", id) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "Invalid plugin type specified") } /* Set up the search parameters */ search_params.type = type; - search_params.id = id; + search_params.key.id = key.id; /* Search in the table of already loaded plugin libraries */ if(H5PL__find_plugin_in_cache(&search_params, &found, &plugin_info) < 0) @@ -304,11 +303,11 @@ done: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" herr_t -H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const void **plugin_info) +H5PL__open(const char *path, H5PL_type_t type, H5PL_key_t key, hbool_t *success, const void **plugin_info) { H5PL_HANDLE handle = NULL; H5PL_get_plugin_info_t get_plugin_info = NULL; - htri_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -326,35 +325,46 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v */ if (NULL == (handle = H5PL_OPEN_DLIB(path))) { H5PL_CLR_ERROR; /* clear error */ - HGOTO_DONE(SUCCEED); + HGOTO_DONE(SUCCEED) } /* Return a handle for the function H5PLget_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ - if (NULL != (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { - - const H5Z_class2_t *info; + if (NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) + HGOTO_DONE(SUCCEED) - /* Get the plugin info */ - if (NULL == (info = (const H5Z_class2_t *)(*get_plugin_info)())) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + /* Get the plugin information */ + switch (type) { + case H5PL_TYPE_FILTER: + { + const H5Z_class2_t *filter_info; - /* Check if the filter IDs match */ - if (info->id == id) { + /* Get the plugin info */ + if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info)())) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get filter info from plugin") - /* Store the plugin in the cache */ - if (H5PL__add_plugin(type, id, handle)) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") + /* If the filter IDs match, we're done. Set the output parameters. */ + if (filter_info->id == key.id) { + *plugin_info = (const void *)filter_info; + *success = TRUE; + } - /* Set output parameters */ - *success = TRUE; - *plugin_info = (const void *)info; + break; } - } + case H5PL_TYPE_ERROR: + case H5PL_TYPE_NONE: + default: + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "Invalid plugin type specified") + } /* end switch */ + + /* If we found the correct plugin, store it in the cache */ + if (*success) + if (H5PL__add_plugin(type, key, handle)) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") done: - if (!success && handle) + if (!(*success) && handle) if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 435802a..d8e82f8 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -689,7 +689,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 0d1c271..dfaa4af 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -115,8 +115,8 @@ /* Data used to search for plugins */ typedef struct H5PL_search_params_t { - H5PL_type_t type; - int id; + H5PL_type_t type; + H5PL_key_t key; } H5PL_search_params_t; @@ -134,13 +134,13 @@ H5_DLL herr_t H5PL__get_plugin_control_mask(unsigned int *mask /*out*/); H5_DLL herr_t H5PL__set_plugin_control_mask(unsigned int mask); /* Plugin search and manipulation */ -H5_DLL herr_t H5PL__open(const char *libname, H5PL_type_t type, int id, hbool_t *success /*out*/, const void **plugin_info /*out*/); +H5_DLL herr_t H5PL__open(const char *libname, H5PL_type_t type, H5PL_key_t key, hbool_t *success /*out*/, const void **plugin_info /*out*/); H5_DLL herr_t H5PL__close(H5PL_HANDLE handle); /* Plugin cache calls */ H5_DLL herr_t H5PL__create_plugin_cache(void); H5_DLL herr_t H5PL__close_plugin_cache(hbool_t *already_closed /*out*/); -H5_DLL herr_t H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle); +H5_DLL herr_t H5PL__add_plugin(H5PL_type_t type, H5PL_key_t key, H5PL_HANDLE handle); H5_DLL herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found /*out*/, const void **plugin_info /*out*/); /* Plugin search path calls */ diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index e483e01..e905ac2 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -56,9 +56,9 @@ /* Type for the list of info for opened plugin libraries */ typedef struct H5PL_plugin_t { - H5PL_type_t type; /* Plugin type */ - int id; /* ID for the plugin */ - H5PL_HANDLE handle; /* Plugin handle */ + H5PL_type_t type; /* Plugin type */ + H5PL_key_t key; /* Unique key to identify the plugin */ + H5PL_HANDLE handle; /* Plugin handle */ } H5PL_plugin_t; @@ -209,14 +209,14 @@ done: /*------------------------------------------------------------------------- * Function: H5PL__add_plugin * - * Purpose: Add a plugin to the plugin cached. + * Purpose: Add a plugin to the plugin cache. * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) +H5PL__add_plugin(H5PL_type_t type, H5PL_key_t key, H5PL_HANDLE handle) { herr_t ret_value = SUCCEED; @@ -229,7 +229,7 @@ H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) /* Store the plugin info and bump the # of plugins */ H5PL_cache_g[H5PL_num_plugins_g].type = type; - H5PL_cache_g[H5PL_num_plugins_g].id = id; + H5PL_cache_g[H5PL_num_plugins_g].key = key; H5PL_cache_g[H5PL_num_plugins_g].handle = handle; H5PL_num_plugins_g++; @@ -276,7 +276,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f for (u = 0; u < H5PL_num_plugins_g; u++) { /* If the plugin type (filter, etc.) and ID match, query the plugin for its info */ - if ((search_params->type == (H5PL_cache_g[u]).type) && (search_params->id == (H5PL_cache_g[u]).id)) { + if ((search_params->type == (H5PL_cache_g[u]).type) && (search_params->key.id == (H5PL_cache_g[u]).key.id)) { H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index bc12e64..cc2e258 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -33,6 +33,11 @@ /* Library Private Typedefs */ /****************************/ +/* The key that will be used to find the plugin */ +typedef union H5PL_key_t { + int id; /* filters */ +} H5PL_key_t; + /*****************************/ /* Library-private Variables */ @@ -44,7 +49,7 @@ /***************************************/ /* Internal API routines */ -H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, H5PL_key_t key); #endif /* _H5PLprivate_H */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 3b36ccd..fe5bdfb 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -30,9 +30,9 @@ /* Plugin type used by the plugin library */ typedef enum H5PL_type_t { - H5PL_TYPE_ERROR = -1, /* Error */ - H5PL_TYPE_FILTER = 0, /* Filter */ - H5PL_TYPE_NONE = 1 /* This must be last! */ + H5PL_TYPE_ERROR = -1, /* Error */ + H5PL_TYPE_FILTER = 0, /* Filter */ + H5PL_TYPE_NONE = 1 /* This must be last! */ } H5PL_type_t; /* Common dynamic plugin type flags used by the set/get_loading_state functions */ diff --git a/src/H5Z.c b/src/H5Z.c index a9f7336..1e7cd79 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -86,24 +86,24 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if (H5Z_register (H5Z_SHUFFLE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if (H5Z_register (H5Z_FLETCHER32) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if (H5Z_register (H5Z_NBIT) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if (H5Z_register (H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register(H5Z_SHUFFLE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register(H5Z_FLETCHER32) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register(H5Z_NBIT) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register(H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if (H5Z_register (H5Z_DEFLATE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") + if (H5Z_register(H5Z_DEFLATE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_register (H5Z_SZIP) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") + if (H5Z_register(H5Z_SZIP) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ done: @@ -180,7 +180,7 @@ H5Z_term_package(void) } /* end if */ #endif /* H5Z_DEBUG */ /* Free the table of filters */ - if(H5Z_table_g) { + if (H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); #ifdef H5Z_DEBUG H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); @@ -191,7 +191,7 @@ H5Z_term_package(void) } /* end if */ /* Mark interface as closed */ - if(0 == n) + if (0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -219,7 +219,7 @@ H5Zregister(const void *cls) /* Check args */ if (cls_real==NULL) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class") /* Check H5Z_class_t version number; this is where a function to convert * from an outdated version should be called. @@ -251,20 +251,20 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if (cls_real->id < H5Z_FILTER_RESERVED) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") if (cls_real->filter == NULL) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ - if (H5Z_register (cls_real) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + if (H5Z_register(cls_real) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: FUNC_LEAVE_API(ret_value) @@ -289,8 +289,8 @@ H5Z_register (const H5Z_class2_t *cls) FUNC_ENTER_NOAPI(FAIL) - HDassert (cls); - HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert(cls); + HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) @@ -306,11 +306,11 @@ H5Z_register (const H5Z_class2_t *cls) H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ if (!table) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") H5Z_table_g = table; #ifdef H5Z_DEBUG if (!stat_table) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") H5Z_stat_table_g = stat_table; #endif /* H5Z_DEBUG */ H5Z_table_alloc_g = n; @@ -318,15 +318,15 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG - HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); + HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { /* Replace old contents */ - HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -420,9 +420,9 @@ H5Z_unregister(H5Z_filter_t filter_id) /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -450,11 +450,11 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) /* Get the plist structure of object creation */ if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -487,11 +487,11 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void /* Get the group creation property */ if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -504,7 +504,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -536,11 +536,11 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * /* Get the dataset creation property */ if ((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") /* Check if the filter is in the dataset creation property list */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -553,7 +553,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -582,7 +582,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUS * if the file is opened for write */ if (H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { if (H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -608,10 +608,10 @@ H5Zfilter_avail(H5Z_filter_t id) /* Check args */ if (id < 0 || id > H5Z_FILTER_MAX) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if ((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -629,22 +629,25 @@ done: htri_t H5Z_filter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ - H5Z_class2_t *filter_info; - htri_t ret_value = FALSE; /* Return value */ + H5PL_key_t key; /* Key for finding a plugin */ + const H5Z_class2_t *filter_info; /* Filter information */ + size_t i; /* Local index variable */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) - HGOTO_DONE (TRUE) + HGOTO_DONE(TRUE) - if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - if (H5Z_register (filter_info) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") - HGOTO_DONE (TRUE) + key.id = (int)id; + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { + if (H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE(TRUE) } + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_filter_avail() */ @@ -683,7 +686,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) H5E_clear_stack (NULL); else - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ @@ -691,7 +694,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ if (!fclass->encoder_present) - HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ @@ -716,7 +719,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, /* Make callback to filter's "set local" function */ if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; @@ -753,8 +756,8 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type FUNC_ENTER_NOAPI_NOINIT - HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert (H5I_DATATYPE == H5I_get_type(type_id)); + HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert(H5I_DATATYPE == H5I_get_type(type_id)); /* Check if the property list is non-default */ if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { @@ -834,7 +837,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -865,7 +868,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -894,7 +897,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -927,7 +930,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -952,10 +955,10 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -964,7 +967,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, /* Check if the filter was not already in the pipeline */ if (idx > pline->nused) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Change parameters for filter */ pline->filter[idx].flags = flags; @@ -982,7 +985,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1017,10 +1020,10 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may @@ -1052,13 +1055,13 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, x.nalloc = MAX(H5Z_MAX_NFILTERS, 2 * pline->nalloc); x.filter = (H5Z_filter_info_t *)H5MM_realloc(pline->filter, x.nalloc * sizeof(x.filter[0])); if (NULL == x.filter) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") /* Fix pointers in previous filters that need to point to their own * internal data. */ - for(n = 0; n < pline->nalloc; ++n) - if(x.filter[n].cd_values == (void *) ~((size_t) NULL)) + for (n = 0; n < pline->nalloc; ++n) + if (x.filter[n].cd_values == (void *) ~((size_t) NULL)) x.filter[n].cd_values = x.filter[n]._cd_values; /* Point to newly allocated buffer */ @@ -1079,7 +1082,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1118,7 +1121,7 @@ H5Z_find_idx(H5Z_filter_t id) for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) - HGOTO_DONE ((int)i) + HGOTO_DONE((int)i) done: FUNC_LEAVE_NOAPI(ret_value) @@ -1145,10 +1148,10 @@ H5Z_find(H5Z_filter_t id) /* Get the index in the global table */ if ((idx = H5Z_find_idx(id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ - ret_value = H5Z_table_g+idx; + ret_value = H5Z_table_g + idx; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1219,13 +1222,15 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; + H5PL_key_t key; const H5Z_class2_t *filter_info; /* Try loading the filter */ - if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + key.id = (int)(pline->filter[idx].id); + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { /* Register the filter we loaded */ - if (H5Z_register(filter_info) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) @@ -1263,7 +1268,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, if (0 == new_nbytes) { if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR (H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; @@ -1303,7 +1308,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR (H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; } @@ -1350,7 +1355,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) /* Check if the filter was not already in the pipeline */ if (idx >= pline->nused) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ ret_value = &pline->filter[idx]; @@ -1427,7 +1432,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) /* Check if we didn't find the filter */ if (j == H5Z_table_used_g) - HGOTO_DONE (FALSE) + HGOTO_DONE(FALSE) } /* end for */ done: @@ -1480,7 +1485,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* filter was not found in the pipeline */ if (!found) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) @@ -1563,7 +1568,7 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) /* Look up the filter class info */ if (NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ if (filter_config_flags != NULL) { diff --git a/test/error_test.c b/test/error_test.c index 9c39065..5356fa7 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -82,35 +82,33 @@ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, /*------------------------------------------------------------------------- - * Function: test_error + * Function: test_error * - * Purpose: Test error API functions + * Purpose: Test error API functions * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_error(hid_t file) { - hid_t dataset, space; - hid_t estack_id; + hid_t dataset = -1; + hid_t space = -1; + hid_t estack_id = -1; hsize_t dims[2]; const char *FUNC_test_error = "test_error"; H5E_auto2_t old_func; - void *old_data; + void *old_data = NULL; HDfprintf(stderr, "\nTesting error API based on data I/O\n"); /* Create the data space */ dims[0] = DIM0; dims[1] = DIM1; - if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; + if ((space = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR; /* Test H5E_BEGIN_TRY */ H5E_BEGIN_TRY { @@ -118,40 +116,40 @@ test_error(hid_t file) } H5E_END_TRY; /* Create the dataset */ - if((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "H5Dcreate2 failed"); goto error; - } /* end if */ + } /* Test enabling and disabling default printing */ - if(H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) - TEST_ERROR; - if(old_data != NULL) - TEST_ERROR; + if (H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) + TEST_ERROR; + if (old_data != NULL) + TEST_ERROR; #ifdef H5_USE_16_API if (old_func != (H5E_auto_t)H5Eprint) - TEST_ERROR; + TEST_ERROR; #else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) - TEST_ERROR; + TEST_ERROR; #endif /* H5_USE_16_API */ - if(H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) + if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) TEST_ERROR; /* Make H5Dwrite fail, verify default print is disabled */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite shouldn't succeed"); goto error; - } /* end if */ + } - if(H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) + if (H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) TEST_ERROR; /* Test saving and restoring the current error stack */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite failed as supposed to"); estack_id = H5Eget_current_stack(); @@ -159,10 +157,11 @@ test_error(hid_t file) H5Sclose(space); H5Eset_current_stack(estack_id); goto error; - } /* end if */ + } /* In case program comes to this point, close dataset */ - if(H5Dclose(dataset) < 0) TEST_ERROR; + if(H5Dclose(dataset) < 0) + TEST_ERROR; TEST_ERROR; @@ -172,16 +171,12 @@ test_error(hid_t file) /*------------------------------------------------------------------------- - * Function: init_error + * Function: init_error * - * Purpose: Initialize error information. + * Purpose: Initialize error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -194,46 +189,46 @@ init_error(void) char *msg = NULL; H5E_type_t msg_type; - if(NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) + if (NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) TEST_ERROR - if(NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) + if (NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) TEST_ERROR - if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) + if ((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) TEST_ERROR; - if(cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) + if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) TEST_ERROR; - if(HDstrcmp(ERR_CLS_NAME, cls_name)) + if (HDstrcmp(ERR_CLS_NAME, cls_name)) TEST_ERROR; - if((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) + if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) + if ((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) + if ((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) + if ((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) + if ((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) + if ((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) + if ((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) + if ((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) TEST_ERROR; - if(msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) + if (msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) TEST_ERROR; - if(msg_type != H5E_MINOR) + if (msg_type != H5E_MINOR) TEST_ERROR; - if(HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) + if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) TEST_ERROR; /* Register another class for later testing. */ - if((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) + if ((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) TEST_ERROR; HDfree(cls_name); @@ -242,9 +237,9 @@ init_error(void) return 0; error: - if(cls_name) + if (cls_name) HDfree(cls_name); - if(msg) + if (msg) HDfree(msg); return -1; @@ -252,16 +247,12 @@ error: /*------------------------------------------------------------------------- - * Function: error_stack - * - * Purpose: Manipulates current error stack. + * Function: error_stack * - * Return: Success: 0 + * Purpose: Manipulates current error stack. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 14, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -271,23 +262,23 @@ error_stack(void) ssize_t err_num; const char *FUNC_error_stack = "error_stack"; - if((err_num = H5Eget_num(H5E_DEFAULT)) < 0) + if ((err_num = H5Eget_num(H5E_DEFAULT)) < 0) TEST_ERROR; - if(err_num) + if (err_num) TEST_ERROR; - if((ERR_STACK = H5Eget_current_stack()) < 0) + if ((ERR_STACK = H5Eget_current_stack()) < 0) TEST_ERROR; /* Make it push error, force this function to fail */ - if((err_num = H5Eget_num(ERR_STACK)) == 0) { + if ((err_num = H5Eget_num(ERR_STACK)) == 0) { H5Epush(ERR_STACK, __FILE__, FUNC_error_stack, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_GETNUM, "Get number test failed, returned %d", (int)err_num); goto error; - } /* end if */ + } /* In case program falls through here, close the stack and let it fail. */ - if(H5Eclose_stack(ERR_STACK) < 0) + if (H5Eclose_stack(ERR_STACK) < 0) TEST_ERROR; return -1; @@ -300,14 +291,10 @@ error: /*------------------------------------------------------------------------- * Function: long_desc_cb * - * Purpose: Callback function to help test long description handling - * - * Return: Success: 0 + * Purpose: Callback function to help test long description handling * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -316,24 +303,20 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie { char *real_desc = (char *)client_data; - if(err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) - return(0); + if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) + return 0; else - return(-1); + return -1; } /* end long_desc_cb() */ /*------------------------------------------------------------------------- - * Function: test_long_desc + * Function: test_long_desc * - * Purpose: Test long error description handling + * Purpose: Test long error description handling * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -347,56 +330,59 @@ test_long_desc(void) const char *test_FUNC = "test_long_desc"; /* Allocate space for the error description info */ - if(NULL == (long_desc = (char*)HDmalloc(LONG_DESC_SIZE))) TEST_ERROR; - if(NULL == (full_desc = (char*)HDmalloc(LONG_DESC_SIZE + 128))) TEST_ERROR; + if (NULL == (long_desc = (char *)HDmalloc(LONG_DESC_SIZE))) + TEST_ERROR; + if (NULL == (full_desc = (char *)HDmalloc(LONG_DESC_SIZE + 128))) + TEST_ERROR; /* Create the long part of the error description */ - for(u = 0; u < LONG_DESC_SIZE; u++) + for (u = 0; u < LONG_DESC_SIZE; u++) long_desc[u] = (char)('A' + (u % 26)); long_desc[LONG_DESC_SIZE - 1] = '\0'; /* Clear the default error stack */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) + TEST_ERROR; /* Create the string that should be in the description. Must use HDsnprintf here - * because snprintf is _snprintf on Windows */ + * because snprintf is _snprintf on Windows + */ HDsnprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc); /* Make certain that the description is correct */ - if(H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) TEST_ERROR; + if (H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) + TEST_ERROR; /* Clear the default error stack again */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; HDfree(long_desc); HDfree(full_desc); - return(0); + return 0; error: - if(long_desc) + if (long_desc) HDfree(long_desc); - if(full_desc) + if (full_desc) HDfree(full_desc); - return(-1); + return -1; } /* end test_long_desc() */ /*------------------------------------------------------------------------- * Function: dump_error * - * Purpose: Prints error stack in default and customized ways. + * Purpose: Prints error stack in default and customized ways. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -405,12 +391,12 @@ dump_error(hid_t estack) { /* Print errors in library default way */ HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); - if(H5Eprint2(estack, stderr) < 0) + if (H5Eprint2(estack, stderr) < 0) TEST_ERROR; /* Customized way to print errors */ HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); - if(H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) + if (H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) TEST_ERROR; return 0; @@ -423,34 +409,30 @@ error: /*------------------------------------------------------------------------- * Function: custom_print_cb * - * Purpose: Callback function to print error stack in customized way. - * - * Return: Success: 0 + * Purpose: Callback function to print error stack in customized way. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data) { - FILE *stream = (FILE *)client_data; + FILE *stream = (FILE *)client_data; char maj[MSG_SIZE]; char min[MSG_SIZE]; char cls[MSG_SIZE]; - const int indent = 4; + const int indent = 4; /* Get descriptions for the major and minor error numbers */ - if(H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) + if (H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) TEST_ERROR; HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", @@ -468,54 +450,58 @@ error: /*------------------------------------------------------------------------- - * Function: test_create - * - * Purpose: Test creating an empty error stack + * Function: test_create * - * Return: Success: 0 - * Failure: -1 + * Purpose: Test creating an empty error stack * - * Programmer: Quincey Koziol - * November 1, 2007 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_create(void) { - const char *err_func = "test_create"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ + const char *err_func = "test_create"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ /* Create an empty error stack */ - if((estack_id = H5Ecreate_stack()) < 0) TEST_ERROR + if ((estack_id = H5Ecreate_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Push an error with a long description */ - if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Clear the error stack */ - if(H5Eclear2(estack_id) < 0) TEST_ERROR + if (H5Eclear2(estack_id) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Close error stack */ - if(H5Eclose_stack(estack_id) < 0) TEST_ERROR + if(H5Eclose_stack(estack_id) < 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_create() */ /*------------------------------------------------------------------------- @@ -526,70 +512,72 @@ error: * Return: Success: 0 * Failure: -1 * - * Programmer: Allen Byrne - * February 18, 2010 - * *------------------------------------------------------------------------- */ static herr_t test_copy(void) { - const char *err_func = "test_copy"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ - herr_t ret; /* Generic return value */ + const char *err_func = "test_copy"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ + herr_t ret; /* Generic return value */ /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Copy error stack, which clears the original */ - if((estack_id = H5Eget_current_stack()) < 0) TEST_ERROR + if ((estack_id = H5Eget_current_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack copy */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Check the number of errors on original stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Put the stack copy as the default. It closes the stack copy, too. */ - if(H5Eset_current_stack(estack_id) < 0) TEST_ERROR + if (H5Eset_current_stack(estack_id) < 0) + TEST_ERROR /* Check the number of errors on default stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Try to close error stack copy. Should fail because - * the current H5Eset_current_stack closes the stack to be set.*/ + * the current H5Eset_current_stack closes the stack to be set. + */ H5E_BEGIN_TRY { ret = H5Eclose_stack(estack_id); } H5E_END_TRY - if(ret >= 0) TEST_ERROR + if (ret >= 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_copy() */ /*------------------------------------------------------------------------- - * Function: close_error + * Function: close_error * - * Purpose: Closes error information. + * Purpose: Closes error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -597,19 +585,19 @@ static herr_t close_error(void) { /* Close major errors, let H5Eunregister_class close minor errors */ - if(H5Eclose_msg(ERR_MAJ_TEST) < 0) + if (H5Eclose_msg(ERR_MAJ_TEST) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_IO) < 0) + if (H5Eclose_msg(ERR_MAJ_IO) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_API) < 0) + if (H5Eclose_msg(ERR_MAJ_API) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS) < 0) + if (H5Eunregister_class(ERR_CLS) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS2) < 0) + if (H5Eunregister_class(ERR_CLS2) < 0) TEST_ERROR; return 0; @@ -620,19 +608,15 @@ error: /*------------------------------------------------------------------------- - * Function: test_filter_error + * Function: test_filter_error * - * Purpose: Make sure the error message prints out the filter name + * Purpose: Make sure the error message prints out the filter name * when the existent file is opened but the filter isn't * registered. The existent file was created with * gen_filters.c. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * 2 June 2011 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -640,71 +624,72 @@ static herr_t test_filter_error(const char *fname) { const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */ - hid_t file, dataset; /* handles */ + hid_t file = -1; + hid_t dataset = -1; int buf[20]; HDfprintf(stderr, "\nTesting error message during data reading when filter isn't registered\n"); /* Open the file */ - if((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if ((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR; /* Open the regular dataset */ - if((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) + if ((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) - TEST_ERROR; + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) + TEST_ERROR; /* Close/release resources */ - if(H5Dclose(dataset) < 0) + if (H5Dclose(dataset) < 0) TEST_ERROR - if(H5Fclose(file) < 0) + if (H5Fclose(file) < 0) TEST_ERROR return 0; error: return -1; -} +} /* end test_filter_error() */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test error API. - * - * Programmer: Raymond Lu - * July 10, 2003 + * Purpose: Test error API. * *------------------------------------------------------------------------- */ int main(void) { - hid_t file, fapl; - hid_t estack_id; - char filename[1024]; - const char *FUNC_main = "main"; + hid_t file = -1; + hid_t fapl = -1; + hid_t estack_id = -1; + char filename[1024]; + const char *FUNC_main = "main"; HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n"); /* Initialize errors */ - if(init_error() < 0) + if (init_error() < 0) TEST_ERROR; - fapl = h5_fileaccess(); + if ((fapl = h5_fileaccess()) < 0) + TEST_ERROR; - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR; + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); + if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR; /* Test error stack */ - if(error_stack() < 0) { + if (error_stack() < 0) { /* Push an error onto error stack */ - if(H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, - "Error stack test failed") < 0) TEST_ERROR; + if (H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, + "Error stack test failed") < 0) + TEST_ERROR; /* Delete an error from the top of error stack */ H5Epop(ERR_STACK, 1); @@ -724,34 +709,39 @@ main(void) } /* end if */ /* Test error API */ - if(test_error(file) < 0) { + if (test_error(file) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed, %s", "it's wrong"); estack_id = H5Eget_current_stack(); H5Eprint2(estack_id, stderr); H5Eclose_stack(estack_id); - } /* end if */ + } /* Test pushing a very long error description */ - if(test_long_desc() < 0) TEST_ERROR; + if (test_long_desc() < 0) + TEST_ERROR; /* Test creating a new error stack */ - if(test_create() < 0) TEST_ERROR; + if (test_create() < 0) + TEST_ERROR; /* Test copying a new error stack */ - if(test_copy() < 0) TEST_ERROR; + if (test_copy() < 0) + TEST_ERROR; - if(H5Fclose(file) < 0) TEST_ERROR; + if (H5Fclose(file) < 0) + TEST_ERROR; /* Close error information */ - if(close_error() < 0) + if (close_error() < 0) TEST_ERROR; /* Test error message during data reading when filter isn't registered * Use default FAPL to avoid some VFD drivers by the check-vfd test because - * the test file was pre-generated. */ + * the test file was pre-generated. + */ h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename); - if(test_filter_error(filename) < 0) + if (test_filter_error(filename) < 0) TEST_ERROR; h5_clean_files(FILENAME, fapl); diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 0acd288..5b68002 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -53,7 +53,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '305' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache diff --git a/tools/test/h5dump/errfiles/filter_fail.err b/tools/test/h5dump/errfiles/filter_fail.err index db21044..5276ab0 100644 --- a/tools/test/h5dump/errfiles/filter_fail.err +++ b/tools/test/h5dump/errfiles/filter_fail.err @@ -14,7 +14,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '312' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache h5dump error: unable to print data -- cgit v0.12 From 5c472f5d7bbaa7cad6ec29fa531fea4257a5fc39 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 01:22:21 -0800 Subject: Fixed Windows code in H5PLpath.c --- src/H5PLpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index d8e82f8..972f1d0 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) -- cgit v0.12 From 2b7f23a33323f68011540f31ecf4900415b17f56 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 10:38:15 -0800 Subject: Fixed an uninitialized filter callback struct in H5Dchunk.c and unified the naming and initialization of said struct throughout the library. This was causing a crash on VS2015 in debug mode when the debug heap complained. Fixes HDFFV-10330. --- release_docs/RELEASE.txt | 15 +++++++++ src/H5Dchunk.c | 76 ++++++++++++++++++++++------------------- src/H5HFcache.c | 88 +++++++++++++++++++++++++++--------------------- src/H5HFhuge.c | 12 +++++-- src/H5Z.c | 62 +++++++++++++++++----------------- src/H5Zpublic.h | 20 +++++------ 6 files changed, 159 insertions(+), 114 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a1b59b1..7498d01 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -179,6 +179,21 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + - An uninitialized struct could cause a memory access error when using + variable-length or reference types in a compressed, chunked dataset. + + A struct containing a callback function pointer and a pointer to some + associated data was used before initialization. This could cause a + memory access error and system crash. This could only occur under + unusual conditions when using variable-lenth and reference types in + a compressed, chunked dataset. + + On recent versions of Visual Studio, when built in debug mode, the + debug heap will complain and cause a crash if the code in question + is executed (this will cause the objcopy test to fail). + + (DER - 2017/11/21, HDFFV-10330) + Configuration ------------- - cmake diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 0d7fcc9..be3b678 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5661,7 +5661,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* needed for commpressed variable length data */ hbool_t must_filter = FALSE; /* Whether chunk must be filtered during copy */ size_t nbytes; /* Size of chunk in file (in bytes) */ - H5Z_cb_t cb_struct; /* Filter failure callback struct */ + H5Z_cb_t filter_cb; /* Filter failure callback struct */ int ret_value = H5_ITER_CONT; /* Return value */ @@ -5670,6 +5670,10 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Get 'size_t' local value for number of bytes in chunk */ H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Check for filtered chunks */ /* Check for an edge chunk that is not filtered */ if(pline && pline->nused) { @@ -5716,7 +5720,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(!H5F_addr_defined(chunk_rec->chunk_addr)); HDmemcpy(buf, udata->chunk, nbytes); udata->chunk = NULL; - } else { + } + else { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ unsigned idx; /* Index of chunk in cache, if present */ unsigned u; /* Counter */ @@ -5748,7 +5753,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); HDmemcpy(buf, ent->chunk, nbytes); - } else { + } + else { /* read chunk data from the source file */ if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") @@ -5759,8 +5765,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) if(must_filter && (is_vlen || fix_ref) && !udata->chunk_in_cache) { unsigned filter_mask = chunk_rec->filter_mask; - cb_struct.func = NULL; /* no callback function when failed */ - if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) + if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "data pipeline read failed") } /* end if */ @@ -5822,7 +5827,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Need to compress variable-length or reference data elements or a chunk found in cache before writing to file */ if(must_filter && (is_vlen || fix_ref || udata->chunk_in_cache) ) { - if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) + if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ @@ -6707,46 +6712,49 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); chunk_addr = chunk_rec->chunk_addr; - if(new_idx_info->pline->nused && + if (new_idx_info->pline->nused && (new_idx_info->layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && (H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, new_idx_info->layout->dim, chunk_rec->scaled, udata->dset_dims))) { - /* This is a partial non-filtered edge chunk */ - /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - unsigned filter_mask = chunk_rec->filter_mask; - H5Z_cb_t cb_struct; /* Filter failure callback struct */ - size_t read_size = nbytes; /* Bytes to read */ + /* This is a partial non-filtered edge chunk */ + /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - HDassert(read_size == new_idx_info->layout->size); + unsigned filter_mask = chunk_rec->filter_mask; + H5Z_cb_t filter_cb; /* Filter failure callback struct */ + size_t read_size = nbytes; /* Bytes to read */ + + HDassert(read_size == new_idx_info->layout->size); - cb_struct.func = NULL; /* no callback function when failed */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ - /* Allocate buffer for chunk data */ - if(NULL == (buf = H5MM_malloc(read_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") + /* Allocate buffer for chunk data */ + if (NULL == (buf = H5MM_malloc(read_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") - /* Read the non-filtered edge chunk */ - if(H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + /* Read the non-filtered edge chunk */ + if (H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - /* Pass the chunk through the pipeline */ - if(H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &read_size, &buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + /* Pass the chunk through the pipeline */ + if (H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ - if(nbytes > ((size_t)0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") + if (nbytes > ((size_t)0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ - /* Allocate space for the filtered chunk */ - if((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") - HDassert(H5F_addr_defined(chunk_addr)); + /* Allocate space for the filtered chunk */ + if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") + HDassert(H5F_addr_defined(chunk_addr)); - /* Write the filtered chunk to disk */ - if(H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") + /* Write the filtered chunk to disk */ + if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") } /* end if */ /* Set up chunk information for insertion to chunk index */ @@ -6758,11 +6766,11 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) insert_udata.common.storage = new_idx_info->storage; /* Insert chunk into the v1 B-tree chunk index */ - if((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) + if ((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") done: - if(buf) + if (buf) H5MM_xfree(buf); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index f957e2e..069bf17 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -1671,9 +1671,13 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) HGOTO_DONE(TRUE); if(hdr->filter_len > 0) { - size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ - unsigned filter_mask; /* Excluded filters for direct block */ - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ + unsigned filter_mask; /* Excluded filters for direct block */ + H5Z_cb_t filter_cb; /* Filter callback structure */ + + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into * it. Must do this as H5Z_pipeline() may re-size the buffer @@ -1682,17 +1686,17 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) if(NULL == (read_buf = H5MM_malloc(len))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") - /* Set up parameters for filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; + /* Set up parameters for filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") /* Update info about direct block */ - udata->decompressed = TRUE; + udata->decompressed = TRUE; len = nbytes; } /* end if */ else @@ -1818,45 +1822,49 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, udata->dblk = NULL; } /* end if */ else { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ unsigned filter_mask; /* Excluded filters for direct block */ /* Sanity check */ - HDassert(udata->dblk == NULL); + HDassert(udata->dblk == NULL); - /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may resize the buffer - * provided to it. - */ - if(NULL == (read_buf = H5MM_malloc(len))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + + /* Allocate buffer to perform I/O filtering on and copy image into + * it. Must do this as H5Z_pipeline() may resize the buffer + * provided to it. + */ + if (NULL == (read_buf = H5MM_malloc(len))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") /* Copy compressed image into buffer */ - HDmemcpy(read_buf, image, len); + HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; + if (H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") - /* Sanity check */ - HDassert(nbytes == dblock->size); + /* Sanity check */ + HDassert(nbytes == dblock->size); - /* Copy un-filtered data into block's buffer */ - HDmemcpy(dblock->blk, read_buf, dblock->size); - } /* end if */ + /* Copy un-filtered data into block's buffer */ + HDmemcpy(dblock->blk, read_buf, dblock->size); + } /* end if */ } /* end if */ else { /* Sanity checks */ - HDassert(udata->dblk == NULL); - HDassert(!udata->decompressed); + HDassert(udata->dblk == NULL); + HDassert(!udata->decompressed); - /* Allocate block buffer */ -/* XXX: Change to using free-list factories */ - if(NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Allocate block buffer */ + /* XXX: Change to using free-list factories */ + if (NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy image to dblock->blk */ HDassert(dblock->size == len); @@ -1895,9 +1903,9 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Decode checksum on direct block, if requested */ if(hdr->checksum_dblocks) { - uint32_t stored_chksum; /* Metadata checksum value */ + uint32_t stored_chksum; /* Metadata checksum value */ - /* checksum verification already done in verify_chksum cb */ + /* checksum verification already done in verify_chksum cb */ /* Metadata checksum */ UINT32DECODE(image, stored_chksum); @@ -2188,10 +2196,14 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ unsigned filter_mask = 0; /* Filter mask for block */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = dblock->size; if(NULL == (write_buf = H5MM_malloc(write_size))) diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index b2a1e68..350100e 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -345,9 +345,13 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = obj_size; if(NULL == (write_buf = H5MM_malloc(write_size))) @@ -773,10 +777,14 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t read_size; /* Object's size in the file */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* De-filter the object */ read_size = nbytes = obj_size; if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &read_buf) < 0) diff --git a/src/H5Z.c b/src/H5Z.c index 1e7cd79..89c97d4 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -275,7 +275,7 @@ done: * Function: H5Z_register * * Purpose: Same as the public version except this one allows filters - * to be set for predefined method numbers nused > 0); + HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) @@ -926,7 +926,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline->nused > 0); + HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) @@ -1200,12 +1200,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); - HDassert (filter_mask); - HDassert (nbytes && *nbytes>0); - HDassert (buf_size && *buf_size>0); - HDassert (buf && *buf); - HDassert (!pline || pline->nused0); + HDassert(buf_size && *buf_size>0); + HDassert(buf && *buf); + HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ for (i = pline->nused; i > 0; --i) { @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; - } /* end if */ + } else issue_error = TRUE; @@ -1247,7 +1247,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } /* end if */ + } } /* end if */ fclass = &H5Z_table_g[fclass_idx]; @@ -1263,11 +1263,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #ifdef H5Z_DEBUG H5_timer_end (&(fstats->stats[1].timer), &timer); fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) fstats->stats[1].errors += *nbytes; + if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif if (0 == new_nbytes) { - if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) + if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; @@ -1303,7 +1304,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #ifdef H5Z_DEBUG H5_timer_end (&(fstats->stats[0].timer), &timer); fstats->stats[0].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) fstats->stats[0].errors += *nbytes; + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { @@ -1345,8 +1347,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1384,8 +1386,8 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1421,7 +1423,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); + HDassert(pline); /* Iterate through all the filters in pipeline */ for (i = 0; i < pline->nused; i++) { @@ -1459,8 +1461,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ if (pline->nused == 0) @@ -1470,7 +1472,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (H5Z_FILTER_ALL == filter) { if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") - } /* end if */ + } /* Delete filter */ else { size_t idx; /* Index of filter in pipeline */ @@ -1481,7 +1483,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (pline->filter[idx].id == filter) { found = TRUE; break; - } /* end if */ + } /* filter was not found in the pipeline */ if (!found) @@ -1489,11 +1491,11 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); @@ -1506,8 +1508,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->filter[idx].name = pline->filter[idx]._name; if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; - } /* end for */ - } /* end if */ + } + } /* Decrement number of used filters */ pline->nused--; diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index f6b313e..fcb2d37 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -129,8 +129,8 @@ typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void* buf, /* Structure for filter callback property */ typedef struct H5Z_cb_t { - H5Z_filter_func_t func; - void* op_data; + H5Z_filter_func_t func; + void *op_data; } H5Z_cb_t; #ifdef __cplusplus @@ -206,14 +206,14 @@ typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, * contain a pointers to the filter function and timing statistics. */ typedef struct H5Z_class2_t { - int version; /* Version number of the H5Z_class_t struct */ - H5Z_filter_t id; /* Filter ID number */ - unsigned encoder_present; /* Does this filter have an encoder? */ - unsigned decoder_present; /* Does this filter have a decoder? */ - const char *name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + int version; /* Version number of the H5Z_class_t struct */ + H5Z_filter_t id; /* Filter ID number */ + unsigned encoder_present; /* Does this filter have an encoder? */ + unsigned decoder_present; /* Does this filter have a decoder? */ + const char *name; /* Comment for debugging */ + H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ + H5Z_func_t filter; /* The actual filter function */ } H5Z_class2_t; H5_DLL herr_t H5Zregister(const void *cls); -- cgit v0.12 From e432a23f8bf7461ea4775986fd8c0b802ba67af9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 13:20:33 -0800 Subject: Made a dcpl layout struct in H5Z.c dynamic to quiet a stack size warning. --- src/H5Z.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 89c97d4..6f173b2 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -752,6 +752,7 @@ static herr_t H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { hid_t space_id = -1; /* ID for dataspace describing chunk */ + H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -761,19 +762,22 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type /* Check if the property list is non-default */ if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { - H5P_genplist_t *dc_plist; /* Dataset creation property list object */ - H5O_layout_t dcpl_layout; /* Dataset's layout information */ + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + + /* Get memory for the layout */ + if (NULL == (dcpl_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate dcpl layout buffer") /* Get dataset creation property list object */ if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Peek at the layout information */ - if (H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) + if (H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, dcpl_layout) < 0) HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") /* Check if the dataset is chunked */ - if (H5D_CHUNKED == dcpl_layout.type) { + if (H5D_CHUNKED == dcpl_layout->type) { H5O_pline_t dcpl_pline; /* Object's I/O pipeline information */ /* Get I/O pipeline information */ @@ -787,28 +791,31 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type size_t u; /* Local index variable */ /* Create a dataspace for a chunk & set the extent */ - for (u = 0; u < dcpl_layout.u.chunk.ndims; u++) - chunk_dims[u] = dcpl_layout.u.chunk.dim[u]; - if (NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) + for (u = 0; u < dcpl_layout->u.chunk.ndims; u++) + chunk_dims[u] = dcpl_layout->u.chunk.dim[u]; + if (NULL == (space = H5S_create_simple(dcpl_layout->u.chunk.ndims, chunk_dims, NULL))) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close (space); + (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") - } /* end if */ + } /* Make the callbacks */ if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") - } /* end if */ - } /* end if */ - } /* end if */ + } + } + } done: if (space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") + if (dcpl_layout) + dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_prepare_prelude_callback_dcpl() */ -- cgit v0.12 From abd2ab411a68d95d122b17ef04447adb2be0794b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 26 Nov 2017 18:13:18 -0800 Subject: Fixed misc Warnings flagged by VS2017. --- examples/h5_cmprss.c | 1 - src/H5Dio.c | 4 +- src/H5MF.c | 5 +- src/H5Tdbg.c | 227 +++++++++++++++++++++++++-------------------------- src/H5system.c | 2 +- test/cache_tagging.c | 13 +-- test/tarray.c | 24 +++--- test/tattr.c | 14 ++-- test/tchecksum.c | 2 +- test/testhdf5.h | 1 + test/tfile.c | 6 +- test/th5o.c | 4 +- test/theap.c | 30 +++---- test/tid.c | 18 ++-- test/titerate.c | 18 ++-- test/tmisc.c | 36 ++++---- test/trefstr.c | 26 +++--- test/tselect.c | 130 ++++++++++++++--------------- test/tskiplist.c | 142 ++++++++++++++++---------------- test/ttst.c | 18 ++-- test/tvltypes.c | 6 +- 21 files changed, 364 insertions(+), 363 deletions(-) diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index ebc7712..b51ec44 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -36,7 +36,6 @@ int main () { hsize_t dims[2]; hsize_t cdims[2]; - int idx; int i,j, numfilt; int buf[DIM0][DIM1]; int rbuf [DIM0][DIM1]; diff --git a/src/H5Dio.c b/src/H5Dio.c index 104a632..280d602 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -962,7 +962,9 @@ const io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ -done: +#ifdef H5_DEBUG_BUILD + done: +#endif /* H5_DEBUG_BUILD */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_init() */ diff --git a/src/H5MF.c b/src/H5MF.c index 49c7b77..7e06654 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3247,7 +3247,6 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* for self referential FSMs */ haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ /* for self referential FSMs */ - H5FS_stat_t fs_stat; /* Information for hdr FSM */ H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ hbool_t reset_ring = FALSE; /* Whether we set the ring */ @@ -3310,6 +3309,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) reset_ring = TRUE; #ifndef NDEBUG +{ + H5FS_stat_t fs_stat; /* Information for hdr FSM */ + /* Verify that sm_hdr_fspace is floating if it exists */ if(sm_hdr_fspace) { /* Query free space manager info for this type */ @@ -3357,6 +3359,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) HDassert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ +} #endif /* NDEBUG */ /* Free the space in the metadata aggregator. Do this via the diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index f434543..eb648f3 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -32,9 +32,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ @@ -74,28 +74,21 @@ /*------------------------------------------------------------------------- - * Function: H5T__print_stats + * Function: H5T__print_stats * - * Purpose: Print statistics about a conversion path. Statistics are - * printed only if all the following conditions are true: + * Purpose: Print statistics about a conversion path. Statistics are + * printed only if all the following conditions are true: * - * 1. The library was compiled with H5T_DEBUG defined. - * 2. Data type debugging is turned on at run time. - * 3. The path was called at least one time. + * 1. The library was compiled with H5T_DEBUG defined. + * 2. Data type debugging is turned on at run time. + * 3. The path was called at least one time. * - * The optional NPRINT argument keeps track of the number of - * conversions paths for which statistics have been shown. If - * its value is zero then table headers are printed before the - * first line of output. + * The optional NPRINT argument keeps track of the number of + * conversions paths for which statistics have been shown. If + * its value is zero then table headers are printed before the + * first line of output. * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Robb Matzke - * Monday, December 14, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -110,34 +103,34 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG - if(H5DEBUG(T) && path->stats.ncalls > 0) { - if(nprint && 0 == (*nprint)++) { - HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); - } - if(path->src && path->dst) + if (H5DEBUG(T) && path->stats.ncalls > 0) { + if (nprint && 0 == (*nprint)++) { + HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "Conversion", "Elmts", "Calls", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "----------", "-----", "-----", "----", + "------", "-------", "---------"); + } + if (path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); - else if(path->src) + else if (path->src) nbytes = H5T_get_size(path->src); - else if(path->dst) + else if (path->dst) nbytes = H5T_get_size(path->dst); else nbytes = 0; - nbytes *= path->stats.nelmts; - H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); - HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", - path->name, - path->stats.nelmts, - path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, - path->stats.timer.etime, - bandwidth); + nbytes *= path->stats.nelmts; + H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); + HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", + path->name, + path->stats.nelmts, + path->stats.ncalls, + path->stats.timer.utime, + path->stats.timer.stime, + path->stats.timer.etime, + bandwidth); } #endif FUNC_LEAVE_NOAPI(SUCCEED) @@ -145,24 +138,20 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* /*------------------------------------------------------------------------- - * Function: H5T_debug - * - * Purpose: Prints information about a data type. + * Function: H5T_debug * - * Return: Non-negative on success/Negative on failure + * Purpose: Prints information about a data type. * - * Programmer: Robb Matzke - * Wednesday, January 7, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5T_debug(const H5T_t *dt, FILE *stream) { - const char *s1 = "", *s2 = ""; - unsigned i; + const char *s1 = ""; + const char *s2 = ""; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -171,7 +160,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) HDassert(dt); HDassert(stream); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -221,9 +210,9 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = ""; break; - } /* end switch */ + } /* end switch */ - switch(dt->shared->state) { + switch (dt->shared->state) { case H5T_STATE_TRANSIENT: s2 = "[transient]"; break; @@ -245,14 +234,14 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; default: HDassert(0 && "This Should never be executed!"); - } /* end switch */ + } /* end switch */ - fprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); + HDfprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); - if(H5T_IS_ATOMIC(dt->shared)) { - uint64_t tmp; + if (H5T_IS_ATOMIC(dt->shared)) { + uint64_t tmp; - switch(dt->shared->u.atomic.order) { + switch (dt->shared->u.atomic.order) { case H5T_ORDER_ERROR: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "order error"); break; @@ -277,17 +266,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = "order?"; break; - } /* end switch */ + } /* end switch */ + + HDfprintf(stream, ", %s", s1); - fprintf(stream, ", %s", s1); + if (dt->shared->u.atomic.offset) + HDfprintf(stream, ", offset=%lu", (unsigned long) (dt->shared->u.atomic.offset)); + if (dt->shared->u.atomic.prec != 8 * dt->shared->size) + HDfprintf(stream, ", prec=%lu", (unsigned long) (dt->shared->u.atomic.prec)); - if(dt->shared->u.atomic.offset) - fprintf(stream, ", offset=%lu", - (unsigned long) (dt->shared->u.atomic.offset)); - if(dt->shared->u.atomic.prec != 8 * dt->shared->size) - fprintf(stream, ", prec=%lu", - (unsigned long) (dt->shared->u.atomic.prec)); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -313,7 +301,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } /* end switch */ if(s1) - fprintf(stream, ", %s", s1); + HDfprintf(stream, ", %s", s1); break; case H5T_FLOAT: @@ -339,23 +327,24 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; } /* end switch */ - fprintf(stream, ", sign=%lu+1", + HDfprintf(stream, ", sign=%lu+1", (unsigned long)(dt->shared->u.atomic.u.f.sign)); - fprintf(stream, ", mant=%lu+%lu (%s)", + HDfprintf(stream, ", mant=%lu+%lu (%s)", (unsigned long)(dt->shared->u.atomic.u.f.mpos), (unsigned long)(dt->shared->u.atomic.u.f.msize), s1); - fprintf(stream, ", exp=%lu+%lu", + HDfprintf(stream, ", exp=%lu+%lu", (unsigned long)(dt->shared->u.atomic.u.f.epos), (unsigned long)(dt->shared->u.atomic.u.f.esize)); tmp = dt->shared->u.atomic.u.f.ebias >> 32; - if(tmp) { + if (tmp) { size_t hi = (size_t)tmp; size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx%08lx", + HDfprintf(stream, " bias=0x%08lx%08lx", (unsigned long)hi, (unsigned long)lo); - } else { + } + else { size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx", (unsigned long)lo); + HDfprintf(stream, " bias=0x%08lx", (unsigned long)lo); } break; @@ -372,69 +361,73 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: /* No additional info */ break; - } /* end switch */ - } else if(H5T_COMPOUND == dt->shared->type) { - /* Compound data type */ - for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { - fprintf(stream, "\n\"%s\" @%lu", - dt->shared->u.compnd.memb[i].name, - (unsigned long)(dt->shared->u.compnd.memb[i].offset)); - fprintf(stream, " "); - H5T_debug(dt->shared->u.compnd.memb[i].type, stream); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_VLEN == dt->shared->type) { - switch(dt->shared->u.vlen.loc) { + } /* end switch */ + } + else if (H5T_COMPOUND == dt->shared->type) { + /* Compound data type */ + for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { + HDfprintf(stream, "\n\"%s\" @%lu", + dt->shared->u.compnd.memb[i].name, + (unsigned long)(dt->shared->u.compnd.memb[i].offset)); + HDfprintf(stream, " "); + H5T_debug(dt->shared->u.compnd.memb[i].type, stream); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_VLEN == dt->shared->type) { + switch (dt->shared->u.vlen.loc) { case H5T_LOC_BADLOC: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid datatype location"); break; case H5T_LOC_MEMORY: - fprintf(stream, ", loc=memory"); + HDfprintf(stream, ", loc=memory"); break; case H5T_LOC_DISK: - fprintf(stream, ", loc=disk"); + HDfprintf(stream, ", loc=disk"); break; case H5T_LOC_MAXLOC: default: - fprintf(stream, ", loc=UNKNOWN"); + HDfprintf(stream, ", loc=UNKNOWN"); break; } /* end switch */ - if(H5T_IS_VL_STRING(dt->shared)) + if (H5T_IS_VL_STRING(dt->shared)) /* Variable length string datatype */ - fprintf(stream, ", variable-length"); + HDfprintf(stream, ", variable-length"); else { /* Variable length sequence datatype */ - fprintf(stream, " VLEN "); + HDfprintf(stream, " VLEN "); H5T_debug(dt->shared->parent, stream); - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); } /* end else */ - } else if(H5T_ENUM == dt->shared->type) { + } + else if (H5T_ENUM == dt->shared->type) { size_t base_size; - /* Enumeration data type */ - fprintf(stream, " "); - H5T_debug(dt->shared->parent, stream); - base_size = dt->shared->parent->shared->size; - for(i = 0; i < dt->shared->u.enumer.nmembs; i++) { + /* Enumeration data type */ + HDfprintf(stream, " "); + H5T_debug(dt->shared->parent, stream); + base_size = dt->shared->parent->shared->size; + for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { size_t k; - fprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); - for(k = 0; k < base_size; k++) - fprintf(stream, "%02lx", - (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_OPAQUE == dt->shared->type) { - fprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); - } else { - /* Unknown */ - fprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); + HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); + for (k = 0; k < base_size; k++) + HDfprintf(stream, "%02lx", (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_OPAQUE == dt->shared->type) { + HDfprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); + } + else { + /* Unknown */ + HDfprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); } - fprintf(stream, "}"); + HDfprintf(stream, "}"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5system.c b/src/H5system.c index a1cdf19..a8726c2 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -977,7 +977,7 @@ Wround(double arg) float Wroundf(float arg) { - return arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F); + return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); } #endif /* H5_HAVE_WIN32_API */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 99ab49c..9c79968 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3631,11 +3631,14 @@ error: static unsigned check_invalid_tag_application(void) { +#if H5C_DO_TAGGING_SANITY_CHECKS /* Variables */ H5F_t * f = NULL; - hid_t fid, dxpl_id = -1; + hid_t fid = -1; + hid_t dxpl_id = -1; haddr_t addr; H5HL_t * lheap = NULL; +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ TESTING("failure on invalid tag application"); @@ -3683,8 +3686,8 @@ check_invalid_tag_application(void) PASSED(); #else SKIPPED(); - printf(" test skipped because sanity checking on tag value is disabled.\n"); -#endif + HDprintf(" test skipped because sanity checking on tag value is disabled.\n"); +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ return 0; @@ -3791,10 +3794,10 @@ main(void) HDremove(FILENAME2); /* Return Errors */ - return(nerrs > 0); + return nerrs > 0; error: /* Return with Error */ - return(1); + return 1; } /* main */ diff --git a/test/tarray.c b/test/tarray.c index a35b8a3..b2e0ee7 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -679,7 +679,7 @@ test_array_compound_atomic(void) /* Check the 1st field's name */ mname = H5Tget_member_name(tid2, 0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "i") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -698,7 +698,7 @@ test_array_compound_atomic(void) /* Check the 2nd field's name */ mname = H5Tget_member_name(tid2, 1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "f") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -897,7 +897,7 @@ test_array_compound_array(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid2,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -916,7 +916,7 @@ test_array_compound_array(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid2,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1604,7 +1604,7 @@ test_array_bkg(void) /* Initialize the data */ /* ------------------- */ dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo)); - CHECK(dtsinfo, NULL, "HDmalloc"); + CHECK_PTR(dtsinfo, "HDmalloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { @@ -1927,7 +1927,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1946,7 +1946,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1965,7 +1965,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -2009,7 +2009,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2028,7 +2028,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2073,7 +2073,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2118,7 +2118,7 @@ test_compat(void) /* Check the 4th field's name */ mname=H5Tget_member_name(tid1,3); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"d")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); diff --git a/test/tattr.c b/test/tattr.c index 3786d0d..2d333e9 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -277,7 +277,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); @@ -313,7 +313,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); @@ -6862,7 +6862,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; visited = (hbool_t*)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); - CHECK(visited, NULL, "HDmalloc"); + CHECK_PTR(visited, "HDmalloc"); iter_info.visited = visited; /* Loop over operating on different indices on link fields */ @@ -8040,7 +8040,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8371,7 +8371,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8817,7 +8817,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9186,7 +9186,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ diff --git a/test/tchecksum.c b/test/tchecksum.c index febaacc..ffbab45 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -187,7 +187,7 @@ test_chksum_large(void) /* Allocate the buffer */ large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN); - CHECK(large_buf, NULL, "HDmalloc"); + CHECK_PTR(large_buf, "HDmalloc"); /* Initialize buffer w/known data */ for(u = 0; u < BUF_LEN; u++) diff --git a/test/testhdf5.h b/test/testhdf5.h index 2cbe6c6..41675cf 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -54,6 +54,7 @@ } \ } +/* Check that a pointer is valid (i.e.: not NULL) */ #define CHECK_PTR(ret,where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ diff --git a/test/tfile.c b/test/tfile.c index 027ad62..80ba4da 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1072,7 +1072,7 @@ test_get_obj_ids(void) VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in @@ -1135,7 +1135,7 @@ test_get_obj_ids(void) VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); @@ -2667,7 +2667,7 @@ cal_chksum(const char *file, uint32_t *chksum) /* Allocate space for the file data */ file_data = HDmalloc((size_t)sb.st_size); - CHECK(file_data, NULL, "HDmalloc"); + CHECK_PTR(file_data, "HDmalloc"); if(file_data) { /* Read file's data into memory */ diff --git a/test/th5o.c b/test/th5o.c index 4baac20..144ea4c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -783,9 +783,9 @@ test_h5o_link(void) /* Allocate memory buffers */ /* (These are treated as 2-D buffers) */ wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); /* Initialize the raw data */ for(i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) diff --git a/test/theap.c b/test/theap.c index 3c23025..cdb423e 100644 --- a/test/theap.c +++ b/test/theap.c @@ -88,11 +88,11 @@ test_heap_init(void) /* Allocate arrays */ rand_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(rand_num, NULL, "HDmalloc"); + CHECK_PTR(rand_num, "HDmalloc"); inc_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(inc_sort_num, NULL, "HDmalloc"); + CHECK_PTR(inc_sort_num, "HDmalloc"); dec_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(dec_sort_num, NULL, "HDmalloc"); + CHECK_PTR(dec_sort_num, "HDmalloc"); /* Create randomized set of numbers */ curr_time = HDtime(NULL); @@ -127,7 +127,7 @@ test_heap_create(void) /* Try creating a maximum Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -135,7 +135,7 @@ test_heap_create(void) /* Try creating a minimum Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -163,7 +163,7 @@ test_heap_insert_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -237,7 +237,7 @@ test_heap_insert_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -325,7 +325,7 @@ test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, i /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -405,7 +405,7 @@ test_heap_remove_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -479,7 +479,7 @@ test_heap_remove_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -567,7 +567,7 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -714,7 +714,7 @@ test_heap_change_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -788,7 +788,7 @@ test_heap_change_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -880,7 +880,7 @@ test_heap_incdec_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -955,7 +955,7 @@ test_heap_incdec_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); diff --git a/test/tid.c b/test/tid.c index 494ee60..375ef69 100644 --- a/test/tid.c +++ b/test/tid.c @@ -57,7 +57,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -65,7 +65,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -118,7 +118,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -126,14 +126,14 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; /* Remove an ID and make sure we can't access it */ testPtr = (int*) H5Iremove_verify(arrayID, myType); - CHECK(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR(testPtr, "H5Iremove_verify"); if(testPtr == NULL) goto out; @@ -141,7 +141,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iobject_verify(arrayID, myType); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -263,7 +263,7 @@ static int id_predefined_test(void ) testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Isearch"); + CHECK_PTR_NULL(testPtr, "H5Isearch"); if(testPtr != NULL) goto out; @@ -301,7 +301,7 @@ static int id_predefined_test(void ) testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -309,7 +309,7 @@ static int id_predefined_test(void ) testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; diff --git a/test/titerate.c b/test/titerate.c index aad62c9..231bd2e 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -159,7 +159,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) /* Keep a copy of the dataset names around for later */ lnames[i] = HDstrdup(name); - CHECK(lnames[i], NULL, "strdup"); + CHECK_PTR(lnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -170,13 +170,13 @@ test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Gcreate2"); lnames[NDATASETS] = HDstrdup("grp"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); lnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -412,7 +412,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) /* Keep a copy of the attribute names around for later */ anames[i] = HDstrdup(name); - CHECK(anames[i], NULL, "strdup"); + CHECK_PTR(anames[i], "strdup"); ret = H5Aclose(attribute); CHECK(ret, FAIL, "H5Aclose"); @@ -596,7 +596,7 @@ test_iter_group_large(hid_t fapl) /* Allocate & initialize array */ names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2)); - CHECK(names, NULL, "HDcalloc"); + CHECK_PTR(names, "HDcalloc"); /* Output message about test being performed */ MESSAGE(5, ("Testing Large Group Iteration Functionality\n")); @@ -733,7 +733,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ dnames[i] = HDstrdup(name); - CHECK(dnames[i], NULL, "strdup"); + CHECK_PTR(dnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -744,13 +744,13 @@ static void test_grp_memb_funcs(hid_t fapl) CHECK(ret, FAIL, "H5Gcreate2"); dnames[NDATASETS] = HDstrdup("grp"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); dnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -797,7 +797,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ obj_names[i] = HDstrdup(dataset_name); - CHECK(obj_names[i], NULL, "strdup"); + CHECK_PTR(obj_names[i], "strdup"); ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info_by_idx"); diff --git a/test/tmisc.c b/test/tmisc.c index 6da4589..f0e595b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -723,7 +723,7 @@ create_struct3(void) herr_t ret; /* For error checking */ str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); - CHECK(str3hndl,NULL,"malloc"); + CHECK_PTR(str3hndl, "malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); CHECK(str3hndl->st3h_base, FAIL, "H5Tcreate"); @@ -766,7 +766,7 @@ create_struct2(void) herr_t ret; /* For error checking */ str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); - CHECK(str2hndl, NULL, "malloc"); + CHECK_PTR(str2hndl, "HDmalloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); @@ -775,7 +775,7 @@ create_struct2(void) CHECK(ret, FAIL, "H5Tinsert"); str2hndl->st2h_st3hndl = create_struct3(); - CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); + CHECK_PTR(str2hndl->st2h_st3hndl, "create_struct3"); ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -811,7 +811,7 @@ set_struct2(misc5_struct2 *buf) buf->st2_el2.len = MISC5_DBGNELM3; buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); - CHECK(buf->st2_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st2_el2.p, "HDmalloc"); for(i=0; i<(buf->st2_el2.len); i++) set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i])); @@ -832,7 +832,7 @@ create_struct1(void) herr_t ret; /* For error checking */ str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); - CHECK(str1hndl, NULL, "malloc"); + CHECK_PTR(str1hndl, "HDmalloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); @@ -841,7 +841,7 @@ create_struct1(void) CHECK(ret, FAIL, "H5Tinsert"); str1hndl->st1h_st2hndl=create_struct2(); - CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); + CHECK_PTR(str1hndl->st1h_st2hndl, "create_struct2"); ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -877,7 +877,7 @@ set_struct1(misc5_struct1 *buf) buf->st1_el2.len=MISC5_DBGNELM2; buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2)); - CHECK(buf->st1_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st1_el2.p, "HDmalloc"); for(i=0; i<(buf->st1_el2.len); i++) set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); @@ -913,7 +913,7 @@ test_misc5(void) /* Create the memory structure to write */ str1hndl = create_struct1(); - CHECK(str1hndl, NULL, "create_struct1"); + CHECK_PTR(str1hndl, "create_struct1"); /* Create the dataspace */ dims[0] = MISC5_NELMTOPLVL; @@ -927,7 +927,7 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); - CHECK(buf.p, NULL, "malloc"); + CHECK_PTR(buf.p, "HDmalloc"); /* Create the top-level VL information */ for(i = 0; i < MISC5_DBGNELM1; i++) @@ -1253,10 +1253,10 @@ test_misc8(void) /* Allocate space for the data to write & read */ wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(wdata,NULL,"malloc"); + CHECK_PTR(wdata, "HDmalloc"); #ifdef VERIFY_DATA rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(rdata,NULL,"malloc"); + CHECK_PTR(rdata, "HDmalloc"); #endif /* VERIFY_DATA */ /* Initialize values */ @@ -2144,7 +2144,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) /* Create a data buffer for the dataset read */ read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(read_data, NULL, "HDcalloc"); + CHECK_PTR(read_data, "HDcalloc"); /* Open the contiguous dataset in the root group */ dsid = H5Dopen2(loc_id, name, H5P_DEFAULT); @@ -2270,14 +2270,14 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Allocate space for the user block */ user_block = HDcalloc(size, (size_t)1); - CHECK(user_block, NULL, "HDcalloc"); + CHECK_PTR(user_block, "HDcalloc"); /* Copy in the user block data */ HDmemcpy(user_block, str, strlen(str)); /* Open the new file */ new_fp = HDfopen(new_name,"wb"); - CHECK(new_fp, NULL, "HDfopen"); + CHECK_PTR(new_fp, "HDfopen"); /* Write the user block to the new file */ written = HDfwrite(user_block, (size_t)1, size, new_fp); @@ -2285,11 +2285,11 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Open the old file */ old_fp = HDfopen(old_name,"rb"); - CHECK(old_fp, NULL, "HDfopen"); + CHECK_PTR(old_fp, "HDfopen"); /* Allocate space for the copy buffer */ copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); - CHECK(copy_buf, NULL, "HDmalloc"); + CHECK_PTR(copy_buf, "HDmalloc"); /* Copy data from the old file to the new file */ while((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { @@ -2439,7 +2439,7 @@ test_misc13(void) /* Create a data buffer for the datasets */ data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(data, NULL, "HDcalloc"); + CHECK_PTR(data, "HDcalloc"); /* Initialize data to write */ misc13_init_data(data); @@ -3446,7 +3446,7 @@ test_misc19(void) /* Get a VFD class to register */ vfd_cls = h5_get_dummy_vfd_class(); - CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class"); + CHECK_PTR(vfd_cls, "h5_get_dummy_vfd_class"); /* Register a virtual file driver */ vfdid = H5FDregister(vfd_cls); diff --git a/test/trefstr.c b/test/trefstr.c index 40ce344..f55ede0 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -67,7 +67,7 @@ test_refstr_create(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -97,7 +97,7 @@ test_refstr_count(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -144,7 +144,7 @@ test_refstr_dup(void) /* Try creating a ref-counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs1); @@ -152,7 +152,7 @@ test_refstr_dup(void) /* Duplicate r-string */ rs2=H5RS_dup(rs1); - CHECK(rs2, NULL, "H5RS_dup"); + CHECK_PTR(rs2, "H5RS_dup"); /* Get the reference count on the strings */ count=H5RS_get_count(rs1); @@ -194,11 +194,11 @@ test_refstr_cmp(void) /* Create first reference counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Create second reference counted string */ rs2=H5RS_create("foo2"); - CHECK(rs2, NULL, "H5RS_create"); + CHECK_PTR(rs2, "H5RS_create"); /* Compare the strings in various ways */ cmp=H5RS_cmp(rs1,rs1); @@ -246,11 +246,11 @@ test_refstr_wrap(void) /* Wrap ref-counted string around existing buffer */ rs=H5RS_wrap(buf); - CHECK(rs, NULL, "H5RS_wrap"); + CHECK_PTR(rs, "H5RS_wrap"); /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); VERIFY(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -264,7 +264,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); CHECK(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); if(cmp<=0) @@ -299,16 +299,16 @@ test_refstr_own(void) /* Initialize buffer */ s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1); - CHECK(s, NULL, "H5FL_BLK_MALLOC"); + CHECK_PTR(s, "H5FL_BLK_MALLOC"); HDstrcpy(s, "foo"); /* Transfer ownership of dynamically allocated string to ref-counted string */ rs=H5RS_own(s); - CHECK(rs, NULL, "H5RS_own"); + CHECK_PTR(rs, "H5RS_own"); /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -322,7 +322,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tselect.c b/test/tselect.c index 85c21bb..2022a11 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -228,9 +228,9 @@ test_select_hyper(hid_t xfer_plist) /* Allocate write & read buffers */ wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK(wbuf, NULL, "HDmalloc"); + CHECK_PTR(wbuf, "HDmalloc"); rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK(rbuf, NULL, "HDcalloc"); + CHECK_PTR(rbuf, "HDcalloc"); /* Initialize write buffer */ for(i=0, tbuf=wbuf; islist, &j); - CHECK(obj_ret, NULL, "H5SL_remove"); + CHECK_PTR(obj_ret, "H5SL_remove"); obj_ret->nfrees++; obj_list->nobjs_rem--; } /* end else */ @@ -1324,7 +1324,7 @@ test_skiplist_try_free_safe(void) /* Create a skip list */ obj_list.slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(obj_list.slist, NULL, "H5SL_create"); + CHECK_PTR(obj_list.slist, "H5SL_create"); /* Init obj_list.list */ obj_list.list = list; @@ -1396,7 +1396,7 @@ test_skiplist_less(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u=0; u<10; u++) { @@ -1430,7 +1430,7 @@ test_skiplist_less(void) VERIFY(*found_item,5,"H5SL_less"); find_item=4; found_item=(unsigned *)H5SL_less(slist,&find_item); - VERIFY(found_item,NULL,"H5SL_less"); + CHECK_PTR_NULL(found_item, "H5SL_less"); /* Close the skip list */ ret=H5SL_close(slist); @@ -1460,7 +1460,7 @@ test_skiplist_greater(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1488,7 +1488,7 @@ test_skiplist_greater(void) VERIFY(*found_item, 90, "H5SL_greater"); find_item = 100; found_item = (unsigned *)H5SL_greater(slist, &find_item); - VERIFY(found_item, NULL, "H5SL_greater"); + CHECK_PTR_NULL(found_item, "H5SL_greater"); find_item = 6; found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 10, "H5SL_greater"); @@ -1525,7 +1525,7 @@ test_skiplist_below(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1536,44 +1536,44 @@ test_skiplist_below(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 90; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 5; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); /* Find item less than a missing key, in various positions */ find_item = 19; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 15, "H5SL_below"); find_item = 89; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 80, "H5SL_below"); find_item = 100; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_below"); find_item = 9; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_below"); find_item = 4; node = (H5SL_node_t *)H5SL_less(slist, &find_item); - VERIFY(node, NULL, "H5SL_below"); + CHECK_PTR_NULL(node, "H5SL_below"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1604,7 +1604,7 @@ test_skiplist_above(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1615,42 +1615,42 @@ test_skiplist_above(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 90; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 5; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); /* Find item greater than a missing key, in various positions */ find_item = 19; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 20, "H5SL_above"); find_item = 89; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_above"); find_item = 100; node = H5SL_above(slist, &find_item); - VERIFY(node, NULL, "H5SL_above"); + CHECK_PTR_NULL(node, "H5SL_above"); find_item = 6; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 10, "H5SL_above"); find_item = 4; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_above"); @@ -1681,7 +1681,7 @@ test_skiplist_remove_first(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1697,7 +1697,7 @@ test_skiplist_remove_first(void) /* Check for removing object from empty list */ found_item = (unsigned *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1725,7 +1725,7 @@ test_skiplist_remove_first_many(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < NUM_ELEMS; u++) { @@ -1742,7 +1742,7 @@ test_skiplist_remove_first_many(void) /* Check for removing object from empty list */ found_item = (int *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); diff --git a/test/ttst.c b/test/ttst.c index b26d582..c5912c5 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -157,7 +157,7 @@ test_tst_create(void) /* Try creating a TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Try closing a real tree */ ret=H5ST_close(tree); @@ -186,7 +186,7 @@ test_tst_insert(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,uniq_words[u])) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]); obj=H5ST_locate(tree,uniq_words[u]); - CHECK(obj, NULL, "H5ST_locate"); + CHECK_PTR(obj, "H5ST_locate"); if(HDstrcmp((const char *)obj,uniq_words[u])) TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]); @@ -246,7 +246,7 @@ test_tst_iterate(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,rand_uniq_words[u])) diff --git a/test/tvltypes.c b/test/tvltypes.c index 5121a66..0c4cb9d 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1015,9 +1015,9 @@ test_vltypes_compound_vlen_vlen(void) /* Allocate and initialize VL data to write */ wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); for(i = 0; i < SPACE3_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; @@ -2503,7 +2503,7 @@ test_vltypes_fill_value(void) /* Allocate space for the buffer to read data */ rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); - CHECK(rbuf, NULL, "HDmalloc"); + CHECK_PTR(rbuf, "HDmalloc"); /* Create the small & large dataspaces to use */ -- cgit v0.12 From fd5531e302aeff22f94f380bebc8a380a21cb120 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 08:57:26 -0800 Subject: Added CHECK_PTR_EQ macro to testhdf5 to quiet cast warnings on Windows. --- test/testhdf5.h | 208 +++++++++++++++++---------------- test/theap.c | 12 +- test/tid.c | 342 ++++++++++++++++++++++++++++--------------------------- test/trefstr.c | 6 +- test/tskiplist.c | 14 +-- 5 files changed, 300 insertions(+), 282 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 41675cf..6244524 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -30,131 +30,147 @@ /* Use %ld to print the value because long should cover most cases. */ /* Used to make certain a return value _is_not_ a value */ -#define CHECK(ret, val, where) do { \ - if (VERBOSE_HI) print_func(" Call to routine: %15s at line %4d " \ - "in %s returned %ld \n", \ - where, (int)__LINE__, __FILE__, \ - (long)(ret)); \ - if ((ret) == (val)) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK(ret, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d " \ + "in %s returned %ld \n", \ + where, (int)__LINE__, __FILE__, \ + (long)(ret)); \ + } \ + if ((ret) == (val)) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) -#define CHECK_I(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ - (where), (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if ((ret)<0) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ - (where), (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_I(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ + (where), (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if ((ret)<0) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ + (where), (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Check that a pointer is valid (i.e.: not NULL) */ -#define CHECK_PTR(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (!(ret)) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_PTR(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (!(ret)) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } -#define CHECK_PTR_NULL(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (ret) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +/* Check that a pointer is NULL */ +#define CHECK_PTR_NULL(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ +} + +/* Check that two pointers are equal */ +#define CHECK_PTR_EQ(ret, val, where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret != val) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ + (where), ret, val, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Used to make certain a return value _is_ a value */ -#define VERIFY(_x, _val, where) do { \ - long __x = (long)_x, __val = (long)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY(_x, _val, where) do { \ + long __x = (long)_x, __val = (long)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a (non-'long' type's) return value _is_ a value */ -#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ - _type __x = (_type)_x, __val = (_type)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - _format " \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ + _type __x = (_type)_x, __val = (_type)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + _format " \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a string return value _is_ a value */ -#define VERIFY_STR(x, val, where) do { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%s \n", (where), (int)__LINE__, __FILE__, x); \ - } \ - if (HDstrcmp(x, val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ - "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_STR(x, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%s \n", (where), (int)__LINE__, __FILE__, x); \ + } \ + if (HDstrcmp(x, val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ + "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test and to check for errors */ -#define RESULT(ret,func) do { \ - if (VERBOSE_MED) { \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if (VERBOSE_HI) \ - H5Eprint2(H5E_DEFAULT, stdout); \ - if ((ret) == FAIL) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define RESULT(ret,func) do { \ + if (VERBOSE_MED) { \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if (VERBOSE_HI) \ + H5Eprint2(H5E_DEFAULT, stdout); \ + if ((ret) == FAIL) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test */ #if defined(H5_HAVE_PARALLEL) && defined(H5_PARALLEL_TEST) -#define MESSAGE(V,A) { \ - int mpi_rank; \ - \ - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ - if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ - print_func A ; \ +#define MESSAGE(V,A) { \ + int mpi_rank; \ + \ + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ + if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ + print_func A ; \ } #else /* H5_HAVE_PARALLEL */ #define MESSAGE(V,A) {if (HDGetTestVerbosity() > (V)) print_func A;} #endif /* H5_HAVE_PARALLEL */ /* Used to indicate an error that is complex to check for */ -#define ERROR(where) do { \ - if(VERBOSE_HI) \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "invalid result\n", where, (int)__LINE__, __FILE__); \ - TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ - where, (int)__LINE__, __FILE__); \ +#define ERROR(where) do { \ + if(VERBOSE_HI) \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "invalid result\n", where, (int)__LINE__, __FILE__); \ + TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ + where, (int)__LINE__, __FILE__); \ } while(0) /* definitions for command strings */ diff --git a/test/theap.c b/test/theap.c index cdb423e..7b2fadb 100644 --- a/test/theap.c +++ b/test/theap.c @@ -434,19 +434,19 @@ test_heap_remove_min(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); @@ -508,19 +508,19 @@ test_heap_remove_max(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); diff --git a/test/tid.c b/test/tid.c index 375ef69..7d6757f 100644 --- a/test/tid.c +++ b/test/tid.c @@ -16,223 +16,225 @@ #include "testhdf5.h" #include "hdf5.h" - /* Include H5Ipkg.h to calculate max number of groups */ +/* Include H5Ipkg.h to calculate max number of groups */ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" - /* Test basic functionality of registering and deleting types and IDs */ +/* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { - H5I_type_t myType = H5I_BADID; - hid_t arrayID = H5I_INVALID_HID; - void* testObj = NULL; - void* testPtr = NULL; - char nameString[10]; - hid_t testID; - ssize_t testSize = -1; - herr_t err; - int num_ref; - hsize_t num_members; - + H5I_type_t myType = H5I_BADID; + hid_t arrayID = H5I_INVALID_HID; + void* testObj = NULL; + void* testPtr = NULL; + char nameString[10]; + hid_t testID; + ssize_t testSize = -1; + herr_t err; + int num_ref; + hsize_t num_members; + + + /* Try to register an ID with ficticious types */ + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) 420, testObj); + H5E_END_TRY - /* Try to register an ID with ficticious types */ - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) 420, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) -1, testObj); + H5E_END_TRY - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) -1, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + /* Try to access IDs with ficticious types */ + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); + H5E_END_TRY - /* Try to access IDs with ficticious types */ - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Register a type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + /* Register an ID and retrieve the object it points to. + * Once the ID has been registered, testObj will be freed when + * its ID type is destroyed. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - /* Register an ID and retrieve the object it points to. - * Once the ID has been registered, testObj will be freed when - * its ID type is destroyed. */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + testPtr = (int *)H5Iobject_verify(arrayID, myType); - testPtr = (int *) H5Iobject_verify(arrayID, myType); + CHECK_PTR_EQ(testPtr, testObj, "H5Iobject_verify"); + if(testPtr != testObj) + goto out; - VERIFY(testPtr, testObj, "H5Iobject_verify"); - if(testPtr != testObj) - goto out; + /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this + * is an hid_t for the wrong kind of object + */ + H5E_BEGIN_TRY + testID = H5Iget_file_id(arrayID); + H5E_END_TRY - /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this - * is an hid_t for the wrong kind of object */ - H5E_BEGIN_TRY - testID = H5Iget_file_id(arrayID); - H5E_END_TRY + VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); + if(testID != H5I_INVALID_HID) + goto out; - VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); - if(testID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + testSize = H5Iget_name(arrayID, nameString, (size_t)9); + H5E_END_TRY - H5E_BEGIN_TRY - testSize = H5Iget_name(arrayID, nameString, (size_t)9); - H5E_END_TRY + VERIFY(testSize, -1, "H5Iget_name"); + if(testSize != -1) + goto out; - VERIFY(testSize, -1, "H5Iget_name"); - if(testSize != -1) - goto out; + /* Make sure H5Iremove_verify catches objects of the wrong type */ + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); + H5E_END_TRY - /* Make sure H5Iremove_verify catches objects of the wrong type */ - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + /* Remove an ID and make sure we can't access it */ + testPtr = (int*) H5Iremove_verify(arrayID, myType); - /* Remove an ID and make sure we can't access it */ - testPtr = (int*) H5Iremove_verify(arrayID, myType); + CHECK_PTR(testPtr, "H5Iremove_verify"); + if(testPtr == NULL) + goto out; - CHECK_PTR(testPtr, "H5Iremove_verify"); - if(testPtr == NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iobject_verify(arrayID, myType); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iobject_verify(arrayID, myType); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Delete the type and make sure we can't access objects within it */ + arrayID = H5Iregister(myType, testObj); - /* Delete the type and make sure we can't access objects within it */ - arrayID = H5Iregister(myType, testObj); + err = H5Idestroy_type(myType); + VERIFY(err, 0, "H5Idestroy_type"); + if( err != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if(H5Itype_exists(myType) != 0) + goto out; - err = H5Idestroy_type(myType); - VERIFY(err, 0, "H5Idestroy_type"); - if( err != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if(H5Itype_exists(myType) != 0) + H5E_BEGIN_TRY + VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); + if(H5Inmembers(myType, NULL) != -1) goto out; + H5E_END_TRY - H5E_BEGIN_TRY - VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); - if(H5Inmembers(myType, NULL) != -1) - goto out; - H5E_END_TRY - - /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + /* Register another type and another object in that type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - /* The memory that testObj pointed to should already have been - * freed when the previous type was destroyed. Allocate new - * memory for it. - */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + /* The memory that testObj pointed to should already have been + * freed when the previous type was destroyed. Allocate new + * memory for it. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* Increment references to type and ensure that dec_type_ref - doesn't destroy the type */ - num_ref = H5Iinc_type_ref(myType); - VERIFY(num_ref, 2, "H5Iinc_type_ref"); - if( num_ref != 2) - goto out; - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 1, "H5Idec_type_ref"); - if(num_ref != 1) - goto out; - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + /* Increment references to type and ensure that dec_type_ref + * doesn't destroy the type + */ + num_ref = H5Iinc_type_ref(myType); + VERIFY(num_ref, 2, "H5Iinc_type_ref"); + if( num_ref != 2) + goto out; + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 1, "H5Idec_type_ref"); + if(num_ref != 1) + goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* This call to dec_type_ref should destroy the type */ - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 0, "H5Idec_type_ref"); - if(num_ref != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if (H5Itype_exists(myType) != 0) - goto out; + /* This call to dec_type_ref should destroy the type */ + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 0, "H5Idec_type_ref"); + if(num_ref != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if (H5Itype_exists(myType) != 0) + goto out; - H5E_BEGIN_TRY + H5E_BEGIN_TRY err = H5Inmembers(myType, &num_members); - if(err >= 0) - goto out; - H5E_END_TRY + if(err >= 0) + goto out; + H5E_END_TRY - return 0; + return 0; out: - /* Clean up type if it has been allocated and free memory used - * by testObj */ - if(myType >= 0) - H5Idestroy_type(myType); + /* Clean up type if it has been allocated and free memory used + * by testObj + */ + if(myType >= 0) + H5Idestroy_type(myType); - return -1; + return -1; } diff --git a/test/trefstr.c b/test/trefstr.c index f55ede0..83e2951 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -251,7 +251,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); CHECK_PTR(s, "H5RS_get_str"); - VERIFY(s, buf, "wrapping"); + CHECK_PTR_EQ(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -309,7 +309,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -323,7 +323,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tskiplist.c b/test/tskiplist.c index 12320ea..2806afe 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -322,17 +322,17 @@ test_skiplist_remove(void) search_key=key1; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key1, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key1, "H5SL_remove"); search_key=key2; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key2, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key2, "H5SL_remove"); search_key=key3; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key3, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key3, "H5SL_remove"); /* Check that the skip list has no elements */ num=H5SL_count(slist); @@ -1210,8 +1210,8 @@ static herr_t test_tfs_iter(void *_obj, void *key, void *_udata) { test_tfs_it_ud_t *udata = (test_tfs_it_ud_t *)_udata; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Increment number of calls */ udata->ncalls++; @@ -1236,8 +1236,8 @@ static htri_t test_tfs_free(void *_obj, void *key, void *_obj_list) { htri_t ret_value; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Mark this object as freed (to make sure it isn't recursively freed, that * is not something we support, we will undo this if we decide later not to -- cgit v0.12 From eeb1802055922417ca281ecc7822fbef50975f6d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:11:53 -0800 Subject: Casted pointers to void to quiet warnings on Linux. --- test/testhdf5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 6244524..c36c4e1 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -90,7 +90,7 @@ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), ret, val, (int)__LINE__, __FILE__); \ + (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 796cc17f414b35708ae51e06f75f5a7d0205881b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:15:45 -0800 Subject: Changed casts to const void * --- test/testhdf5.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index c36c4e1..127c687 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -86,11 +86,11 @@ #define CHECK_PTR_EQ(ret, val, where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ + (where), (int)__LINE__, __FILE__, (const void *)(ret)); \ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ + (where), (const void *)(ret), (const void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 04f22540e239103f468ed48c2349b8ffe8f3b476 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Nov 2017 13:06:10 -0600 Subject: Update macros --- config/cmake_ext_mod/HDFMacros.cmake | 1 + fortran/src/H5f90global.F90 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 602b6bf..192a5c8 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -108,6 +108,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES + OUTPUT_NAME ${LIB_RELEASE_NAME} OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index d4a9008..4a04971 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -83,7 +83,8 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in - ! both h5open_f and in h5close_f + ! both h5open_f and in h5close_f; initialize to fix linking issues + ! on OSX and Intel compilers. INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 @@ -437,7 +438,6 @@ MODULE H5GLOBAL INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - CONTAINS ! Copy a c string to a Fortran string -- cgit v0.12 From d60ec508bcce1e6970bcf7f46ef81c87c6f420f0 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 15:24:27 -0600 Subject: initialized integer constants --- fortran/src/H5f90global.F90 | 126 ++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 4a04971..8d17ff0 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -89,50 +89,50 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_INTEGER - INTEGER(HID_T) :: H5T_NATIVE_REAL - INTEGER(HID_T) :: H5T_NATIVE_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_CHARACTER - INTEGER(HID_T) :: H5T_STD_REF_OBJ - INTEGER(HID_T) :: H5T_STD_REF_DSETREG - INTEGER(HID_T) :: H5T_IEEE_F32BE - INTEGER(HID_T) :: H5T_IEEE_F32LE - INTEGER(HID_T) :: H5T_IEEE_F64BE - INTEGER(HID_T) :: H5T_IEEE_F64LE - INTEGER(HID_T) :: H5T_STD_I8BE - INTEGER(HID_T) :: H5T_STD_I8LE - INTEGER(HID_T) :: H5T_STD_I16BE - INTEGER(HID_T) :: H5T_STD_I16LE - INTEGER(HID_T) :: H5T_STD_I32BE - INTEGER(HID_T) :: H5T_STD_I32LE - INTEGER(HID_T) :: H5T_STD_I64BE - INTEGER(HID_T) :: H5T_STD_I64LE - INTEGER(HID_T) :: H5T_STD_U8BE - INTEGER(HID_T) :: H5T_STD_U8LE - INTEGER(HID_T) :: H5T_STD_U16BE - INTEGER(HID_T) :: H5T_STD_U16LE - INTEGER(HID_T) :: H5T_STD_U32BE - INTEGER(HID_T) :: H5T_STD_U32LE - INTEGER(HID_T) :: H5T_STD_U64BE - INTEGER(HID_T) :: H5T_STD_U64LE - INTEGER(HID_T) :: H5T_STRING - INTEGER(HID_T) :: H5T_STD_B8BE - INTEGER(HID_T) :: H5T_STD_B8LE - INTEGER(HID_T) :: H5T_STD_B16BE - INTEGER(HID_T) :: H5T_STD_B16LE - INTEGER(HID_T) :: H5T_STD_B32BE - INTEGER(HID_T) :: H5T_STD_B32LE - INTEGER(HID_T) :: H5T_STD_B64BE - INTEGER(HID_T) :: H5T_STD_B64LE - INTEGER(HID_T) :: H5T_NATIVE_B8 - INTEGER(HID_T) :: H5T_NATIVE_B16 - INTEGER(HID_T) :: H5T_NATIVE_B32 - INTEGER(HID_T) :: H5T_NATIVE_B64 - INTEGER(HID_T) :: H5T_FORTRAN_S1 - INTEGER(HID_T) :: H5T_C_S1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_INTEGER = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL = -1 + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER = -1 + INTEGER(HID_T) :: H5T_STD_REF_OBJ = -1 + INTEGER(HID_T) :: H5T_STD_REF_DSETREG = -1 + INTEGER(HID_T) :: H5T_IEEE_F32BE = -1 + INTEGER(HID_T) :: H5T_IEEE_F32LE = -1 + INTEGER(HID_T) :: H5T_IEEE_F64BE = -1 + INTEGER(HID_T) :: H5T_IEEE_F64LE = -1 + INTEGER(HID_T) :: H5T_STD_I8BE = -1 + INTEGER(HID_T) :: H5T_STD_I8LE = -1 + INTEGER(HID_T) :: H5T_STD_I16BE = -1 + INTEGER(HID_T) :: H5T_STD_I16LE = -1 + INTEGER(HID_T) :: H5T_STD_I32BE = -1 + INTEGER(HID_T) :: H5T_STD_I32LE = -1 + INTEGER(HID_T) :: H5T_STD_I64BE = -1 + INTEGER(HID_T) :: H5T_STD_I64LE = -1 + INTEGER(HID_T) :: H5T_STD_U8BE = -1 + INTEGER(HID_T) :: H5T_STD_U8LE = -1 + INTEGER(HID_T) :: H5T_STD_U16BE = -1 + INTEGER(HID_T) :: H5T_STD_U16LE = -1 + INTEGER(HID_T) :: H5T_STD_U32BE = -1 + INTEGER(HID_T) :: H5T_STD_U32LE = -1 + INTEGER(HID_T) :: H5T_STD_U64BE = -1 + INTEGER(HID_T) :: H5T_STD_U64LE = -1 + INTEGER(HID_T) :: H5T_STRING = -1 + INTEGER(HID_T) :: H5T_STD_B8BE = -1 + INTEGER(HID_T) :: H5T_STD_B8LE = -1 + INTEGER(HID_T) :: H5T_STD_B16BE = -1 + INTEGER(HID_T) :: H5T_STD_B16LE = -1 + INTEGER(HID_T) :: H5T_STD_B32BE = -1 + INTEGER(HID_T) :: H5T_STD_B32LE = -1 + INTEGER(HID_T) :: H5T_STD_B64BE = -1 + INTEGER(HID_T) :: H5T_STD_B64LE = -1 + INTEGER(HID_T) :: H5T_NATIVE_B8 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B16 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B32 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B64 = -1 + INTEGER(HID_T) :: H5T_FORTRAN_S1 = -1 + INTEGER(HID_T) :: H5T_C_S1 = -1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -156,25 +156,25 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! - INTEGER :: H5F_ACC_RDWR_F - INTEGER :: H5F_ACC_RDONLY_F - INTEGER :: H5F_ACC_TRUNC_F - INTEGER :: H5F_ACC_EXCL_F - INTEGER :: H5F_ACC_DEBUG_F - INTEGER :: H5F_SCOPE_LOCAL_F - INTEGER :: H5F_SCOPE_GLOBAL_F - INTEGER :: H5F_CLOSE_DEFAULT_F - INTEGER :: H5F_CLOSE_WEAK_F - INTEGER :: H5F_CLOSE_SEMI_F - INTEGER :: H5F_CLOSE_STRONG_F - INTEGER :: H5F_OBJ_FILE_F - INTEGER :: H5F_OBJ_DATASET_F - INTEGER :: H5F_OBJ_GROUP_F - INTEGER :: H5F_OBJ_DATATYPE_F - INTEGER :: H5F_OBJ_ALL_F - INTEGER :: H5F_LIBVER_EARLIEST_F - INTEGER :: H5F_LIBVER_LATEST_F - INTEGER :: H5F_UNLIMITED_F + INTEGER :: H5F_ACC_RDWR_F = -1 + INTEGER :: H5F_ACC_RDONLY_F = -1 + INTEGER :: H5F_ACC_TRUNC_F = -1 + INTEGER :: H5F_ACC_EXCL_F = -1 + INTEGER :: H5F_ACC_DEBUG_F = -1 + INTEGER :: H5F_SCOPE_LOCAL_F = -1 + INTEGER :: H5F_SCOPE_GLOBAL_F = -1 + INTEGER :: H5F_CLOSE_DEFAULT_F = -1 + INTEGER :: H5F_CLOSE_WEAK_F = -1 + INTEGER :: H5F_CLOSE_SEMI_F = -1 + INTEGER :: H5F_CLOSE_STRONG_F = -1 + INTEGER :: H5F_OBJ_FILE_F = -1 + INTEGER :: H5F_OBJ_DATASET_F = -1 + INTEGER :: H5F_OBJ_GROUP_F = -1 + INTEGER :: H5F_OBJ_DATATYPE_F = -1 + INTEGER :: H5F_OBJ_ALL_F = -1 + INTEGER :: H5F_LIBVER_EARLIEST_F = -1 + INTEGER :: H5F_LIBVER_LATEST_F = -1 + INTEGER :: H5F_UNLIMITED_F = -1 ! ! H5G flags declaration ! -- cgit v0.12 From d37c9b1cb03fa04aadf08bb51fd45aa570016797 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 16:34:20 -0600 Subject: export var. --- fortran/src/H5f90global.F90 | 128 ++++++++++++++++++------------------- fortran/src/hdf5_fortrandll.def.in | 2 + 2 files changed, 66 insertions(+), 64 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 8d17ff0..0247ad8 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -89,50 +89,50 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_INTEGER = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL = -1 - INTEGER(HID_T) :: H5T_NATIVE_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_CHARACTER = -1 - INTEGER(HID_T) :: H5T_STD_REF_OBJ = -1 - INTEGER(HID_T) :: H5T_STD_REF_DSETREG = -1 - INTEGER(HID_T) :: H5T_IEEE_F32BE = -1 - INTEGER(HID_T) :: H5T_IEEE_F32LE = -1 - INTEGER(HID_T) :: H5T_IEEE_F64BE = -1 - INTEGER(HID_T) :: H5T_IEEE_F64LE = -1 - INTEGER(HID_T) :: H5T_STD_I8BE = -1 - INTEGER(HID_T) :: H5T_STD_I8LE = -1 - INTEGER(HID_T) :: H5T_STD_I16BE = -1 - INTEGER(HID_T) :: H5T_STD_I16LE = -1 - INTEGER(HID_T) :: H5T_STD_I32BE = -1 - INTEGER(HID_T) :: H5T_STD_I32LE = -1 - INTEGER(HID_T) :: H5T_STD_I64BE = -1 - INTEGER(HID_T) :: H5T_STD_I64LE = -1 - INTEGER(HID_T) :: H5T_STD_U8BE = -1 - INTEGER(HID_T) :: H5T_STD_U8LE = -1 - INTEGER(HID_T) :: H5T_STD_U16BE = -1 - INTEGER(HID_T) :: H5T_STD_U16LE = -1 - INTEGER(HID_T) :: H5T_STD_U32BE = -1 - INTEGER(HID_T) :: H5T_STD_U32LE = -1 - INTEGER(HID_T) :: H5T_STD_U64BE = -1 - INTEGER(HID_T) :: H5T_STD_U64LE = -1 - INTEGER(HID_T) :: H5T_STRING = -1 - INTEGER(HID_T) :: H5T_STD_B8BE = -1 - INTEGER(HID_T) :: H5T_STD_B8LE = -1 - INTEGER(HID_T) :: H5T_STD_B16BE = -1 - INTEGER(HID_T) :: H5T_STD_B16LE = -1 - INTEGER(HID_T) :: H5T_STD_B32BE = -1 - INTEGER(HID_T) :: H5T_STD_B32LE = -1 - INTEGER(HID_T) :: H5T_STD_B64BE = -1 - INTEGER(HID_T) :: H5T_STD_B64LE = -1 - INTEGER(HID_T) :: H5T_NATIVE_B8 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B16 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B32 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B64 = -1 - INTEGER(HID_T) :: H5T_FORTRAN_S1 = -1 - INTEGER(HID_T) :: H5T_C_S1 = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -156,25 +156,25 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! - INTEGER :: H5F_ACC_RDWR_F = -1 - INTEGER :: H5F_ACC_RDONLY_F = -1 - INTEGER :: H5F_ACC_TRUNC_F = -1 - INTEGER :: H5F_ACC_EXCL_F = -1 - INTEGER :: H5F_ACC_DEBUG_F = -1 - INTEGER :: H5F_SCOPE_LOCAL_F = -1 - INTEGER :: H5F_SCOPE_GLOBAL_F = -1 - INTEGER :: H5F_CLOSE_DEFAULT_F = -1 - INTEGER :: H5F_CLOSE_WEAK_F = -1 - INTEGER :: H5F_CLOSE_SEMI_F = -1 - INTEGER :: H5F_CLOSE_STRONG_F = -1 - INTEGER :: H5F_OBJ_FILE_F = -1 - INTEGER :: H5F_OBJ_DATASET_F = -1 - INTEGER :: H5F_OBJ_GROUP_F = -1 - INTEGER :: H5F_OBJ_DATATYPE_F = -1 - INTEGER :: H5F_OBJ_ALL_F = -1 - INTEGER :: H5F_LIBVER_EARLIEST_F = -1 - INTEGER :: H5F_LIBVER_LATEST_F = -1 - INTEGER :: H5F_UNLIMITED_F = -1 + INTEGER :: H5F_ACC_RDWR_F + INTEGER :: H5F_ACC_RDONLY_F + INTEGER :: H5F_ACC_TRUNC_F + INTEGER :: H5F_ACC_EXCL_F + INTEGER :: H5F_ACC_DEBUG_F + INTEGER :: H5F_SCOPE_LOCAL_F + INTEGER :: H5F_SCOPE_GLOBAL_F + INTEGER :: H5F_CLOSE_DEFAULT_F + INTEGER :: H5F_CLOSE_WEAK_F + INTEGER :: H5F_CLOSE_SEMI_F + INTEGER :: H5F_CLOSE_STRONG_F + INTEGER :: H5F_OBJ_FILE_F + INTEGER :: H5F_OBJ_DATASET_F + INTEGER :: H5F_OBJ_GROUP_F + INTEGER :: H5F_OBJ_DATATYPE_F + INTEGER :: H5F_OBJ_ALL_F + INTEGER :: H5F_LIBVER_EARLIEST_F + INTEGER :: H5F_LIBVER_LATEST_F + INTEGER :: H5F_UNLIMITED_F ! ! H5G flags declaration ! @@ -258,7 +258,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F + INTEGER :: H5FD_MEM_NTYPES_F=-1 INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 3a5a91f..43a802c 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,4 +1,6 @@ EXPORTS +; H5GLOBAL +H5GLOBAL_mp_H5FD_MEM_NTYPES_F ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From 4a15b32a42f3f22773290e04f898d212e572dae0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 1 Dec 2017 13:36:23 -0600 Subject: H5detect and H5make_libsettings need include folder --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b163b8a..ab06ce8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -849,6 +849,9 @@ endif () #----------------------------------------------------------------------------- add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect STATIC " " " ") +if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (H5detect PUBLIC ${MPI_C_INCLUDE_DIRS}) +endif () if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () @@ -863,6 +866,9 @@ add_custom_command ( add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") +if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (H5make_libsettings PUBLIC ${MPI_C_INCLUDE_DIRS}) +endif () if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () -- cgit v0.12 From e416d374935430e94ebc8d7f3917b2a0b1f82967 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 12:18:13 -0600 Subject: exported global variables for windows --- fortran/src/H5f90global.F90 | 4 +- fortran/src/hdf5_fortrandll.def.in | 329 +++++++++++++++++++++++++++++++++++++ 2 files changed, 331 insertions(+), 2 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 0247ad8..9054522 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -139,7 +139,7 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:NUM_NATIVE_INTEGER_KIND) :: H5T_NATIVE_INTEGER_KIND INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- - + ! ! H5generic flags declaration ! INTEGER :: H5_INDEX_UNKNOWN_F @@ -258,7 +258,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F=-1 + INTEGER :: H5FD_MEM_NTYPES_F INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 43a802c..3903c8b 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,6 +1,335 @@ EXPORTS ; H5GLOBAL +H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT +H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_INTEGER +H5GLOBAL_mp_H5T_NATIVE_REAL +H5GLOBAL_mp_H5T_NATIVE_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_CHARACTER +H5GLOBAL_mp_H5T_STD_REF_OBJ +H5GLOBAL_mp_H5T_STD_REF_DSETREG +H5GLOBAL_mp_H5T_IEEE_F32BE +H5GLOBAL_mp_H5T_IEEE_F32LE +H5GLOBAL_mp_H5T_IEEE_F64BE +H5GLOBAL_mp_H5T_IEEE_F64LE +H5GLOBAL_mp_H5T_STD_I8BE +H5GLOBAL_mp_H5T_STD_I8LE +H5GLOBAL_mp_H5T_STD_I16BE +H5GLOBAL_mp_H5T_STD_I16LE +H5GLOBAL_mp_H5T_STD_I32BE +H5GLOBAL_mp_H5T_STD_I32LE +H5GLOBAL_mp_H5T_STD_I64BE +H5GLOBAL_mp_H5T_STD_I64LE +H5GLOBAL_mp_H5T_STD_U8BE +H5GLOBAL_mp_H5T_STD_U8LE +H5GLOBAL_mp_H5T_STD_U16BE +H5GLOBAL_mp_H5T_STD_U16LE +H5GLOBAL_mp_H5T_STD_U32BE +H5GLOBAL_mp_H5T_STD_U32LE +H5GLOBAL_mp_H5T_STD_U64BE +H5GLOBAL_mp_H5T_STD_U64LE +H5GLOBAL_mp_H5T_STRING +H5GLOBAL_mp_H5T_STD_B8BE +H5GLOBAL_mp_H5T_STD_B8LE +H5GLOBAL_mp_H5T_STD_B16BE +H5GLOBAL_mp_H5T_STD_B16LE +H5GLOBAL_mp_H5T_STD_B32BE +H5GLOBAL_mp_H5T_STD_B32LE +H5GLOBAL_mp_H5T_STD_B64BE +H5GLOBAL_mp_H5T_STD_B64LE +H5GLOBAL_mp_H5T_NATIVE_B8 +H5GLOBAL_mp_H5T_NATIVE_B16 +H5GLOBAL_mp_H5T_NATIVE_B32 +H5GLOBAL_mp_H5T_NATIVE_B64 +H5GLOBAL_mp_H5T_FORTRAN_S1 +H5GLOBAL_mp_H5T_C_S1 +H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 +; +; H5generic flags declaration +; +H5GLOBAL_mp_H5_INDEX_UNKNOWN_F +H5GLOBAL_mp_H5_INDEX_NAME_F +H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F +H5GLOBAL_mp_H5_INDEX_N_F +H5GLOBAL_mp_H5_ITER_UNKNOWN_F +H5GLOBAL_mp_H5_ITER_INC_F +H5GLOBAL_mp_H5_ITER_DEC_F +H5GLOBAL_mp_H5_ITER_NATIVE_F +H5GLOBAL_mp_H5_ITER_N_F +H5GLOBAL_mp_HADDR_UNDEF_F +; +; H5F flags declaration +; +H5GLOBAL_mp_H5F_ACC_RDWR_F +H5GLOBAL_mp_H5F_ACC_RDONLY_F +H5GLOBAL_mp_H5F_ACC_TRUNC_F +H5GLOBAL_mp_H5F_ACC_EXCL_F +H5GLOBAL_mp_H5F_ACC_DEBUG_F +H5GLOBAL_mp_H5F_SCOPE_LOCAL_F +H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F +H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F +H5GLOBAL_mp_H5F_CLOSE_WEAK_F +H5GLOBAL_mp_H5F_CLOSE_SEMI_F +H5GLOBAL_mp_H5F_CLOSE_STRONG_F +H5GLOBAL_mp_H5F_OBJ_FILE_F +H5GLOBAL_mp_H5F_OBJ_DATASET_F +H5GLOBAL_mp_H5F_OBJ_GROUP_F +H5GLOBAL_mp_H5F_OBJ_DATATYPE_F +H5GLOBAL_mp_H5F_OBJ_ALL_F +H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F +H5GLOBAL_mp_H5F_LIBVER_LATEST_F +H5GLOBAL_mp_H5F_UNLIMITED_F +; +; H5G flags declaration +; +H5GLOBAL_mp_H5G_UNKNOWN_F +H5GLOBAL_mp_H5G_GROUP_F +H5GLOBAL_mp_H5G_DATASET_F +H5GLOBAL_mp_H5G_TYPE_F +H5GLOBAL_mp_H5G_LINK_F +H5GLOBAL_mp_H5G_UDLINK_F +H5GLOBAL_mp_H5G_SAME_LOC_F +H5GLOBAL_mp_H5G_LINK_ERROR_F +H5GLOBAL_mp_H5G_LINK_HARD_F +H5GLOBAL_mp_H5G_LINK_SOFT_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F +; +; H5D flags declaration +; +H5GLOBAL_mp_H5D_COMPACT_F +H5GLOBAL_mp_H5D_CONTIGUOUS_F +H5GLOBAL_mp_H5D_CHUNKED_F +H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F +H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F +H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F +H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F +H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F +H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F +H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F +H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F +H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F +H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F +H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F +H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F +H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F +H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F +H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F +H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F +H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F +H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F +H5GLOBAL_mp_H5D_VDS_ERROR_F +H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F +H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F +H5GLOBAL_mp_H5D_VIRTUAL_F +; +; H5E flags declaration +; +H5GLOBAL_mp_H5E_DEFAULT_F +H5GLOBAL_mp_H5E_MAJOR_F +H5GLOBAL_mp_H5E_MINOR_F +H5GLOBAL_mp_H5E_WALK_UPWARD_F +H5GLOBAL_mp_H5E_WALK_DOWNWARD_F +; +; H5FD file drivers flags declaration +; +H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F +H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F +H5GLOBAL_mp_H5FD_MEM_NOLIST_F +H5GLOBAL_mp_H5FD_MEM_DEFAULT_F +H5GLOBAL_mp_H5FD_MEM_SUPER_F +H5GLOBAL_mp_H5FD_MEM_BTREE_F +H5GLOBAL_mp_H5FD_MEM_DRAW_F +H5GLOBAL_mp_H5FD_MEM_GHEAP_F +H5GLOBAL_mp_H5FD_MEM_LHEAP_F +H5GLOBAL_mp_H5FD_MEM_OHDR_F H5GLOBAL_mp_H5FD_MEM_NTYPES_F +H5GLOBAL_mp_H5FD_CORE_F +H5GLOBAL_mp_H5FD_FAMILY_F +H5GLOBAL_mp_H5FD_LOG_F +H5GLOBAL_mp_H5FD_MPIO_F +H5GLOBAL_mp_H5FD_MULTI_F +H5GLOBAL_mp_H5FD_SEC2_F +H5GLOBAL_mp_H5FD_STDIO_F +; +; H5I flags declaration +; +H5GLOBAL_mp_H5I_FILE_F +H5GLOBAL_mp_H5I_GROUP_F +H5GLOBAL_mp_H5I_DATATYPE_F +H5GLOBAL_mp_H5I_DATASPACE_F +H5GLOBAL_mp_H5I_DATASET_F +H5GLOBAL_mp_H5I_ATTR_F +H5GLOBAL_mp_H5I_BADID_F +; +; H5L flags declaration +; +H5GLOBAL_mp_H5L_TYPE_ERROR_F +H5GLOBAL_mp_H5L_TYPE_HARD_F +H5GLOBAL_mp_H5L_TYPE_SOFT_F +H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F +H5GLOBAL_mp_H5L_SAME_LOC_F +H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F +; +; H5O flags declaration +; +H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO +H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE +H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER +H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE +H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F +H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F +H5GLOBAL_mp_H5O_COPY_ALL_F +H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F +H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE +H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** +H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F +H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F +H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F +H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F +H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F +H5GLOBAL_mp_H5O_TYPE_GROUP_F +H5GLOBAL_mp_H5O_TYPE_DATASET_F +H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F +H5GLOBAL_mp_H5O_TYPE_NTYPES_F +; +; H5P flags declaration +; +H5GLOBAL_mp_H5P_FILE_CREATE_F +H5GLOBAL_mp_H5P_FILE_ACCESS_F +H5GLOBAL_mp_H5P_DATASET_CREATE_F +H5GLOBAL_mp_H5P_DATASET_XFER_F +H5GLOBAL_mp_H5P_FILE_MOUNT_F +H5GLOBAL_mp_H5P_DEFAULT_F +H5GLOBAL_mp_H5P_ROOT_F +H5GLOBAL_mp_H5P_OBJECT_CREATE_F +H5GLOBAL_mp_H5P_DATASET_ACCESS_F +H5GLOBAL_mp_H5P_GROUP_CREATE_F +H5GLOBAL_mp_H5P_GROUP_ACCESS_F +H5GLOBAL_mp_H5P_DATATYPE_CREATE_F +H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F +H5GLOBAL_mp_H5P_STRING_CREATE_F +H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F +H5GLOBAL_mp_H5P_OBJECT_COPY_F +H5GLOBAL_mp_H5P_LINK_CREATE_F +H5GLOBAL_mp_H5P_LINK_ACCESS_F +H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F +H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F +; +; H5R flags declaration +; +H5GLOBAL_mp_H5R_OBJECT_F +H5GLOBAL_mp_H5R_DATASET_REGION_F +; +; H5S flags declaration +; +H5GLOBAL_mp_H5S_UNLIMITED_F +H5GLOBAL_mp_H5S_ALL_F +H5GLOBAL_mp_H5S_SCALAR_F +H5GLOBAL_mp_H5S_SIMPLE_F +H5GLOBAL_mp_H5S_NULL_F +H5GLOBAL_mp_H5S_SELECT_NOOP_F +H5GLOBAL_mp_H5S_SELECT_SET_F +H5GLOBAL_mp_H5S_SELECT_OR_F +H5GLOBAL_mp_H5S_SELECT_AND_F +H5GLOBAL_mp_H5S_SELECT_XOR_F +H5GLOBAL_mp_H5S_SELECT_NOTB_F +H5GLOBAL_mp_H5S_SELECT_NOTA_F +H5GLOBAL_mp_H5S_SELECT_APPEND_F +H5GLOBAL_mp_H5S_SELECT_PREPEND_F +H5GLOBAL_mp_H5S_SELECT_INVALID_F +H5GLOBAL_mp_H5S_SEL_ERROR_F +H5GLOBAL_mp_H5S_SEL_NONE_F +H5GLOBAL_mp_H5S_SEL_POINTS_F +H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F +H5GLOBAL_mp_H5S_SEL_ALL_F +; +; H5T flags declaration +; +H5GLOBAL_mp_H5T_NO_CLASS_F +H5GLOBAL_mp_H5T_INTEGER_F +H5GLOBAL_mp_H5T_FLOAT_F +H5GLOBAL_mp_H5T_TIME_F +H5GLOBAL_mp_H5T_STRING_F +H5GLOBAL_mp_H5T_BITFIELD_F +H5GLOBAL_mp_H5T_OPAQUE_F +H5GLOBAL_mp_H5T_COMPOUND_F +H5GLOBAL_mp_H5T_REFERENCE_F +H5GLOBAL_mp_H5T_ENUM_F +H5GLOBAL_mp_H5T_VLEN_F +H5GLOBAL_mp_H5T_ARRAY_F +H5GLOBAL_mp_H5T_ORDER_LE_F +H5GLOBAL_mp_H5T_ORDER_BE_F +H5GLOBAL_mp_H5T_ORDER_VAX_F +H5GLOBAL_mp_H5T_ORDER_NONE_F +H5GLOBAL_mp_H5T_ORDER_MIXED_F +H5GLOBAL_mp_H5T_PAD_ZERO_F +H5GLOBAL_mp_H5T_PAD_ONE_F +H5GLOBAL_mp_H5T_PAD_BACKGROUND_F +H5GLOBAL_mp_H5T_PAD_ERROR_F +H5GLOBAL_mp_H5T_SGN_NONE_F +H5GLOBAL_mp_H5T_SGN_2_F +H5GLOBAL_mp_H5T_SGN_ERROR_F +H5GLOBAL_mp_H5T_NORM_IMPLIED_F +H5GLOBAL_mp_H5T_NORM_MSBSET_F +H5GLOBAL_mp_H5T_NORM_NONE_F +H5GLOBAL_mp_H5T_CSET_ASCII_F +H5GLOBAL_mp_H5T_CSET_UTF8_F +H5GLOBAL_mp_H5T_STR_NULLTERM_F +H5GLOBAL_mp_H5T_STR_NULLPAD_F +H5GLOBAL_mp_H5T_STR_SPACEPAD_F +H5GLOBAL_mp_H5T_STR_ERROR_F +H5GLOBAL_mp_H5T_DIR_ASCEND_F +H5GLOBAL_mp_H5T_DIR_DESCEND_F +; +; H5Z flags declaration +; +H5GLOBAL_mp_H5Z_FILTER_ERROR_F +H5GLOBAL_mp_H5Z_FILTER_NONE_F +H5GLOBAL_mp_H5Z_FILTER_ALL_F +H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F +H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F +H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F +H5GLOBAL_mp_H5Z_FILTER_SZIP_F +H5GLOBAL_mp_H5Z_ERROR_EDC_F +H5GLOBAL_mp_H5Z_DISABLE_EDC_F +H5GLOBAL_mp_H5Z_ENABLE_EDC_F +H5GLOBAL_mp_H5Z_NO_EDC_F +H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F +H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F +H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F +H5GLOBAL_mp_H5Z_FILTER_NBIT_F +H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F +H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F +H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F +H5GLOBAL_mp_H5Z_SO_INT_F +H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F +; +; H5 Library flags declaration +; +H5GLOBAL_mp_H5_SZIP_EC_OM_F +H5GLOBAL_mp_H5_SZIP_NN_OM_F +; +; PROCEDURES +; -------------- +; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From 9e39def205fe470ef1527d7955ddbde6290be511 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 12:53:20 -0600 Subject: removed fortran comments --- fortran/src/hdf5_fortrandll.def.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 3903c8b..585602f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -182,10 +182,10 @@ H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F ; ; H5O flags declaration ; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE +H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F +H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F +H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F +H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F H5GLOBAL_mp_H5O_COPY_ALL_F @@ -197,9 +197,9 @@ H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F +H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -- cgit v0.12 From 9deb5267ca482050288d993bd67d1ec3064cdfb1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 4 Dec 2017 13:05:53 -0600 Subject: Changed reference from dl to CMake variable --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab06ce8..1d217c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -891,7 +891,7 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) @@ -935,7 +935,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) -- cgit v0.12 From 6d658a946cc71994fc239b16ccc645b5e728998f Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines --- hl/fortran/src/H5DSff.F90 | 65 +++-------------------------------------------- 1 file changed, 3 insertions(+), 62 deletions(-) diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From fc089499ad407364bcefaa72ed06f7b4d579a387 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:38:38 -0600 Subject: added missing parameter --- fortran/src/hdf5_fortrandll.def.in | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 585602f..507c991 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -44,6 +44,7 @@ H5GLOBAL_mp_H5T_NATIVE_B32 H5GLOBAL_mp_H5T_NATIVE_B64 H5GLOBAL_mp_H5T_FORTRAN_S1 H5GLOBAL_mp_H5T_C_S1 +H5GLOBAL_mp_H5T_NATIVE_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 ; ; H5generic flags declaration -- cgit v0.12 From 1f3eb82bceacf5d08db02d68977de0d21f54d26f Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:55:51 -0600 Subject: added missing parameter --- fortran/src/hdf5_fortrandll.def.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 507c991..417778d 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,5 +1,7 @@ EXPORTS ; H5GLOBAL +H5GLOBAL_mp_H5_REAL_KIND +H5GLOBAL_mp_H5_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -- cgit v0.12 From 30807e1d80e9edd09cb5f2c75220bd82b761d595 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 16:35:13 -0600 Subject: removed parameters --- fortran/src/hdf5_fortrandll.def.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 417778d..507c991 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,7 +1,5 @@ EXPORTS ; H5GLOBAL -H5GLOBAL_mp_H5_REAL_KIND -H5GLOBAL_mp_H5_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -- cgit v0.12 From bd49f6460c3b4b3bafe5607f41af8b605d3044bb Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 5 Dec 2017 10:03:49 -0600 Subject: moved dll export to Module --- fortran/src/H5f90global.F90 | 342 ++++++++++++++++++++++++++++++++++++- fortran/src/hdf5_fortrandll.def.in | 332 ----------------------------------- 2 files changed, 336 insertions(+), 338 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 9054522..3f00d9a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -88,7 +88,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -142,6 +191,19 @@ MODULE H5GLOBAL ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +218,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +262,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +296,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +354,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +375,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +391,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -269,6 +433,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +453,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +471,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +531,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +578,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +638,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +714,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +760,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 507c991..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,336 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT -H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_INTEGER -H5GLOBAL_mp_H5T_NATIVE_REAL -H5GLOBAL_mp_H5T_NATIVE_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_CHARACTER -H5GLOBAL_mp_H5T_STD_REF_OBJ -H5GLOBAL_mp_H5T_STD_REF_DSETREG -H5GLOBAL_mp_H5T_IEEE_F32BE -H5GLOBAL_mp_H5T_IEEE_F32LE -H5GLOBAL_mp_H5T_IEEE_F64BE -H5GLOBAL_mp_H5T_IEEE_F64LE -H5GLOBAL_mp_H5T_STD_I8BE -H5GLOBAL_mp_H5T_STD_I8LE -H5GLOBAL_mp_H5T_STD_I16BE -H5GLOBAL_mp_H5T_STD_I16LE -H5GLOBAL_mp_H5T_STD_I32BE -H5GLOBAL_mp_H5T_STD_I32LE -H5GLOBAL_mp_H5T_STD_I64BE -H5GLOBAL_mp_H5T_STD_I64LE -H5GLOBAL_mp_H5T_STD_U8BE -H5GLOBAL_mp_H5T_STD_U8LE -H5GLOBAL_mp_H5T_STD_U16BE -H5GLOBAL_mp_H5T_STD_U16LE -H5GLOBAL_mp_H5T_STD_U32BE -H5GLOBAL_mp_H5T_STD_U32LE -H5GLOBAL_mp_H5T_STD_U64BE -H5GLOBAL_mp_H5T_STD_U64LE -H5GLOBAL_mp_H5T_STRING -H5GLOBAL_mp_H5T_STD_B8BE -H5GLOBAL_mp_H5T_STD_B8LE -H5GLOBAL_mp_H5T_STD_B16BE -H5GLOBAL_mp_H5T_STD_B16LE -H5GLOBAL_mp_H5T_STD_B32BE -H5GLOBAL_mp_H5T_STD_B32LE -H5GLOBAL_mp_H5T_STD_B64BE -H5GLOBAL_mp_H5T_STD_B64LE -H5GLOBAL_mp_H5T_NATIVE_B8 -H5GLOBAL_mp_H5T_NATIVE_B16 -H5GLOBAL_mp_H5T_NATIVE_B32 -H5GLOBAL_mp_H5T_NATIVE_B64 -H5GLOBAL_mp_H5T_FORTRAN_S1 -H5GLOBAL_mp_H5T_C_S1 -H5GLOBAL_mp_H5T_NATIVE_INTEGER_KIND -H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 -; -; H5generic flags declaration -; -H5GLOBAL_mp_H5_INDEX_UNKNOWN_F -H5GLOBAL_mp_H5_INDEX_NAME_F -H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F -H5GLOBAL_mp_H5_INDEX_N_F -H5GLOBAL_mp_H5_ITER_UNKNOWN_F -H5GLOBAL_mp_H5_ITER_INC_F -H5GLOBAL_mp_H5_ITER_DEC_F -H5GLOBAL_mp_H5_ITER_NATIVE_F -H5GLOBAL_mp_H5_ITER_N_F -H5GLOBAL_mp_HADDR_UNDEF_F -; -; H5F flags declaration -; -H5GLOBAL_mp_H5F_ACC_RDWR_F -H5GLOBAL_mp_H5F_ACC_RDONLY_F -H5GLOBAL_mp_H5F_ACC_TRUNC_F -H5GLOBAL_mp_H5F_ACC_EXCL_F -H5GLOBAL_mp_H5F_ACC_DEBUG_F -H5GLOBAL_mp_H5F_SCOPE_LOCAL_F -H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F -H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F -H5GLOBAL_mp_H5F_CLOSE_WEAK_F -H5GLOBAL_mp_H5F_CLOSE_SEMI_F -H5GLOBAL_mp_H5F_CLOSE_STRONG_F -H5GLOBAL_mp_H5F_OBJ_FILE_F -H5GLOBAL_mp_H5F_OBJ_DATASET_F -H5GLOBAL_mp_H5F_OBJ_GROUP_F -H5GLOBAL_mp_H5F_OBJ_DATATYPE_F -H5GLOBAL_mp_H5F_OBJ_ALL_F -H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F -H5GLOBAL_mp_H5F_LIBVER_LATEST_F -H5GLOBAL_mp_H5F_UNLIMITED_F -; -; H5G flags declaration -; -H5GLOBAL_mp_H5G_UNKNOWN_F -H5GLOBAL_mp_H5G_GROUP_F -H5GLOBAL_mp_H5G_DATASET_F -H5GLOBAL_mp_H5G_TYPE_F -H5GLOBAL_mp_H5G_LINK_F -H5GLOBAL_mp_H5G_UDLINK_F -H5GLOBAL_mp_H5G_SAME_LOC_F -H5GLOBAL_mp_H5G_LINK_ERROR_F -H5GLOBAL_mp_H5G_LINK_HARD_F -H5GLOBAL_mp_H5G_LINK_SOFT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F -; -; H5D flags declaration -; -H5GLOBAL_mp_H5D_COMPACT_F -H5GLOBAL_mp_H5D_CONTIGUOUS_F -H5GLOBAL_mp_H5D_CHUNKED_F -H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F -H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F -H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F -H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F -H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F -H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F -H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F -H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F -H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F -H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F -H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F -H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F -H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F -H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F -H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F -H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F -H5GLOBAL_mp_H5D_VDS_ERROR_F -H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F -H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F -H5GLOBAL_mp_H5D_VIRTUAL_F -; -; H5E flags declaration -; -H5GLOBAL_mp_H5E_DEFAULT_F -H5GLOBAL_mp_H5E_MAJOR_F -H5GLOBAL_mp_H5E_MINOR_F -H5GLOBAL_mp_H5E_WALK_UPWARD_F -H5GLOBAL_mp_H5E_WALK_DOWNWARD_F -; -; H5FD file drivers flags declaration -; -H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F -H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F -H5GLOBAL_mp_H5FD_MEM_NOLIST_F -H5GLOBAL_mp_H5FD_MEM_DEFAULT_F -H5GLOBAL_mp_H5FD_MEM_SUPER_F -H5GLOBAL_mp_H5FD_MEM_BTREE_F -H5GLOBAL_mp_H5FD_MEM_DRAW_F -H5GLOBAL_mp_H5FD_MEM_GHEAP_F -H5GLOBAL_mp_H5FD_MEM_LHEAP_F -H5GLOBAL_mp_H5FD_MEM_OHDR_F -H5GLOBAL_mp_H5FD_MEM_NTYPES_F -H5GLOBAL_mp_H5FD_CORE_F -H5GLOBAL_mp_H5FD_FAMILY_F -H5GLOBAL_mp_H5FD_LOG_F -H5GLOBAL_mp_H5FD_MPIO_F -H5GLOBAL_mp_H5FD_MULTI_F -H5GLOBAL_mp_H5FD_SEC2_F -H5GLOBAL_mp_H5FD_STDIO_F -; -; H5I flags declaration -; -H5GLOBAL_mp_H5I_FILE_F -H5GLOBAL_mp_H5I_GROUP_F -H5GLOBAL_mp_H5I_DATATYPE_F -H5GLOBAL_mp_H5I_DATASPACE_F -H5GLOBAL_mp_H5I_DATASET_F -H5GLOBAL_mp_H5I_ATTR_F -H5GLOBAL_mp_H5I_BADID_F -; -; H5L flags declaration -; -H5GLOBAL_mp_H5L_TYPE_ERROR_F -H5GLOBAL_mp_H5L_TYPE_HARD_F -H5GLOBAL_mp_H5L_TYPE_SOFT_F -H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F -H5GLOBAL_mp_H5L_SAME_LOC_F -H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F -; -; H5O flags declaration -; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F -H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F -H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F -H5GLOBAL_mp_H5O_COPY_ALL_F -H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F -H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F -H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F -H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F -H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F -H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5O_TYPE_GROUP_F -H5GLOBAL_mp_H5O_TYPE_DATASET_F -H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F -H5GLOBAL_mp_H5O_TYPE_NTYPES_F -; -; H5P flags declaration -; -H5GLOBAL_mp_H5P_FILE_CREATE_F -H5GLOBAL_mp_H5P_FILE_ACCESS_F -H5GLOBAL_mp_H5P_DATASET_CREATE_F -H5GLOBAL_mp_H5P_DATASET_XFER_F -H5GLOBAL_mp_H5P_FILE_MOUNT_F -H5GLOBAL_mp_H5P_DEFAULT_F -H5GLOBAL_mp_H5P_ROOT_F -H5GLOBAL_mp_H5P_OBJECT_CREATE_F -H5GLOBAL_mp_H5P_DATASET_ACCESS_F -H5GLOBAL_mp_H5P_GROUP_CREATE_F -H5GLOBAL_mp_H5P_GROUP_ACCESS_F -H5GLOBAL_mp_H5P_DATATYPE_CREATE_F -H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F -H5GLOBAL_mp_H5P_STRING_CREATE_F -H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F -H5GLOBAL_mp_H5P_OBJECT_COPY_F -H5GLOBAL_mp_H5P_LINK_CREATE_F -H5GLOBAL_mp_H5P_LINK_ACCESS_F -H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F -H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F -; -; H5R flags declaration -; -H5GLOBAL_mp_H5R_OBJECT_F -H5GLOBAL_mp_H5R_DATASET_REGION_F -; -; H5S flags declaration -; -H5GLOBAL_mp_H5S_UNLIMITED_F -H5GLOBAL_mp_H5S_ALL_F -H5GLOBAL_mp_H5S_SCALAR_F -H5GLOBAL_mp_H5S_SIMPLE_F -H5GLOBAL_mp_H5S_NULL_F -H5GLOBAL_mp_H5S_SELECT_NOOP_F -H5GLOBAL_mp_H5S_SELECT_SET_F -H5GLOBAL_mp_H5S_SELECT_OR_F -H5GLOBAL_mp_H5S_SELECT_AND_F -H5GLOBAL_mp_H5S_SELECT_XOR_F -H5GLOBAL_mp_H5S_SELECT_NOTB_F -H5GLOBAL_mp_H5S_SELECT_NOTA_F -H5GLOBAL_mp_H5S_SELECT_APPEND_F -H5GLOBAL_mp_H5S_SELECT_PREPEND_F -H5GLOBAL_mp_H5S_SELECT_INVALID_F -H5GLOBAL_mp_H5S_SEL_ERROR_F -H5GLOBAL_mp_H5S_SEL_NONE_F -H5GLOBAL_mp_H5S_SEL_POINTS_F -H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F -H5GLOBAL_mp_H5S_SEL_ALL_F -; -; H5T flags declaration -; -H5GLOBAL_mp_H5T_NO_CLASS_F -H5GLOBAL_mp_H5T_INTEGER_F -H5GLOBAL_mp_H5T_FLOAT_F -H5GLOBAL_mp_H5T_TIME_F -H5GLOBAL_mp_H5T_STRING_F -H5GLOBAL_mp_H5T_BITFIELD_F -H5GLOBAL_mp_H5T_OPAQUE_F -H5GLOBAL_mp_H5T_COMPOUND_F -H5GLOBAL_mp_H5T_REFERENCE_F -H5GLOBAL_mp_H5T_ENUM_F -H5GLOBAL_mp_H5T_VLEN_F -H5GLOBAL_mp_H5T_ARRAY_F -H5GLOBAL_mp_H5T_ORDER_LE_F -H5GLOBAL_mp_H5T_ORDER_BE_F -H5GLOBAL_mp_H5T_ORDER_VAX_F -H5GLOBAL_mp_H5T_ORDER_NONE_F -H5GLOBAL_mp_H5T_ORDER_MIXED_F -H5GLOBAL_mp_H5T_PAD_ZERO_F -H5GLOBAL_mp_H5T_PAD_ONE_F -H5GLOBAL_mp_H5T_PAD_BACKGROUND_F -H5GLOBAL_mp_H5T_PAD_ERROR_F -H5GLOBAL_mp_H5T_SGN_NONE_F -H5GLOBAL_mp_H5T_SGN_2_F -H5GLOBAL_mp_H5T_SGN_ERROR_F -H5GLOBAL_mp_H5T_NORM_IMPLIED_F -H5GLOBAL_mp_H5T_NORM_MSBSET_F -H5GLOBAL_mp_H5T_NORM_NONE_F -H5GLOBAL_mp_H5T_CSET_ASCII_F -H5GLOBAL_mp_H5T_CSET_UTF8_F -H5GLOBAL_mp_H5T_STR_NULLTERM_F -H5GLOBAL_mp_H5T_STR_NULLPAD_F -H5GLOBAL_mp_H5T_STR_SPACEPAD_F -H5GLOBAL_mp_H5T_STR_ERROR_F -H5GLOBAL_mp_H5T_DIR_ASCEND_F -H5GLOBAL_mp_H5T_DIR_DESCEND_F -; -; H5Z flags declaration -; -H5GLOBAL_mp_H5Z_FILTER_ERROR_F -H5GLOBAL_mp_H5Z_FILTER_NONE_F -H5GLOBAL_mp_H5Z_FILTER_ALL_F -H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F -H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F -H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F -H5GLOBAL_mp_H5Z_FILTER_SZIP_F -H5GLOBAL_mp_H5Z_ERROR_EDC_F -H5GLOBAL_mp_H5Z_DISABLE_EDC_F -H5GLOBAL_mp_H5Z_ENABLE_EDC_F -H5GLOBAL_mp_H5Z_NO_EDC_F -H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F -H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_NBIT_F -H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F -H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F -H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F -H5GLOBAL_mp_H5Z_SO_INT_F -H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F -; -; H5 Library flags declaration -; -H5GLOBAL_mp_H5_SZIP_EC_OM_F -H5GLOBAL_mp_H5_SZIP_NN_OM_F -; -; PROCEDURES -; -------------- -; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From 23cec838a410deaf8be6a9ce76d2865a078a7d51 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 5 Dec 2017 10:29:53 -0600 Subject: clean-up --- fortran/src/H5f90global.F90 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 3f00d9a..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in -- cgit v0.12 From ec1e00a55f7b005fa9d87f92e58bc312286d0b8a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 5 Dec 2017 10:41:54 -0800 Subject: Normalization with VOL integration branch. --- src/H5.c | 24 ++++++------- src/H5Fint.c | 2 +- src/H5Fmount.c | 7 ++-- src/H5Fpkg.h | 25 ++++++------- src/H5Fprivate.h | 4 +-- src/H5Fquery.c | 8 ++--- src/H5Pprivate.h | 12 ++++--- src/hdf5.h | 52 +++++++++++++-------------- test/h5test.c | 107 ++++++++++++++++++++++--------------------------------- 9 files changed, 109 insertions(+), 132 deletions(-) diff --git a/src/H5.c b/src/H5.c index f0a222d..b8fd885 100644 --- a/src/H5.c +++ b/src/H5.c @@ -19,18 +19,18 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5FSprivate.h" /* File free space */ -#include "H5Lprivate.h" /* Links */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SLprivate.h" /* Skip lists */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5FSprivate.h" /* File free space */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5FSprivate.h" /* File free space */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip lists */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5FSprivate.h" /* File free space */ /****************/ /* Local Macros */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0eb1ea9..8212eb5 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1574,7 +1574,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi * * Purpose: Flushes cached data. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 3cd5c21..17d7850 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -25,9 +25,6 @@ #include "H5MMprivate.h" /* Memory management */ /* PRIVATE PROTOTYPES */ -static herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t plist_id, hid_t dxpl_id); -static herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); @@ -99,7 +96,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id) { @@ -265,7 +262,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) { H5G_t *child_group = NULL; /* Child's group in parent mtab */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index d702506..b50b4e5 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -360,16 +360,16 @@ struct H5F_file_t { * to shared H5F_file_t structs. */ struct H5F_t { - char *open_name; /* Name used to open file */ - char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */ - char *extpath; /* Path for searching target external link file */ - H5F_file_t *shared; /* The shared file info */ - unsigned nopen_objs; /* Number of open object headers*/ - H5FO_t *obj_count; /* # of time each object is opened through top file structure */ - hid_t file_id; /* ID of this file */ - hbool_t closing; /* File is in the process of being closed */ - struct H5F_t *parent; /* Parent file that this file is mounted to */ - unsigned nmounts; /* Number of children mounted to this file */ + char *open_name; /* Name used to open file */ + char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */ + char *extpath; /* Path for searching target external link file */ + H5F_file_t *shared; /* The shared file info */ + unsigned nopen_objs; /* Number of open object headers */ + H5FO_t *obj_count; /* # of time each object is opened through top file structure */ + hid_t file_id; /* ID of this file */ + hbool_t closing; /* File is in the process of being closed */ + struct H5F_t *parent; /* Parent file that this file is mounted to */ + unsigned nmounts; /* Number of children mounted to this file */ #ifdef H5_HAVE_PARALLEL H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */ hbool_t coll_md_write; /* Do all metadata writes collectively */ @@ -399,11 +399,12 @@ H5_DLL herr_t H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t H5_DLL herr_t H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); -H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, - hid_t meta_dxpl_id, hid_t raw_dxpl_id); +H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_id, hid_t raw_dxpl_id); H5_DLL herr_t H5F_close(H5F_t *f); /* File mount related routines */ +H5_DLL herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id, hid_t dxpl_id); +H5_DLL herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); H5_DLL herr_t H5F_close_mounts(H5F_t *f); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 18d0460..daf0a52 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -586,7 +586,7 @@ typedef struct H5F_t H5F_t; #define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ -#define H5B_MAGIC "TREE" +#define H5B_MAGIC "TREE" /* v2 B-tree signatures */ #define H5B2_HDR_MAGIC "BTHD" /* Header */ @@ -616,7 +616,7 @@ typedef struct H5F_t H5F_t; #define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */ /* Global heap signature */ -#define H5HG_MAGIC "GCOL" +#define H5HG_MAGIC "GCOL" /* Local heap signature */ #define H5HL_MAGIC "HEAP" diff --git a/src/H5Fquery.c b/src/H5Fquery.c index cc2399b..61b4183 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -32,10 +32,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ /****************/ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index a468464..374c117 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -17,6 +17,9 @@ #ifndef _H5Pprivate_H #define _H5Pprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5P_genplist_t H5P_genplist_t; + /* Include package's public header */ #include "H5Ppublic.h" @@ -52,12 +55,7 @@ typedef enum H5P_coll_md_read_flag_t { H5P_USER_TRUE = 1 } H5P_coll_md_read_flag_t; -/* Forward declarations (for prototypes & type definitions) */ -struct H5O_fill_t; -struct H5T_t; - /* Forward declarations for anonymous H5P objects */ -typedef struct H5P_genplist_t H5P_genplist_t; typedef struct H5P_genclass_t H5P_genclass_t; typedef enum H5P_plist_type_t { @@ -145,6 +143,10 @@ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_FACC[1]; /* File access */ /* Library Private Prototypes */ /******************************/ +/* Forward declaration of structs used below */ +struct H5O_fill_t; +struct H5T_t; + /* Package initialization routine */ H5_DLL herr_t H5P_init(void); diff --git a/src/hdf5.h b/src/hdf5.h index fc4541a..1709375 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -20,35 +20,35 @@ #define _HDF5_H #include "H5public.h" -#include "H5Apublic.h" /* Attributes */ -#include "H5ACpublic.h" /* Metadata cache */ -#include "H5Dpublic.h" /* Datasets */ -#include "H5Epublic.h" /* Errors */ -#include "H5Fpublic.h" /* Files */ -#include "H5FDpublic.h" /* File drivers */ -#include "H5Gpublic.h" /* Groups */ -#include "H5Ipublic.h" /* ID management */ -#include "H5Lpublic.h" /* Links */ -#include "H5MMpublic.h" /* Memory management */ -#include "H5Opublic.h" /* Object headers */ -#include "H5Ppublic.h" /* Property lists */ -#include "H5PLpublic.h" /* Plugins */ -#include "H5Rpublic.h" /* References */ -#include "H5Spublic.h" /* Dataspaces */ -#include "H5Tpublic.h" /* Datatypes */ -#include "H5Zpublic.h" /* Data filters */ +#include "H5Apublic.h" /* Attributes */ +#include "H5ACpublic.h" /* Metadata cache */ +#include "H5Dpublic.h" /* Datasets */ +#include "H5Epublic.h" /* Errors */ +#include "H5Fpublic.h" /* Files */ +#include "H5FDpublic.h" /* File drivers */ +#include "H5Gpublic.h" /* Groups */ +#include "H5Ipublic.h" /* ID management */ +#include "H5Lpublic.h" /* Links */ +#include "H5MMpublic.h" /* Memory management */ +#include "H5Opublic.h" /* Object headers */ +#include "H5Ppublic.h" /* Property lists */ +#include "H5PLpublic.h" /* Plugins */ +#include "H5Rpublic.h" /* References */ +#include "H5Spublic.h" /* Dataspaces */ +#include "H5Tpublic.h" /* Datatypes */ +#include "H5Zpublic.h" /* Data filters */ /* Predefined file drivers */ -#include "H5FDcore.h" /* Files stored entirely in memory */ -#include "H5FDdirect.h" /* Linux direct I/O */ -#include "H5FDfamily.h" /* File families */ -#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ -#include "H5FDmpi.h" /* MPI-based file drivers */ -#include "H5FDmulti.h" /* Usage-partitioned file family */ -#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ -#include "H5FDstdio.h" /* Standard C buffered I/O */ +#include "H5FDcore.h" /* Files stored entirely in memory */ +#include "H5FDdirect.h" /* Linux direct I/O */ +#include "H5FDfamily.h" /* File families */ +#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ +#include "H5FDmpi.h" /* MPI-based file drivers */ +#include "H5FDmulti.h" /* Usage-partitioned file family */ +#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ +#include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS -#include "H5FDwindows.h" /* Windows buffered I/O */ +#include "H5FDwindows.h" /* Win32 I/O */ #endif #endif diff --git a/test/h5test.c b/test/h5test.c index af45589..bbdd58b 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -104,68 +104,6 @@ static herr_t h5_errors(hid_t estack, void *client_data); static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size, hbool_t nest_printf); - - -/* A non-usable VFD class and its functions. - * - * Usable for testing things like ID handling where we shouldn't mess with the real VFDs. - */ -static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; } - -static herr_t dummy_vfd_close(H5FD_t *_file); -static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; } - -static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type); -static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } - -static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; } - -static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type); -static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } - -static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; } - -static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; } - -static H5FD_class_t dummy_vfd_class_g = { - "fake", /* name */ - 1, /* maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - NULL, /* terminate */ - NULL, /* sb_size */ - NULL, /* sb_encode */ - NULL, /* sb_decode */ - 0, /* fapl_size */ - NULL, /* fapl_get */ - NULL, /* fapl_copy */ - NULL, /* fapl_free */ - 0, /* dxpl_size */ - NULL, /* dxpl_copy */ - NULL, /* dxpl_free */ - dummy_vfd_open, /* open */ - dummy_vfd_close, /* close */ - NULL, /* cmp */ - NULL, /* query */ - NULL, /* get_type_map */ - NULL, /* alloc */ - NULL, /* free */ - dummy_vfd_get_eoa, /* get_eoa */ - dummy_vfd_set_eoa, /* set_eoa */ - dummy_vfd_get_eof, /* get_eof */ - NULL, /* get_handle */ - dummy_vfd_read, /* read */ - dummy_vfd_write, /* write */ - NULL, /* flush */ - NULL, /* truncate */ - NULL, /* lock */ - NULL, /* unlock */ - H5FD_FLMAP_DEFAULT /* fl_map */ -}; - /*------------------------------------------------------------------------- * Function: h5_errors @@ -1890,6 +1828,33 @@ error: return FAIL; } /* h5_wait_message() */ +/* Functions for the dummy VFD class (see below). + * + * Useful for testing things like ID handling where we shouldn't mess with the + * real VFDs. + */ +static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); +static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; } + +static herr_t dummy_vfd_close(H5FD_t *_file); +static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; } + +static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; } + +static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); +static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; } + +static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); +static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; } + + /*------------------------------------------------------------------------- * Function: h5_get_dummy_vfd_class() * @@ -1913,12 +1878,24 @@ error: H5FD_class_t * h5_get_dummy_vfd_class(void) { - H5FD_class_t *vfd_class = NULL; + H5FD_class_t *vfd_class = NULL; /* Dummy VFD that will be returned */ - if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) + /* Create the class and initialize everything to zero/NULL */ + if(NULL == (vfd_class = (H5FD_class_t *)HDcalloc((size_t)1, sizeof(H5FD_class_t)))) TEST_ERROR; - HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t)); + /* Fill in the minimum parameters to make a VFD that + * can be registered. + */ + vfd_class->name = "dummy"; + vfd_class->maxaddr = 1; + vfd_class->open = dummy_vfd_open; + vfd_class->close = dummy_vfd_close; + vfd_class->get_eoa = dummy_vfd_get_eoa; + vfd_class->set_eoa = dummy_vfd_set_eoa; + vfd_class->get_eof = dummy_vfd_get_eof; + vfd_class->read = dummy_vfd_read; + vfd_class->write = dummy_vfd_write; return vfd_class; -- cgit v0.12 From 19507b91d53dd7ee17fd26d10e672af26178110c Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines added missing parameter added missing parameter removed parameters moved dll export to Module clean-up --- fortran/src/H5f90global.F90 | 350 +++++++++++++++++++++++++++++++++++-- fortran/src/hdf5_fortrandll.def.in | 331 ----------------------------------- hl/fortran/src/H5DSff.F90 | 65 +------ 3 files changed, 340 insertions(+), 406 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 9054522..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in @@ -88,7 +82,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -142,6 +185,19 @@ MODULE H5GLOBAL ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +212,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +256,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +290,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +348,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +369,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +385,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -269,6 +427,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +447,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +465,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +525,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +572,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +632,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +708,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +754,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 585602f..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,335 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT -H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_INTEGER -H5GLOBAL_mp_H5T_NATIVE_REAL -H5GLOBAL_mp_H5T_NATIVE_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_CHARACTER -H5GLOBAL_mp_H5T_STD_REF_OBJ -H5GLOBAL_mp_H5T_STD_REF_DSETREG -H5GLOBAL_mp_H5T_IEEE_F32BE -H5GLOBAL_mp_H5T_IEEE_F32LE -H5GLOBAL_mp_H5T_IEEE_F64BE -H5GLOBAL_mp_H5T_IEEE_F64LE -H5GLOBAL_mp_H5T_STD_I8BE -H5GLOBAL_mp_H5T_STD_I8LE -H5GLOBAL_mp_H5T_STD_I16BE -H5GLOBAL_mp_H5T_STD_I16LE -H5GLOBAL_mp_H5T_STD_I32BE -H5GLOBAL_mp_H5T_STD_I32LE -H5GLOBAL_mp_H5T_STD_I64BE -H5GLOBAL_mp_H5T_STD_I64LE -H5GLOBAL_mp_H5T_STD_U8BE -H5GLOBAL_mp_H5T_STD_U8LE -H5GLOBAL_mp_H5T_STD_U16BE -H5GLOBAL_mp_H5T_STD_U16LE -H5GLOBAL_mp_H5T_STD_U32BE -H5GLOBAL_mp_H5T_STD_U32LE -H5GLOBAL_mp_H5T_STD_U64BE -H5GLOBAL_mp_H5T_STD_U64LE -H5GLOBAL_mp_H5T_STRING -H5GLOBAL_mp_H5T_STD_B8BE -H5GLOBAL_mp_H5T_STD_B8LE -H5GLOBAL_mp_H5T_STD_B16BE -H5GLOBAL_mp_H5T_STD_B16LE -H5GLOBAL_mp_H5T_STD_B32BE -H5GLOBAL_mp_H5T_STD_B32LE -H5GLOBAL_mp_H5T_STD_B64BE -H5GLOBAL_mp_H5T_STD_B64LE -H5GLOBAL_mp_H5T_NATIVE_B8 -H5GLOBAL_mp_H5T_NATIVE_B16 -H5GLOBAL_mp_H5T_NATIVE_B32 -H5GLOBAL_mp_H5T_NATIVE_B64 -H5GLOBAL_mp_H5T_FORTRAN_S1 -H5GLOBAL_mp_H5T_C_S1 -H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 -; -; H5generic flags declaration -; -H5GLOBAL_mp_H5_INDEX_UNKNOWN_F -H5GLOBAL_mp_H5_INDEX_NAME_F -H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F -H5GLOBAL_mp_H5_INDEX_N_F -H5GLOBAL_mp_H5_ITER_UNKNOWN_F -H5GLOBAL_mp_H5_ITER_INC_F -H5GLOBAL_mp_H5_ITER_DEC_F -H5GLOBAL_mp_H5_ITER_NATIVE_F -H5GLOBAL_mp_H5_ITER_N_F -H5GLOBAL_mp_HADDR_UNDEF_F -; -; H5F flags declaration -; -H5GLOBAL_mp_H5F_ACC_RDWR_F -H5GLOBAL_mp_H5F_ACC_RDONLY_F -H5GLOBAL_mp_H5F_ACC_TRUNC_F -H5GLOBAL_mp_H5F_ACC_EXCL_F -H5GLOBAL_mp_H5F_ACC_DEBUG_F -H5GLOBAL_mp_H5F_SCOPE_LOCAL_F -H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F -H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F -H5GLOBAL_mp_H5F_CLOSE_WEAK_F -H5GLOBAL_mp_H5F_CLOSE_SEMI_F -H5GLOBAL_mp_H5F_CLOSE_STRONG_F -H5GLOBAL_mp_H5F_OBJ_FILE_F -H5GLOBAL_mp_H5F_OBJ_DATASET_F -H5GLOBAL_mp_H5F_OBJ_GROUP_F -H5GLOBAL_mp_H5F_OBJ_DATATYPE_F -H5GLOBAL_mp_H5F_OBJ_ALL_F -H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F -H5GLOBAL_mp_H5F_LIBVER_LATEST_F -H5GLOBAL_mp_H5F_UNLIMITED_F -; -; H5G flags declaration -; -H5GLOBAL_mp_H5G_UNKNOWN_F -H5GLOBAL_mp_H5G_GROUP_F -H5GLOBAL_mp_H5G_DATASET_F -H5GLOBAL_mp_H5G_TYPE_F -H5GLOBAL_mp_H5G_LINK_F -H5GLOBAL_mp_H5G_UDLINK_F -H5GLOBAL_mp_H5G_SAME_LOC_F -H5GLOBAL_mp_H5G_LINK_ERROR_F -H5GLOBAL_mp_H5G_LINK_HARD_F -H5GLOBAL_mp_H5G_LINK_SOFT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F -; -; H5D flags declaration -; -H5GLOBAL_mp_H5D_COMPACT_F -H5GLOBAL_mp_H5D_CONTIGUOUS_F -H5GLOBAL_mp_H5D_CHUNKED_F -H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F -H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F -H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F -H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F -H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F -H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F -H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F -H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F -H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F -H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F -H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F -H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F -H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F -H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F -H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F -H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F -H5GLOBAL_mp_H5D_VDS_ERROR_F -H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F -H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F -H5GLOBAL_mp_H5D_VIRTUAL_F -; -; H5E flags declaration -; -H5GLOBAL_mp_H5E_DEFAULT_F -H5GLOBAL_mp_H5E_MAJOR_F -H5GLOBAL_mp_H5E_MINOR_F -H5GLOBAL_mp_H5E_WALK_UPWARD_F -H5GLOBAL_mp_H5E_WALK_DOWNWARD_F -; -; H5FD file drivers flags declaration -; -H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F -H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F -H5GLOBAL_mp_H5FD_MEM_NOLIST_F -H5GLOBAL_mp_H5FD_MEM_DEFAULT_F -H5GLOBAL_mp_H5FD_MEM_SUPER_F -H5GLOBAL_mp_H5FD_MEM_BTREE_F -H5GLOBAL_mp_H5FD_MEM_DRAW_F -H5GLOBAL_mp_H5FD_MEM_GHEAP_F -H5GLOBAL_mp_H5FD_MEM_LHEAP_F -H5GLOBAL_mp_H5FD_MEM_OHDR_F -H5GLOBAL_mp_H5FD_MEM_NTYPES_F -H5GLOBAL_mp_H5FD_CORE_F -H5GLOBAL_mp_H5FD_FAMILY_F -H5GLOBAL_mp_H5FD_LOG_F -H5GLOBAL_mp_H5FD_MPIO_F -H5GLOBAL_mp_H5FD_MULTI_F -H5GLOBAL_mp_H5FD_SEC2_F -H5GLOBAL_mp_H5FD_STDIO_F -; -; H5I flags declaration -; -H5GLOBAL_mp_H5I_FILE_F -H5GLOBAL_mp_H5I_GROUP_F -H5GLOBAL_mp_H5I_DATATYPE_F -H5GLOBAL_mp_H5I_DATASPACE_F -H5GLOBAL_mp_H5I_DATASET_F -H5GLOBAL_mp_H5I_ATTR_F -H5GLOBAL_mp_H5I_BADID_F -; -; H5L flags declaration -; -H5GLOBAL_mp_H5L_TYPE_ERROR_F -H5GLOBAL_mp_H5L_TYPE_HARD_F -H5GLOBAL_mp_H5L_TYPE_SOFT_F -H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F -H5GLOBAL_mp_H5L_SAME_LOC_F -H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F -; -; H5O flags declaration -; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F -H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F -H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F -H5GLOBAL_mp_H5O_COPY_ALL_F -H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F -H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F -H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F -H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F -H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F -H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5O_TYPE_GROUP_F -H5GLOBAL_mp_H5O_TYPE_DATASET_F -H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F -H5GLOBAL_mp_H5O_TYPE_NTYPES_F -; -; H5P flags declaration -; -H5GLOBAL_mp_H5P_FILE_CREATE_F -H5GLOBAL_mp_H5P_FILE_ACCESS_F -H5GLOBAL_mp_H5P_DATASET_CREATE_F -H5GLOBAL_mp_H5P_DATASET_XFER_F -H5GLOBAL_mp_H5P_FILE_MOUNT_F -H5GLOBAL_mp_H5P_DEFAULT_F -H5GLOBAL_mp_H5P_ROOT_F -H5GLOBAL_mp_H5P_OBJECT_CREATE_F -H5GLOBAL_mp_H5P_DATASET_ACCESS_F -H5GLOBAL_mp_H5P_GROUP_CREATE_F -H5GLOBAL_mp_H5P_GROUP_ACCESS_F -H5GLOBAL_mp_H5P_DATATYPE_CREATE_F -H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F -H5GLOBAL_mp_H5P_STRING_CREATE_F -H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F -H5GLOBAL_mp_H5P_OBJECT_COPY_F -H5GLOBAL_mp_H5P_LINK_CREATE_F -H5GLOBAL_mp_H5P_LINK_ACCESS_F -H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F -H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F -; -; H5R flags declaration -; -H5GLOBAL_mp_H5R_OBJECT_F -H5GLOBAL_mp_H5R_DATASET_REGION_F -; -; H5S flags declaration -; -H5GLOBAL_mp_H5S_UNLIMITED_F -H5GLOBAL_mp_H5S_ALL_F -H5GLOBAL_mp_H5S_SCALAR_F -H5GLOBAL_mp_H5S_SIMPLE_F -H5GLOBAL_mp_H5S_NULL_F -H5GLOBAL_mp_H5S_SELECT_NOOP_F -H5GLOBAL_mp_H5S_SELECT_SET_F -H5GLOBAL_mp_H5S_SELECT_OR_F -H5GLOBAL_mp_H5S_SELECT_AND_F -H5GLOBAL_mp_H5S_SELECT_XOR_F -H5GLOBAL_mp_H5S_SELECT_NOTB_F -H5GLOBAL_mp_H5S_SELECT_NOTA_F -H5GLOBAL_mp_H5S_SELECT_APPEND_F -H5GLOBAL_mp_H5S_SELECT_PREPEND_F -H5GLOBAL_mp_H5S_SELECT_INVALID_F -H5GLOBAL_mp_H5S_SEL_ERROR_F -H5GLOBAL_mp_H5S_SEL_NONE_F -H5GLOBAL_mp_H5S_SEL_POINTS_F -H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F -H5GLOBAL_mp_H5S_SEL_ALL_F -; -; H5T flags declaration -; -H5GLOBAL_mp_H5T_NO_CLASS_F -H5GLOBAL_mp_H5T_INTEGER_F -H5GLOBAL_mp_H5T_FLOAT_F -H5GLOBAL_mp_H5T_TIME_F -H5GLOBAL_mp_H5T_STRING_F -H5GLOBAL_mp_H5T_BITFIELD_F -H5GLOBAL_mp_H5T_OPAQUE_F -H5GLOBAL_mp_H5T_COMPOUND_F -H5GLOBAL_mp_H5T_REFERENCE_F -H5GLOBAL_mp_H5T_ENUM_F -H5GLOBAL_mp_H5T_VLEN_F -H5GLOBAL_mp_H5T_ARRAY_F -H5GLOBAL_mp_H5T_ORDER_LE_F -H5GLOBAL_mp_H5T_ORDER_BE_F -H5GLOBAL_mp_H5T_ORDER_VAX_F -H5GLOBAL_mp_H5T_ORDER_NONE_F -H5GLOBAL_mp_H5T_ORDER_MIXED_F -H5GLOBAL_mp_H5T_PAD_ZERO_F -H5GLOBAL_mp_H5T_PAD_ONE_F -H5GLOBAL_mp_H5T_PAD_BACKGROUND_F -H5GLOBAL_mp_H5T_PAD_ERROR_F -H5GLOBAL_mp_H5T_SGN_NONE_F -H5GLOBAL_mp_H5T_SGN_2_F -H5GLOBAL_mp_H5T_SGN_ERROR_F -H5GLOBAL_mp_H5T_NORM_IMPLIED_F -H5GLOBAL_mp_H5T_NORM_MSBSET_F -H5GLOBAL_mp_H5T_NORM_NONE_F -H5GLOBAL_mp_H5T_CSET_ASCII_F -H5GLOBAL_mp_H5T_CSET_UTF8_F -H5GLOBAL_mp_H5T_STR_NULLTERM_F -H5GLOBAL_mp_H5T_STR_NULLPAD_F -H5GLOBAL_mp_H5T_STR_SPACEPAD_F -H5GLOBAL_mp_H5T_STR_ERROR_F -H5GLOBAL_mp_H5T_DIR_ASCEND_F -H5GLOBAL_mp_H5T_DIR_DESCEND_F -; -; H5Z flags declaration -; -H5GLOBAL_mp_H5Z_FILTER_ERROR_F -H5GLOBAL_mp_H5Z_FILTER_NONE_F -H5GLOBAL_mp_H5Z_FILTER_ALL_F -H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F -H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F -H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F -H5GLOBAL_mp_H5Z_FILTER_SZIP_F -H5GLOBAL_mp_H5Z_ERROR_EDC_F -H5GLOBAL_mp_H5Z_DISABLE_EDC_F -H5GLOBAL_mp_H5Z_ENABLE_EDC_F -H5GLOBAL_mp_H5Z_NO_EDC_F -H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F -H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_NBIT_F -H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F -H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F -H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F -H5GLOBAL_mp_H5Z_SO_INT_F -H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F -; -; H5 Library flags declaration -; -H5GLOBAL_mp_H5_SZIP_EC_OM_F -H5GLOBAL_mp_H5_SZIP_NN_OM_F -; -; PROCEDURES -; -------------- -; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From 701029876eef6c54df27620411c959969dfab5a4 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines --- fortran/src/H5f90global.F90 | 354 +++++++++++++++++++++++++++++++++++-- fortran/src/hdf5_fortrandll.def.in | 2 - hl/fortran/src/H5DSff.F90 | 65 +------ 3 files changed, 342 insertions(+), 79 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 0247ad8..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in @@ -88,7 +82,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -139,9 +182,22 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:NUM_NATIVE_INTEGER_KIND) :: H5T_NATIVE_INTEGER_KIND INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- - + ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +212,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +256,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +290,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +348,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +369,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +385,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -258,7 +416,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F=-1 + INTEGER :: H5FD_MEM_NTYPES_F INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -269,6 +427,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +447,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +465,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +525,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +572,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +632,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +708,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +754,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 43a802c..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,6 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5FD_MEM_NTYPES_F ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From 6eab04894e88f7dcc0e684271328efc409a98662 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 7 Dec 2017 08:56:04 -0600 Subject: HDFFV-10223 Shared libraries fail test on OSX with fortran enabled with cmake This is now fixed via the HDFFV-10325 fix. --- CMakeLists.txt | 15 +-------------- fortran/examples/CMakeLists.txt | 6 +++--- fortran/examples/CMakeTests.cmake | 8 ++++---- fortran/src/CMakeLists.txt | 14 +++++++------- fortran/test/CMakeLists.txt | 20 ++++++++++---------- fortran/test/CMakeTests.cmake | 2 +- hl/fortran/src/CMakeLists.txt | 14 +++++++------- hl/fortran/test/CMakeLists.txt | 8 ++++---- hl/fortran/test/CMakeTests.cmake | 2 +- release_docs/INSTALL_CMake.txt | 1 - 10 files changed, 38 insertions(+), 52 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2640b1..e22ac2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -849,21 +849,8 @@ set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) - option (SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF) if (HDF5_BUILD_FORTRAN) - if (BUILD_SHARED_LIBS AND APPLE) - # Tell cmake to do the right thing with COMMON symbols, this fixes - # corrupt values with COMMON and EQUIVALENCE when building shared - # Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). - # *** NOTE: Fix does not work with Cmake. *** - # set (HDF5_LINKER_FLAGS "-Wl,-commons,use_dylibs") - if (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") - set (SKIP_HDF5_FORTRAN_SHARED ON) - else () - message (STATUS " **** Allowing unsupported Fortran shared libraries **** ") - endif () - endif () + option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 426df7e..a05f296 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -52,7 +52,7 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_${example}-shared SHARED " " " ") @@ -83,7 +83,7 @@ foreach (example ${F2003_examples}) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") @@ -114,7 +114,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example-shared SHARED " " " ") diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index b130f30..c3d94b4 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -41,7 +41,7 @@ set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f90_ex-clear-objects") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_test ( NAME f90_ex-shared-clear-objects COMMAND ${CMAKE_COMMAND} @@ -87,7 +87,7 @@ foreach (example ${examples}) set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f90_ex_${example}") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME f90_ex-shared_${example} COMMAND $) else () @@ -129,7 +129,7 @@ if (HDF5_ENABLE_F2003) set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f03_ex_${example}") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME f03_ex-shared_${example} COMMAND $) else () @@ -154,7 +154,7 @@ endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endif () endif () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index e34c778..0f576d4 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -64,7 +64,7 @@ set_target_properties (H5_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -136,7 +136,7 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) @@ -173,7 +173,7 @@ add_custom_target (H5gen ALL ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 @@ -220,7 +220,7 @@ set (f90_F_SOURCES # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (f90_F_SOURCES_SHARED # generated file ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 @@ -262,7 +262,7 @@ endif () set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) add_dependencies(${HDF5_F90_LIB_TARGET} H5gen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -339,7 +339,7 @@ install ( fortheaders ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (modsh_files ${MODSH_BUILD_DIR}/h5fortran_types.mod ${MODSH_BUILD_DIR}/hdf5.mod @@ -375,7 +375,7 @@ endif () # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) endif () diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 1661a10..3c3eb8f 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -32,7 +32,7 @@ set_target_properties (H5_test_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -64,7 +64,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C INTERFACE_INCLUDE_DIRECTORIES "$/include>" ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} @@ -94,7 +94,7 @@ add_custom_target (H5testgen ALL ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES GENERATED TRUE) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 @@ -117,7 +117,7 @@ set (HDF5_F90_TF_SOURCES tf.F90 ) set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (HDF5_F90_TF_SOURCES_SHARED # generated file ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 @@ -150,7 +150,7 @@ if (WIN32) endif () add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -220,7 +220,7 @@ set_target_properties (testhdf5_fortran PROPERTIES ) add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (testhdf5_fortran-shared fortranlib_test.F90 tH5A.F90 @@ -284,7 +284,7 @@ set_target_properties (testhdf5_fortran_1_8 PROPERTIES ) add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (testhdf5_fortran_1_8-shared fortranlib_test_1_8.F90 tH5O.F90 @@ -341,7 +341,7 @@ set_target_properties (fortranlib_test_F03 PROPERTIES ) add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fortranlib_test_F03-shared fortranlib_test_F03.F90 tH5E_F03.F90 @@ -392,7 +392,7 @@ set_target_properties (fflush1 PROPERTIES ) add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fflush1-shared fflush1.F90) TARGET_NAMING (fflush1-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush1-shared SHARED " " " ") @@ -433,7 +433,7 @@ set_target_properties (fflush2 PROPERTIES ) add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fflush2-shared fflush2.F90) TARGET_NAMING (fflush2-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush2-shared SHARED " " " ") diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index e171e7c..4d06359 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -132,7 +132,7 @@ set_tests_properties (FORTRAN_fflush1 PROPERTIES DEPENDS FORTRAN_testhdf5-clear- add_test (NAME FORTRAN_fflush2 COMMAND $) set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_test ( NAME FORTRAN_testhdf5-shared-clear-objects COMMAND ${CMAKE_COMMAND} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 345a739..c870aed 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -36,7 +36,7 @@ set_target_properties (H5HL_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -87,7 +87,7 @@ set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) @@ -129,7 +129,7 @@ set_source_files_properties ( ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 @@ -157,7 +157,7 @@ set (HDF5_HL_F90_F_SOURCES ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (HDF5_HL_F90_F_SOURCES_SHARED ${HDF5_HL_F90_F_BASE_SOURCES} @@ -187,7 +187,7 @@ endif () set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -236,7 +236,7 @@ install ( fortheaders ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (modsh_files ${MODSH_BUILD_DIR}/h5ds.mod ${MODSH_BUILD_DIR}/h5tb.mod @@ -259,7 +259,7 @@ endif () # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) endif () diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 3138173..fbd31c5 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -14,7 +14,7 @@ target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TAR target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstds-shared tstds.F90) TARGET_NAMING (hl_f90_tstds-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") @@ -35,7 +35,7 @@ target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_T target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstlite-shared tstlite.F90) TARGET_NAMING (hl_f90_tstlite-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") @@ -56,7 +56,7 @@ target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstimage-shared tstimage.F90) TARGET_NAMING (hl_f90_tstimage-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") @@ -77,7 +77,7 @@ target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_ target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tsttable-shared tsttable.F90) TARGET_NAMING (hl_f90_tsttable-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 90cc3a3..d541377 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -96,7 +96,7 @@ else () endif () set_tests_properties (HL_FORTRAN_f90_tsttable PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_test ( NAME HL_FORTRAN_test-shared-clear-objects COMMAND ${CMAKE_COMMAND} diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 26750b5..f20ca43 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -594,7 +594,6 @@ HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF -SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF if (CMAKE_BUILD_TYPE MATCHES Debug) -- cgit v0.12 From 95e96246a67593776da863c88837c6cb0b7d0058 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Dec 2017 14:44:30 -0600 Subject: HDFFV-9724 Initial changes and test --- src/H5Dint.c | 101 +++++++++++++++ src/H5Dpkg.h | 3 +- src/H5Dprivate.h | 11 +- src/H5Dvirtual.c | 65 ++++++++-- src/H5Fprivate.h | 1 + src/H5Pdapl.c | 366 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Pfapl.c | 69 +++++++++++ src/H5Ppublic.h | 4 + test/vds.c | 274 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 879 insertions(+), 15 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index b6c0341..2123836 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -63,6 +63,8 @@ static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix); +static herr_t H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, + char **vds_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); @@ -1037,6 +1039,81 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_build_extfile_prefix() */ + +/*-------------------------------------------------------------------------- + * Function: H5D_build_vds_prefix + * + * Purpose: Determine the vds file prefix to be used and store + * it in vds_prefix. Stores an empty string if no prefix + * should be used. + * + * Return: SUCCEED/FAIL + *-------------------------------------------------------------------------- + */ +static herr_t +H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/) +{ + char *prefix = NULL; /* prefix used to look for the file */ + char *vdspath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t vdspath_len; /* length of vdstpath */ + size_t prefix_len; /* length of prefix */ + size_t vds_prefix_len; /* length of expanded prefix */ + H5P_genplist_t *plist = NULL; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(dset); + HDassert(dset->oloc.file); + + vdspath = H5F_EXTPATH(dset->oloc.file); + HDassert(vdspath); + + /* XXX: Future thread-safety note - getenv is not required + * to be reentrant. + */ + prefix = HDgetenv("HDF5_VDS_PREFIX"); + + if(prefix == NULL || *prefix == '\0') { + /* Set prefix to value of H5D_ACS_VDS_PREFIX_NAME property */ + if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds prefix") + } /* end if */ + + /* Prefix has to be checked for NULL / empty string again because the + * code above might have updated it. + */ + if(prefix == NULL || *prefix == '\0' || HDstrcmp(prefix, ".") == 0) { + /* filename is interpreted as relative to the current directory, + * does not need to be expanded + */ + if(NULL == (*vds_prefix = (char *)H5MM_strdup(""))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + } /* end if */ + else { + if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { + /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ + vdspath_len = HDstrlen(vdspath); + prefix_len = HDstrlen(prefix); + vds_prefix_len = vdspath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + + if(NULL == (*vds_prefix = (char *)H5MM_malloc(vds_prefix_len))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") + HDsnprintf(*vds_prefix, vds_prefix_len, "%s%s", vdspath, prefix + HDstrlen("${ORIGIN}")); + } /* end if */ + else { + if(NULL == (*vds_prefix = (char *)H5MM_strdup(prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + } /* end else */ + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_build_vds_prefix() */ + /*------------------------------------------------------------------------- * Function: H5D__create @@ -1220,6 +1297,10 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Set the vds file prefix */ + if(H5D_build_vds_prefix(new_dset, dapl_id, &new_dset->shared->vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Add the dataset to the list of opened objects in the file */ if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count") @@ -1265,6 +1346,7 @@ done: if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix); + new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix); new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared); } /* end if */ new_dset->oloc.file = NULL; @@ -1351,6 +1433,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; char *extfile_prefix = NULL; /* Expanded external file prefix */ + char *vds_prefix = NULL; /* Expanded vds prefix */ H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1374,6 +1457,10 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Get the vds prefix */ + if(H5D_build_vds_prefix(dataset, dapl_id, &vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Check if dataset was already open */ if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) { /* Clear any errors from H5FO_opened() */ @@ -1399,6 +1486,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* Prevent string from being freed during done: */ extfile_prefix = NULL; + /* Set the vds file prefix */ + dataset->shared->vds_prefix = vds_prefix; + /* Prevent string from being freed during done: */ + vds_prefix = NULL; + } /* end if */ else { /* Point to shared info */ @@ -1430,12 +1522,14 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) done: extfile_prefix = (char *)H5MM_xfree(extfile_prefix); + vds_prefix = (char *)H5MM_xfree(vds_prefix); if(ret_value == NULL) { /* Free the location--casting away const*/ if(dataset) { if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); } @@ -1818,6 +1912,9 @@ H5D_close(H5D_t *dataset) /* Free the external file prefix */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + /* Free the vds file prefix */ + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); + /* Release layout, fill-value, efl & pipeline messages */ if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) || @@ -3360,6 +3457,10 @@ H5D_get_access_plist(H5D_t *dset) if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap") + /* Set the vds prefix option */ + if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix") + /* Set the external file prefix option */ if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix") diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 542abd0..45f2d3a 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -476,6 +476,7 @@ typedef struct H5D_shared_t { H5D_append_flush_t append_flush; /* Append flush property information */ char *extfile_prefix; /* expanded external file prefix */ + char *vds_prefix; /* expanded vds prefix */ } H5D_shared_t; struct H5D_t { @@ -598,7 +599,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ -H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index fb994d8..ed13467 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -47,12 +47,13 @@ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ /* ======== Dataset access property names ======== */ -#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ -#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ -#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ -#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ +#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ +#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ +#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ +#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ #define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */ -#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ +#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */ +#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ #define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */ /* ======== Data transfer properties ======== */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3be2353..e0a4a83 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -731,6 +731,38 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_delete */ + +/*-------------------------------------------------------------------------- + * Function: H5D__virtual_build_name + * + * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME + * + * Return: Non-negative on success/Negative on failure + *--------------------------------------------------------------------------*/ +static herr_t +H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) +{ + size_t prefix_len; /* length of prefix */ + size_t fname_len; /* Length of external link file name */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + prefix_len = HDstrlen(prefix); + fname_len = HDstrlen(file_name); + + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") + + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_build_name() */ + /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -750,9 +782,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ + char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ + char *full_name = NULL; /* File name with prefix */ FUNC_ENTER_STATIC @@ -762,14 +796,27 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, HDassert(!source_dset->dset); HDassert(source_dset->file_name); HDassert(source_dset->dset_name); + vds_prefix = vdset->shared->vds_prefix; /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) - H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ - else - src_file_open = TRUE; + if(vds_prefix && HDstrlen(vds_prefix) > 0) { + if(H5D__virtual_build_name(vds_prefix, source_dset->file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") + /* Open the source file */ + if(NULL == (src_file = H5F_open(full_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ + else + src_file_open = TRUE; + full_name = (char *)H5MM_xfree(full_name); + } + else { + /* Open the source file */ + if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ + else + src_file_open = TRUE; + } } /* end if */ else /* Source file is ".", use the virtual dataset's file */ @@ -1407,7 +1454,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection") } /* end if */ - /* Update cached values unlim_extent_source and + /* Update cached values unlim_extent_source and * clip_size_virtual */ storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source]; storage->list[i].clip_size_virtual = clip_size; @@ -1559,7 +1606,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") /* Mark the space as dirty, for later writing to the file */ - if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) + if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2246,7 +2293,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space") storage->list[i].sub_dset[j].projected_mem_space = NULL; } /* end if */ - else + else *tot_nelmts += (hsize_t)select_nelmts; } /* end if */ } /* end for */ @@ -2506,7 +2553,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 18d0460..262e63b 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -489,6 +489,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ +#define H5F_ACS_VDS_SIZE_NAME "vds_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 494de3e..da06297 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -71,6 +71,17 @@ #define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0 #define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t #define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t +/* Definitions for VDS file prefix */ +#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *) +#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */ +#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set +#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get +#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc +#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec +#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del +#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy +#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp +#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close /* Definition for append flush */ #define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) #define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} @@ -112,6 +123,14 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value); /* Property list callbacks */ static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value); +static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value); +static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value); +static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value); /* Property list callbacks */ static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value); @@ -160,6 +179,7 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{ /* Property value defaults */ static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ +static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */ /*------------------------------------------------------------------------- @@ -210,6 +230,12 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register property for vds prefix */ + if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, + NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC, + H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, @@ -226,6 +252,254 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dacc_reg_prop() */ + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_set + * + * Purpose: Copies a vds file prefix property when it's set + * for a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_set() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_get + * + * Purpose: Copies a vds file prefix property when it's retrieved + * from a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_get() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_enc + * + * Purpose: Callback routine which is called whenever the vds file flags + * property in the dataset access property list is + * encoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) +{ + const char *vds_file_pref = *(const char * const *)value; + uint8_t **pp = (uint8_t **)_pp; + size_t len = 0; + uint64_t enc_value; + unsigned enc_size; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* calculate prefix length */ + if(NULL != vds_file_pref) + len = HDstrlen(vds_file_pref); + + enc_value = (uint64_t)len; + enc_size = H5VM_limit_enc_size(enc_value); + HDassert(enc_size < 256); + + if(NULL != *pp) { + /* encode the length of the prefix */ + *(*pp)++ = (uint8_t)enc_size; + UINT64ENCODE_VAR(*pp, enc_value, enc_size); + + /* encode the prefix */ + if(NULL != vds_file_pref) { + HDmemcpy(*(char **)pp, vds_file_pref, len); + *pp += len; + } /* end if */ + } /* end if */ + + *size += (1 + enc_size); + if(NULL != vds_file_pref) + *size += len; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_enc() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_dec + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset access property list is + * decoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) +{ + char **vds_file_pref = (char **)_value; + const uint8_t **pp = (const uint8_t **)_pp; + size_t len; + uint64_t enc_value; /* Decoded property value */ + unsigned enc_size; /* Size of encoded property */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(pp); + HDassert(*pp); + HDassert(vds_file_pref); + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* Decode the size */ + enc_size = *(*pp)++; + HDassert(enc_size < 256); + + /* Decode the value */ + UINT64DECODE_VAR(*pp, enc_value, enc_size); + len = (size_t)enc_value; + + if(0 != len) { + /* Make a copy of the user's prefix string */ + if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix") + HDstrncpy(*vds_file_pref, *(const char **)pp, len); + (*vds_file_pref)[len] = '\0'; + + *pp += len; + } /* end if */ + else + *vds_file_pref = NULL; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_dec() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_del + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED (Can't fail) + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_del() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_copy + * + * Purpose: Creates a copy of the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_copy() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_cmp + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset creation property list is + * compared. + * + * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise. + *------------------------------------------------------------------------- + */ +static int +H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) +{ + const char *pref1 = *(const char * const *)value1; + const char *pref2 = *(const char * const *)value2; + int ret_value = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(NULL == pref1 && NULL != pref2) + HGOTO_DONE(1); + if(NULL != pref1 && NULL == pref2) + HGOTO_DONE(-1); + if(NULL != pref1 && NULL != pref2) + ret_value = HDstrcmp(pref1, pref2); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_cmp() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_close + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_close() */ + /*------------------------------------------------------------------------- * Function: H5P__dapl_efile_pref_set @@ -1220,3 +1494,95 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_efile_prefix() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_virtual_prefix + * + * Purpose: Set a prefix to be applied to the path of any vds files + * traversed. + * + * If the prefix starts with ${ORIGIN}, this will be replaced by + * the absolute path of the directory of the HDF5 file containing + * the dataset. + * + * If the prefix is ".", no prefix will be applied. + * + * This property can be overwritten by the environment variable + * HDF5_VDS_PREFIX. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_virtual_prefix(hid_t plist_id, const char *prefix) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*s", plist_id, prefix); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Set prefix */ + if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_virtual_prefix() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_virtual_prefix + * + * Purpose: Gets the prefix to be applied to any vds file + * traversals made using this property list. + * + * If the pointer is not NULL, it points to a user-allocated + * buffer. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +ssize_t +H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + char *my_prefix; /* Library's copy of the prefix */ + size_t len; /* Length of prefix string */ + ssize_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "i*sz", plist_id, prefix, size); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get the current prefix */ + if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix") + + /* Check for prefix being set */ + if(my_prefix) { + /* Copy to user's buffer, if given */ + len = HDstrlen(my_prefix); + if(prefix) { + HDstrncpy(prefix, my_prefix, MIN(len + 1, size)); + if(len >= size) + prefix[size - 1] = '\0'; + } /* end if */ + } /* end if */ + else + len = 0; + + /* Set return value */ + ret_value = (ssize_t)len; + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_virtual_prefix() */ + diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 915aa38..8650a03 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2462,6 +2462,75 @@ done: /*------------------------------------------------------------------------- + * Function: H5Pset_vds_file_cache_size + * + * Purpose: Sets the number of files opened through vds links + * from the file associated with this fapl to be held open + * in that file's vds file cache. When the maximum + * number of files is reached, the least recently used file + * is closed (unless it is opened from somewhere else). + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "iIu", plist_id, vds_size); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Set value */ + if(H5P_set(plist, H5F_ACS_VDS_SIZE_NAME, &vds_size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set elink file cache size") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_vds_file_cache_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_vds_file_cache_size + * + * Purpose: Gets the number of files opened through vds links + * from the file associated with this fapl to be held open + * in that file's vds file cache. When the maximum + * number of files is reached, the least recently used file + * is closed (unless it is opened from somewhere else). + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Iu", plist_id, vds_size); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get value */ + if(vds_size) + if(H5P_get(plist, H5F_ACS_VDS_SIZE_NAME, vds_size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get elink file cache size") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_vds_file_cache_size() */ + + +/*------------------------------------------------------------------------- * Function: H5Pset_file_image * * Purpose: Sets the initial file image. Some file drivers can initialize diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 493a322..38be320 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -343,6 +343,8 @@ H5_DLL herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, H5F_libver_t *high); H5_DLL herr_t H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size); H5_DLL herr_t H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size); +H5_DLL herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); +H5_DLL herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); H5_DLL herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); H5_DLL herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id, @@ -420,6 +422,8 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view); H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view); H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size); H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size); +H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); +H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t boundary[], H5D_append_cb_t func, void *udata); H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims, diff --git a/test/vds.c b/test/vds.c index c9b7a1b..3485023 100644 --- a/test/vds.c +++ b/test/vds.c @@ -36,6 +36,12 @@ const char *FILENAME[] = { "vds_src_1", "vds%%_src", "vds_dapl", + "vds_virt_2", + "vds_virt_3", + "vds_src_2", + "vds_src_3", + "vds%%_src2", + "vds_dapl2", NULL }; @@ -49,6 +55,8 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 +#define TMPDIR "tmp/" + /*------------------------------------------------------------------------- * Function: vds_select_equal @@ -1140,6 +1148,271 @@ error: return 1; } /* end test_api() */ +/*------------------------------------------------------------------------- + * Function: vds_link_prefix + * + * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp" + * Should be able to access the target source files in tmp directory via the prefix set + * by H5Pset_virtual_prefix() + * + * Return: Success: 0 + * Failure: -1 + *------------------------------------------------------------------------- + */ +static int +test_vds_prefix(unsigned config, hid_t fapl) +{ + char srcfilename[FILENAME_BUF_SIZE]; + char srcfilename_map[FILENAME_BUF_SIZE]; + char vfilename[FILENAME_BUF_SIZE]; + char vfilename2[FILENAME_BUF_SIZE]; + char srcfilenamepct[FILENAME_BUF_SIZE]; + char srcfilenamepct_map[FILENAME_BUF_SIZE]; + const char *srcfilenamepct_map_orig = "vds%%%%_src"; + hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ + hid_t vfile = -1; /* File with virtual dset */ + hid_t vfile2 = -1; /* File with copied virtual dset */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dapl = -1; /* Dataset access property list */ + hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ + hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ + hid_t memspace = -1; /* Memory dataspace */ + hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */ + hid_t vdset = -1; /* Virtual dataset */ + hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ + hsize_t start[4]; /* Hyperslab start */ + hsize_t stride[4]; /* Hyperslab stride */ + hsize_t count[4]; /* Hyperslab count */ + hsize_t block[4]; /* Hyperslab block */ + hssize_t offset[2] = {0, 0}; /* Selection offset */ + int buf[10][26]; /* Write and expected read buffer */ + int rbuf[10][26]; /* Read buffer */ + int rbuf99[9][9]; /* 9x9 Read buffer */ + int evbuf[10][26]; /* Expected VDS "buffer" */ + int erbuf[10][26]; /* Expected read buffer */ + int fill = -1; /* Fill value */ + herr_t ret; /* Generic return value */ + int i, j; + char buffer[1024]; /* buffer to read vds_prefix */ + + TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()") + + h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename); + h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2); + h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename); + h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map); + h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct); + h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map); + + /* create tmp directory and get current working directory path */ + if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Initialize VDS prefix items */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, TMPDIR) != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* + * Test 1: All - all selection + */ + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } /* end if */ + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } /* end if */ + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } /* end if */ + } /* end if */ + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { + if(srcfile[i] >= 0) + (void)H5Fclose(srcfile[i]); + } /* end for */ + if(vfile >= 0) + (void)H5Fclose(vfile); + if(vfile2 >= 0) + (void)H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); + } H5E_END_TRY; + + return 1; +} /* end vds_link_prefix() */ + /*------------------------------------------------------------------------- * Function: test_basic_io @@ -11299,6 +11572,7 @@ main(void) for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); nerrors += test_basic_io(bit_config, fapl); + nerrors += test_vds_prefix(bit_config, fapl); nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); -- cgit v0.12 From 690cb84f10da7d72fcf87b07d346a26e6fefd1d0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Dec 2017 13:10:46 -0600 Subject: Added java wrappers and tests --- java/src/hdf/hdf5lib/H5.java | 196 ++++++- java/src/hdf/hdf5lib/HDF5Constants.java | 3 + java/src/hdf/overview.html | 6 +- java/src/jni/h5Constants.c | 2 + java/src/jni/h5pImp.c | 246 ++++++++ java/src/jni/h5pImp.h | 91 ++- java/test/JUnit-interface.txt | 10 +- java/test/TestH5P.java | 53 +- java/test/TestH5Pfapl.java | 41 ++ java/test/TestH5Pvirtual.java | 33 ++ release_docs/RELEASE.txt | 32 +- src/H5Pfapl.c | 954 ++++++++++++++++---------------- 12 files changed, 1172 insertions(+), 495 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 7b5b5c9..3de49da 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - // Generic property list routines + // /////// Generic property list routines /////// /** * H5Pget_class_name retrieves the name of a generic property list class @@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; - // Object creation property list (OCPL) routines + // /////// Object creation property list (OCPL) routines /////// /** * H5Pget_attr_phase_change retrieves attribute storage phase change thresholds. @@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; - // File creation property list (FCPL) routines + // /////// File creation property list (FCPL) routines /////// /** * H5Pget_userblock retrieves the size of a user block in a file creation property list. @@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, IllegalArgumentException; - // File access property list (FAPL) routines + // /////// File access property list (FAPL) routines /////// /** * H5Pget_alignment retrieves the current settings for alignment properties from a file access property list. @@ -5860,6 +5860,37 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts) throws HDF5LibraryException; + /** + * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object + * will be evicted from the library's metadata cache when it is closed. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return indication if the object will be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_evict_on_close(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object. + * + * @param fapl_id + * IN: File access property list identifier + * @param evict_on_close + * IN: Whether the HDF5 object should be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) + throws HDF5LibraryException; + // Dataset creation property list (DCPL) routines // /** @@ -6067,6 +6098,35 @@ public class H5 implements java.io.Serializable { public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; /** + * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return VDS link open file cache size in number of files. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; + + /** + * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. + * + * @param fapl_id + * IN: File access property list identifier + * @param efc_size + * IN: VDS link open file cache size in number of files. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) + throws HDF5LibraryException; + + /** * H5Pget_external returns information about an external file. * * @param plist @@ -6285,7 +6345,37 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, NullPointerException; - // Dataset access property list (DAPL) routines // + // /////// Dataset creation property list (DCPL) routines /////// + + /** + * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. + * + * @param dcpl_id + * IN: Dataset creation property list identifier + * @param opts + * IN: Edge chunk option flag. Valid values are: + * H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks. + * 0 - Disables option; partial edge chunks will be compressed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException; + + /** + * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list . + * + * @param dcpl_id + * IN: Dataset creation property list + + * @return The edge chunk option setting. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException; + + // /////// Dataset access property list (DAPL) routines /////// /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6388,12 +6478,76 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException; + /** + * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to virtual file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_virtual_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to virtual file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Pget_efile_prefix Retrieves prefix applied to external file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to external file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_efile_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_efile_prefix Sets prefix to be applied to external file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to external file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + // public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; // public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; - // Dataset xfer property list (DXPL) routines // + // /////// Dataset xfer property list (DXPL) routines /////// /** * H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property @@ -6544,7 +6698,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; - // Link creation property list (LCPL) routines // + // /////// Link creation property list (LCPL) routines /////// /** * H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate @@ -6579,7 +6733,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group) throws HDF5LibraryException; - // Group creation property list (GCPL) routines // + // /////// Group creation property list (GCPL) routines /////// /** * H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups. @@ -6736,14 +6890,14 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags) throws HDF5LibraryException; - // String creation property list (STRCPL) routines // + // /////// String creation property list (STRCPL) routines /////// public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; - // Link access property list (LAPL) routines // + // /////// Link access property list (LAPL) routines /////// /** * H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the @@ -6896,7 +7050,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException, IllegalArgumentException; - // Object copy property list (OCPYPL) routines // + // /////// Object copy property list (OCPYPL) routines /////// /** * H5Pget_copy_object retrieves the properties to be used when an object is copied. @@ -6927,7 +7081,7 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) throws HDF5LibraryException; - // Other/Older property list routines // + // /////// Other/Older property list routines /////// /** * H5Pget_version retrieves the version information of various objects for a file creation property list. @@ -6955,7 +7109,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - // file drivers property list routines // + // /////// file drivers property list routines /////// public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; @@ -7102,20 +7256,28 @@ public class H5 implements java.io.Serializable { // File creation property list (FCPL) routines // // File access property list (FAPL) routines // - // herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info ) - // const void *H5Pget_driver_info( hid_t plist_id ) - // herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type ) - // herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type ) + // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) + // const void *H5Pget_driver_info(hid_t plist_id) + // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) + // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) // herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); // herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); // herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); + // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); + // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); + // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective); + // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); + // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); + // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); // Dataset creation property list (DCPL) routines // // Dataset access property list (DAPL) routines // + // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data); + // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data) // Dataset xfer property list (DXPL) routines // // herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg); diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 8a3d6c8..3e43ba2 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -88,6 +88,7 @@ public class HDF5Constants { public static final int H5D_VDS_ERROR = H5D_VDS_ERROR(); public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING(); public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); + public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); public static final int H5E_MAJOR = H5E_MAJOR(); public static final int H5E_MINOR = H5E_MINOR(); @@ -768,6 +769,8 @@ public class HDF5Constants { private static native final int H5D_VDS_LAST_AVAILABLE(); + private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); + private static native final long H5E_ALIGNMENT(); private static native final long H5E_ALREADYEXISTS(); diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html index 39d75b7..9c19442 100644 --- a/java/src/hdf/overview.html +++ b/java/src/hdf/overview.html @@ -47,20 +47,20 @@ which has a method: The native method is implemented in C using the Java Native Method Interface (JNI). This is written something like the following: -
JNIEXPORT jint
+
JNIEXPORT jlong
 JNICALL Java_hdf_hdf5lib_H5_H5Fopen
 (
  JNIEnv *env,
  jclass class,
  jstring hdfFile,
  jint flags,
- jint access)
+ jlong access)
  {
 
  /* ...convert Java String to (char *) */
 
  /* call the HDF library */
- retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
+ retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
 
  /* ... */
 }
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index f6f8bfa..5a4b53e 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -140,6 +140,8 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index dcfcd82..3c799f2 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,6 +5733,252 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_vds_file_cache_size + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size + (JNIEnv *env, jclass clss, jlong plist, jint size) +{ + unsigned sz = (unsigned)size; + + if (H5Pset_vds_file_cache_size((hid_t)plist, (unsigned)sz) < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_vds_file_cache_size + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size + (JNIEnv *env, jclass clss, jlong plist) +{ + unsigned s; + + if (H5Pget_vds_file_cache_size((hid_t)plist, &s) < 0) + h5libraryError(env); + + return (jint)s; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } + + return (jint)retVal; +} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } + + return (jint)retVal; +} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close) +{ + herr_t retVal = -1; + hbool_t evict_on_close_val; + + if (evict_on_close == JNI_TRUE) + evict_on_close_val = TRUE; + else + evict_on_close_val = FALSE; + + retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t evict_on_close_val = FALSE; + jboolean bval = JNI_FALSE; + + if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) { + h5libraryError(env); + } /* end if */ + else { + if (evict_on_close_val == TRUE) + bval = JNI_TRUE; + } /* end else */ + + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id, jint opts) +{ + herr_t retVal = -1; + + retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id) +{ + unsigned opts = 0; + + if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0) + h5libraryError(env); + + return (jint)opts; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index d413f69..19df4b2 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1533,7 +1533,6 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts (JNIEnv *, jclass, jlong); - /* * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts @@ -1543,6 +1542,96 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts (JNIEnv *, jclass, jlong, jlong); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_vds_file_cache_size + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size +(JNIEnv *, jclass, jlong, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_vds_file_cache_size + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close +(JNIEnv *, jclass, jlong, jboolean); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts +(JNIEnv *, jclass, jlong, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts +(JNIEnv *, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index ab2f3b1..fa5b149 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -415,6 +415,7 @@ JUnit version 4.11 .testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue .testH5P_layout .testH5Pget_link_creation_order +.testH5Pget_efile_prefix .testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes .testH5P_file_space_page_size .testH5Pget_shared_mesg_index_Invalid_indexnum @@ -444,6 +445,7 @@ JUnit version 4.11 .testH5Pset_est_link_info_InvalidValues .testH5Pset_local_heap_size_hint .testH5Pget_est_link_info +.testH5Pset_efile_prefix_null .testH5Pset_scaleoffset .testH5Pset_create_intermediate_group_invalidobject .testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue @@ -466,6 +468,7 @@ JUnit version 4.11 .testH5Pget_sym_k_null .testH5Pset_nlinks .testH5P_obj_track_times +.testH5Pset_efile_prefix .testH5P_userblock .testH5Pget_local_heap_size_hint .testH5Pset_shared_mesg_index_Invalid_indexnum @@ -502,8 +505,10 @@ JUnit version 4.11 .testH5Fmdc_logging .testH5Pget_elink_fapl .testH5Pset_mdc_config +.testH5P_vds_file_cache_size .testH5P_small_data_block_size .testH5Pset_fapl_log +.testH5P_evict_on_close .testH5Pset_libver_bounds .testH5P_sieve_buf_size .testH5P_elink_file_cache_size @@ -530,11 +535,14 @@ JUnit version 4.11 .testH5Pget_source_datasetname .testH5Pvirtual_storage .testH5Pget_selection_source_dataset +.testH5Pget_virtual_prefix .testH5Pget_source_filename .testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count +.testH5Pset_virtual_prefix .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters +.testH5Pset_virtual_prefix_null .testH5P_genprop_basic_class .testH5P_genprop_class_iter .testH5P_genprop_basic_class_prop @@ -640,7 +648,7 @@ JUnit version 4.11 Time: XXXX -OK (638 tests) +OK (646 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 5aafb5b..9e45e4c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -28,6 +28,7 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; @@ -852,7 +853,7 @@ public class TestH5P { } catch (Throwable err) { err.printStackTrace(); - fail("H5Pset_est_link_info: " + err); + fail("H5Pset_elink_prefix: " + err); } assertTrue("H5Pset_elink_prefix", ret_val >= 0); } @@ -1232,4 +1233,54 @@ public class TestH5P { fail("testH5P_file_space_page_size: " + err); } } + + @Test + public void testH5Pset_efile_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_efile_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_efile_prefix_null() throws Throwable{ + H5.H5Pset_efile_prefix(lapl_id, null); + } + + @Test + public void testH5Pget_efile_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + pre = H5.H5Pget_efile_prefix(lapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_efile_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } + + @Ignore + public void testH5P_chunk_opts() { + int chunk_opts = -1; + + try { + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0); + H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_lchunk_opts: " + err); + } + } } diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index d4a2231..f6783d4 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1376,4 +1376,45 @@ public class TestH5Pfapl { deleteH5file(); _deleteLogFile(); } + + @Test + public void testH5P_evict_on_close() { + boolean ret_val_id = false; + try { + H5.H5Pset_evict_on_close(fapl_id, true); + ret_val_id = H5.H5Pget_evict_on_close(fapl_id); + assertTrue("H5P_evict_on_close", ret_val_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_evict_on_close: " + err); + } + } + + @Test + public void testH5P_vds_file_cache_size() { + int vds_size = 0; + try { + try { + vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); + assertTrue("H5P_vds_file_cache_size default", vds_size == 0); + } + catch (UnsupportedOperationException err) { + System.out.println(err.getMessage()); + } + try { + vds_size = 8; + H5.H5Pset_vds_file_cache_size(fapl_id, vds_size); + vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); + assertTrue("H5P_vds_file_cache_size 8", vds_size == 8); + } + catch (UnsupportedOperationException err) { + System.out.println(err.getMessage()); + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_vds_file_cache_size: " + err); + } + } } diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 40cfbac..ff2e4dc 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -429,4 +429,37 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } } + + @Test + public void testH5Pset_virtual_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_virtual_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_virtual_prefix_null() throws Throwable{ + H5.H5Pset_virtual_prefix(H5dapl_id, null); + } + + @Test + public void testH5Pget_virtual_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + pre = H5.H5Pget_virtual_prefix(H5dapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_virtual_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7498d01..5249c1a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -58,7 +58,23 @@ New Features Library: -------- - - + - Add prefix option to VDS files. + + Currently, VDS source files must be in the active directory to be + found by the virtual file. Adding the option of a prefix to be set + on the virtual file, using a data access property list (DAPL), + allows the source files to located at an absolute or relative path + to the virtual file. + + New public APIs: + herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); + ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); + herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); + herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); + The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. + + (ADB - 2017/12/12, HDFFV-9724) + Parallel Library: ----------------- @@ -119,6 +135,20 @@ New Features ------------ - + Java Library: + ---------------- + - Wrappers added for the following APIs: + H5Pset_evict_on_close + H5Pget_evict_on_close + H5Pset_chunk_opts + H5Pget_chunk_opts + H5Pset_efile_prefix + H5Pget_efile_prefix + H5Pset_virtual_prefix + H5Pget_virtual_prefix + H5Pset_vds_file_cache_size + H5Pget_vds_file_cache_size + Tools: ------ - h5diff diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 8650a03..586f559 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -13,9 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pfapl.c + * Created: H5Pfapl.c * - * Purpose: File access property list class routines + * Purpose: File access property list class routines * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ #include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ #include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Win32 I/O */ @@ -54,10 +54,10 @@ /* ========= File Access properties ============ */ /* Definitions for the initial metadata cache resize configuration */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG -#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec +#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG +#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec #define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp /* Definitions for size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t) @@ -118,10 +118,10 @@ #define H5F_ACS_FILE_DRV_CMP H5P__facc_file_driver_cmp #define H5F_ACS_FILE_DRV_CLOSE H5P__facc_file_driver_close /* Definition for file close degree */ -#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) -#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT -#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc -#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec +#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) +#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT +#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc +#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec /* Definition for offset position in file for family file driver */ #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 @@ -155,6 +155,11 @@ #define H5F_ACS_EFC_SIZE_DEF 0 #define H5F_ACS_EFC_SIZE_ENC H5P__encode_unsigned #define H5F_ACS_EFC_SIZE_DEC H5P__decode_unsigned +/* Definition for vds file cache size */ +#define H5F_ACS_VDS_SIZE_SIZE sizeof(unsigned) +#define H5F_ACS_VDS_SIZE_DEF 0 +#define H5F_ACS_VDS_SIZE_ENC H5P__encode_unsigned +#define H5F_ACS_VDS_SIZE_DEC H5P__decode_unsigned /* Definition of pointer to initial file image info */ #define H5F_ACS_FILE_IMAGE_INFO_SIZE sizeof(H5FD_file_image_info_t) #define H5F_ACS_FILE_IMAGE_INFO_DEF H5FD_DEFAULT_FILE_IMAGE_INFO @@ -175,12 +180,12 @@ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC H5P__encode_size_t #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC H5P__decode_size_t /* Definition for # of metadata read attempts */ -#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 -#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 +#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned /* Definition for object flush callback */ -#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) +#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) #define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL} /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) @@ -309,21 +314,21 @@ static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); /* File access property list class library initialization object */ const H5P_libclass_t H5P_CLS_FACC[1] = {{ - "file access", /* Class name for debugging */ + "file access", /* Class name for debugging */ H5P_TYPE_FILE_ACCESS, /* Class type */ - &H5P_CLS_ROOT_g, /* Parent class */ - &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ - &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ - &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ - H5P__facc_reg_prop, /* Default property registration routine */ - - NULL, /* Class creation callback */ - NULL, /* Class creation callback info */ - NULL, /* Class copy callback */ - NULL, /* Class copy callback info */ - NULL, /* Class close callback */ - NULL /* Class close callback info */ + &H5P_CLS_ROOT_g, /* Parent class */ + &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ + &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ + &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ + H5P__facc_reg_prop, /* Default property registration routine */ + + NULL, /* Class creation callback */ + NULL, /* Class creation callback info */ + NULL, /* Class copy callback */ + NULL, /* Class copy callback info */ + NULL, /* Class close callback */ + NULL /* Class close callback info */ }}; @@ -355,6 +360,7 @@ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ +static const unsigned H5F_def_vds_size_g = H5F_ACS_VDS_SIZE_DEF; /* Default vds file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ static const hbool_t H5F_def_core_write_tracking_flag_g = H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEF; /* Default setting for core VFD write tracking */ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEF; /* Default core VFD write tracking page size */ @@ -395,149 +401,155 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the initial metadata cache resize configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, - NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, + if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, + NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, - NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, + NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, - NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, + NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, - NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, + NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, - NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, + if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, + NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID & info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, + if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL, H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ - if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, - NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, + NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the offset of family driver info */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, - NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, + NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of new family file size. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether convert family to sec2 driver. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the data type of multi driver info */ - if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, - NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, + if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, + NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, + NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to retrieve the file descriptor from the core VFD */ /* (used internally to the library only) */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, + if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the external file cache size */ - if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, - NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, + NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the vds file cache size */ + if(H5P_register_real(pclass, H5F_ACS_VDS_SIZE_NAME, H5F_ACS_VDS_SIZE_SIZE, &H5F_def_vds_size_g, + NULL, NULL, NULL, H5F_ACS_VDS_SIZE_ENC, H5F_ACS_VDS_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, + if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the core VFD backing store write tracking flag */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the core VFD backing store page size */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, - NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object flush callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, + if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -563,44 +575,44 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the evict on close flag */ - if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, - NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, + NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, + if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata collective write flag */ - if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ /* Register the initial metadata cache image configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum metadata size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum raw data size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -610,33 +622,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_alignment + * Function: H5Pset_alignment * - * Purpose: Sets the alignment properties of a file access property list - * so that any file object >= THRESHOLD bytes will be aligned on - * an address which is a multiple of ALIGNMENT. The addresses - * are relative to the end of the user block; the alignment is - * calculated by subtracting the user block size from the - * absolute file address and then adjusting the address to be a - * multiple of ALIGNMENT. + * Purpose: Sets the alignment properties of a file access property list + * so that any file object >= THRESHOLD bytes will be aligned on + * an address which is a multiple of ALIGNMENT. The addresses + * are relative to the end of the user block; the alignment is + * calculated by subtracting the user block size from the + * absolute file address and then adjusting the address to be a + * multiple of ALIGNMENT. * - * Default values for THRESHOLD and ALIGNMENT are one, implying - * no alignment. Generally the default values will result in - * the best performance for single-process access to the file. - * For MPI-IO and other parallel systems, choose an alignment - * which is a multiple of the disk block size. + * Default values for THRESHOLD and ALIGNMENT are one, implying + * no alignment. Generally the default values will result in + * the best performance for single-process access to the file. + * For MPI-IO and other parallel systems, choose an alignment + * which is a multiple of the disk block size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed file access property list mechanism to the new + * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -668,15 +680,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_alignment + * Function: H5Pget_alignment * - * Purpose: Returns the current settings for alignment properties from a - * file access property list. The THRESHOLD and/or ALIGNMENT - * pointers may be null pointers. + * Purpose: Returns the current settings for alignment properties from a + * file access property list. The THRESHOLD and/or ALIGNMENT + * pointers may be null pointers. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -709,20 +721,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_set_driver + * Function: H5P_set_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -757,20 +769,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_driver + * Function: H5Pset_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -800,20 +812,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver + * Function: H5P_peek_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Return: Success: A low-level driver ID which is the same ID - * used when the driver was set for the property - * list. The driver ID is only valid as long as - * the file driver remains registered. + * Return: Success: A low-level driver ID which is the same ID + * used when the driver was set for the property + * list. The driver ID is only valid as long as + * the file driver remains registered. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -844,22 +856,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver + * Function: H5Pget_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Note: The ID returned should not be closed. + * Note: The ID returned should not be closed. * - * Return: Success: A low-level driver ID which is the same ID - * used when the driver was set for the property - * list. The driver ID is only valid as long as - * the file driver remains registered. + * Return: Success: A low-level driver ID which is the same ID + * used when the driver was set for the property + * list. The driver ID is only valid as long as + * the file driver remains registered. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -867,7 +879,7 @@ hid_t H5Pget_driver(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); @@ -885,20 +897,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver_info + * Function: H5P_peek_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -927,20 +939,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver_info + * Function: H5Pget_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -973,7 +985,7 @@ done: * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -1486,30 +1498,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_cache + * Function: H5Pset_cache * - * Purpose: Set the number of objects in the meta data cache and the - * maximum number of chunks and bytes in the raw data chunk - * cache. + * Purpose: Set the number of objects in the meta data cache and the + * maximum number of chunks and bytes in the raw data chunk + * cache. * - * The RDCC_W0 value should be between 0 and 1 inclusive and - * indicates how much chunks that have been fully read or fully - * written are favored for preemption. A value of zero means - * fully read or written chunks are treated no differently than - * other chunks (the preemption is strictly LRU) while a value - * of one means fully read chunks are always preempted before - * other chunks. + * The RDCC_W0 value should be between 0 and 1 inclusive and + * indicates how much chunks that have been fully read or fully + * written are favored for preemption. A value of zero means + * fully read or written chunks are treated no differently than + * other chunks (the preemption is strictly LRU) while a value + * of one means fully read chunks are always preempted before + * other chunks. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, - size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) + size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1540,24 +1552,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_cache + * Function: H5Pget_cache * - * Purpose: Retrieves the maximum possible number of elements in the meta - * data cache and the maximum possible number of elements and - * bytes and the RDCC_W0 value in the raw data chunk cache. Any - * (or all) arguments may be null pointers in which case the - * corresponding datum is not returned. + * Purpose: Retrieves the maximum possible number of elements in the meta + * data cache and the maximum possible number of elements and + * bytes and the RDCC_W0 value in the raw data chunk cache. Any + * (or all) arguments may be null pointers in which case the + * corresponding datum is not returned. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, - size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) + size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1592,14 +1604,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_image_config + * Function: H5Pset_mdc_image_config * - * Purpose: Set the initial metadata cache image configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache image configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, June 25, 2015 * *------------------------------------------------------------------------- @@ -1636,18 +1648,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_image_config + * Function: H5Pget_mdc_image_config * - * Purpose: Retrieve the metadata cache initial image configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial image configuration + * from the target FAPL. * - * Observe that the function will fail if config_ptr is - * NULL, or if config_ptr->version specifies an unknown - * version of H5AC_cache_image_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_image_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Friday, June 26, 2015 * *------------------------------------------------------------------------- @@ -1687,14 +1699,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_config + * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache resize configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1731,18 +1743,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_config + * Function: H5Pget_mdc_config * - * Purpose: Retrieve the metadata cache initial resize configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial resize configuration + * from the target FAPL. * - * Observe that the function will fail if config_ptr is - * NULL, or if config_ptr->version specifies an unknown - * version of H5AC_cache_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1782,33 +1794,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_gc_references + * Function: H5Pset_gc_references * - * Purpose: Sets the flag for garbage collecting references for the file. - * Dataset region references (and other reference types - * probably) use space in the file heap. If garbage collection - * is on and the user passes in an uninitialized value in a - * reference structure, the heap might get corrupted. When - * garbage collection is off however and the user re-uses a - * reference, the previous heap block will be orphaned and not - * returned to the free heap space. When garbage collection is - * on, the user must initialize the reference structures to 0 or - * risk heap corruption. + * Purpose: Sets the flag for garbage collecting references for the file. + * Dataset region references (and other reference types + * probably) use space in the file heap. If garbage collection + * is on and the user passes in an uninitialized value in a + * reference structure, the heap might get corrupted. When + * garbage collection is off however and the user re-uses a + * reference, the previous heap block will be orphaned and not + * returned to the free heap space. When garbage collection is + * on, the user must initialize the reference structures to 0 or + * risk heap corruption. * - * Default value for garbage collecting references is off, just - * to be on the safe side. + * Default value for garbage collecting references is off, just + * to be on the safe side. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * June, 1999 + * Programmer: Quincey Koziol + * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1835,22 +1847,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_gc_references + * Function: H5Pget_gc_references * - * Purpose: Returns the current setting for the garbage collection - * references property from a file access property list. + * Purpose: Returns the current setting for the garbage collection + * references property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1949,31 +1961,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_meta_block_size + * Function: H5Pset_meta_block_size * - * Purpose: Sets the minimum size of metadata block allocations when + * Purpose: Sets the minimum size of metadata block allocations when * the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver. * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. * - * The default value is set to 2048 (bytes), indicating that metadata + * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will * turn off the metadata aggregation, even if the VFL driver attempts to * use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2000,22 +2012,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_meta_block_size + * Function: H5Pget_meta_block_size * - * Purpose: Returns the current settings for the metadata block allocation + * Purpose: Returns the current settings for the metadata block allocation * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 29, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2044,31 +2056,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_sieve_buf_size + * Function: H5Pset_sieve_buf_size * - * Purpose: Sets the maximum size of the data seive buffer used for file + * Purpose: Sets the maximum size of the data seive buffer used for file * drivers which are capable of using data sieving. The data sieve * buffer is used when performing I/O on datasets in the file. Using a * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. * - * The default value is set to 64KB, indicating that file I/O for raw data + * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the * data sieving, even if the VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2095,22 +2107,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_sieve_buf_size + * Function: H5Pget_sieve_buf_size * - * Purpose: Returns the current settings for the data sieve buffer size + * Purpose: Returns the current settings for the data sieve buffer size * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2138,23 +2150,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_small_data_block_size + * Function: H5Pset_small_data_block_size * - * Purpose: Sets the minimum size of "small" raw data block allocations + * Purpose: Sets the minimum size of "small" raw data block allocations * when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver. * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. * - * The default value is set to 2048 (bytes), indicating that raw data + * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API * function will turn off the "small" raw data aggregation, even if the * VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2184,14 +2196,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_small_data_block_size + * Function: H5Pget_small_data_block_size * - * Purpose: Returns the current settings for the "small" raw data block + * Purpose: Returns the current settings for the "small" raw data block * allocation property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2223,9 +2235,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_libver_bounds + * Function: H5Pset_libver_bounds * - * Purpose: Indicates which versions of the file format the library should + * Purpose: Indicates which versions of the file format the library should * use when creating objects. LOW is the earliest version of the HDF5 * library that is guaranteed to be able to access the objects created * (the format of some objects in an HDF5 file may not have changed between @@ -2301,9 +2313,9 @@ done: * releases and then map down to the previous actual library release which * had a format change. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, December 30, 2007 * *------------------------------------------------------------------------- @@ -2341,14 +2353,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_libver_bounds + * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * *------------------------------------------------------------------------- @@ -2488,7 +2500,7 @@ H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) /* Set value */ if(H5P_set(plist, H5F_ACS_VDS_SIZE_NAME, &vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set elink file cache size") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds file cache size") done: FUNC_LEAVE_API(ret_value) @@ -2523,7 +2535,7 @@ H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) /* Get value */ if(vds_size) if(H5P_get(plist, H5F_ACS_VDS_SIZE_NAME, vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get elink file cache size") + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file cache size") done: FUNC_LEAVE_API(ret_value) @@ -2533,9 +2545,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_file_image * - * Purpose: Sets the initial file image. Some file drivers can initialize - * the starting data in a file from a buffer. - * + * Purpose: Sets the initial file image. Some file drivers can initialize + * the starting data in a file from a buffer. + * * Return: Non-negative on success/Negative on failure * * Programmer: Jacob Gruber @@ -2549,22 +2561,22 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) H5P_genplist_t *fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len); /* validate parameters */ if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len") - + /* Get the plist structure */ if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - + /* Get old image info */ if(H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer") - + /* Release previous buffer, if it exists */ if(image_info.buffer != NULL) { if(image_info.callbacks.image_free) { @@ -2573,8 +2585,8 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) } /* end if */ else H5MM_xfree(image_info.buffer); - } /* end if */ - + } /* end if */ + /* Update struct */ if(buf_ptr) { /* Allocate memory */ @@ -2586,15 +2598,15 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) else if(NULL == (image_info.buffer = H5MM_malloc(buf_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { - if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, - buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, + buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata)) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(image_info.buffer, buf_ptr, buf_len); } /* end if */ else @@ -2614,24 +2626,24 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, - * allocate a buffer of the correct size, copy the image into - * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks - * if defined. + * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * allocate a buffer of the correct size, copy the image into + * the new buffer, and return the buffer to the caller in + * *buf_ptr_ptr. Do this using the file image callbacks + * if defined. * - * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do - * this using free if the file image callbacks are not - * defined, or with whatever method is appropriate if - * the callbacks are defined. + * NB: It is the responsibility of the caller to free the + * buffer whose address is returned in *buf_ptr_ptr. Do + * this using free if the file image callbacks are not + * defined, or with whatever method is appropriate if + * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf_ptr_ptr is not NULL, and no image exists, set + * *buf_ptr_ptr to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal - * to the length of the file image if it exists, and - * to 0 if it does not. + * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * to the length of the file image if it exists, and + * to 0 if it does not. * * Return: Non-negative on success/Negative on failure * @@ -2659,7 +2671,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || + HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ @@ -2680,15 +2692,15 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) else if(NULL == (copy_ptr = H5MM_malloc(image_info.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, - image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ @@ -2705,7 +2717,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * and memcpys or to perform detailed logging. * @@ -2735,7 +2747,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* Make sure a file image hasn't already been set */ @@ -2744,7 +2756,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Make sure udata callbacks are going to be set if udata is going to be set */ if(callbacks_ptr->udata) @@ -2755,7 +2767,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback if(info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_free); if(info.callbacks.udata_free(info.callbacks.udata) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") } /* end if */ /* Update struct */ @@ -2782,7 +2794,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * * Return: Non-negative on success/Negative on failure @@ -2811,12 +2823,12 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Transfer values to parameters */ *callbacks_ptr = info.callbacks; @@ -2837,12 +2849,12 @@ done: * Function: H5P__file_image_info_copy * * Purpose: Copy file image info. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -2865,7 +2877,7 @@ H5P__file_image_info_copy(void *value) info = (H5FD_file_image_info_t *)value; /* verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); if(info->buffer && info->size > 0) { @@ -2884,14 +2896,14 @@ H5P__file_image_info_copy(void *value) if(NULL == (info->buffer = H5MM_malloc(info->size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory block") } /* end else */ - + /* Copy data to new buffer */ if(info->callbacks.image_memcpy) { - if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, - info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(info->buffer, old_buffer, info->size); } /* end if */ @@ -2915,8 +2927,8 @@ done: * Function: H5P__file_image_info_free * * Purpose: Free file image info. The buffer and udata may need to be - * freed, possibly using their respective callbacks, so the - * default free won't work. + * freed, possibly using their respective callbacks, so the + * default free won't work. * * Return: Success: Non-negative * Failure: Negative @@ -2937,16 +2949,16 @@ H5P__file_image_info_free(void *value) H5FD_file_image_info_t *info; /* Image info struct */ info = (H5FD_file_image_info_t *)value; - + /* Verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); /* Free buffer */ - if(info->buffer != NULL && info->size > 0) { + if(info->buffer != NULL && info->size > 0) { if(info->callbacks.image_free) { if((*info->callbacks.image_free)(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") + HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else H5MM_xfree(info->buffer); @@ -2972,7 +2984,7 @@ done: * Purpose: Compare two cache image configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: John Mainzer * June 26, 2015 @@ -3013,11 +3025,11 @@ done: * Function: H5P__facc_cache_image_config_enc * * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation - * property list is encoded. + * cache image config property in the file creation + * property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3059,11 +3071,11 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) * Function: H5P__facc_cache_image_config_dec * * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation property - * list is decoded. + * cache image config property in the file creation property + * list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3178,7 +3190,7 @@ done: * * Purpose: Delete callback for the file image info property, called * when the property is deleted from the plist. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the default free won't work. * * Return: Non-negative on success/Negative on failure @@ -3208,7 +3220,7 @@ done: * Function: H5P__facc_file_image_info_copy * * Purpose: Copy callback for the file image info property. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Return: Non-negative on success/Negative on failure @@ -3297,7 +3309,7 @@ done: * Function: H5P__facc_file_image_info_close * * Purpose: Close callback for the file image info property. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the standard free won't work. * * Return: Non-negative on success/Negative on failure @@ -3329,7 +3341,7 @@ done: * Purpose: Compare two cache configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: Mohamad Chaarawi * September 24, 2012 @@ -3442,8 +3454,8 @@ done: * cache config property in the file creation property list is * encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3587,8 +3599,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) * cache config property in the file creation property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3722,8 +3734,8 @@ done: * degree property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3760,8 +3772,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) * degree property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3795,8 +3807,8 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) * memory type property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3833,8 +3845,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) * memory type property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3862,12 +3874,12 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * - * Purpose: Enables/disables core VFD write tracking and page + * Purpose: Enables/disables core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3903,12 +3915,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_core_write_tracking + * Function: H5Pget_core_write_tracking * - * Purpose: Gets information about core VFD write tracking and page + * Purpose: Gets information about core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3945,19 +3957,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_metadata_read_attempts + * Function: H5Pset_metadata_read_attempts + * + * Purpose: Sets the # of read attempts in the file access property list + * when reading metadata with checksum. + * The # of read attempts set via this routine will only apply + * when opening a file with SWMR access. + * The # of read attempts set via this routine does not have + * any effect when opening a file with non-SWMR access; for this + * case, the # of read attempts will be always be 1. * - * Purpose: Sets the # of read attempts in the file access property list - * when reading metadata with checksum. - * The # of read attempts set via this routine will only apply - * when opening a file with SWMR access. - * The # of read attempts set via this routine does not have - * any effect when opening a file with non-SWMR access; for this - * case, the # of read attempts will be always be 1. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3988,13 +4000,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_metadata_read_attempts + * Function: H5Pget_metadata_read_attempts * - * Purpose: Returns the # of metadata read attempts set in the file access property list. + * Purpose: Returns the # of metadata read attempts set in the file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -4014,13 +4026,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -4029,14 +4041,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_obj_flush_cb + * Function: H5Pset_obj_flush_cb * - * Purpose: Sets the callback function to invoke and the user data when an - * object flush occurs in the file. - * - * Return: Non-negative on success/Negative on failure + * Purpose: Sets the callback function to invoke and the user data when an + * object flush occurs in the file. * - * Programmer: Vailin Choi; Dec 2013 + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4073,14 +4085,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_obj_flush_cb + * Function: H5Pget_obj_flush_cb + * + * Purpose: Retrieves the callback function and user data set in the + * property list for an object flush. * - * Purpose: Retrieves the callback function and user data set in the - * property list for an object flush. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4104,9 +4116,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4114,11 +4126,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_log_options + * Function: H5Pset_mdc_log_options * - * Purpose: Set metadata cache log options. + * Purpose: Set metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4166,11 +4178,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_log_options + * Function: H5Pget_mdc_log_options * - * Purpose: Get metadata cache log options. + * Purpose: Get metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4524,8 +4536,8 @@ done: * * Purpose: Generic encoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4562,8 +4574,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) * * Purpose: Generic decoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4592,22 +4604,22 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_all_coll_metadata_ops + * Function: H5Pset_all_coll_metadata_ops * - * Purpose: Tell the library whether the metadata read operations will - * be done collectively (1) or not (0). Default is independent. - * With collective mode, the library will optimize access to - * metadata operations on the file. + * Purpose: Tell the library whether the metadata read operations will + * be done collectively (1) or not (0). Default is independent. + * With collective mode, the library will optimize access to + * metadata operations on the file. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4651,19 +4663,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_all_coll_metadata_ops + * Function: H5Pget_all_coll_metadata_ops * - * Purpose: Gets information about collective metadata read mode. + * Purpose: Gets information about collective metadata read mode. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4709,14 +4721,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_coll_metadata_write + * Function: H5Pset_coll_metadata_write * - * Purpose: Tell the library whether the metadata write operations will - * be done collectively (1) or not (0). Default is collective. + * Purpose: Tell the library whether the metadata write operations will + * be done collectively (1) or not (0). Default is collective. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4748,13 +4760,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_coll_metadata_write + * Function: H5Pget_coll_metadata_write * - * Purpose: Gets information about collective metadata write mode. + * Purpose: Gets information about collective metadata write mode. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4786,15 +4798,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_page_buffer_size + * Function: H5Pset_page_buffer_size * * Purpose: Set the maximum page buffering size. This has to be a * multiple of the page allocation size which must be enabled; * otherwise file create/open will fail. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- @@ -4834,13 +4846,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_page_buffer_size + * Function: H5Pget_page_buffer_size * - * Purpose: Retrieves the maximum page buffer size. + * Purpose: Retrieves the maximum page buffer size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- -- cgit v0.12 From b475a809d823c0aaf91260f3b3b7df6026ba13b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 10:31:30 -0600 Subject: Remove return from void functions --- java/src/jni/h5pImp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index 3c799f2..b144ff6 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5786,8 +5786,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix if(retVal < 0) h5libraryError(env); } - - return (jint)retVal; } /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ /* @@ -5854,8 +5852,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix if(retVal < 0) h5libraryError(env); } - - return (jint)retVal; } /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ /* -- cgit v0.12 From 8561bd327b37960d62e977e1283a10d8e5102424 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 11:04:29 -0600 Subject: Fix VDS file cache var names --- src/H5Fprivate.h | 424 +++++++++++++++++++++++++++---------------------------- src/H5Pfapl.c | 18 +-- 2 files changed, 221 insertions(+), 221 deletions(-) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 262e63b..84c8c90 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t; #include "H5Fpublic.h" /* Public headers needed by this file */ -#include "H5FDpublic.h" /* File drivers */ +#include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ #ifdef H5_HAVE_PARALLEL -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /**************************/ @@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t; * Currently, all file meta-data is little-endian. */ -# define INT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define INT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define UINT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define UINT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define INT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ +# define INT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ } -# define UINT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ +# define UINT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ } /* Encode an unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define ENCODE_VAR(p, typ, n, l) { \ - typ _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for(_i = 0; _i < l; _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t*)(p) + l; \ +# define ENCODE_VAR(p, typ, n, l) { \ + typ _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for(_i = 0; _i < l; _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t*)(p) + l; \ } /* Encode a 32-bit unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l) -# define INT64ENCODE(p, n) { \ - int64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = (n) < 0 ? 0xff : 0; \ - (p) = (uint8_t*)(p)+8; \ +# define INT64ENCODE(p, n) { \ + int64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = (n) < 0 ? 0xff : 0; \ + (p) = (uint8_t*)(p)+8; \ } -# define UINT64ENCODE(p, n) { \ - uint64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = 0; \ - (p) = (uint8_t*)(p) + 8; \ +# define UINT64ENCODE(p, n) { \ + uint64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = 0; \ + (p) = (uint8_t*)(p) + 8; \ } /* Encode a 64-bit unsigned integer into a variable-sized buffer */ @@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ +# define UINT64ENCODE_VARLEN(p, n) { \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } -# define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ +# define H5_ENCODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_ENCODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - HDmemcpy(&_n, &n, sizeof(double)); \ - for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t *)(p) + 8; \ +# define H5_ENCODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + HDmemcpy(&_n, &n, sizeof(double)); \ + for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t *)(p) + 8; \ } /* DECODE converts little endian bytes pointed by p to integer values and store @@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t; * correctly even if i is actually a 64bit int like in a Cray. */ -# define INT16DECODE(p, i) { \ - (i) = (int16_t)((*(p) & 0xff)); (p)++; \ +# define INT16DECODE(p, i) { \ + (i) = (int16_t)((*(p) & 0xff)); (p)++; \ (i) |= (int16_t)(((*(p) & 0xff) << 8) | \ - ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ + ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ } -# define UINT16DECODE(p, i) { \ - (i) = (uint16_t) (*(p) & 0xff); (p)++; \ - (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ +# define UINT16DECODE(p, i) { \ + (i) = (uint16_t) (*(p) & 0xff); (p)++; \ + (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ } -# define INT32DECODE(p, i) { \ - (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ +# define INT32DECODE(p, i) { \ + (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ (i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \ ((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \ } -# define UINT32DECODE(p, i) { \ - (i) = (uint32_t)(*(p) & 0xff); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ +# define UINT32DECODE(p, i) { \ + (i) = (uint32_t)(*(p) & 0xff); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ } /* Decode a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define DECODE_VAR(p, n, l) { \ - size_t _i; \ - \ - n = 0; \ - (p) += l; \ - for (_i = 0; _i < l; _i++) \ - n = (n << 8) | *(--p); \ - (p) += l; \ +# define DECODE_VAR(p, n, l) { \ + size_t _i; \ + \ + n = 0; \ + (p) += l; \ + for (_i = 0; _i < l; _i++) \ + n = (n << 8) | *(--p); \ + (p) += l; \ } /* Decode a variable-sized buffer into a 32-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ # define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) -# define INT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(int64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define INT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(int64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } -# define UINT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(uint64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define UINT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(uint64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } /* Decode a variable-sized buffer into a 64-bit unsigned integer */ @@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t; /* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT64DECODE_VARLEN(p, n) { \ - unsigned _s = *(p)++; \ - \ - UINT64DECODE_VAR(p, n, _s); \ +# define UINT64DECODE_VARLEN(p, n) { \ + unsigned _s = *(p)++; \ + \ + UINT64DECODE_VAR(p, n, _s); \ } -# define H5_DECODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32DECODE(p, n) \ +# define H5_DECODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32DECODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_DECODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - _n = 0; \ - (p) += 8; \ - for(_u = 0; _u < sizeof(uint64_t); _u++) \ - _n = (_n << 8) | *(--p); \ - HDmemcpy(&(n), &_n, sizeof(double)); \ - (p) += 8; \ +# define H5_DECODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + _n = 0; \ + (p) += 8; \ + for(_u = 0; _u < sizeof(uint64_t); _u++) \ + _n = (_n << 8) | *(--p); \ + HDmemcpy(&(n), &_n, sizeof(double)); \ + (p) += 8; \ } /* Address-related macros */ -#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ - HADDR_UNDEF==(X)+(haddr_t)(Z) || \ - (X)+(haddr_t)(Z)<(X)) -#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) +#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ + HADDR_UNDEF==(X)+(haddr_t)(Z) || \ + (X)+(haddr_t)(Z)<(X)) +#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) /* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making * certain that X is not HADDR_UNDEF and then checking that X equals Y */ -#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ - (X)==(Y)) -#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) -#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<(Y)) -#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<=(Y)) -#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>(Y)) -#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>=(Y)) -#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ - (H5F_addr_lt((X), (Y)) ? -1 : 1)) -#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) +#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ + (X)==(Y)) +#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) +#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<(Y)) +#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<=(Y)) +#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>(Y)) +#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>=(Y)) +#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ + (H5F_addr_lt((X), (Y)) ? -1 : 1)) +#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) #define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) @@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) #define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k) #define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id]) -#define H5F_NREFS(F) ((F)->shared->nrefs) +#define H5F_NREFS(F) ((F)->shared->nrefs) #define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) #define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) #define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr) @@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging) #define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access) #define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location) -#define H5F_ALIGNMENT(F) ((F)->shared->alignment) -#define H5F_THRESHOLD(F) ((F)->shared->threshold) +#define H5F_ALIGNMENT(F) ((F)->shared->alignment) +#define H5F_THRESHOLD(F) ((F)->shared->threshold) #define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres) #define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return) #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) @@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) #define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F)) #define H5F_KVALUE(F,T) (H5F_Kvalue(F,T)) -#define H5F_NREFS(F) (H5F_get_nrefs(F)) +#define H5F_NREFS(F) (H5F_get_nrefs(F)) #define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) #define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) #define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F)) @@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F)) #define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F)) #define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F)) -#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) -#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) +#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) +#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) #define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F)) #define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F)) #define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F)) @@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t; /* Macros to encode/decode offset/length's for storing in the file */ -#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ - case 4: UINT32ENCODE(p,o); break; \ - case 8: UINT64ENCODE(p,o); break; \ - case 2: UINT16ENCODE(p,o); break; \ +#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ + case 4: UINT32ENCODE(p,o); break; \ + case 8: UINT64ENCODE(p,o); break; \ + case 2: UINT16ENCODE(p,o); break; \ } -#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ - case 4: UINT32DECODE(p, o); break; \ - case 8: UINT64DECODE(p, o); break; \ - case 2: UINT16DECODE(p, o); break; \ +#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ + case 4: UINT32DECODE(p, o); break; \ + case 8: UINT64DECODE(p, o); break; \ + case 2: UINT16DECODE(p, o); break; \ } -#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32ENCODE(p,l); break; \ - case 8: UINT64ENCODE(p,l); break; \ - case 2: UINT16ENCODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32ENCODE(p,l); break; \ + case 8: UINT64ENCODE(p,l); break; \ + case 2: UINT16ENCODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) -#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32DECODE(p,l); break; \ - case 8: UINT64DECODE(p,l); break; \ - case 2: UINT16DECODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32DECODE(p,l); break; \ + case 8: UINT64DECODE(p,l); break; \ + case 2: UINT16DECODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) @@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t; * with. */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_SIZET2OFFT(X) \ +# define H5F_OVERFLOW_SIZET2OFFT(X) \ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1))) #else # define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif #if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_HSIZET2OFFT(X) \ +# define H5F_OVERFLOW_HSIZET2OFFT(X) \ ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1))) #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 @@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */ #define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */ #define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */ -#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ +#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ #define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */ #define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */ /* ========= File Access properties ============ */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ +#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ @@ -487,9 +487,9 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ -#define H5F_ACS_VDS_SIZE_NAME "vds_size" /* Size of vds file cache */ +#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ @@ -505,7 +505,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ /* ======================== File Mount properties ====================*/ -#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ +#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ #ifdef H5_HAVE_PARALLEL @@ -514,20 +514,20 @@ typedef struct H5F_t H5F_t; #endif /* H5_HAVE_PARALLEL */ /* Define the HDF5 file signature */ -#define H5F_SIGNATURE "\211HDF\r\n\032\n" +#define H5F_SIGNATURE "\211HDF\r\n\032\n" #define H5F_SIGNATURE_LEN 8 /* Version #'s of the major components of the file format */ -#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ -#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ -#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ -#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ -#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ +#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ +#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ +#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ +#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ +#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ #define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */ -#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ -#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ -#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ -#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ +#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ +#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ +#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ +#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ /* B-tree internal 'K' values */ #define HDF5_BTREE_SNODE_IK_DEF 16 @@ -537,43 +537,43 @@ typedef struct H5F_t H5F_t; if it is changed, the code must compensate. -QAK */ -#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ - /* See format specification on version 1 B-trees */ +#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ + /* See format specification on version 1 B-trees */ /* Default file space handling strategy */ -#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_PERSIST_DEF FALSE +#define H5F_FREE_SPACE_PERSIST_DEF FALSE /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_THRESHOLD_DEF 1 +#define H5F_FREE_SPACE_THRESHOLD_DEF 1 /* For paged aggregation: default file space page size when not set */ -#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 +#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 /* For paged aggregation: minimum value for file space page size */ -#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512 +#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512 /* For paged aggregation: maxiumum value for file space page size: 1 gigabyte */ -#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024 +#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024 /* For paged aggregation: drop free-space with size <= this threshold for small meta section */ #define H5F_FILE_SPACE_PGEND_META_THRES 0 /* Default for threshold for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_DEF 1 +#define H5F_ALIGN_DEF 1 /* Default for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_THRHD_DEF 1 +#define H5F_ALIGN_THRHD_DEF 1 /* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */ -#define H5F_META_BLOCK_SIZE_DEF 2048 +#define H5F_META_BLOCK_SIZE_DEF 2048 /* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */ -#define H5F_SDATA_BLOCK_SIZE_DEF 2048 +#define H5F_SDATA_BLOCK_SIZE_DEF 2048 /* Check for file using paged aggregation */ #define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size) /* Metadata read attempt values */ -#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ -#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ +#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ +#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ /* Macros to define signatures of all objects in the file */ @@ -584,10 +584,10 @@ typedef struct H5F_t H5F_t; /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ -#define H5_SIZEOF_CHKSUM 4 +#define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ -#define H5B_MAGIC "TREE" +#define H5B_MAGIC "TREE" /* v2 B-tree signatures */ #define H5B2_HDR_MAGIC "BTHD" /* Header */ @@ -617,7 +617,7 @@ typedef struct H5F_t H5F_t; #define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */ /* Global heap signature */ -#define H5HG_MAGIC "GCOL" +#define H5HG_MAGIC "GCOL" /* Local heap signature */ #define H5HL_MAGIC "HEAP" @@ -705,11 +705,11 @@ typedef enum H5F_fs_state_t { typedef enum H5F_mem_page_t { H5F_MEM_PAGE_DEFAULT = 0, /* Not used */ H5F_MEM_PAGE_SUPER = 1, - H5F_MEM_PAGE_BTREE = 2, - H5F_MEM_PAGE_DRAW = 3, - H5F_MEM_PAGE_GHEAP = 4, - H5F_MEM_PAGE_LHEAP = 5, - H5F_MEM_PAGE_OHDR = 6, + H5F_MEM_PAGE_BTREE = 2, + H5F_MEM_PAGE_DRAW = 3, + H5F_MEM_PAGE_GHEAP = 4, + H5F_MEM_PAGE_LHEAP = 5, + H5F_MEM_PAGE_OHDR = 6, H5F_MEM_PAGE_LARGE_SUPER = 7, H5F_MEM_PAGE_LARGE_BTREE = 8, H5F_MEM_PAGE_LARGE_DRAW = 9, diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 586f559..d4e84ab 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -156,10 +156,10 @@ #define H5F_ACS_EFC_SIZE_ENC H5P__encode_unsigned #define H5F_ACS_EFC_SIZE_DEC H5P__decode_unsigned /* Definition for vds file cache size */ -#define H5F_ACS_VDS_SIZE_SIZE sizeof(unsigned) -#define H5F_ACS_VDS_SIZE_DEF 0 -#define H5F_ACS_VDS_SIZE_ENC H5P__encode_unsigned -#define H5F_ACS_VDS_SIZE_DEC H5P__decode_unsigned +#define H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE sizeof(unsigned) +#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEF 0 +#define H5F_ACS_VDS_FILE_CACHE_SIZE_ENC H5P__encode_unsigned +#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEC H5P__decode_unsigned /* Definition of pointer to initial file image info */ #define H5F_ACS_FILE_IMAGE_INFO_SIZE sizeof(H5FD_file_image_info_t) #define H5F_ACS_FILE_IMAGE_INFO_DEF H5FD_DEFAULT_FILE_IMAGE_INFO @@ -360,7 +360,7 @@ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ -static const unsigned H5F_def_vds_size_g = H5F_ACS_VDS_SIZE_DEF; /* Default vds file cache size */ +static const unsigned H5F_def_vds_file_cache_size_g = H5F_ACS_VDS_FILE_CACHE_SIZE_DEF; /* Default vds file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ static const hbool_t H5F_def_core_write_tracking_flag_g = H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEF; /* Default setting for core VFD write tracking */ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEF; /* Default core VFD write tracking page size */ @@ -517,8 +517,8 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vds file cache size */ - if(H5P_register_real(pclass, H5F_ACS_VDS_SIZE_NAME, H5F_ACS_VDS_SIZE_SIZE, &H5F_def_vds_size_g, - NULL, NULL, NULL, H5F_ACS_VDS_SIZE_ENC, H5F_ACS_VDS_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE, &H5F_def_vds_file_cache_size_g, + NULL, NULL, NULL, H5F_ACS_VDS_FILE_CACHE_SIZE_ENC, H5F_ACS_VDS_FILE_CACHE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -2499,7 +2499,7 @@ H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set value */ - if(H5P_set(plist, H5F_ACS_VDS_SIZE_NAME, &vds_size) < 0) + if(H5P_set(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, &vds_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds file cache size") done: @@ -2534,7 +2534,7 @@ H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) /* Get value */ if(vds_size) - if(H5P_get(plist, H5F_ACS_VDS_SIZE_NAME, vds_size) < 0) + if(H5P_get(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, vds_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file cache size") done: -- cgit v0.12 From 8b24653c1fba1d1811e692a028760ffb091cd0a8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 11:14:49 -0600 Subject: Correct var name --- src/H5Fprivate.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 84c8c90..575aa1c 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -489,7 +489,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ -#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ +#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ @@ -580,14 +580,14 @@ typedef struct H5F_t H5F_t; /* Size of signature information (on disk) */ /* (all on-disk signatures should be this length) */ -#define H5_SIZEOF_MAGIC 4 +#define H5_SIZEOF_MAGIC 4 /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ #define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ -#define H5B_MAGIC "TREE" +#define H5B_MAGIC "TREE" /* v2 B-tree signatures */ #define H5B2_HDR_MAGIC "BTHD" /* Header */ @@ -617,7 +617,7 @@ typedef struct H5F_t H5F_t; #define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */ /* Global heap signature */ -#define H5HG_MAGIC "GCOL" +#define H5HG_MAGIC "GCOL" /* Local heap signature */ #define H5HL_MAGIC "HEAP" -- cgit v0.12 From 386be69a30f2ef8db94c32b1d9731fd379a4062a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 11:51:09 -0600 Subject: HDFFV-9724 combine efc and vds into one function --- src/H5Dint.c | 131 +++++++++++++-------------------------------------------- src/H5Fquery.c | 2 +- 2 files changed, 31 insertions(+), 102 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index 2123836..8b663b8 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -61,9 +61,7 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, - char **extfile_prefix); -static herr_t H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, +static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type, char **vds_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, @@ -965,99 +963,25 @@ done: } /* end H5D__update_oh_info() */ -/*-------------------------------------------------------------------------- - * Function: H5D_build_extfile_prefix - * - * Purpose: Determine the external file prefix to be used and store - * it in extfile_prefix. Stores an empty string if no prefix - * should be used. - * - * Return: SUCCEED/FAIL - *-------------------------------------------------------------------------- - */ -static herr_t -H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) -{ - char *prefix = NULL; /* prefix used to look for the file */ - char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t extpath_len; /* length of extpath */ - size_t prefix_len; /* length of prefix */ - size_t extfile_prefix_len; /* length of expanded prefix */ - H5P_genplist_t *plist = NULL; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* Return value */ - - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(dset); - HDassert(dset->oloc.file); - - extpath = H5F_EXTPATH(dset->oloc.file); - HDassert(extpath); - - /* XXX: Future thread-safety note - getenv is not required - * to be reentrant. - */ - prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); - - if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */ - if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix") - } /* end if */ - - /* Prefix has to be checked for NULL / empty string again because the - * code above might have updated it. - */ - if(prefix == NULL || *prefix == '\0' || HDstrcmp(prefix, ".") == 0) { - /* filename is interpreted as relative to the current directory, - * does not need to be expanded - */ - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(""))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - } /* end if */ - else { - if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { - /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - extpath_len = HDstrlen(extpath); - prefix_len = HDstrlen(prefix); - extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - - if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}")); - } /* end if */ - else { - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - } /* end else */ - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_extfile_prefix() */ - /*-------------------------------------------------------------------------- - * Function: H5D_build_vds_prefix + * Function: H5D_build_file_prefix * - * Purpose: Determine the vds file prefix to be used and store - * it in vds_prefix. Stores an empty string if no prefix + * Purpose: Determine the file prefix to be used and store + * it in file_prefix. Stores an empty string if no prefix * should be used. * * Return: SUCCEED/FAIL *-------------------------------------------------------------------------- */ static herr_t -H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/) +H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ - char *vdspath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t vdspath_len; /* length of vdstpath */ + char *filepath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t filepath_len; /* length of file path */ size_t prefix_len; /* length of prefix */ - size_t vds_prefix_len; /* length of expanded prefix */ + size_t file_prefix_len; /* length of expanded prefix */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1067,20 +991,25 @@ H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/ HDassert(dset); HDassert(dset->oloc.file); - vdspath = H5F_EXTPATH(dset->oloc.file); - HDassert(vdspath); + filepath = H5F_EXTPATH(dset->oloc.file); + HDassert(filepath); /* XXX: Future thread-safety note - getenv is not required * to be reentrant. */ - prefix = HDgetenv("HDF5_VDS_PREFIX"); + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_VDS_PREFIX"); + else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); + else + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible") if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of H5D_ACS_VDS_PREFIX_NAME property */ + /* Set prefix to value of prefix_type property */ if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds prefix") + if(H5P_peek(plist, prefix_type, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix") } /* end if */ /* Prefix has to be checked for NULL / empty string again because the @@ -1090,29 +1019,29 @@ H5D_build_vds_prefix(const H5D_t *dset, hid_t dapl_id, char **vds_prefix /*out*/ /* filename is interpreted as relative to the current directory, * does not need to be expanded */ - if(NULL == (*vds_prefix = (char *)H5MM_strdup(""))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(""))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ else { if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - vdspath_len = HDstrlen(vdspath); + filepath_len = HDstrlen(filepath); prefix_len = HDstrlen(prefix); - vds_prefix_len = vdspath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - if(NULL == (*vds_prefix = (char *)H5MM_malloc(vds_prefix_len))) + if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*vds_prefix, vds_prefix_len, "%s%s", vdspath, prefix + HDstrlen("${ORIGIN}")); + HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}")); } /* end if */ else { - if(NULL == (*vds_prefix = (char *)H5MM_strdup(prefix))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end else */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_vds_prefix() */ +} /* H5D_build_file_prefix() */ /*------------------------------------------------------------------------- @@ -1294,11 +1223,11 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Set the vds file prefix */ - if(H5D_build_vds_prefix(new_dset, dapl_id, &new_dset->shared->vds_prefix) < 0) + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") /* Add the dataset to the list of opened objects in the file */ @@ -1454,11 +1383,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Get the vds prefix */ - if(H5D_build_vds_prefix(dataset, dapl_id, &vds_prefix) < 0) + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") /* Check if dataset was already open */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 61b4183..4765d00 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f) * Function: H5F_get_extpath * * Purpose: Retrieve the file's 'extpath' flags - * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location + * This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location * when searching the target file. * * Return: 'extpath' on success/abort on failure (shouldn't fail) -- cgit v0.12 From 4da73f893ab4df56871e11d82978d21b6b9a6ecb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 14:29:22 -0600 Subject: Add h5dump VDS prefix tests --- tools/test/h5dump/CMakeTestsVDS.cmake | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 3addecf..368471c 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -72,6 +72,14 @@ f-3.h5 vds-eiger.h5 ) + set (HDF5_REFERENCE_PREFIX_VDS + 1_vds.h5 + 2_vds.h5 + 4_vds.h5 + 5_vds.h5 + vds-percival-unlim-maxmin.h5 + vds-eiger.h5 + ) set (HDF5_ERROR_REFERENCE_VDS ) @@ -80,12 +88,21 @@ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () + foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_VDS}) + get_filename_component(fname "${vds_h5_file}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files") + endforeach () foreach (ddl_vds ${HDF5_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () + foreach (ddl_vds ${HDF5_REFERENCE_VDS}) + get_filename_component(fname "${ddl_vds}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files") + endforeach () + foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") @@ -134,6 +151,44 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_vds_test}" STREQUAL "") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) + endif () + else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + add_test ( + NAME H5DUMP_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -261,3 +316,15 @@ ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5) ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5) endif () + + # Data read with prefix + if (USE_FILTER_DEFLATE) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) + endif () + -- cgit v0.12 From ba714e682047d19fba7ef2c87b072f75ac772e88 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 15:08:04 -0600 Subject: HDFFV-9724 Add H5LS prefix test with ${ORIGIN} --- MANIFEST | 6 ++++ config/cmake_ext_mod/runTest.cmake | 1 + tools/test/h5ls/CMakeTestsVDS.cmake | 55 ++++++++++++++++++++++++++++++++++ tools/test/h5ls/vds_prefix/tvds-1.ls | 14 +++++++++ tools/test/h5ls/vds_prefix/tvds-2.ls | 13 ++++++++ tools/test/h5ls/vds_prefix/tvds-3_1.ls | 14 +++++++++ tools/test/h5ls/vds_prefix/tvds-3_2.ls | 13 ++++++++ tools/test/h5ls/vds_prefix/tvds-4.ls | 9 ++++++ tools/test/h5ls/vds_prefix/tvds-5.ls | 11 +++++++ 9 files changed, 136 insertions(+) create mode 100644 tools/test/h5ls/vds_prefix/tvds-1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-4.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-5.ls diff --git a/MANIFEST b/MANIFEST index 9b91c78..c6c7b3c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1430,6 +1430,12 @@ ./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in +./tools/test/h5ls/vds_prefix/tvds-1.ls +./tools/test/h5ls/vds_prefix/tvds-2.ls +./tools/test/h5ls/vds_prefix/tvds-3_1.ls +./tools/test/h5ls/vds_prefix/tvds-3_2.ls +./tools/test/h5ls/vds_prefix/tvds-4.ls +./tools/test/h5ls/vds_prefix/tvds-5.ls # h5copy sources ./tools/src/h5copy/Makefile.am diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 2479728..5569a73 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -55,6 +55,7 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") + #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") endif () if (NOT TEST_INPUT) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 5df61bb..f7eb198 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -61,6 +61,17 @@ get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files") endforeach () + + foreach (listfiles ${LIST_HDF5_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + + foreach (listfiles ${LIST_OTHER_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -104,6 +115,43 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + if ("${resultcode}" STREQUAL "1") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + else () + add_test ( + NAME H5LS_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + add_test ( + NAME H5LS_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=\${ORIGIN}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -155,3 +203,10 @@ ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5) ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5) + diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls new file mode 100644 index 0000000..2830d1a --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 18/18, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 2880 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls new file mode 100644 index 0000000..5c6f9d3 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 8/8, 14/14} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 2688 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls new file mode 100644 index 0000000..f4c8e78 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/3_1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 25/25, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 4000 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls new file mode 100644 index 0000000..5a7e2d8 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/3_2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 13/13, 19/19} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 5928 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls new file mode 100644 index 0000000..c22d3a4 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-4.ls @@ -0,0 +1,9 @@ +Opened "vds/prefix/4_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {1} Source { + 4_%b.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls new file mode 100644 index 0000000..efba8dc --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-5.ls @@ -0,0 +1,11 @@ +Opened "vds/prefix/5_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {3} Source { + 5_a.h5 /source_dset + 5_b.h5 /source_dset + 5_c.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer -- cgit v0.12 From 65e09afd6c05ab34fde4f8779ca93a822014c8aa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Dec 2017 15:17:02 -0600 Subject: Add prefix dir to the clear command --- tools/test/h5ls/CMakeTestsVDS.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index f7eb198..f25bd98 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -119,7 +119,7 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -134,7 +134,7 @@ ${resultfile}.out ${resultfile}.out.err ) - set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") add_test ( NAME H5LS_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" -- cgit v0.12 From ac8274c3506c106a65dbc9c7a53a6f574ff3379a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Dec 2017 15:32:27 -0600 Subject: HDFFV-9724 Copy efc_open search from Lextern_traverse --- src/H5Dvirtual.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++++----- src/H5system.c | 2 +- 2 files changed, 212 insertions(+), 20 deletions(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index e0a4a83..4882e9f 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -763,6 +763,208 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__virtual_build_name() */ + +/*-------------------------------------------------------------------------- + * Function: H5D_getenv_prefix_name -- + * + * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, + * which is separated by the environment delimiter. + * env_prefix is modified to point to the remaining pathnames + * in the list. + * + * Return: A pointer to a pathname +--------------------------------------------------------------------------*/ +static char * +H5D_getenv_prefix_name(char **env_prefix/*in,out*/) +{ + char *retptr=NULL; + char *strret=NULL; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); + if (strret == NULL) { + retptr = *env_prefix; + *env_prefix = strret; + } else { + retptr = *env_prefix; + *env_prefix = strret + 1; + *strret = '\0'; + } + + FUNC_LEAVE_NOAPI(retptr) +} /* end H5D_getenv_prefix_name() */ + +/*------------------------------------------------------------------------- + * Function: H5D__virtual_open_file + * + * Purpose: Attempts to open a source dataset file. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +static H5F_t * +H5D__virtual_open_file(H5P_genplist_t *plist, const H5F_t *vdset_file, + const char *file_name, + hid_t fapl_id, hid_t dxpl_id) +{ + H5F_t *src_file = NULL; /* Source file */ + H5F_t *ret_value = NULL; /* Actual return value */ + char *full_name = NULL; /* File name with prefix */ + char *my_prefix; /* Library's copy of the prefix */ + unsigned intent; /* File access permissions */ + char *actual_file_name = NULL; /* Virtual file's actual name */ + char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ + + FUNC_ENTER_STATIC + + /* Simplify intent flags for open calls */ + intent = H5F_INTENT(vdset_file); + intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); + + /* Copy the file name to use */ + if(NULL == (temp_file_name = H5MM_strdup(file_name))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); + + /* target file_name is an absolute pathname: see RM for detailed description */ + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + char *ptr; + + H5E_clear_stack(NULL); + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(file_name, ptr) + HDassert(ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + + H5E_clear_stack(NULL); + + /* strip ":" */ + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + + /* try searching from paths set in the environment variable */ + if(src_file == NULL) { + char *env_prefix; + + if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { + char *tmp_env_prefix, *saved_env; + + if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + while((tmp_env_prefix) && (*tmp_env_prefix)) { + char *out_prefix_name; + + out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + if(out_prefix_name && (*out_prefix_name)) { + if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + saved_env = (char *)H5MM_xfree(saved_env); + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + } /* end if */ + + src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + full_name = (char *)H5MM_xfree(full_name); + if(src_file != NULL) + break; + H5E_clear_stack(NULL); + } /* end if */ + } /* end while */ + saved_env = (char *)H5MM_xfree(saved_env); + } /* end if */ + } /* end if */ + + /* try searching from property list */ + if(src_file == NULL) { + size_t size = 0; + if((size = H5Pget_virtual_prefix(plist, NULL, 0)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate prefix buffer") + if(H5Pget_virtual_prefix(plist, my_prefix, size+1) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") + if(my_prefix) { + if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ + if(src_file == NULL) { + char *vdspath; + + if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { + if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try the relative file_name stored in temp_file_name */ + if(src_file == NULL) { + if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + } /* end if */ + + /* try the 'resolved' name for the virtual file */ + if(src_file == NULL) { + char *ptr = NULL; + + /* Copy resolved file name */ + if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(actual_file_name, ptr) + if(!ptr) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + + /* Truncate filename portion from actual file name path */ + *ptr = '\0'; + + /* Build new file name for the external file */ + if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + + /* Try opening with the resolved name */ + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + + /* Success */ + ret_value = src_file; +done: + if((NULL == ret_value) && src_file) + if(H5F_try_close(src_file, NULL) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file") + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_open_file() */ + /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -787,6 +989,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ char *full_name = NULL; /* File name with prefix */ + unsigned intent; /* File access permissions */ + H5P_genplist_t *plist; /* Property list pointer */ FUNC_ENTER_STATIC @@ -796,27 +1000,15 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, HDassert(!source_dset->dset); HDassert(source_dset->file_name); HDassert(source_dset->dset_name); - vds_prefix = vdset->shared->vds_prefix; /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - if(vds_prefix && HDstrlen(vds_prefix) > 0) { - if(H5D__virtual_build_name(vds_prefix, source_dset->file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - /* Open the source file */ - if(NULL == (src_file = H5F_open(full_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) - H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ - else - src_file_open = TRUE; - full_name = (char *)H5MM_xfree(full_name); - } - else { - /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) - H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ - else - src_file_open = TRUE; - } + if((plist = H5D_get_access_plist(vdset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") + if(NULL == (src_file = H5D__virtual_open_file(plist, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ + else + src_file_open = TRUE; } /* end if */ else /* Source file is ".", use the virtual dataset's file */ @@ -2312,7 +2504,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Check if anything is selected */ if(select_nelmts > (hssize_t)0) { /* Open source dataset */ - if(!storage->list[i].source_dset.dset) + if(!storage->list[i].source_dset.dset) /* Try to open dataset */ if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") diff --git a/src/H5system.c b/src/H5system.c index a8726c2..7b3a0eb 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = name[0] - 'A' + 1; + drive = toupper(name[0]) - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ -- cgit v0.12 From 8aa520584463a5151699dc5768bcdef39f5564a6 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 18 Dec 2017 13:42:09 -0600 Subject: Optimized version of avoid truncate patch. --- src/H5FDmpio.c | 198 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5FDprivate.h | 3 + src/H5Fint.c | 11 +++ 3 files changed, 212 insertions(+) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index f594d8e..3fe6ed9 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -56,6 +56,7 @@ static char H5FD_mpi_native_g[] = "native"; * library to determine whether the file is empty, truncated, or okay. The MPIO * driver doesn't bother to keep it updated since it's an expensive operation. */ +#if 0 /* original version */ /* JRM */ typedef struct H5FD_mpio_t { H5FD_t pub; /*public stuff, must be first */ MPI_File f; /*MPIO file handle */ @@ -68,6 +69,26 @@ typedef struct H5FD_mpio_t { haddr_t last_eoa; /* Last known end-of-address marker */ haddr_t local_eof; /* Local end-of-file address for each process */ } H5FD_mpio_t; +#else /* modified version */ /* JRM */ +typedef struct H5FD_mpio_t { + H5FD_t pub; /*public stuff, must be first */ + MPI_File f; /*MPIO file handle */ + MPI_Comm comm; /*communicator */ + MPI_Info info; /*file information */ + int mpi_rank; /* This process's rank */ + int mpi_size; /* Total number of processes */ + haddr_t eof; /*end-of-file marker */ + haddr_t eoa; /*end-of-address marker */ + haddr_t last_eoa; /* Last known end-of-address marker */ + haddr_t local_eof; /* Local end-of-file address for each process */ + herr_t do_pre_trunc_barrier; /* hack to allow us to skip */ + /* unnecessary barriers in */ + /* H5FD_mpio_trucate() without a VFD */ + /* API change. This should be removed */ + /* as soon as be make the necessary */ + /* VFD API change. */ +} H5FD_mpio_t; +#endif /* modified version */ /* JRM */ /* Private Prototypes */ @@ -1039,6 +1060,11 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, file->eof = H5FD_mpi_MPIOff_to_haddr(size); file->local_eof = file->eof; +#if 1 /* JRM */ + /* Mark initial barriers in H5FD_mpio_truncate() as necessary */ + file->do_pre_trunc_barrier = TRUE; +#endif /* JRM */ + /* Set return value */ ret_value=(H5FD_t*)file; @@ -1930,6 +1956,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_flush() */ +#if 0 /* original version */ /*------------------------------------------------------------------------- * Function: H5FD_mpio_truncate @@ -1996,6 +2023,177 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_truncate() */ +#else /* modified versin */ + + +/*------------------------------------------------------------------------- + * Function: H5FD_mark_pre_trunc_barrier_unecessary + * + * Purpose: Hack to allow us to avoid most unnecessary barriers + * prior in H5FD_mpio_truncate(). + * + * This function should be deleted when next we modify the + * VFD interface. This change should allow us to tell the + * truncate function to omit the initial barrier if no + * file I/O has occurred since the last barrier. + * + * Return: void + * + * + * Programmer: John Mainzer + * 12/14/17 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file) +{ + H5FD_mpio_t *file = (H5FD_mpio_t*)_file; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(file); + HDassert(H5FD_MPIO == file->pub.driver_id); + + file->do_pre_trunc_barrier = FALSE; + + FUNC_LEAVE_NOAPI_VOID + +} /* end H5FD_mpio_mark_pre_trunc_barrier_unecessary() */ + + +/*------------------------------------------------------------------------- + * Function: H5FD_mpio_truncate + * + * Purpose: Make certain the file's size matches it's allocated size + * + * This is a little sticky in the mpio case, as it is not + * easy for us to track the current EOF by extracting it from + * write calls. + * + * Instead, we first check to see if the eoa has changed since + * the last call to this function. If it has, we call + * MPI_File_get_size() to determine the current EOF, and + * only call MPI_File_set_size() if this value disagrees + * with the current eoa. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * January 31, 2008 + * + * Changes: Heavily reworked to avoid unnecessary MPI_File_set_size() + * calls. The hope is that these calls are superfluous in the + * typical case, allowing us to avoid truncates most of the + * time. + * + * The basic idea is to query the file system to get the + * current eof, and only truncate if the file systems + * conception of the eof disagrees with our eoa. + * + * JRM -- 10/27/17 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +{ + H5FD_mpio_t *file = (H5FD_mpio_t*)_file; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#ifdef H5FDmpio_DEBUG + if(H5FD_mpio_Debug[(int)'t']) + HDfprintf(stdout, "Entering %s\n", FUNC); +#endif + HDassert(file); + HDassert(H5FD_MPIO == file->pub.driver_id); + + if ( !H5F_addr_eq(file->eoa, file->last_eoa) ) { + + int mpi_code; /* mpi return code */ + MPI_Offset size; + MPI_Offset needed_eof; + + /* In principle, it is possible for the size returned by the + * call to MPI_File_get_size() to depend on whether writes from + * all proceeses have completed at the time process 0 makes the + * call. + * + * In practice, most (all?) truncate calls will come after a barrier + * and with no interviening writes to the file (with the possible + * exception of sueprblock / superblock extension message updates). + * + * Unfortunately, the current VFD API doesn't let us pass in a + * flag indicating whether this particular call is unnecessary. + * To work around this, I have added the new function + * H5FD_mpio_mark_pre_trunc_barrier_unecessary() allow us to + * set a flag in H5FD_mpio_t indicating that we can skip the + * barrier. + * + * This is a pretty ugly hack, but until we revise the VFD API, + * it is about the best we can do. + */ + if (file->do_pre_trunc_barrier) { + if (MPI_SUCCESS!= (mpi_code=MPI_Barrier(file->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed(1)", mpi_code) + } + + /* Only processor p0 will get the filesize and broadcast it. */ + if (file->mpi_rank == 0) { + if (MPI_SUCCESS != (mpi_code=MPI_File_get_size(file->f, &size))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_get_size failed", mpi_code) + } /* end if */ + + /* Broadcast file size */ + if(MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), + MPI_BYTE, 0, file->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code) + + if(H5FD_mpi_haddr_to_MPIOff(file->eoa, &needed_eof) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, \ + "cannot convert from haddr_t to MPI_Offset") + + if (size != needed_eof) /* eoa != eof. Set eof to eoa */ { + + /* Extend the file's size */ + if(MPI_SUCCESS != (mpi_code=MPI_File_set_size(file->f, needed_eof))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) + + /* In general, we must wait until all processes have finished + * the truncate before any process can continue, since it is + * possible that a process would write at the end of the + * file, and this write would be discarded by the truncate. + * + * While this is an issue for a user initiated flush, it may + * not be an issue at file close. If so, we may be able to + * optimize out the following barrier in that case. + */ + if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) + } + + /* Update the 'last' eoa value */ + file->last_eoa = file->eoa; + } /* end if */ + +done: + file->do_pre_trunc_barrier = TRUE; + +#ifdef H5FDmpio_DEBUG + if(H5FD_mpio_Debug[(int)'t']) + HDfprintf(stdout, "Leaving %s\n", FUNC); +#endif + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_mpio_truncate() */ + +#endif /* modified version */ + /*------------------------------------------------------------------------- * Function: H5FD_mpio_mpi_rank diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index e758951..f7be327 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -203,6 +203,9 @@ H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info); +#if 1 /* JRM */ +H5_DLL void H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file); +#endif /* JRM */ #endif /* H5_HAVE_PARALLEL */ #endif /* !_H5FDprivate_H */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 8212eb5..25df964 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1532,6 +1532,17 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Truncate the file to the current allocated size */ +#if 1 /* JRM */ +#ifdef H5_HAVE_PARALLEL + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + /* Since we just returned from a call to H5AC_flush(), we just + * passed through a barrier. Hence we can skip the barrier on + * entry to the mpio file driver call below. + */ + H5FD_mpio_mark_pre_trunc_barrier_unecessary(f->shared->lf); + } +#endif /* H5_HAVE_PARALLEL */ +#endif /* JRM */ if(H5FD_truncate(f->shared->lf, meta_dxpl_id, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") -- cgit v0.12 From 8444f018ca115dcf8b1066b9dbad69b0617c0e58 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Dec 2017 14:58:17 -0600 Subject: HDFFV-9724 Add ENV VAR to vds test --- test/CMakeTests.cmake | 2 +- test/vds.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 1 deletion(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 973d389..e0acc6d 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -452,7 +452,6 @@ set (test_CLEANFILES extlinks19B00026.h5 extlinks19B00027.h5 extlinks19B00028.h5 - tmp big.data big*.h5 stdio.h5 @@ -582,6 +581,7 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 + tmp/vds_src_2.h5 ) # Remove any output file left over from previous test run diff --git a/test/vds.c b/test/vds.c index 3485023..66de456 100644 --- a/test/vds.c +++ b/test/vds.c @@ -1376,6 +1376,193 @@ test_vds_prefix(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + /* + * Test 2: All - all selection with ENV prefix + */ + if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1)) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Set prefix to a nonexistent directory, will be overwritten by environment variable */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, "someprefix") < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, "someprefix") != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } /* end if */ + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } /* end if */ + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } /* end if */ + } /* end if */ + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } /* end if */ + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR PASSED(); return 0; @@ -1410,6 +1597,9 @@ test_vds_prefix(unsigned config, hid_t fapl) (void)H5Pclose(dcpl); } H5E_END_TRY; + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR + return 1; } /* end vds_link_prefix() */ -- cgit v0.12 From 6cbb336ca753118a8413feb928627cb3a33a227f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Dec 2017 15:47:05 -0600 Subject: Skip test if 1.6 API --- test/CMakeTests.cmake | 74 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index e0acc6d..fca2f27 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -839,21 +839,28 @@ add_test (NAME H5TEST-clear-error_test-objects WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" -) -set_tests_properties (H5TEST-error_test PROPERTIES - DEPENDS H5TEST-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST -) +if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) +else () + add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-error_test PROPERTIES + DEPENDS H5TEST-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) +endif () #-- Adding test for links_env add_test (NAME H5TEST-clear-links_env-objects @@ -959,21 +966,28 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-shared-error_test PROPERTIES - DEPENDS H5TEST-shared-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) + if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-shared-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) + else () + add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-error_test PROPERTIES + DEPENDS H5TEST-shared-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endif () #-- Adding test for links_env add_test (NAME H5TEST-shared-clear-links_env-objects -- cgit v0.12 From 0065fd4b6d5edf61b21cd352c74268de13fd516a Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 19 Dec 2017 16:47:31 -0600 Subject: Fix -- HDFFV-10363 Fortran compilation fails for xlf and cmake builds --- fortran/src/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 0f576d4..18d6d80 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -95,6 +95,18 @@ add_custom_command ( ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE) +if (BUILD_SHARED_LIBS) + set (CMDSH $) + add_custom_command ( + OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 + COMMAND ${CMDSH} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared + DEPENDS H5match_types + ) + set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h PROPERTIES GENERATED TRUE) + set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 PROPERTIES GENERATED TRUE) +endif () #----------------------------------------------------------------------------- # f90CStub lib @@ -223,7 +235,7 @@ set (f90_F_SOURCES if (BUILD_SHARED_LIBS) set (f90_F_SOURCES_SHARED # generated file - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 ${f90_F_BASE_SOURCES} @@ -243,6 +255,7 @@ set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET}) target_link_libraries (${HDF5_F90_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS}) +target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () @@ -271,6 +284,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) + target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () -- cgit v0.12 From 94b8a212bfba2ad7a7740c8a22e0e5d96d05e4ec Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 10:57:41 -0600 Subject: Cleanup comments and if() in TRY blocks --- test/vds.c | 1105 +++++++++++++++++++++++++++--------------------------------- 1 file changed, 497 insertions(+), 608 deletions(-) diff --git a/test/vds.c b/test/vds.c index 66de456..eca26bc 100644 --- a/test/vds.c +++ b/test/vds.c @@ -65,14 +65,7 @@ const char *FILENAME[] = { * provided dataspaces are the same. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t @@ -138,7 +131,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -188,7 +181,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -225,14 +218,7 @@ error: * parameters. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -306,8 +292,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, error: H5E_BEGIN_TRY { - if(space_out >= 0) - (void)H5Sclose(space_out); + H5Sclose(space_out); } H5E_END_TRY return -1; @@ -320,14 +305,7 @@ error: * Purpose: Tests API functions related to virtual datasets. * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Monday, February 16, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ /* Helper function to get DCPL for examination depending on config */ @@ -378,12 +356,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, file = -1; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open dataset */ if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get DCPL from dataset */ if((*ex_dcpl = H5Dget_create_plist(dset)) < 0) @@ -402,8 +380,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(oinfo.meta_size.obj.heap_size != exp_meta_size) { printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size); TEST_ERROR - } /* end if */ - } /* end if */ + } + } else if((oinfo.meta_size.obj.heap_size != exp_meta_size) && (oinfo.meta_size.obj.heap_size != (hsize_t)0)) @@ -432,12 +410,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(H5Fclose(file) < 0) TEST_ERROR file = -1; - } /* end if */ + } else if(config == TEST_API_COPY_PLIST) { /* Copy property list */ if((*ex_dcpl = H5Pcopy(dcpl)) < 0) TEST_ERROR - } /* end if */ + } else if(config == TEST_API_ENCDEC_PLIST) { size_t plist_buf_size; @@ -456,14 +434,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, /* Free plist_buf */ HDfree(plist_buf); plist_buf = NULL; - } /* end if */ + } else { /* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl * can be closed */ if(H5Iinc_ref(dcpl) < 0) TEST_ERROR *ex_dcpl = dcpl; - } /* end else */ + } /* Verify examination DCPL is equal to original DCPL. Do not compare the * plist to itself, and do not do the comparison if we reopened the file, @@ -474,16 +452,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, TEST_ERROR if(!tri_ret) TEST_ERROR - } /* end if */ + } return 0; error: H5E_BEGIN_TRY { - if(file >= 0) - (void)H5Fclose(file); - if(dset >= 0) - (void)H5Dclose(dset); + H5Fclose(file); + H5Dclose(dset); } H5E_END_TRY; if(plist_buf) HDfree(plist_buf); @@ -540,7 +516,7 @@ test_api(test_api_config_t config, hid_t fapl) case TEST_API_NTESTS: default: TEST_ERROR - } /* end switch */ + } h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -826,7 +802,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Create virtual dataspace */ if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - } /* end for */ + } /* Select all (should not be necessary, but just to be sure) */ if(H5Sselect_all(srcspace[0]) < 0) @@ -940,7 +916,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1046,7 +1022,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Add virtual layout mapping */ if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0) TEST_ERROR - } /* end if */ + } /* Get examination DCPL */ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0) @@ -1071,7 +1047,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Check that the mapping in the DCPL is correct */ if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0) TEST_ERROR - } /* end if */ + } /* Close */ if(H5Sclose(srcspace[0]) < 0) @@ -1081,7 +1057,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1131,18 +1107,12 @@ test_api(test_api_config_t config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(ex_dcpl >= 0) - (void)H5Pclose(ex_dcpl); + for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Pclose(dcpl); + H5Pclose(ex_dcpl); } H5E_END_TRY; return 1; @@ -1260,12 +1230,12 @@ test_vds_prefix(unsigned config, hid_t fapl) if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR HDchdir(buffer); - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1294,8 +1264,8 @@ test_vds_prefix(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1309,7 +1279,7 @@ test_vds_prefix(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1344,7 +1314,7 @@ test_vds_prefix(unsigned config, hid_t fapl) } if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1438,12 +1408,12 @@ test_vds_prefix(unsigned config, hid_t fapl) if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR HDchdir(buffer); - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1472,8 +1442,8 @@ test_vds_prefix(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1487,7 +1457,7 @@ test_vds_prefix(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1522,7 +1492,7 @@ test_vds_prefix(unsigned config, hid_t fapl) } if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1569,32 +1539,19 @@ test_vds_prefix(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(vfile2 >= 0) - (void)H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dcpl); } H5E_END_TRY; if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) @@ -1611,14 +1568,7 @@ test_vds_prefix(unsigned config, hid_t fapl) * pattern-matching file/dataset strings * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Tuesday, March 3, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1701,12 +1651,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1735,8 +1685,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1750,7 +1700,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1779,7 +1729,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1863,12 +1813,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1904,8 +1854,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1919,7 +1869,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1950,7 +1900,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1999,8 +1949,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2009,7 +1959,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset2 */ if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0) @@ -2035,7 +1985,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Only copy to a different file if the source datasets are in a different * file */ @@ -2077,8 +2027,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen copied virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2087,7 +2037,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile2 = -1; if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset3 */ if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0) @@ -2113,13 +2063,13 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Close copied virtual file */ if(H5Fclose(vfile2) < 0) TEST_ERROR vfile2 = -1; - } /* end if */ + } /* Close */ if(H5Dclose(srcdset[0]) < 0) @@ -2198,12 +2148,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2245,8 +2195,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2260,7 +2210,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2291,7 +2241,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2386,12 +2336,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2427,8 +2377,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2442,7 +2392,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read first source dataset through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2495,7 +2445,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2594,12 +2544,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2627,7 +2577,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i][j] = buf[2 * i][j]; for(/* j = 13 */; j < 26; j++) evbuf[i][j] = buf[2 * i + 1][j - 13]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2644,7 +2594,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i + 5][j] = buf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) evbuf[i + 5][j] = buf[2 * i + 1][j]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2659,8 +2609,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2674,7 +2624,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2690,7 +2640,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i][j] = evbuf[2 * i][j]; for(/* j = 13 */; j < 26; j++) erbuf[i][j] = evbuf[2 * i + 1][j - 13]; - } /* end for */ + } /* Read second slice */ if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2702,7 +2652,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i + 5][j] = evbuf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) erbuf[i + 5][j] = evbuf[2 * i + 1][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2726,7 +2676,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j] = buf[i][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j - 13] = buf[i][j]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2743,7 +2693,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j + 13] = buf[i + 5][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j] = buf[i + 5][j]; - } /* end for */ + } /* Reopen srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2754,7 +2704,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2770,7 +2720,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j] = evbuf[i][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j - 13] = evbuf[i][j]; - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2782,7 +2732,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j + 13] = evbuf[i + 5][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j] = evbuf[i + 5][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2902,12 +2852,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2961,8 +2911,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2976,7 +2926,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -3001,7 +2951,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -3047,7 +2997,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -3068,7 +3018,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0) @@ -3243,12 +3193,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -3285,8 +3235,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3300,7 +3250,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ /* Reset rbuf */ @@ -3406,7 +3356,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 3) && (j < 6)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -3459,7 +3409,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 6) && (j < 9)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -3677,7 +3627,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ /* Select hyperslab in memory space */ @@ -3752,32 +3702,19 @@ test_basic_io(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(vfile2 >= 0) - (void)H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dcpl); } H5E_END_TRY; return 1; @@ -3790,14 +3727,7 @@ error: * Purpose: Tests VDS with unlimited selections * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Thursday, April 30, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3910,12 +3840,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -3980,8 +3910,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3995,7 +3925,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4040,11 +3970,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_view() */ if(H5Pget_virtual_view(dapl, &virtual_view) < 0) @@ -4064,7 +3994,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4112,11 +4042,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4125,7 +4055,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -4162,8 +4092,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4177,7 +4107,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4224,11 +4154,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -4242,7 +4172,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4295,11 +4225,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4308,7 +4238,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 5; @@ -4350,8 +4280,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4365,7 +4295,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4427,7 +4357,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -4492,11 +4422,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 15 */ dims[1] = 15; @@ -4523,12 +4453,12 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4542,7 +4472,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4590,11 +4520,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -4629,11 +4559,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 18 */ @@ -4661,11 +4591,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 20 */ dims[1] = 20; @@ -4691,7 +4621,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < (int)mdims[1]; j++) if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4704,12 +4634,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -4785,12 +4715,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -4855,8 +4785,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4870,7 +4800,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4914,11 +4844,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4932,7 +4862,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4974,11 +4904,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4987,7 +4917,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -5029,8 +4959,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5044,7 +4974,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5090,11 +5020,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5108,7 +5038,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5159,11 +5089,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5172,7 +5102,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 10; @@ -5214,8 +5144,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5229,7 +5159,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5291,7 +5221,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -5308,7 +5238,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5360,11 +5290,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -5377,12 +5307,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5477,12 +5407,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5522,7 +5452,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][6 * j] = buf[i][2 * j]; erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5538,7 +5468,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][(6 * j) + 2] = buf[i][2 * j]; erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5559,7 +5489,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][4] = buf[i][0]; erbuf[i][5] = buf[i][1]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5577,8 +5507,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5592,7 +5522,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5636,11 +5566,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5654,7 +5584,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5696,11 +5626,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5709,7 +5639,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -5746,8 +5676,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5761,7 +5691,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5806,11 +5736,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5824,7 +5754,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5834,7 +5764,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][12] = buf[i][0]; erbuf[i][13] = buf[i][1]; erbuf[i][18] = buf[i][2]; - } /* end for */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5878,11 +5808,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5891,7 +5821,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[2] */ dims[1] = 5; @@ -5923,7 +5853,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][10] = buf[i][0]; erbuf[i][11] = buf[i][1]; erbuf[i][16] = buf[i][2]; - } /* end for */ + } /* Close srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5935,8 +5865,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5950,7 +5880,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5995,11 +5925,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6013,7 +5943,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6059,11 +5989,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6072,7 +6002,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 6; @@ -6103,7 +6033,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][14] = buf[i][0]; erbuf[i][15] = buf[i][1]; - } /* end for */ + } /* Close srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6115,8 +6045,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6130,7 +6060,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6174,11 +6104,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6192,7 +6122,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6234,11 +6164,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now just read middle 2 rows */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -6264,11 +6194,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -6287,12 +6217,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6373,12 +6303,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -6431,8 +6361,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6446,7 +6376,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6492,11 +6422,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6510,7 +6440,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6552,11 +6482,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6565,7 +6495,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -6603,8 +6533,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6618,7 +6548,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6664,11 +6594,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6682,7 +6612,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6730,11 +6660,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -6747,12 +6677,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6795,23 +6725,23 @@ error: for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { if(srcdset[i] >= 0) (void)H5Dclose(srcdset[i]); - } /* end for */ + } if(vdset >= 0) (void)H5Dclose(vdset); for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { if(srcfile[i] >= 0) (void)H5Fclose(srcfile[i]); - } /* end for */ + } if(vfile >= 0) (void)H5Fclose(vfile); for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { if(srcspace[i] >= 0) (void)H5Sclose(srcspace[i]); - } /* end for */ + } for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(vspace[i] >= 0) (void)H5Sclose(vspace[i]); - } /* end for */ + } if(filespace >= 0) (void)H5Sclose(filespace); if(memspace >= 0) @@ -6948,12 +6878,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6965,7 +6895,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6979,7 +6909,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7065,8 +6995,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7080,7 +7010,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7124,11 +7054,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -7165,8 +7095,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7180,7 +7110,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7220,11 +7150,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try with different selections */ count[0] = 10; @@ -7251,12 +7181,12 @@ test_printf(unsigned config, hid_t fapl) if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end for */ + } + } start[1] = 0; /* Now try writing through VDS */ @@ -7292,7 +7222,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read srcdset[0] */ count[0] = 10; @@ -7394,12 +7324,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -7411,7 +7341,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7425,7 +7355,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7563,14 +7493,14 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7584,7 +7514,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7628,11 +7558,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_printf_gap() */ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) @@ -7652,7 +7582,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7704,11 +7634,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 2, reopen file as well if * config option specified */ @@ -7722,7 +7652,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7774,11 +7704,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 3, reopen file as well if * config option specified */ @@ -7792,7 +7722,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7844,11 +7774,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 4, reopen file as well if * config option specified */ @@ -7862,7 +7792,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7914,11 +7844,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -7932,7 +7862,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7978,11 +7908,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -7996,16 +7926,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8078,7 +8008,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8144,7 +8074,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8158,7 +8088,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8202,11 +8132,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8241,7 +8171,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8255,7 +8185,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8299,11 +8229,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8319,7 +8249,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8389,7 +8319,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8455,7 +8385,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8469,7 +8399,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8513,11 +8443,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8552,7 +8482,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8566,7 +8496,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8610,11 +8540,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8630,7 +8560,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8643,7 +8573,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; - } /* end if */ + } /* @@ -8701,12 +8631,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8718,7 +8648,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8732,7 +8662,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8818,8 +8748,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8833,7 +8763,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8877,11 +8807,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8917,8 +8847,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8932,7 +8862,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8976,11 +8906,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -8994,7 +8924,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9041,11 +8971,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9081,8 +9011,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9096,7 +9026,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9140,11 +9070,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9158,7 +9088,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9205,11 +9135,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf_gap set to 1, reopen file as well if * config option specified */ @@ -9223,7 +9153,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9270,11 +9200,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -9288,16 +9218,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -9373,12 +9303,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -9390,7 +9320,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9404,7 +9334,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9500,8 +9430,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9515,7 +9445,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9559,11 +9489,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9577,7 +9507,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9624,11 +9554,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9668,8 +9598,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9683,7 +9613,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9727,11 +9657,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9745,7 +9675,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9791,11 +9721,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9832,8 +9762,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9847,7 +9777,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9891,11 +9821,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9929,11 +9859,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Shrink to 12 */ @@ -9959,11 +9889,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 10 */ dims[1] = 12; @@ -9988,12 +9918,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -10007,7 +9937,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -10053,11 +9983,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -10091,11 +10021,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 12 */ @@ -10121,11 +10051,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 15 */ dims[1] = 15; @@ -10150,12 +10080,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Reset dapl */ if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0) @@ -10167,16 +10097,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10233,12 +10163,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -10250,7 +10180,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10264,7 +10194,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10330,8 +10260,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10345,7 +10275,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10389,11 +10319,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 127, reopen file as well if * config option specified */ @@ -10407,7 +10337,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -10453,11 +10383,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -10471,12 +10401,12 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10507,32 +10437,19 @@ test_printf(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(srcspace >= 0) - (void)H5Sclose(srcspace); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(dapl >= 0) - (void)H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Sclose(srcspace); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -10546,14 +10463,7 @@ error: * VDS * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Friday, August 14, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -10675,12 +10585,12 @@ test_all(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile = vfile; if(H5Iinc_ref(srcfile) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -10692,7 +10602,7 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10706,7 +10616,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10777,14 +10687,14 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10798,7 +10708,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10844,11 +10754,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10857,7 +10767,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 2; @@ -10892,8 +10802,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10907,7 +10817,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10953,11 +10863,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10997,8 +10907,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11012,7 +10922,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11058,11 +10968,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -11071,7 +10981,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 3; @@ -11115,8 +11025,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11130,7 +11040,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11176,11 +11086,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11220,8 +11130,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11235,7 +11145,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11281,11 +11191,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -11294,7 +11204,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 7; @@ -11339,8 +11249,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11354,7 +11264,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11400,11 +11310,11 @@ test_all(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11444,8 +11354,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11459,7 +11369,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11511,16 +11421,16 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -11531,12 +11441,12 @@ test_all(unsigned config, hid_t fapl) if(H5Sclose(srcspace[i]) < 0) TEST_ERROR srcspace[i] = -1; - } /* end for */ + } for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(dcpl) < 0) TEST_ERROR dcpl = -1; @@ -11552,32 +11462,19 @@ test_all(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - if(srcfile >= 0) - (void)H5Fclose(srcfile); - if(vfile >= 0) - (void)H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(srcdcpl >= 0) - (void)H5Pclose(srcdcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + H5Fclose(srcfile); + H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(srcdcpl); } H5E_END_TRY; return 1; @@ -11591,10 +11488,6 @@ error: * * Return: Success: 0 * Failure: 1 - * - * Programmer: Dana Robinson - * March 2016 - * *------------------------------------------------------------------------- */ static int @@ -11736,10 +11629,6 @@ test_dapl_values(hid_t fapl_id) * Purpose: Tests datasets with virtual layout * * Return: EXIT_SUCCESS/EXIT_FAILURE - * - * Programmer: Neil Fortner - * Tuesday, February 17, 2015 - * *------------------------------------------------------------------------- */ int @@ -11766,7 +11655,7 @@ main(void) nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); - } /* end for */ + } nerrors += test_dapl_values(fapl); -- cgit v0.12 From 925f3c9b54368005da0129d5928142f04f53ef57 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 13:10:34 -0600 Subject: Because of MPI requirements in library ALWAYS add include path --- CMakeLists.txt | 1 + config/cmake_ext_mod/FindMPI.cmake | 287 ++++++++++++++++++++++--------------- src/CMakeLists.txt | 12 -- 3 files changed, 171 insertions(+), 129 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e22ac2e..6165b35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -631,6 +631,7 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS}) else () message (STATUS "Parallel libraries not found") endif () diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 8084472..d01dd35 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) # library that has invalid or missing version information there would be warning # messages emitted by ld.so in the compiler output. In either case, we'll treat # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") set(WRAPPER_RETURN 255) endif() # Ensure that no error output might be passed upwards. @@ -615,6 +615,16 @@ function (_MPI_interrogate_compiler lang) endif() endif() + if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") + endif() + if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_EXTRA_LIB_NAMES) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") + endif() + # If we found MPI, set up all of the appropriate cache entries if(NOT MPI_${LANG}_COMPILE_OPTIONS) set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) @@ -823,33 +833,43 @@ endfunction() macro(_MPI_assemble_libraries LANG) set(MPI_${LANG}_LIBRARIES "") - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() + # Only for libraries do we need to check whether the compiler's linking stage is separate. + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() + endif() endmacro() macro(_MPI_assemble_include_dirs LANG) - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_${LANG}_INCLUDE_DIRS "") + else() + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") + endforeach() endif() endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") - endforeach() - endif() endmacro() function(_MPI_split_include_dirs LANG) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + return() + endif() # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") @@ -885,6 +905,13 @@ function(_MPI_split_include_dirs LANG) endif() mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) endif() + # Remove duplicates and default system directories from the list. + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) + endforeach() + endif() set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() @@ -1014,7 +1041,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") # FreeBSD ships mpich under the normal system paths - but available openmpi implementations # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi/") + MPI_search_mpi_prefix_folder("/usr/local/mpi") endif() # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. @@ -1050,48 +1077,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE # # Once we find the new variables, we translate them back into their old # equivalents below. -foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - if(MPI_${LANG}_COMPILE_FLAGS) - unset(MPI_${LANG}_COMPILE_OPTIONS) - unset(MPI_${LANG}_COMPILE_DEFINITIONS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") +if(NOT MPI_IGNORE_LEGACY_VARIABLES) + foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") endif() endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - # If a list of libraries was given, we'll split it into new-style cache variables - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - endif() -endforeach() + # Chop the old compile flags into options and definitions + + unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + if(MPI_${LANG}_COMPILE_FLAGS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + unset(MPI_${LANG}_EXTRA_LIB_NAMES) + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + if(_MPI_LIB) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endif() + endforeach() + endif() + endforeach() +endif() #============================================================================= unset(MPI_VERSION) @@ -1100,6 +1133,11 @@ unset(MPI_VERSION_MINOR) unset(_MPI_MIN_VERSION) +# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. +if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) +endif() + # This loop finds the compilers and sends them off for interrogation. foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) @@ -1121,6 +1159,8 @@ foreach(LANG IN ITEMS C CXX Fortran) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + set(MPI_${LANG}_TRIED_IMPLICIT FALSE) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. # Cray PrgEnv. @@ -1130,80 +1170,90 @@ foreach(LANG IN ITEMS C CXX Fortran) # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. if(MPI_${LANG}_WORKS) set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) endif() + set(MPI_${LANG}_TRIED_IMPLICIT TRUE) endif() - # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. - if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) - endif() - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + endif() + + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - else() - set(MPI_PINNED_COMPILER FALSE) - endif() - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) - endif() - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_SKIP_GUESSING TRUE) - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_PINNED_COMPILER TRUE) + + # If we haven't made the implicit compiler test yet, perform it now. + if(NOT MPI_${LANG}_TRIED_IMPLICIT) + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + endif() + + # Should the MPI compiler not work implicitly for MPI, still interrogate it. + # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used + # directly during linkage instead of CMAKE__COMPILER will not work. + if(NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) + endif() + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + endif() endif() - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - endif() - if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - set(MPI_${LANG}_WRAPPER_FOUND TRUE) - elseif(NOT MPI_SKIP_GUESSING) - _MPI_guess_settings(${LANG}) + if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + else() + _MPI_guess_settings(${LANG}) + endif() endif() endif() endif() _MPI_split_include_dirs(${LANG}) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - endif() + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + _MPI_adjust_compile_definitions(${LANG}) # We always create imported targets even if they're empty _MPI_create_imported_target(${LANG}) @@ -1217,7 +1267,9 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + endif() mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) @@ -1337,7 +1389,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) unset(MPI_${LANG}_REQUIRED_VARS) - if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) + if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") endforeach() @@ -1448,6 +1500,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() +set(MPI_IGNORE_LEGACY_VARIABLES TRUE) #============================================================================= # unset these vars to cleanup namespace diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1d217c6..0552244 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -849,9 +849,6 @@ endif () #----------------------------------------------------------------------------- add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect STATIC " " " ") -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (H5detect PUBLIC ${MPI_C_INCLUDE_DIRS}) -endif () if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () @@ -866,9 +863,6 @@ add_custom_command ( add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (H5make_libsettings PUBLIC ${MPI_C_INCLUDE_DIRS}) -endif () if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () @@ -893,9 +887,6 @@ target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) -endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES @@ -937,9 +928,6 @@ if (BUILD_SHARED_LIBS) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () - if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) - endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES -- cgit v0.12 From 50238cb285c37dc32029f1891f069fc76f5cbb07 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 13:33:57 -0600 Subject: Par example needs to link with mpi libs --- examples/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d8eb1a2..04a99ce 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") - target_link_libraries (ph5example ${HDF5_LIB_TARGET}) + target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") - target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) + target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) endif () endif () -- cgit v0.12 From d989a0b1cb3d6abeb71d1e37fae5a6d353fb7fc2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 13:41:06 -0600 Subject: Removed incorrect MPI text --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 5249c1a..96d247a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -243,7 +243,7 @@ Bug Fixes since HDF5-1.10.1 release CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. - Reworked the CMake MPI code to properly create CMake targets.Also merged + Reworked the CMake MPI code to properly create CMake targets. Also merged the latest CMake FindMPI.cmake changes to the local copy. This is necessary until HDF changes the CMake minimum to 3.9 or greater. -- cgit v0.12 From 4ecf02f6f6a7c79e4e0d57ea2058ccb5e760f992 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 14:23:19 -0600 Subject: HDFFV-9724 Remove VDS file cache functionality --- java/src/hdf/hdf5lib/H5.java | 57 +++++++++++++++--------------- java/src/jni/h5pImp.c | 31 ----------------- java/src/jni/h5pImp.h | 18 ---------- java/test/JUnit-interface.txt | 3 +- java/test/TestH5Pfapl.java | 27 --------------- release_docs/RELEASE.txt | 4 --- src/H5Fprivate.h | 1 - src/H5Pfapl.c | 81 ------------------------------------------- src/H5Ppublic.h | 2 -- 9 files changed, 30 insertions(+), 194 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 3de49da..78ebbe2 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -6097,34 +6097,35 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; - /** - * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. - * - * @param fapl_id - * IN: File access property list identifier - * - * @return VDS link open file cache size in number of files. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; - - /** - * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. - * - * @param fapl_id - * IN: File access property list identifier - * @param efc_size - * IN: VDS link open file cache size in number of files. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) - throws HDF5LibraryException; +// ///// unimplemented ///// +// /** +// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * +// * @return VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; +// +// /** +// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * @param efc_size +// * IN: VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) +// throws HDF5LibraryException; /** * H5Pget_external returns information about an external file. diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index b144ff6..cf27341 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,37 +5733,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_vds_file_cache_size - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size - (JNIEnv *env, jclass clss, jlong plist, jint size) -{ - unsigned sz = (unsigned)size; - - if (H5Pset_vds_file_cache_size((hid_t)plist, (unsigned)sz) < 0) - h5libraryError(env); -} /* end Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_vds_file_cache_size - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size - (JNIEnv *env, jclass clss, jlong plist) -{ - unsigned s; - - if (H5Pget_vds_file_cache_size((hid_t)plist, &s) < 0) - h5libraryError(env); - - return (jint)s; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size */ /* * Class: hdf_hdf5lib_H5 diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index 19df4b2..1d12e3d 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1544,24 +1544,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts /* * Class: hdf_hdf5lib_H5 - * Method: H5Pset_vds_file_cache_size - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1vds_1file_1cache_1size -(JNIEnv *, jclass, jlong, jint); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_vds_file_cache_size - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1vds_1file_1cache_1size -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 * Method: H5Pset_virtual_prefix * Signature: (JLjava/lang/String;)V */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index fa5b149..91ea286 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -505,7 +505,6 @@ JUnit version 4.11 .testH5Fmdc_logging .testH5Pget_elink_fapl .testH5Pset_mdc_config -.testH5P_vds_file_cache_size .testH5P_small_data_block_size .testH5Pset_fapl_log .testH5P_evict_on_close @@ -648,7 +647,7 @@ JUnit version 4.11 Time: XXXX -OK (646 tests) +OK (645 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index f6783d4..48a5986 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1390,31 +1390,4 @@ public class TestH5Pfapl { fail("H5P_evict_on_close: " + err); } } - - @Test - public void testH5P_vds_file_cache_size() { - int vds_size = 0; - try { - try { - vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); - assertTrue("H5P_vds_file_cache_size default", vds_size == 0); - } - catch (UnsupportedOperationException err) { - System.out.println(err.getMessage()); - } - try { - vds_size = 8; - H5.H5Pset_vds_file_cache_size(fapl_id, vds_size); - vds_size = H5.H5Pget_vds_file_cache_size(fapl_id); - assertTrue("H5P_vds_file_cache_size 8", vds_size == 8); - } - catch (UnsupportedOperationException err) { - System.out.println(err.getMessage()); - } - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5P_vds_file_cache_size: " + err); - } - } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 96d247a..dc4c98e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -69,8 +69,6 @@ New Features New public APIs: herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); - herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); - herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. (ADB - 2017/12/12, HDFFV-9724) @@ -146,8 +144,6 @@ New Features H5Pget_efile_prefix H5Pset_virtual_prefix H5Pget_virtual_prefix - H5Pset_vds_file_cache_size - H5Pget_vds_file_cache_size Tools: ------ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 575aa1c..96b8e36 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -489,7 +489,6 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ -#define H5F_ACS_VDS_FILE_CACHE_SIZE_NAME "vds_file_cache_size" /* Size of vds file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index d4e84ab..ea9bfb4 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -155,11 +155,6 @@ #define H5F_ACS_EFC_SIZE_DEF 0 #define H5F_ACS_EFC_SIZE_ENC H5P__encode_unsigned #define H5F_ACS_EFC_SIZE_DEC H5P__decode_unsigned -/* Definition for vds file cache size */ -#define H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE sizeof(unsigned) -#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEF 0 -#define H5F_ACS_VDS_FILE_CACHE_SIZE_ENC H5P__encode_unsigned -#define H5F_ACS_VDS_FILE_CACHE_SIZE_DEC H5P__decode_unsigned /* Definition of pointer to initial file image info */ #define H5F_ACS_FILE_IMAGE_INFO_SIZE sizeof(H5FD_file_image_info_t) #define H5F_ACS_FILE_IMAGE_INFO_DEF H5FD_DEFAULT_FILE_IMAGE_INFO @@ -360,7 +355,6 @@ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ -static const unsigned H5F_def_vds_file_cache_size_g = H5F_ACS_VDS_FILE_CACHE_SIZE_DEF; /* Default vds file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ static const hbool_t H5F_def_core_write_tracking_flag_g = H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEF; /* Default setting for core VFD write tracking */ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEF; /* Default core VFD write tracking page size */ @@ -516,12 +510,6 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the vds file cache size */ - if(H5P_register_real(pclass, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, H5F_ACS_VDS_FILE_CACHE_SIZE_SIZE, &H5F_def_vds_file_cache_size_g, - NULL, NULL, NULL, H5F_ACS_VDS_FILE_CACHE_SIZE_ENC, H5F_ACS_VDS_FILE_CACHE_SIZE_DEC, - NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, @@ -2474,75 +2462,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_vds_file_cache_size - * - * Purpose: Sets the number of files opened through vds links - * from the file associated with this fapl to be held open - * in that file's vds file cache. When the maximum - * number of files is reached, the least recently used file - * is closed (unless it is opened from somewhere else). - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "iIu", plist_id, vds_size); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Set value */ - if(H5P_set(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, &vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds file cache size") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_vds_file_cache_size() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_vds_file_cache_size - * - * Purpose: Gets the number of files opened through vds links - * from the file associated with this fapl to be held open - * in that file's vds file cache. When the maximum - * number of files is reached, the least recently used file - * is closed (unless it is opened from somewhere else). - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -herr_t -H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", plist_id, vds_size); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Get value */ - if(vds_size) - if(H5P_get(plist, H5F_ACS_VDS_FILE_CACHE_SIZE_NAME, vds_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file cache size") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pget_vds_file_cache_size() */ - - -/*------------------------------------------------------------------------- * Function: H5Pset_file_image * * Purpose: Sets the initial file image. Some file drivers can initialize diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 38be320..a2c0418 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -343,8 +343,6 @@ H5_DLL herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, H5F_libver_t *high); H5_DLL herr_t H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size); H5_DLL herr_t H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size); -H5_DLL herr_t H5Pset_vds_file_cache_size(hid_t plist_id, unsigned vds_size); -H5_DLL herr_t H5Pget_vds_file_cache_size(hid_t plist_id, unsigned *vds_size); H5_DLL herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); H5_DLL herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id, -- cgit v0.12 From e94ed99c5bf7c4ae5df56f75606ef1b486e16bb2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 14:24:57 -0600 Subject: Add HD prefix --- src/H5system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5system.c b/src/H5system.c index 7b3a0eb..719b7e0 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = toupper(name[0]) - 'A' + 1; + drive = HDtoupper(name[0]) - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ -- cgit v0.12 From 82d092a499dbbb0f5918b887b302e4754821cfd2 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 20 Dec 2017 23:11:58 -0600 Subject: Update for new support website Description: - Replaced external links with text including the C API name - Removed links of copyright at the bottom of each page - Removed logo at top - Removed document name and version number Platforms tested: Linux/32 2.6 (jam) - only documentation --- c++/src/H5ArrayType.cpp | 7 ------- c++/src/H5AtomType.cpp | 12 ++++++------ c++/src/H5CppDoc.h | 13 ++++--------- c++/src/H5DataSet.cpp | 13 ++----------- c++/src/H5DataSpace.cpp | 20 ++++++++------------ c++/src/H5DataType.cpp | 7 ++----- c++/src/H5DcreatProp.cpp | 28 +++++++++++++--------------- c++/src/H5DxferProp.cpp | 9 ++++----- c++/src/H5FaccProp.cpp | 48 +++++++++++++++++++++++------------------------- c++/src/H5FcreatProp.cpp | 25 ++++++++++++------------- c++/src/H5File.cpp | 5 ++--- c++/src/H5Library.cpp | 8 +++----- c++/src/H5Location.cpp | 30 +++++++++--------------------- c++/src/H5Object.cpp | 6 ++---- c++/src/H5OcreatProp.cpp | 14 ++++++-------- c++/src/H5StrType.cpp | 4 ++-- c++/src/cpp_doc_config | 6 +++--- c++/src/footer.html | 4 ++-- 18 files changed, 103 insertions(+), 156 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 15ac140..76e7532 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -119,7 +119,6 @@ ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : Da // Closes the id on the lhs object first with setId, then copies // each data member from the rhs object. (Issue HDFFV-9562) // Programmer Binh-Minh Ribler - Mar 2016 -// Modification //-------------------------------------------------------------------------- ArrayType& ArrayType::operator=(const ArrayType& rhs) { @@ -165,9 +164,6 @@ DataType* ArrayType::decode() const ///\return Number of dimensions ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 -// Modification -// Apr, 2016 -// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayNDims() const { @@ -188,9 +184,6 @@ int ArrayType::getArrayNDims() const ///\return Number of dimensions ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 -// Modification -// Apr, 2016 -// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) const { diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 5e709af..4e19850 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -175,8 +175,8 @@ size_t AtomType::getPrecision() const ///\param precision - IN: Number of bits of precision ///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision +/// For information, please refer to the H5Tset_precision API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPrecision(size_t precision) const @@ -195,8 +195,8 @@ void AtomType::setPrecision(size_t precision) const ///\return Offset value ///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset +/// For information, please refer to the H5Tget_offset API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 // Modification // 12/05/00: due to C API change @@ -222,8 +222,8 @@ int AtomType::getOffset() const ///\param offset - IN: Offset of first significant bit ///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset +/// For information, please refer to the H5Tset_offset API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setOffset(size_t offset) const diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index bfab9cd..6eb85bf 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -26,12 +26,9 @@ * * The C++ API provides C++ wrappers for the HDF5 C Library. * - * It is assumed that the user has knowledge of the - * - * HDF5 file format and its components. - * For more information on the HDF5 C Library, see the - * - * HDF5 Software Documentation page. + * It is assumed that the user has knowledge of the HDF5 file format and its + * components. For more information on the HDF5 C Library, please refer to + * the HDF5 Software Documentation page. * * Because the HDF5 C Library maps very well to * the object oriented design approach, classes in the C++ API can @@ -51,15 +48,13 @@ Datatype Interface (H5T) DataType and subclasses \endverbatim * - * This + * This * table provides a map from the C APIs to the C++ member functions. *
* \section install_sec Installation * * The HDF5 C++ API is included with the HDF5 source code and can * be obtained from - * - * https://support.hdfgroup.org/HDF5/release/obtainsrc.html. * * Please refer to the release_docs/INSTALL file under the top directory * of the HDF5 source code for information about installing, building, diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 32377bc..9e0f9ff 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -90,9 +90,6 @@ DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(origina /// \c loc can be DataSet, Group, H5File, or named DataType, that /// is a datatype that has been named by DataType::commit. // Programmer Binh-Minh Ribler - Oct, 2006 -// Modification -// Jul, 2008 -// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -109,9 +106,6 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co ///\param plist - IN: Property list - default to PropList::DEFAULT ///\exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 -// Modification -// Jul, 2008 -// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -577,10 +571,8 @@ int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& spac ///\param size - IN: Array containing the new magnitude of each dimension ///\exception H5::DataSetIException ///\par Description -/// For more information, please see the Description section in -/// C layer Reference Manual at: -///\par -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend +/// For information, please refer to the H5Dset_extent API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::extend(const hsize_t* size) const @@ -600,7 +592,6 @@ void DataSet::extend(const hsize_t* size) const ///\param space - IN: Dataspace describing memory buffer & containing selection to use ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2014 -// Modification //-------------------------------------------------------------------------- void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const { diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 379de2f..b563da4 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -466,9 +466,8 @@ hssize_t DataSpace::getSelectElemNpoints () const ///\param buf - IN: List of element points selected ///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList +/// For information, please refer to the C API +/// H5Sget_select_elem_pointlist in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const @@ -490,9 +489,8 @@ void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, h /// the coordinates of the diagonally opposite corner ///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds +/// For information, please refer to the H5Sget_select_bounds API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const @@ -516,9 +514,8 @@ void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const /// specifying the coordinates of the elements being selected ///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements +/// For information, please refer to the H5Sselect_elements API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const @@ -598,9 +595,8 @@ bool DataSpace::selectValid () const ///\param block - IN: Size of block in the hyperslab - default to \c NULL ///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab +/// For information, please refer to the H5Sselect_hyperslab API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block) const diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 444a77a..4b06c0a 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -96,9 +96,6 @@ DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object(), enco ///\param plist - IN: Property list - default to PropList::DEFAULT ///\exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 -// Modification -// Jul, 2008 -// Added for application convenience. //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), encoded_buf(NULL), buf_size(0) { @@ -653,8 +650,8 @@ DataType DataType::getSuper() const /// destination datatypes. ///\exception H5::DataTypeIException ///\par Description -/// For more information, please see: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register +/// For information, please refer to the H5Tregister API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index fd3cd17..2946730 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -158,8 +158,8 @@ int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const ///\param layout - IN: Type of storage layout for raw data ///\exception H5::PropListIException ///\par Description -/// For information on valid layout types, please refer to -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout +/// For information, please refer to the H5Pset_layout API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const @@ -233,9 +233,8 @@ void DSetCreatPropList::setDeflate(int level) const ///\par Description /// The associate C function sets an SZIP compression filter, /// H5Z_FILTER_SZIP, for a dataset. For more information about -/// SZIP and usage, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip +/// SZIP and usage, please refer to the H5Pset_szip API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const @@ -255,9 +254,8 @@ void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_p ///\par Description /// The associate C function sets an Nbit compression filter, /// H5Z_FILTER_NBIT, for a dataset. For more information about -/// Nbit compression, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit +/// Nbit compression, please refer to the H5Pset_nbit API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Apr, 2016 //-------------------------------------------------------------------------- void DSetCreatPropList::setNbit() const @@ -284,8 +282,7 @@ void DSetCreatPropList::setNbit() const /// according to the actual dataset datatype. ///\par /// For information on setting fill value, please refer to the -/// C layer Reference Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue +/// H5Pset_fill_value API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const @@ -534,9 +531,8 @@ bool DSetCreatPropList::allFiltersAvail() const /// ///\exception H5::PropListIException ///\par Description -/// Please refer to the Reference Manual of \c H5Pset_shuffle for -/// details. -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle +/// For information, please refer to the H5Pset_shuffle API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const @@ -752,7 +748,8 @@ void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, /// an unlimited selection ///\exception H5::PropListIException ///\par Description -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetVirtual +/// For information, please refer to the H5Pset_virtual API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Mar, 2017 //-------------------------------------------------------------------------- void DSetCreatPropList::setVirtual(const DataSpace& vspace, const char *src_fname, const char *src_dsname, const DataSpace& sspace) const @@ -779,7 +776,8 @@ void DSetCreatPropList::setVirtual(const DataSpace& vspace, const char *src_fnam /// an unlimited selection ///\exception H5::PropListIException ///\par Description -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetVirtual +/// For information, please refer to the H5Pset_virtual API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Mar, 2017 //-------------------------------------------------------------------------- void DSetCreatPropList::setVirtual(const DataSpace& vspace, const H5std_string src_fname, const H5std_string src_dsname, const DataSpace& sspace) const diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 3a72b28..21e18e7 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -434,8 +434,8 @@ void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** ///\param size - IN: Maximum size, in bytes, of the small data block. ///\exception H5::PropListIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData +/// For detail, please refer to the H5Pset_small_data_block_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const @@ -473,9 +473,8 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() const /// ///\exception H5::PropListIException ///\par Description -/// For information, please refer to the C layer Reference -/// Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize +/// For detail, please refer to the H5Pset_hyper_vector_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index b414294..9e1098b 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -124,8 +124,8 @@ void FileAccPropList::setStdio() const ///\return A low-level driver ID which is the same ID used when the /// driver was set for the property list. The driver ID is /// only valid as long as the file driver remains registered. -/// Valid driver identifiers can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver +/// For detail on valid driver identifiers, please refer to the +/// H5Pget_driver API in the HDF5 C Reference Manual. ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -146,9 +146,8 @@ hid_t FileAccPropList::getDriver() const ///\param new_driver_info - IN: Struct containing the driver-specific properites ///\exception H5::PropListIException ///\par Description -/// For a list of valid driver identifiers, please see the C -/// layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver +/// For information, please refer to the H5Pset_driver API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const @@ -205,8 +204,7 @@ hsize_t FileAccPropList::getFamilyOffset() const ///\exception H5::PropListIException ///\par Description /// For more details on the use of \c H5FD_CORE driver, please -/// refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore +/// refer to the H5Pset_fapl_core API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const @@ -309,8 +307,8 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const ///\param raw_ext - IN: Raw data filename extension as \c char* ///\exception H5::PropListIException ///\par Description -/// Temporary - For information, please refer to: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit +/// For information, please refer to the H5Pset_fapl_split API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext) const @@ -369,8 +367,8 @@ size_t FileAccPropList::getSieveBufSize() const ///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer ///\exception H5::PropListIException ///\par Description -/// For detail on data sieving, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize +/// For more detail, please refer to the H5Pset_sieve_buf_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSieveBufSize(size_t bufsize) const @@ -389,8 +387,8 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const /// block allocations ///\exception H5::PropListIException ///\par Description -/// For more detail, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize +/// For information, please refer to the H5Pset_meta_block_size +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const @@ -429,8 +427,8 @@ hsize_t FileAccPropList::getMetaBlockSize() const ///\param buf_size - IN: Size of the logging buffer ///\exception H5::PropListIException ///\par Description -/// For detail on \a flags, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog +/// For information, please refer to the H5Pset_fapl_log API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const @@ -486,8 +484,8 @@ void FileAccPropList::setSec2() const /// effect of a special case, forcing everything to be aligned. /// The parameter \a alignment must have a positive value. /// -/// For detail on \a setting alignment, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment +/// For more detail, please refer to the H5Pset_alignment API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setAlignment(hsize_t threshold, hsize_t alignment) const @@ -523,8 +521,8 @@ void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t &alignment) const ///\param dtype - IN: Type of data ///\exception H5::PropListIException ///\par Description -/// More details and valid values for \a dtype can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType +/// For information, please refer to the H5Pset_multi_type API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMultiType(H5FD_mem_t dtype) const @@ -542,8 +540,8 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const ///\return The data type property ///\exception H5::PropListIException ///\par Description -/// More details and possible returned values can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType +/// For information, please refer to the H5Pget_multi_type API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5FD_mem_t FileAccPropList::getMultiType() const @@ -643,8 +641,8 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() const /// on (1) or off (0). ///\exception H5::PropListIException ///\par Description -/// For detail on \a fapl, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences +/// For information, please refer to the H5Pset_gc_references API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setGcReferences(unsigned gc_ref) const @@ -694,8 +692,8 @@ unsigned FileAccPropList::getGcReferences() const /// \li \c H5F_LIBVER_18 /// \li \c H5F_LIBVER_LATEST (Default) /// -/// For more details, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds +/// For more detail, please refer to the H5Pset_libver_bounds API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 9674c0a..98a35cb 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -173,9 +173,8 @@ hsize_t FileCreatPropList::getUserblock() const ///\param sizeof_size - IN: Size of an object length in bytes. ///\exception H5::PropListIException ///\par Description -/// For information on setting sizes, please refer to the -/// C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes +/// For information, please refer to the H5Pset_sizes API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const @@ -214,8 +213,8 @@ void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const ///\param lk - IN: Symbol table node size ///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK +/// For information, please refer to the H5Pset_sym_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const @@ -235,8 +234,8 @@ void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const /// ///\exception H5::PropListIException ///\par Description -/// For information, please see -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK +/// For information, please refer to the H5Pget_sym_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const @@ -256,8 +255,8 @@ void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const ///\param ik - IN: 1/2 rank of chunked storage B-tree ///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK +/// For information, please refer to the H5Pset_istore_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setIstorek(unsigned ik) const @@ -276,8 +275,8 @@ void FileCreatPropList::setIstorek(unsigned ik) const ///\return 1/2 rank of chunked storage B-tree ///\exception H5::PropListIException ///\par Description -/// For information, please see -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK +/// For information, please refer to the H5Pget_istore_k API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const @@ -306,8 +305,8 @@ unsigned FileCreatPropList::getIstorek() const /// changed and the existing strategy will be retained. /// If the given threshold value is zero, the property will not be /// changed and the existing threshold will be retained. -/// For information, please see the C layer Reference Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFileSpace +/// For information, please refer to the H5Pset_file_space_strategy +/// API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 3a0b54d..57ee4d5 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -72,9 +72,8 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} /// exists, and fail, otherwise ///\par /// For info on file creation in the case of an already-open file, -/// please refer to the \b Special \b case section in the C layer -/// Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create +/// please refer to the \b Special \b case section of the H5Fcreate +/// API in the C Reference Manual. // Notes With a PGI compiler (~2012-2013,) the exception thrown by // p_get_file could not be caught in the applications. Added try // block here to catch then re-throw it. -BMR 2013/03/21 diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 9293622..214c5b2 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -110,8 +110,7 @@ void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& reln ///\exception H5::LibraryIException ///\par Description /// For information about library version, please refer to -/// the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck +/// the H5check_version API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) @@ -240,9 +239,8 @@ void H5Library::termH5cpp() ///\exception H5::LibraryIException ///\par Description /// Setting a value of -1 for a limit means no limit of that type. -/// For more information on free list limits, please refer to C -/// layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits +/// For more information on free list limits, please refer to +/// the H5set_free_list_limits API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index d0b5f9d..95c96ad 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -230,7 +230,6 @@ void H5Location::setComment(const H5std_string& name, const H5std_string& commen /// It differs from the above function in that it doesn't take /// an object name. // Programmer Binh-Minh Ribler - Sep 2013 -// Modification //-------------------------------------------------------------------------- void H5Location::setComment(const char* comment) const { @@ -513,9 +512,6 @@ void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_t // from_func - IN: Name of the calling function // Exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 -// Modification -// May 2008 - BMR -// Moved from IdComponent. //-------------------------------------------------------------------------- hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func) { @@ -544,9 +540,6 @@ hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_ty ///\param plist - IN: Property list - default to PropList::DEFAULT ///\exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 -// Modification -// May, 2008 -// Corrected missing parameters. - BMR //-------------------------------------------------------------------------- void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) { @@ -563,8 +556,6 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t // exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. -BMR // Mar, 2017 // Removed in 1.10.1 because H5Location is Attribute's baseclass // now. -BMR @@ -955,9 +946,8 @@ DataSet H5Location::openDataSet(const H5std_string& name) const /// Note that both names are interpreted relative to the /// specified location. /// For information on creating hard link and soft link, please -/// refer to the C layer Reference Manual at: -/// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateHard and -/// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateSoft +/// refer to the H5Lcreate_hard and H5Lcreate_soft APIs in the +/// HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -1036,8 +1026,7 @@ void H5Location::unlink(const H5std_string& name) const ///\note /// Exercise care in moving groups as it is possible to render /// data in a file inaccessible with H5Location::move. Please refer -/// to the Group Interface in the HDF5 User's Guide for details at: -/// https://www.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm +/// to the Group Interface in the HDF5 User's Guide for details. // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -1070,9 +1059,8 @@ void H5Location::move(const H5std_string& src, const H5std_string& dst) const ///\param statbuf - OUT: Buffer to return information about the object ///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo +/// For information, please refer to the H5Gget_objinfo API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const @@ -1435,8 +1423,8 @@ ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size /// \li \c H5O_TYPE_GROUP /// \li \c H5O_TYPE_DATASET /// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +/// For information, please refer to the H5Oget_info_by_name API in +/// the HDF5 C Reference Manual. ///\exception H5::FileIException/H5::GroupIException/H5::LocationException /// Exception will be thrown when: /// - an error returned by the C API @@ -1501,8 +1489,8 @@ H5O_type_t H5Location::childObjType(const H5std_string& objname) const /// \li \c H5O_TYPE_GROUP /// \li \c H5O_TYPE_DATASET /// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +/// For information, please refer to the H5Oget_info_by_idx API in +/// the HDF5 C Reference Manual. ///\exception H5::FileIException/H5::GroupIException/H5::LocationException /// Exception will be thrown when: /// - an error returned by the C API diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 3eed168..fcdfd59 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -224,9 +224,8 @@ Attribute H5Object::openAttribute(const unsigned int idx) const ///\par Description /// The signature of user_op is /// void (*)(H5::H5Location&, H5std_string, void*). -/// For information, please refer to the C layer Reference Manual -/// at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate +/// For information, please refer to the H5Aiterate2 API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data) @@ -421,7 +420,6 @@ ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const ///\return Name of the object ///\exception H5::Exception // Programmer Binh-Minh Ribler - Mar, 2014 -// Modification //-------------------------------------------------------------------------- H5std_string H5Object::getObjName() const { diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index ec6c08e..121198c 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -113,8 +113,7 @@ ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {} ///\par Description /// If \c max_compact is set to 0, dense storage will be used. /// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange +/// H5Pset_attr_phase_change API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_dense) const @@ -137,8 +136,7 @@ void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_den ///\par Description /// If \c max_compact is set to 0, dense storage will be used. /// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange +/// H5Pget_attr_phase_change API in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const @@ -166,8 +164,8 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d /// tracked not indexed. Note that HDF5 currently provides no /// mechanism to turn on attribute creation order tracking at object /// creation time and to build the index later. -/// The C layer Reference Manual at can be found at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrCreationOrder +/// For detail, please refer to the H5Pset_attr_creation_order API +/// in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const @@ -188,8 +186,8 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const ///\par Description /// When no flag is set, i.e. crt_order_flags = 0, attribute /// creation order is neither tracked not indexed. -/// The C layer Reference Manual at can be found at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder +/// For detail, please refer to the H5Pget_attr_creation_order API +/// in the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- unsigned ObjCreatPropList::getAttrCrtOrder() const diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index d2d87e9..7125676 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -281,8 +281,8 @@ H5T_str_t StrType::getStrpad() const ///\param strpad - IN: String padding type ///\exception H5::DataTypeIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad +/// For information, please refer to the H5Tset_strpad API in +/// the HDF5 C Reference Manual. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void StrType::setStrpad(H5T_str_t strpad) const diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index ae5dd90..6a9f171 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "HDF5 C++ API" +PROJECT_NAME = # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.11.0" +PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -51,7 +51,7 @@ PROJECT_BRIEF = # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. -PROJECT_LOGO = ./header_files/hdf_logo.jpg +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is diff --git a/c++/src/footer.html b/c++/src/footer.html index ba37ee7..5ad9b7c 100644 --- a/c++/src/footer.html +++ b/c++/src/footer.html @@ -11,8 +11,8 @@   - Copyright by - The HDF Group + Copyright by + The HDF Group
and the Board of Trustees of the University of Illinois -- cgit v0.12 From 86d8a4c267eccbc66d6ee6120c9099788853c40f Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 22 Dec 2017 12:28:24 -0600 Subject: Revert "Merge pull request #826 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop" This reverts commit b1223dd653e65e076af92b2dfe236f3704da81c8, reversing changes made to b25f123f5f5e25c1447a6a02861cb7c7265c12f2. --- CMakeLists.txt | 1 - MANIFEST | 6 - config/cmake_ext_mod/FindMPI.cmake | 287 +++--- config/cmake_ext_mod/runTest.cmake | 1 - examples/CMakeLists.txt | 4 +- java/src/hdf/hdf5lib/H5.java | 197 +--- java/src/hdf/hdf5lib/HDF5Constants.java | 3 - java/src/hdf/overview.html | 6 +- java/src/jni/h5Constants.c | 2 - java/src/jni/h5pImp.c | 211 ----- java/src/jni/h5pImp.h | 73 +- java/test/JUnit-interface.txt | 9 +- java/test/TestH5P.java | 53 +- java/test/TestH5Pfapl.java | 14 - java/test/TestH5Pvirtual.java | 33 - release_docs/RELEASE.txt | 30 +- src/CMakeLists.txt | 10 +- src/H5Dint.c | 78 +- src/H5Dpkg.h | 3 +- src/H5Dprivate.h | 11 +- src/H5Dvirtual.c | 253 +----- src/H5Fprivate.h | 420 ++++----- src/H5Fquery.c | 2 +- src/H5Pdapl.c | 366 -------- src/H5Pfapl.c | 938 +++++++++---------- src/H5Ppublic.h | 2 - src/H5system.c | 2 +- test/CMakeTests.cmake | 76 +- test/vds.c | 1493 ++++++++++++------------------- tools/test/h5dump/CMakeTestsVDS.cmake | 67 -- tools/test/h5ls/CMakeTestsVDS.cmake | 55 -- tools/test/h5ls/vds_prefix/tvds-1.ls | 14 - tools/test/h5ls/vds_prefix/tvds-2.ls | 13 - tools/test/h5ls/vds_prefix/tvds-3_1.ls | 14 - tools/test/h5ls/vds_prefix/tvds-3_2.ls | 13 - tools/test/h5ls/vds_prefix/tvds-4.ls | 9 - tools/test/h5ls/vds_prefix/tvds-5.ls | 11 - 37 files changed, 1471 insertions(+), 3309 deletions(-) delete mode 100644 tools/test/h5ls/vds_prefix/tvds-1.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-2.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-3_1.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-3_2.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-4.ls delete mode 100644 tools/test/h5ls/vds_prefix/tvds-5.ls diff --git a/CMakeLists.txt b/CMakeLists.txt index 6165b35..e22ac2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -631,7 +631,6 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS}) else () message (STATUS "Parallel libraries not found") endif () diff --git a/MANIFEST b/MANIFEST index c6c7b3c..9b91c78 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1430,12 +1430,6 @@ ./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in -./tools/test/h5ls/vds_prefix/tvds-1.ls -./tools/test/h5ls/vds_prefix/tvds-2.ls -./tools/test/h5ls/vds_prefix/tvds-3_1.ls -./tools/test/h5ls/vds_prefix/tvds-3_2.ls -./tools/test/h5ls/vds_prefix/tvds-4.ls -./tools/test/h5ls/vds_prefix/tvds-5.ls # h5copy sources ./tools/src/h5copy/Makefile.am diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index d01dd35..8084472 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) # library that has invalid or missing version information there would be warning # messages emitted by ld.so in the compiler output. In either case, we'll treat # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") set(WRAPPER_RETURN 255) endif() # Ensure that no error output might be passed upwards. @@ -615,16 +615,6 @@ function (_MPI_interrogate_compiler lang) endif() endif() - if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") - endif() - if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") - endif() - if(MPI_${LANG}_EXTRA_LIB_NAMES) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") - endif() - # If we found MPI, set up all of the appropriate cache entries if(NOT MPI_${LANG}_COMPILE_OPTIONS) set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) @@ -833,43 +823,33 @@ endfunction() macro(_MPI_assemble_libraries LANG) set(MPI_${LANG}_LIBRARIES "") - # Only for libraries do we need to check whether the compiler's linking stage is separate. - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() - endif() + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() endmacro() macro(_MPI_assemble_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_${LANG}_INCLUDE_DIRS "") - else() - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") - endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") - endif() + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") - endforeach() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") endif() endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") + endforeach() + endif() endmacro() function(_MPI_split_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - return() - endif() # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") @@ -905,13 +885,6 @@ function(_MPI_split_include_dirs LANG) endif() mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) endif() - # Remove duplicates and default system directories from the list. - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) - endforeach() - endif() set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() @@ -1041,7 +1014,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") # FreeBSD ships mpich under the normal system paths - but available openmpi implementations # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi") + MPI_search_mpi_prefix_folder("/usr/local/mpi/") endif() # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. @@ -1077,54 +1050,48 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE # # Once we find the new variables, we translate them back into their old # equivalents below. -if(NOT MPI_IGNORE_LEGACY_VARIABLES) - foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") +foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") + endif() + endforeach() + + # Chop the old compile flags into options and definitions + if(MPI_${LANG}_COMPILE_FLAGS) + unset(MPI_${LANG}_COMPILE_OPTIONS) + unset(MPI_${LANG}_COMPILE_DEFINITIONS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") endif() endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() - # Chop the old compile flags into options and definitions - - unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - if(MPI_${LANG}_COMPILE_FLAGS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") - endif() - endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - - # If a list of libraries was given, we'll split it into new-style cache variables - unset(MPI_${LANG}_EXTRA_LIB_NAMES) - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - if(_MPI_LIB) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endif() - endforeach() - endif() - endforeach() -endif() + # If a list of libraries was given, we'll split it into new-style cache variables + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() + endif() +endforeach() #============================================================================= unset(MPI_VERSION) @@ -1133,11 +1100,6 @@ unset(MPI_VERSION_MINOR) unset(_MPI_MIN_VERSION) -# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. -if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) -endif() - # This loop finds the compilers and sends them off for interrogation. foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) @@ -1159,8 +1121,6 @@ foreach(LANG IN ITEMS C CXX Fortran) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) - set(MPI_${LANG}_TRIED_IMPLICIT FALSE) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. # Cray PrgEnv. @@ -1170,90 +1130,80 @@ foreach(LANG IN ITEMS C CXX Fortran) # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. if(MPI_${LANG}_WORKS) set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) endif() - set(MPI_${LANG}_TRIED_IMPLICIT TRUE) endif() - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) - endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - endif() - - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH - DOC "MPI compiler for ${LANG}" - ) + # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. + if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) + endif() + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + else() + set(MPI_PINNED_COMPILER FALSE) + endif() - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) + endif() - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_PINNED_COMPILER TRUE) - - # If we haven't made the implicit compiler test yet, perform it now. - if(NOT MPI_${LANG}_TRIED_IMPLICIT) - _MPI_create_imported_target(${LANG}) - _MPI_check_lang_works(${LANG}) - endif() - - # Should the MPI compiler not work implicitly for MPI, still interrogate it. - # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used - # directly during linkage instead of CMAKE__COMPILER will not work. - if(NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) - endif() - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - endif() + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + DOC "MPI compiler for ${LANG}" + ) + + if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_SKIP_GUESSING TRUE) + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) endif() + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + endif() - if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - else() - _MPI_guess_settings(${LANG}) - endif() + if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + set(MPI_${LANG}_WRAPPER_FOUND TRUE) + elseif(NOT MPI_SKIP_GUESSING) + _MPI_guess_settings(${LANG}) endif() endif() endif() _MPI_split_include_dirs(${LANG}) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + endif() _MPI_adjust_compile_definitions(${LANG}) # We always create imported targets even if they're empty _MPI_create_imported_target(${LANG}) @@ -1267,9 +1217,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) - endif() + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) @@ -1389,7 +1337,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) unset(MPI_${LANG}_REQUIRED_VARS) - if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") endforeach() @@ -1500,7 +1448,6 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() -set(MPI_IGNORE_LEGACY_VARIABLES TRUE) #============================================================================= # unset these vars to cleanup namespace diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 5569a73..2479728 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -55,7 +55,6 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") endif () if (NOT TEST_INPUT) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 04a99ce..d8eb1a2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") - target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) + target_link_libraries (ph5example ${HDF5_LIB_TARGET}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") - target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) + target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) endif () endif () diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 78ebbe2..7b5b5c9 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - // /////// Generic property list routines /////// + // Generic property list routines /** * H5Pget_class_name retrieves the name of a generic property list class @@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; - // /////// Object creation property list (OCPL) routines /////// + // Object creation property list (OCPL) routines /** * H5Pget_attr_phase_change retrieves attribute storage phase change thresholds. @@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; - // /////// File creation property list (FCPL) routines /////// + // File creation property list (FCPL) routines /** * H5Pget_userblock retrieves the size of a user block in a file creation property list. @@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, IllegalArgumentException; - // /////// File access property list (FAPL) routines /////// + // File access property list (FAPL) routines /** * H5Pget_alignment retrieves the current settings for alignment properties from a file access property list. @@ -5860,37 +5860,6 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts) throws HDF5LibraryException; - /** - * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object - * will be evicted from the library's metadata cache when it is closed. - * - * @param fapl_id - * IN: File access property list identifier - * - * @return indication if the object will be evicted on close. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native boolean H5Pget_evict_on_close(long fapl_id) - throws HDF5LibraryException; - - /** - * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object. - * - * @param fapl_id - * IN: File access property list identifier - * @param evict_on_close - * IN: Whether the HDF5 object should be evicted on close. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) - throws HDF5LibraryException; - // Dataset creation property list (DCPL) routines // /** @@ -6097,36 +6066,6 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; -// ///// unimplemented ///// -// /** -// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. -// * -// * @param fapl_id -// * IN: File access property list identifier -// * -// * @return VDS link open file cache size in number of files. -// * -// * @exception HDF5LibraryException -// * - Error from the HDF-5 Library. -// * -// **/ -// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; -// -// /** -// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. -// * -// * @param fapl_id -// * IN: File access property list identifier -// * @param efc_size -// * IN: VDS link open file cache size in number of files. -// * -// * @exception HDF5LibraryException -// * - Error from the HDF-5 Library. -// * -// **/ -// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) -// throws HDF5LibraryException; - /** * H5Pget_external returns information about an external file. * @@ -6346,37 +6285,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, NullPointerException; - // /////// Dataset creation property list (DCPL) routines /////// - - /** - * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. - * - * @param dcpl_id - * IN: Dataset creation property list identifier - * @param opts - * IN: Edge chunk option flag. Valid values are: - * H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks. - * 0 - Disables option; partial edge chunks will be compressed. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library - **/ - public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException; - - /** - * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list . - * - * @param dcpl_id - * IN: Dataset creation property list - - * @return The edge chunk option setting. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library - **/ - public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException; - - // /////// Dataset access property list (DAPL) routines /////// + // Dataset access property list (DAPL) routines // /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6479,76 +6388,12 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException; - /** - * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths. - * - * @param dapl_id - * IN: Link access property list identifier - * - * @return the prefix to be applied to virtual file paths. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native String H5Pget_virtual_prefix(long dapl_id) - throws HDF5LibraryException; - - /** - * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths. - * - * @param dapl_id - * IN: Dataset access property list identifier - * @param prefix - * IN: Prefix to be applied to virtual file paths - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * @exception NullPointerException - * - prefix is null. - * - **/ - public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix) - throws HDF5LibraryException, NullPointerException; - - /** - * H5Pget_efile_prefix Retrieves prefix applied to external file paths. - * - * @param dapl_id - * IN: Link access property list identifier - * - * @return the prefix to be applied to external file paths. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native String H5Pget_efile_prefix(long dapl_id) - throws HDF5LibraryException; - - /** - * H5Pset_efile_prefix Sets prefix to be applied to external file paths. - * - * @param dapl_id - * IN: Dataset access property list identifier - * @param prefix - * IN: Prefix to be applied to external file paths - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * @exception NullPointerException - * - prefix is null. - * - **/ - public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix) - throws HDF5LibraryException, NullPointerException; - // public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; // public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; - // /////// Dataset xfer property list (DXPL) routines /////// + // Dataset xfer property list (DXPL) routines // /** * H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property @@ -6699,7 +6544,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; - // /////// Link creation property list (LCPL) routines /////// + // Link creation property list (LCPL) routines // /** * H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate @@ -6734,7 +6579,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group) throws HDF5LibraryException; - // /////// Group creation property list (GCPL) routines /////// + // Group creation property list (GCPL) routines // /** * H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups. @@ -6891,14 +6736,14 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags) throws HDF5LibraryException; - // /////// String creation property list (STRCPL) routines /////// + // String creation property list (STRCPL) routines // public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; - // /////// Link access property list (LAPL) routines /////// + // Link access property list (LAPL) routines // /** * H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the @@ -7051,7 +6896,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException, IllegalArgumentException; - // /////// Object copy property list (OCPYPL) routines /////// + // Object copy property list (OCPYPL) routines // /** * H5Pget_copy_object retrieves the properties to be used when an object is copied. @@ -7082,7 +6927,7 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) throws HDF5LibraryException; - // /////// Other/Older property list routines /////// + // Other/Older property list routines // /** * H5Pget_version retrieves the version information of various objects for a file creation property list. @@ -7110,7 +6955,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - // /////// file drivers property list routines /////// + // file drivers property list routines // public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; @@ -7257,28 +7102,20 @@ public class H5 implements java.io.Serializable { // File creation property list (FCPL) routines // // File access property list (FAPL) routines // - // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) - // const void *H5Pget_driver_info(hid_t plist_id) - // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) - // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) + // herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info ) + // const void *H5Pget_driver_info( hid_t plist_id ) + // herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type ) + // herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type ) // herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); // herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); // herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); - // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); - // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); - // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective); - // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); - // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); - // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); // Dataset creation property list (DCPL) routines // // Dataset access property list (DAPL) routines // - // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data); - // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data) // Dataset xfer property list (DXPL) routines // // herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg); diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 3e43ba2..8a3d6c8 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -88,7 +88,6 @@ public class HDF5Constants { public static final int H5D_VDS_ERROR = H5D_VDS_ERROR(); public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING(); public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); - public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); public static final int H5E_MAJOR = H5E_MAJOR(); public static final int H5E_MINOR = H5E_MINOR(); @@ -769,8 +768,6 @@ public class HDF5Constants { private static native final int H5D_VDS_LAST_AVAILABLE(); - private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); - private static native final long H5E_ALIGNMENT(); private static native final long H5E_ALREADYEXISTS(); diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html index 9c19442..39d75b7 100644 --- a/java/src/hdf/overview.html +++ b/java/src/hdf/overview.html @@ -47,20 +47,20 @@ which has a method: The native method is implemented in C using the Java Native Method Interface (JNI). This is written something like the following: -
JNIEXPORT jlong
+
JNIEXPORT jint
 JNICALL Java_hdf_hdf5lib_H5_H5Fopen
 (
  JNIEnv *env,
  jclass class,
  jstring hdfFile,
  jint flags,
- jlong access)
+ jint access)
  {
 
  /* ...convert Java String to (char *) */
 
  /* call the HDF library */
- retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
+ retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
 
  /* ... */
 }
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 5a4b53e..f6f8bfa 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -140,8 +140,6 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index cf27341..dcfcd82 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,217 +5733,6 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_virtual_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) -{ - herr_t retVal = -1; - const char *aName; - - PIN_JAVA_STRING(prefix, aName); - if (aName != NULL) { - retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName); - - UNPIN_JAVA_STRING(prefix, aName); - - if(retVal < 0) - h5libraryError(env); - } -} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_virtual_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id) -{ - size_t size = 0; - char *pre; - jlong prefix_size = -1; - jstring str = NULL; - - prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size); - if(prefix_size < 0) { - h5libraryError(env); - } /* end if */ - else { - size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ - pre = (char*)HDmalloc(sizeof(char)*size); - if (pre == NULL) { - h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed "); - } /* end if */ - else { - prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size); - - if (prefix_size >= 0) { - str = ENVPTR->NewStringUTF(ENVPAR pre); - HDfree(pre); - if (str == NULL) - h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated"); - } /* end if */ - else { - HDfree(pre); - h5libraryError(env); - } /* end else */ - } /* end else */ - } /* end else */ - - return (jstring)str; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_efile_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) -{ - herr_t retVal = -1; - const char *aName; - - PIN_JAVA_STRING(prefix, aName); - if (aName != NULL) { - retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName); - - UNPIN_JAVA_STRING(prefix, aName); - - if(retVal < 0) - h5libraryError(env); - } -} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_efile_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id) -{ - size_t size = 0; - char *pre; - jlong prefix_size = -1; - jstring str = NULL; - - prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size); - if(prefix_size < 0) { - h5libraryError(env); - } /* end if */ - else { - size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ - pre = (char*)HDmalloc(sizeof(char)*size); - if (pre == NULL) { - h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed "); - } /* end if */ - else { - prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size); - - if (prefix_size >= 0) { - str = ENVPTR->NewStringUTF(ENVPAR pre); - HDfree(pre); - if (str == NULL) - h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated"); - } /* end if */ - else { - HDfree(pre); - h5libraryError(env); - } /* end else */ - } /* end else */ - } /* end else */ - - return (jstring)str; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_evict_on_close - * Signature: (JZ)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close - (JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close) -{ - herr_t retVal = -1; - hbool_t evict_on_close_val; - - if (evict_on_close == JNI_TRUE) - evict_on_close_val = TRUE; - else - evict_on_close_val = FALSE; - - retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val); - if (retVal < 0) - h5libraryError(env); -} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_evict_on_close - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close - (JNIEnv *env, jclass clss, jlong fapl_id) -{ - hbool_t evict_on_close_val = FALSE; - jboolean bval = JNI_FALSE; - - if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) { - h5libraryError(env); - } /* end if */ - else { - if (evict_on_close_val == TRUE) - bval = JNI_TRUE; - } /* end else */ - - return bval; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_chunk_opts - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts - (JNIEnv *env, jclass clss, jlong dcpl_id, jint opts) -{ - herr_t retVal = -1; - - retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts); - if (retVal < 0) - h5libraryError(env); -} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */ - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_chunk_opts - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts - (JNIEnv *env, jclass clss, jlong dcpl_id) -{ - unsigned opts = 0; - - if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0) - h5libraryError(env); - - return (jint)opts; -} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */ - #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index 1d12e3d..d413f69 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1533,6 +1533,7 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts (JNIEnv *, jclass, jlong); + /* * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts @@ -1542,78 +1543,6 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts (JNIEnv *, jclass, jlong, jlong); -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_virtual_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix -(JNIEnv *, jclass, jlong, jstring); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_virtual_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_efile_prefix - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix -(JNIEnv *, jclass, jlong, jstring); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_efile_prefix - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_evict_on_close - * Signature: (JZ)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close -(JNIEnv *, jclass, jlong, jboolean); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_evict_on_close - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close -(JNIEnv *, jclass, jlong); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pset_chunk_opts - * Signature: (JI)V - */ -JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts -(JNIEnv *, jclass, jlong, jint); - -/* - * Class: hdf_hdf5lib_H5 - * Method: H5Pget_chunk_opts - * Signature: (J)I - */ -JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts -(JNIEnv *, jclass, jlong); - #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 91ea286..ab2f3b1 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -415,7 +415,6 @@ JUnit version 4.11 .testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue .testH5P_layout .testH5Pget_link_creation_order -.testH5Pget_efile_prefix .testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes .testH5P_file_space_page_size .testH5Pget_shared_mesg_index_Invalid_indexnum @@ -445,7 +444,6 @@ JUnit version 4.11 .testH5Pset_est_link_info_InvalidValues .testH5Pset_local_heap_size_hint .testH5Pget_est_link_info -.testH5Pset_efile_prefix_null .testH5Pset_scaleoffset .testH5Pset_create_intermediate_group_invalidobject .testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue @@ -468,7 +466,6 @@ JUnit version 4.11 .testH5Pget_sym_k_null .testH5Pset_nlinks .testH5P_obj_track_times -.testH5Pset_efile_prefix .testH5P_userblock .testH5Pget_local_heap_size_hint .testH5Pset_shared_mesg_index_Invalid_indexnum @@ -507,7 +504,6 @@ JUnit version 4.11 .testH5Pset_mdc_config .testH5P_small_data_block_size .testH5Pset_fapl_log -.testH5P_evict_on_close .testH5Pset_libver_bounds .testH5P_sieve_buf_size .testH5P_elink_file_cache_size @@ -534,14 +530,11 @@ JUnit version 4.11 .testH5Pget_source_datasetname .testH5Pvirtual_storage .testH5Pget_selection_source_dataset -.testH5Pget_virtual_prefix .testH5Pget_source_filename .testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count -.testH5Pset_virtual_prefix .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters -.testH5Pset_virtual_prefix_null .testH5P_genprop_basic_class .testH5P_genprop_class_iter .testH5P_genprop_basic_class_prop @@ -647,7 +640,7 @@ JUnit version 4.11 Time: XXXX -OK (645 tests) +OK (638 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 9e45e4c..5aafb5b 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -28,7 +28,6 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; @@ -853,7 +852,7 @@ public class TestH5P { } catch (Throwable err) { err.printStackTrace(); - fail("H5Pset_elink_prefix: " + err); + fail("H5Pset_est_link_info: " + err); } assertTrue("H5Pset_elink_prefix", ret_val >= 0); } @@ -1233,54 +1232,4 @@ public class TestH5P { fail("testH5P_file_space_page_size: " + err); } } - - @Test - public void testH5Pset_efile_prefix() { - String prefix = "tmp"; - try { - H5.H5Pset_efile_prefix(lapl_id, prefix); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pset_efile_prefix: " + err); - } - } - - @Test(expected = NullPointerException.class) - public void testH5Pset_efile_prefix_null() throws Throwable{ - H5.H5Pset_efile_prefix(lapl_id, null); - } - - @Test - public void testH5Pget_efile_prefix() { - String prefix = "tmp"; - String pre = ""; - - try { - H5.H5Pset_efile_prefix(lapl_id, prefix); - pre = H5.H5Pget_efile_prefix(lapl_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pget_efile_prefix: " + err); - } - assertTrue("The prefix: ", prefix.equals(pre)); - } - - @Ignore - public void testH5P_chunk_opts() { - int chunk_opts = -1; - - try { - chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); - assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0); - H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); - chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); - assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pget_lchunk_opts: " + err); - } - } } diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 48a5986..d4a2231 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1376,18 +1376,4 @@ public class TestH5Pfapl { deleteH5file(); _deleteLogFile(); } - - @Test - public void testH5P_evict_on_close() { - boolean ret_val_id = false; - try { - H5.H5Pset_evict_on_close(fapl_id, true); - ret_val_id = H5.H5Pget_evict_on_close(fapl_id); - assertTrue("H5P_evict_on_close", ret_val_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5P_evict_on_close: " + err); - } - } } diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index ff2e4dc..40cfbac 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -429,37 +429,4 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } } - - @Test - public void testH5Pset_virtual_prefix() { - String prefix = "tmp"; - try { - H5.H5Pset_virtual_prefix(H5dapl_id, prefix); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pset_virtual_prefix: " + err); - } - } - - @Test(expected = NullPointerException.class) - public void testH5Pset_virtual_prefix_null() throws Throwable{ - H5.H5Pset_virtual_prefix(H5dapl_id, null); - } - - @Test - public void testH5Pget_virtual_prefix() { - String prefix = "tmp"; - String pre = ""; - - try { - H5.H5Pset_virtual_prefix(H5dapl_id, prefix); - pre = H5.H5Pget_virtual_prefix(H5dapl_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5Pget_virtual_prefix: " + err); - } - assertTrue("The prefix: ", prefix.equals(pre)); - } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index dc4c98e..7498d01 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -58,21 +58,7 @@ New Features Library: -------- - - Add prefix option to VDS files. - - Currently, VDS source files must be in the active directory to be - found by the virtual file. Adding the option of a prefix to be set - on the virtual file, using a data access property list (DAPL), - allows the source files to located at an absolute or relative path - to the virtual file. - - New public APIs: - herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); - ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); - The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. - - (ADB - 2017/12/12, HDFFV-9724) - + - Parallel Library: ----------------- @@ -133,18 +119,6 @@ New Features ------------ - - Java Library: - ---------------- - - Wrappers added for the following APIs: - H5Pset_evict_on_close - H5Pget_evict_on_close - H5Pset_chunk_opts - H5Pget_chunk_opts - H5Pset_efile_prefix - H5Pget_efile_prefix - H5Pset_virtual_prefix - H5Pget_virtual_prefix - Tools: ------ - h5diff @@ -239,7 +213,7 @@ Bug Fixes since HDF5-1.10.1 release CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. - Reworked the CMake MPI code to properly create CMake targets. Also merged + Reworked the CMake MPI code to properly create CMake targets.Also merged the latest CMake FindMPI.cmake changes to the local copy. This is necessary until HDF changes the CMake minimum to 3.9 or greater. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0552244..b163b8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -885,7 +885,10 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) +endif () +if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -926,7 +929,10 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) + endif () + if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) diff --git a/src/H5Dint.c b/src/H5Dint.c index 8b663b8..b6c0341 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -61,8 +61,8 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type, - char **vds_prefix); +static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, + char **extfile_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); @@ -963,25 +963,24 @@ done: } /* end H5D__update_oh_info() */ - /*-------------------------------------------------------------------------- - * Function: H5D_build_file_prefix + * Function: H5D_build_extfile_prefix * - * Purpose: Determine the file prefix to be used and store - * it in file_prefix. Stores an empty string if no prefix + * Purpose: Determine the external file prefix to be used and store + * it in extfile_prefix. Stores an empty string if no prefix * should be used. * * Return: SUCCEED/FAIL *-------------------------------------------------------------------------- */ static herr_t -H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/) +H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ - char *filepath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t filepath_len; /* length of file path */ + char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t extpath_len; /* length of extpath */ size_t prefix_len; /* length of prefix */ - size_t file_prefix_len; /* length of expanded prefix */ + size_t extfile_prefix_len; /* length of expanded prefix */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -991,25 +990,20 @@ H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, HDassert(dset); HDassert(dset->oloc.file); - filepath = H5F_EXTPATH(dset->oloc.file); - HDassert(filepath); + extpath = H5F_EXTPATH(dset->oloc.file); + HDassert(extpath); /* XXX: Future thread-safety note - getenv is not required * to be reentrant. */ - if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) - prefix = HDgetenv("HDF5_VDS_PREFIX"); - else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0) - prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); - else - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible") + prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of prefix_type property */ + /* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */ if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, prefix_type, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix") + if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix") } /* end if */ /* Prefix has to be checked for NULL / empty string again because the @@ -1019,29 +1013,29 @@ H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, /* filename is interpreted as relative to the current directory, * does not need to be expanded */ - if(NULL == (*file_prefix = (char *)H5MM_strdup(""))) + if(NULL == (*extfile_prefix = (char *)H5MM_strdup(""))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ else { if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - filepath_len = HDstrlen(filepath); + extpath_len = HDstrlen(extpath); prefix_len = HDstrlen(prefix); - file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len))) + if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}")); + HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}")); } /* end if */ else { - if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix))) + if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end else */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_file_prefix() */ +} /* H5D_build_extfile_prefix() */ /*------------------------------------------------------------------------- @@ -1223,13 +1217,9 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0) + if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") - /* Set the vds file prefix */ - if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") - /* Add the dataset to the list of opened objects in the file */ if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count") @@ -1275,7 +1265,6 @@ done: if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix); - new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix); new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared); } /* end if */ new_dset->oloc.file = NULL; @@ -1362,7 +1351,6 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; char *extfile_prefix = NULL; /* Expanded external file prefix */ - char *vds_prefix = NULL; /* Expanded vds prefix */ H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1383,13 +1371,9 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0) + if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") - /* Get the vds prefix */ - if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") - /* Check if dataset was already open */ if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) { /* Clear any errors from H5FO_opened() */ @@ -1415,11 +1399,6 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* Prevent string from being freed during done: */ extfile_prefix = NULL; - /* Set the vds file prefix */ - dataset->shared->vds_prefix = vds_prefix; - /* Prevent string from being freed during done: */ - vds_prefix = NULL; - } /* end if */ else { /* Point to shared info */ @@ -1451,14 +1430,12 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) done: extfile_prefix = (char *)H5MM_xfree(extfile_prefix); - vds_prefix = (char *)H5MM_xfree(vds_prefix); if(ret_value == NULL) { /* Free the location--casting away const*/ if(dataset) { if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); - dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); } @@ -1841,9 +1818,6 @@ H5D_close(H5D_t *dataset) /* Free the external file prefix */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); - /* Free the vds file prefix */ - dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); - /* Release layout, fill-value, efl & pipeline messages */ if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) || @@ -3386,10 +3360,6 @@ H5D_get_access_plist(H5D_t *dset) if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap") - /* Set the vds prefix option */ - if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix") - /* Set the external file prefix option */ if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix") diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 45f2d3a..542abd0 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -476,7 +476,6 @@ typedef struct H5D_shared_t { H5D_append_flush_t append_flush; /* Append flush property information */ char *extfile_prefix; /* expanded external file prefix */ - char *vds_prefix; /* expanded vds prefix */ } H5D_shared_t; struct H5D_t { @@ -599,7 +598,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ -H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index ed13467..fb994d8 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -47,13 +47,12 @@ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ /* ======== Dataset access property names ======== */ -#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ -#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ -#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ -#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ +#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ +#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ +#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ +#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ #define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */ -#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */ -#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ +#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ #define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */ /* ======== Data transfer properties ======== */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 4882e9f..3be2353 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -731,240 +731,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_delete */ - -/*-------------------------------------------------------------------------- - * Function: H5D__virtual_build_name - * - * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME - * - * Return: Non-negative on success/Negative on failure - *--------------------------------------------------------------------------*/ -static herr_t -H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) -{ - size_t prefix_len; /* length of prefix */ - size_t fname_len; /* Length of external link file name */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - prefix_len = HDstrlen(prefix); - fname_len = HDstrlen(file_name); - - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - - /* Compose the full file name */ - HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, - (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_build_name() */ - - -/*-------------------------------------------------------------------------- - * Function: H5D_getenv_prefix_name -- - * - * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, - * which is separated by the environment delimiter. - * env_prefix is modified to point to the remaining pathnames - * in the list. - * - * Return: A pointer to a pathname ---------------------------------------------------------------------------*/ -static char * -H5D_getenv_prefix_name(char **env_prefix/*in,out*/) -{ - char *retptr=NULL; - char *strret=NULL; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { - retptr = *env_prefix; - *env_prefix = strret; - } else { - retptr = *env_prefix; - *env_prefix = strret + 1; - *strret = '\0'; - } - - FUNC_LEAVE_NOAPI(retptr) -} /* end H5D_getenv_prefix_name() */ - -/*------------------------------------------------------------------------- - * Function: H5D__virtual_open_file - * - * Purpose: Attempts to open a source dataset file. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -static H5F_t * -H5D__virtual_open_file(H5P_genplist_t *plist, const H5F_t *vdset_file, - const char *file_name, - hid_t fapl_id, hid_t dxpl_id) -{ - H5F_t *src_file = NULL; /* Source file */ - H5F_t *ret_value = NULL; /* Actual return value */ - char *full_name = NULL; /* File name with prefix */ - char *my_prefix; /* Library's copy of the prefix */ - unsigned intent; /* File access permissions */ - char *actual_file_name = NULL; /* Virtual file's actual name */ - char *temp_file_name = NULL; /* Temporary pointer to file name */ - size_t temp_file_name_len; /* Length of temporary file name */ - - FUNC_ENTER_STATIC - - /* Simplify intent flags for open calls */ - intent = H5F_INTENT(vdset_file); - intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); - - /* Copy the file name to use */ - if(NULL == (temp_file_name = H5MM_strdup(file_name))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - temp_file_name_len = HDstrlen(temp_file_name); - - /* target file_name is an absolute pathname: see RM for detailed description */ - if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - char *ptr; - - H5E_clear_stack(NULL); - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(file_name, ptr) - HDassert(ptr); - - /* Increment past delimiter */ - ptr++; - - /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - else if(H5_CHECK_ABS_DRIVE(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - - H5E_clear_stack(NULL); - - /* strip ":" */ - HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - - /* try searching from paths set in the environment variable */ - if(src_file == NULL) { - char *env_prefix; - - if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { - char *tmp_env_prefix, *saved_env; - - if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - while((tmp_env_prefix) && (*tmp_env_prefix)) { - char *out_prefix_name; - - out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); - if(out_prefix_name && (*out_prefix_name)) { - if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { - saved_env = (char *)H5MM_xfree(saved_env); - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - } /* end if */ - - src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); - full_name = (char *)H5MM_xfree(full_name); - if(src_file != NULL) - break; - H5E_clear_stack(NULL); - } /* end if */ - } /* end while */ - saved_env = (char *)H5MM_xfree(saved_env); - } /* end if */ - } /* end if */ - - /* try searching from property list */ - if(src_file == NULL) { - size_t size = 0; - if((size = H5Pget_virtual_prefix(plist, NULL, 0)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate prefix buffer") - if(H5Pget_virtual_prefix(plist, my_prefix, size+1) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") - if(my_prefix) { - if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ - if(src_file == NULL) { - char *vdspath; - - if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { - if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try the relative file_name stored in temp_file_name */ - if(src_file == NULL) { - if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - } /* end if */ - - /* try the 'resolved' name for the virtual file */ - if(src_file == NULL) { - char *ptr = NULL; - - /* Copy resolved file name */ - if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(actual_file_name, ptr) - if(!ptr) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - - /* Truncate filename portion from actual file name path */ - *ptr = '\0'; - - /* Build new file name for the external file */ - if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - - /* Try opening with the resolved name */ - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - - /* Success */ - ret_value = src_file; -done: - if((NULL == ret_value) && src_file) - if(H5F_try_close(src_file, NULL) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file") - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_open_file() */ - /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -984,13 +750,9 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ - char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ - char *full_name = NULL; /* File name with prefix */ - unsigned intent; /* File access permissions */ - H5P_genplist_t *plist; /* Property list pointer */ FUNC_ENTER_STATIC @@ -1003,9 +765,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - if((plist = H5D_get_access_plist(vdset)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") - if(NULL == (src_file = H5D__virtual_open_file(plist, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + /* Open the source file */ + if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -1646,7 +1407,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection") } /* end if */ - /* Update cached values unlim_extent_source and + /* Update cached values unlim_extent_source and * clip_size_virtual */ storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source]; storage->list[i].clip_size_virtual = clip_size; @@ -1798,7 +1559,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") /* Mark the space as dirty, for later writing to the file */ - if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) + if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2485,7 +2246,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space") storage->list[i].sub_dset[j].projected_mem_space = NULL; } /* end if */ - else + else *tot_nelmts += (hsize_t)select_nelmts; } /* end if */ } /* end for */ @@ -2504,7 +2265,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Check if anything is selected */ if(select_nelmts > (hssize_t)0) { /* Open source dataset */ - if(!storage->list[i].source_dset.dset) + if(!storage->list[i].source_dset.dset) /* Try to open dataset */ if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") @@ -2745,7 +2506,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 96b8e36..daf0a52 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t; #include "H5Fpublic.h" /* Public headers needed by this file */ -#include "H5FDpublic.h" /* File drivers */ +#include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ #ifdef H5_HAVE_PARALLEL -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /**************************/ @@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t; * Currently, all file meta-data is little-endian. */ -# define INT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define INT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define UINT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define UINT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define INT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ +# define INT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ } -# define UINT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ +# define UINT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ } /* Encode an unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define ENCODE_VAR(p, typ, n, l) { \ - typ _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for(_i = 0; _i < l; _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t*)(p) + l; \ +# define ENCODE_VAR(p, typ, n, l) { \ + typ _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for(_i = 0; _i < l; _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t*)(p) + l; \ } /* Encode a 32-bit unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l) -# define INT64ENCODE(p, n) { \ - int64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = (n) < 0 ? 0xff : 0; \ - (p) = (uint8_t*)(p)+8; \ +# define INT64ENCODE(p, n) { \ + int64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = (n) < 0 ? 0xff : 0; \ + (p) = (uint8_t*)(p)+8; \ } -# define UINT64ENCODE(p, n) { \ - uint64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = 0; \ - (p) = (uint8_t*)(p) + 8; \ +# define UINT64ENCODE(p, n) { \ + uint64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = 0; \ + (p) = (uint8_t*)(p) + 8; \ } /* Encode a 64-bit unsigned integer into a variable-sized buffer */ @@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ +# define UINT64ENCODE_VARLEN(p, n) { \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } -# define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ +# define H5_ENCODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_ENCODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - HDmemcpy(&_n, &n, sizeof(double)); \ - for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t *)(p) + 8; \ +# define H5_ENCODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + HDmemcpy(&_n, &n, sizeof(double)); \ + for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t *)(p) + 8; \ } /* DECODE converts little endian bytes pointed by p to integer values and store @@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t; * correctly even if i is actually a 64bit int like in a Cray. */ -# define INT16DECODE(p, i) { \ - (i) = (int16_t)((*(p) & 0xff)); (p)++; \ +# define INT16DECODE(p, i) { \ + (i) = (int16_t)((*(p) & 0xff)); (p)++; \ (i) |= (int16_t)(((*(p) & 0xff) << 8) | \ - ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ + ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ } -# define UINT16DECODE(p, i) { \ - (i) = (uint16_t) (*(p) & 0xff); (p)++; \ - (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ +# define UINT16DECODE(p, i) { \ + (i) = (uint16_t) (*(p) & 0xff); (p)++; \ + (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ } -# define INT32DECODE(p, i) { \ - (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ +# define INT32DECODE(p, i) { \ + (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ (i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \ ((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \ } -# define UINT32DECODE(p, i) { \ - (i) = (uint32_t)(*(p) & 0xff); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ +# define UINT32DECODE(p, i) { \ + (i) = (uint32_t)(*(p) & 0xff); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ } /* Decode a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define DECODE_VAR(p, n, l) { \ - size_t _i; \ - \ - n = 0; \ - (p) += l; \ - for (_i = 0; _i < l; _i++) \ - n = (n << 8) | *(--p); \ - (p) += l; \ +# define DECODE_VAR(p, n, l) { \ + size_t _i; \ + \ + n = 0; \ + (p) += l; \ + for (_i = 0; _i < l; _i++) \ + n = (n << 8) | *(--p); \ + (p) += l; \ } /* Decode a variable-sized buffer into a 32-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ # define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) -# define INT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(int64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define INT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(int64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } -# define UINT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(uint64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define UINT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(uint64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } /* Decode a variable-sized buffer into a 64-bit unsigned integer */ @@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t; /* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT64DECODE_VARLEN(p, n) { \ - unsigned _s = *(p)++; \ - \ - UINT64DECODE_VAR(p, n, _s); \ +# define UINT64DECODE_VARLEN(p, n) { \ + unsigned _s = *(p)++; \ + \ + UINT64DECODE_VAR(p, n, _s); \ } -# define H5_DECODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32DECODE(p, n) \ +# define H5_DECODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32DECODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_DECODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - _n = 0; \ - (p) += 8; \ - for(_u = 0; _u < sizeof(uint64_t); _u++) \ - _n = (_n << 8) | *(--p); \ - HDmemcpy(&(n), &_n, sizeof(double)); \ - (p) += 8; \ +# define H5_DECODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + _n = 0; \ + (p) += 8; \ + for(_u = 0; _u < sizeof(uint64_t); _u++) \ + _n = (_n << 8) | *(--p); \ + HDmemcpy(&(n), &_n, sizeof(double)); \ + (p) += 8; \ } /* Address-related macros */ -#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ - HADDR_UNDEF==(X)+(haddr_t)(Z) || \ - (X)+(haddr_t)(Z)<(X)) -#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) +#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ + HADDR_UNDEF==(X)+(haddr_t)(Z) || \ + (X)+(haddr_t)(Z)<(X)) +#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) /* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making * certain that X is not HADDR_UNDEF and then checking that X equals Y */ -#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ - (X)==(Y)) -#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) -#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<(Y)) -#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<=(Y)) -#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>(Y)) -#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>=(Y)) -#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ - (H5F_addr_lt((X), (Y)) ? -1 : 1)) -#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) +#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ + (X)==(Y)) +#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) +#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<(Y)) +#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<=(Y)) +#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>(Y)) +#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>=(Y)) +#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ + (H5F_addr_lt((X), (Y)) ? -1 : 1)) +#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) #define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) @@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) #define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k) #define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id]) -#define H5F_NREFS(F) ((F)->shared->nrefs) +#define H5F_NREFS(F) ((F)->shared->nrefs) #define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) #define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) #define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr) @@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging) #define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access) #define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location) -#define H5F_ALIGNMENT(F) ((F)->shared->alignment) -#define H5F_THRESHOLD(F) ((F)->shared->threshold) +#define H5F_ALIGNMENT(F) ((F)->shared->alignment) +#define H5F_THRESHOLD(F) ((F)->shared->threshold) #define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres) #define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return) #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) @@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) #define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F)) #define H5F_KVALUE(F,T) (H5F_Kvalue(F,T)) -#define H5F_NREFS(F) (H5F_get_nrefs(F)) +#define H5F_NREFS(F) (H5F_get_nrefs(F)) #define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) #define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) #define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F)) @@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F)) #define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F)) #define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F)) -#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) -#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) +#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) +#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) #define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F)) #define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F)) #define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F)) @@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t; /* Macros to encode/decode offset/length's for storing in the file */ -#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ - case 4: UINT32ENCODE(p,o); break; \ - case 8: UINT64ENCODE(p,o); break; \ - case 2: UINT16ENCODE(p,o); break; \ +#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ + case 4: UINT32ENCODE(p,o); break; \ + case 8: UINT64ENCODE(p,o); break; \ + case 2: UINT16ENCODE(p,o); break; \ } -#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ - case 4: UINT32DECODE(p, o); break; \ - case 8: UINT64DECODE(p, o); break; \ - case 2: UINT16DECODE(p, o); break; \ +#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ + case 4: UINT32DECODE(p, o); break; \ + case 8: UINT64DECODE(p, o); break; \ + case 2: UINT16DECODE(p, o); break; \ } -#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32ENCODE(p,l); break; \ - case 8: UINT64ENCODE(p,l); break; \ - case 2: UINT16ENCODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32ENCODE(p,l); break; \ + case 8: UINT64ENCODE(p,l); break; \ + case 2: UINT16ENCODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) -#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32DECODE(p,l); break; \ - case 8: UINT64DECODE(p,l); break; \ - case 2: UINT16DECODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32DECODE(p,l); break; \ + case 8: UINT64DECODE(p,l); break; \ + case 2: UINT16DECODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) @@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t; * with. */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_SIZET2OFFT(X) \ +# define H5F_OVERFLOW_SIZET2OFFT(X) \ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1))) #else # define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif #if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_HSIZET2OFFT(X) \ +# define H5F_OVERFLOW_HSIZET2OFFT(X) \ ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1))) #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 @@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */ #define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */ #define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */ -#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ +#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ #define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */ #define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */ /* ========= File Access properties ============ */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ +#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ @@ -487,7 +487,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ @@ -504,7 +504,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ /* ======================== File Mount properties ====================*/ -#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ +#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ #ifdef H5_HAVE_PARALLEL @@ -513,20 +513,20 @@ typedef struct H5F_t H5F_t; #endif /* H5_HAVE_PARALLEL */ /* Define the HDF5 file signature */ -#define H5F_SIGNATURE "\211HDF\r\n\032\n" +#define H5F_SIGNATURE "\211HDF\r\n\032\n" #define H5F_SIGNATURE_LEN 8 /* Version #'s of the major components of the file format */ -#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ -#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ -#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ -#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ -#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ +#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ +#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ +#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ +#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ +#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ #define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */ -#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ -#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ -#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ -#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ +#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ +#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ +#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ +#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ /* B-tree internal 'K' values */ #define HDF5_BTREE_SNODE_IK_DEF 16 @@ -536,54 +536,54 @@ typedef struct H5F_t H5F_t; if it is changed, the code must compensate. -QAK */ -#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ - /* See format specification on version 1 B-trees */ +#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ + /* See format specification on version 1 B-trees */ /* Default file space handling strategy */ -#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_PERSIST_DEF FALSE +#define H5F_FREE_SPACE_PERSIST_DEF FALSE /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_THRESHOLD_DEF 1 +#define H5F_FREE_SPACE_THRESHOLD_DEF 1 /* For paged aggregation: default file space page size when not set */ -#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 +#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 /* For paged aggregation: minimum value for file space page size */ -#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512 +#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512 /* For paged aggregation: maxiumum value for file space page size: 1 gigabyte */ -#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024 +#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024 /* For paged aggregation: drop free-space with size <= this threshold for small meta section */ #define H5F_FILE_SPACE_PGEND_META_THRES 0 /* Default for threshold for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_DEF 1 +#define H5F_ALIGN_DEF 1 /* Default for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_THRHD_DEF 1 +#define H5F_ALIGN_THRHD_DEF 1 /* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */ -#define H5F_META_BLOCK_SIZE_DEF 2048 +#define H5F_META_BLOCK_SIZE_DEF 2048 /* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */ -#define H5F_SDATA_BLOCK_SIZE_DEF 2048 +#define H5F_SDATA_BLOCK_SIZE_DEF 2048 /* Check for file using paged aggregation */ #define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size) /* Metadata read attempt values */ -#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ -#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ +#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ +#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ /* Macros to define signatures of all objects in the file */ /* Size of signature information (on disk) */ /* (all on-disk signatures should be this length) */ -#define H5_SIZEOF_MAGIC 4 +#define H5_SIZEOF_MAGIC 4 /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ -#define H5_SIZEOF_CHKSUM 4 +#define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ #define H5B_MAGIC "TREE" @@ -704,11 +704,11 @@ typedef enum H5F_fs_state_t { typedef enum H5F_mem_page_t { H5F_MEM_PAGE_DEFAULT = 0, /* Not used */ H5F_MEM_PAGE_SUPER = 1, - H5F_MEM_PAGE_BTREE = 2, - H5F_MEM_PAGE_DRAW = 3, - H5F_MEM_PAGE_GHEAP = 4, - H5F_MEM_PAGE_LHEAP = 5, - H5F_MEM_PAGE_OHDR = 6, + H5F_MEM_PAGE_BTREE = 2, + H5F_MEM_PAGE_DRAW = 3, + H5F_MEM_PAGE_GHEAP = 4, + H5F_MEM_PAGE_LHEAP = 5, + H5F_MEM_PAGE_OHDR = 6, H5F_MEM_PAGE_LARGE_SUPER = 7, H5F_MEM_PAGE_LARGE_BTREE = 8, H5F_MEM_PAGE_LARGE_DRAW = 9, diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 4765d00..61b4183 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f) * Function: H5F_get_extpath * * Purpose: Retrieve the file's 'extpath' flags - * This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location + * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location * when searching the target file. * * Return: 'extpath' on success/abort on failure (shouldn't fail) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index da06297..494de3e 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -71,17 +71,6 @@ #define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0 #define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t #define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t -/* Definitions for VDS file prefix */ -#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *) -#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */ -#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set -#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get -#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc -#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec -#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del -#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy -#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp -#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close /* Definition for append flush */ #define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) #define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} @@ -123,14 +112,6 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value); /* Property list callbacks */ static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value); -static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size); -static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value); -static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value); -static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size); -static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value); /* Property list callbacks */ static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value); @@ -179,7 +160,6 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{ /* Property value defaults */ static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ -static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */ /*------------------------------------------------------------------------- @@ -230,12 +210,6 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register property for vds prefix */ - if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, - NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC, - H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, @@ -252,254 +226,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dacc_reg_prop() */ - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_set - * - * Purpose: Copies a vds file prefix property when it's set - * for a property list - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, - size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(value); - - /* Copy the prefix */ - *(char **)value = H5MM_xstrdup(*(const char **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_set() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_get - * - * Purpose: Copies a vds file prefix property when it's retrieved - * from a property list - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, - size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(value); - - /* Copy the prefix */ - *(char **)value = H5MM_xstrdup(*(const char **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_get() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_enc - * - * Purpose: Callback routine which is called whenever the vds file flags - * property in the dataset access property list is - * encoded. - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) -{ - const char *vds_file_pref = *(const char * const *)value; - uint8_t **pp = (uint8_t **)_pp; - size_t len = 0; - uint64_t enc_value; - unsigned enc_size; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - - /* calculate prefix length */ - if(NULL != vds_file_pref) - len = HDstrlen(vds_file_pref); - - enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); - - if(NULL != *pp) { - /* encode the length of the prefix */ - *(*pp)++ = (uint8_t)enc_size; - UINT64ENCODE_VAR(*pp, enc_value, enc_size); - - /* encode the prefix */ - if(NULL != vds_file_pref) { - HDmemcpy(*(char **)pp, vds_file_pref, len); - *pp += len; - } /* end if */ - } /* end if */ - - *size += (1 + enc_size); - if(NULL != vds_file_pref) - *size += len; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_enc() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_dec - * - * Purpose: Callback routine which is called whenever the vds file prefix - * property in the dataset access property list is - * decoded. - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) -{ - char **vds_file_pref = (char **)_value; - const uint8_t **pp = (const uint8_t **)_pp; - size_t len; - uint64_t enc_value; /* Decoded property value */ - unsigned enc_size; /* Size of encoded property */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(pp); - HDassert(*pp); - HDassert(vds_file_pref); - HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - - /* Decode the size */ - enc_size = *(*pp)++; - HDassert(enc_size < 256); - - /* Decode the value */ - UINT64DECODE_VAR(*pp, enc_value, enc_size); - len = (size_t)enc_value; - - if(0 != len) { - /* Make a copy of the user's prefix string */ - if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix") - HDstrncpy(*vds_file_pref, *(const char **)pp, len); - (*vds_file_pref)[len] = '\0'; - - *pp += len; - } /* end if */ - else - *vds_file_pref = NULL; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__dapl_vds_file_pref_dec() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_del - * - * Purpose: Frees memory used to store the vds file prefix string - * - * Return: SUCCEED (Can't fail) - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, - size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(value); - - H5MM_xfree(*(void **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_del() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_copy - * - * Purpose: Creates a copy of the vds file prefix string - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(value); - - *(char **)value = H5MM_xstrdup(*(const char **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_copy() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_cmp - * - * Purpose: Callback routine which is called whenever the vds file prefix - * property in the dataset creation property list is - * compared. - * - * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise. - *------------------------------------------------------------------------- - */ -static int -H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) -{ - const char *pref1 = *(const char * const *)value1; - const char *pref2 = *(const char * const *)value2; - int ret_value = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(NULL == pref1 && NULL != pref2) - HGOTO_DONE(1); - if(NULL != pref1 && NULL == pref2) - HGOTO_DONE(-1); - if(NULL != pref1 && NULL != pref2) - ret_value = HDstrcmp(pref1, pref2); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__dapl_vds_file_pref_cmp() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__dapl_vds_file_pref_close - * - * Purpose: Frees memory used to store the vds file prefix string - * - * Return: SUCCEED/FAIL - *------------------------------------------------------------------------- - */ -static herr_t -H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(value); - - H5MM_xfree(*(void **)value); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__dapl_vds_file_pref_close() */ - /*------------------------------------------------------------------------- * Function: H5P__dapl_efile_pref_set @@ -1494,95 +1220,3 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_efile_prefix() */ - -/*------------------------------------------------------------------------- - * Function: H5Pset_virtual_prefix - * - * Purpose: Set a prefix to be applied to the path of any vds files - * traversed. - * - * If the prefix starts with ${ORIGIN}, this will be replaced by - * the absolute path of the directory of the HDF5 file containing - * the dataset. - * - * If the prefix is ".", no prefix will be applied. - * - * This property can be overwritten by the environment variable - * HDF5_VDS_PREFIX. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_virtual_prefix(hid_t plist_id, const char *prefix) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*s", plist_id, prefix); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Set prefix */ - if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_virtual_prefix() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_virtual_prefix - * - * Purpose: Gets the prefix to be applied to any vds file - * traversals made using this property list. - * - * If the pointer is not NULL, it points to a user-allocated - * buffer. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -ssize_t -H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) -{ - H5P_genplist_t *plist; /* Property list pointer */ - char *my_prefix; /* Library's copy of the prefix */ - size_t len; /* Length of prefix string */ - ssize_t ret_value; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "i*sz", plist_id, prefix, size); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Get the current prefix */ - if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix") - - /* Check for prefix being set */ - if(my_prefix) { - /* Copy to user's buffer, if given */ - len = HDstrlen(my_prefix); - if(prefix) { - HDstrncpy(prefix, my_prefix, MIN(len + 1, size)); - if(len >= size) - prefix[size - 1] = '\0'; - } /* end if */ - } /* end if */ - else - len = 0; - - /* Set return value */ - ret_value = (ssize_t)len; - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pget_virtual_prefix() */ - diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index ea9bfb4..915aa38 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -13,9 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pfapl.c + * Created: H5Pfapl.c * - * Purpose: File access property list class routines + * Purpose: File access property list class routines * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ #include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ #include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Win32 I/O */ @@ -54,10 +54,10 @@ /* ========= File Access properties ============ */ /* Definitions for the initial metadata cache resize configuration */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG -#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec +#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG +#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec #define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp /* Definitions for size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t) @@ -118,10 +118,10 @@ #define H5F_ACS_FILE_DRV_CMP H5P__facc_file_driver_cmp #define H5F_ACS_FILE_DRV_CLOSE H5P__facc_file_driver_close /* Definition for file close degree */ -#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) -#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT -#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc -#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec +#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) +#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT +#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc +#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec /* Definition for offset position in file for family file driver */ #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 @@ -175,12 +175,12 @@ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC H5P__encode_size_t #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC H5P__decode_size_t /* Definition for # of metadata read attempts */ -#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 -#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 +#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned /* Definition for object flush callback */ -#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) +#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) #define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL} /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) @@ -309,21 +309,21 @@ static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); /* File access property list class library initialization object */ const H5P_libclass_t H5P_CLS_FACC[1] = {{ - "file access", /* Class name for debugging */ + "file access", /* Class name for debugging */ H5P_TYPE_FILE_ACCESS, /* Class type */ - &H5P_CLS_ROOT_g, /* Parent class */ - &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ - &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ - &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ - H5P__facc_reg_prop, /* Default property registration routine */ - - NULL, /* Class creation callback */ - NULL, /* Class creation callback info */ - NULL, /* Class copy callback */ - NULL, /* Class copy callback info */ - NULL, /* Class close callback */ - NULL /* Class close callback info */ + &H5P_CLS_ROOT_g, /* Parent class */ + &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ + &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ + &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ + H5P__facc_reg_prop, /* Default property registration routine */ + + NULL, /* Class creation callback */ + NULL, /* Class creation callback info */ + NULL, /* Class copy callback */ + NULL, /* Class copy callback info */ + NULL, /* Class close callback */ + NULL /* Class close callback info */ }}; @@ -395,149 +395,149 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the initial metadata cache resize configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, - NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, + if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, + NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, - NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, + NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, - NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, + NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, - NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, + NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, - NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, + if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, + NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID & info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, + if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL, H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ - if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, - NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, + NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the offset of family driver info */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, - NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, + NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of new family file size. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether convert family to sec2 driver. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the data type of multi driver info */ - if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, - NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, + if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, + NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, + NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to retrieve the file descriptor from the core VFD */ /* (used internally to the library only) */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, + if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the external file cache size */ - if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, - NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, + NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, + if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the core VFD backing store write tracking flag */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the core VFD backing store page size */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, - NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object flush callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, + if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -563,44 +563,44 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the evict on close flag */ - if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, - NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, + NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, + if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata collective write flag */ - if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ /* Register the initial metadata cache image configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum metadata size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum raw data size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -610,33 +610,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_alignment + * Function: H5Pset_alignment * - * Purpose: Sets the alignment properties of a file access property list - * so that any file object >= THRESHOLD bytes will be aligned on - * an address which is a multiple of ALIGNMENT. The addresses - * are relative to the end of the user block; the alignment is - * calculated by subtracting the user block size from the - * absolute file address and then adjusting the address to be a - * multiple of ALIGNMENT. + * Purpose: Sets the alignment properties of a file access property list + * so that any file object >= THRESHOLD bytes will be aligned on + * an address which is a multiple of ALIGNMENT. The addresses + * are relative to the end of the user block; the alignment is + * calculated by subtracting the user block size from the + * absolute file address and then adjusting the address to be a + * multiple of ALIGNMENT. * - * Default values for THRESHOLD and ALIGNMENT are one, implying - * no alignment. Generally the default values will result in - * the best performance for single-process access to the file. - * For MPI-IO and other parallel systems, choose an alignment - * which is a multiple of the disk block size. + * Default values for THRESHOLD and ALIGNMENT are one, implying + * no alignment. Generally the default values will result in + * the best performance for single-process access to the file. + * For MPI-IO and other parallel systems, choose an alignment + * which is a multiple of the disk block size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed file access property list mechanism to the new + * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -668,15 +668,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_alignment + * Function: H5Pget_alignment * - * Purpose: Returns the current settings for alignment properties from a - * file access property list. The THRESHOLD and/or ALIGNMENT - * pointers may be null pointers. + * Purpose: Returns the current settings for alignment properties from a + * file access property list. The THRESHOLD and/or ALIGNMENT + * pointers may be null pointers. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -709,20 +709,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_set_driver + * Function: H5P_set_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -757,20 +757,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_driver + * Function: H5Pset_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -800,20 +800,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver + * Function: H5P_peek_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Return: Success: A low-level driver ID which is the same ID - * used when the driver was set for the property - * list. The driver ID is only valid as long as - * the file driver remains registered. + * Return: Success: A low-level driver ID which is the same ID + * used when the driver was set for the property + * list. The driver ID is only valid as long as + * the file driver remains registered. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -844,22 +844,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver + * Function: H5Pget_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Note: The ID returned should not be closed. + * Note: The ID returned should not be closed. * - * Return: Success: A low-level driver ID which is the same ID - * used when the driver was set for the property - * list. The driver ID is only valid as long as - * the file driver remains registered. + * Return: Success: A low-level driver ID which is the same ID + * used when the driver was set for the property + * list. The driver ID is only valid as long as + * the file driver remains registered. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -867,7 +867,7 @@ hid_t H5Pget_driver(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); @@ -885,20 +885,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver_info + * Function: H5P_peek_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -927,20 +927,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver_info + * Function: H5Pget_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -973,7 +973,7 @@ done: * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -1486,30 +1486,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_cache + * Function: H5Pset_cache * - * Purpose: Set the number of objects in the meta data cache and the - * maximum number of chunks and bytes in the raw data chunk - * cache. + * Purpose: Set the number of objects in the meta data cache and the + * maximum number of chunks and bytes in the raw data chunk + * cache. * - * The RDCC_W0 value should be between 0 and 1 inclusive and - * indicates how much chunks that have been fully read or fully - * written are favored for preemption. A value of zero means - * fully read or written chunks are treated no differently than - * other chunks (the preemption is strictly LRU) while a value - * of one means fully read chunks are always preempted before - * other chunks. + * The RDCC_W0 value should be between 0 and 1 inclusive and + * indicates how much chunks that have been fully read or fully + * written are favored for preemption. A value of zero means + * fully read or written chunks are treated no differently than + * other chunks (the preemption is strictly LRU) while a value + * of one means fully read chunks are always preempted before + * other chunks. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, - size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) + size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1540,24 +1540,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_cache + * Function: H5Pget_cache * - * Purpose: Retrieves the maximum possible number of elements in the meta - * data cache and the maximum possible number of elements and - * bytes and the RDCC_W0 value in the raw data chunk cache. Any - * (or all) arguments may be null pointers in which case the - * corresponding datum is not returned. + * Purpose: Retrieves the maximum possible number of elements in the meta + * data cache and the maximum possible number of elements and + * bytes and the RDCC_W0 value in the raw data chunk cache. Any + * (or all) arguments may be null pointers in which case the + * corresponding datum is not returned. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, - size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) + size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1592,14 +1592,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_image_config + * Function: H5Pset_mdc_image_config * - * Purpose: Set the initial metadata cache image configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache image configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, June 25, 2015 * *------------------------------------------------------------------------- @@ -1636,18 +1636,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_image_config + * Function: H5Pget_mdc_image_config * - * Purpose: Retrieve the metadata cache initial image configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial image configuration + * from the target FAPL. * - * Observe that the function will fail if config_ptr is - * NULL, or if config_ptr->version specifies an unknown - * version of H5AC_cache_image_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_image_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Friday, June 26, 2015 * *------------------------------------------------------------------------- @@ -1687,14 +1687,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_config + * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache resize configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1731,18 +1731,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_config + * Function: H5Pget_mdc_config * - * Purpose: Retrieve the metadata cache initial resize configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial resize configuration + * from the target FAPL. * - * Observe that the function will fail if config_ptr is - * NULL, or if config_ptr->version specifies an unknown - * version of H5AC_cache_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1782,33 +1782,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_gc_references + * Function: H5Pset_gc_references * - * Purpose: Sets the flag for garbage collecting references for the file. - * Dataset region references (and other reference types - * probably) use space in the file heap. If garbage collection - * is on and the user passes in an uninitialized value in a - * reference structure, the heap might get corrupted. When - * garbage collection is off however and the user re-uses a - * reference, the previous heap block will be orphaned and not - * returned to the free heap space. When garbage collection is - * on, the user must initialize the reference structures to 0 or - * risk heap corruption. + * Purpose: Sets the flag for garbage collecting references for the file. + * Dataset region references (and other reference types + * probably) use space in the file heap. If garbage collection + * is on and the user passes in an uninitialized value in a + * reference structure, the heap might get corrupted. When + * garbage collection is off however and the user re-uses a + * reference, the previous heap block will be orphaned and not + * returned to the free heap space. When garbage collection is + * on, the user must initialize the reference structures to 0 or + * risk heap corruption. * - * Default value for garbage collecting references is off, just - * to be on the safe side. + * Default value for garbage collecting references is off, just + * to be on the safe side. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * June, 1999 + * Programmer: Quincey Koziol + * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1835,22 +1835,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_gc_references + * Function: H5Pget_gc_references * - * Purpose: Returns the current setting for the garbage collection - * references property from a file access property list. + * Purpose: Returns the current setting for the garbage collection + * references property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1949,31 +1949,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_meta_block_size + * Function: H5Pset_meta_block_size * - * Purpose: Sets the minimum size of metadata block allocations when + * Purpose: Sets the minimum size of metadata block allocations when * the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver. * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. * - * The default value is set to 2048 (bytes), indicating that metadata + * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will * turn off the metadata aggregation, even if the VFL driver attempts to * use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2000,22 +2000,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_meta_block_size + * Function: H5Pget_meta_block_size * - * Purpose: Returns the current settings for the metadata block allocation + * Purpose: Returns the current settings for the metadata block allocation * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 29, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2044,31 +2044,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_sieve_buf_size + * Function: H5Pset_sieve_buf_size * - * Purpose: Sets the maximum size of the data seive buffer used for file + * Purpose: Sets the maximum size of the data seive buffer used for file * drivers which are capable of using data sieving. The data sieve * buffer is used when performing I/O on datasets in the file. Using a * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. * - * The default value is set to 64KB, indicating that file I/O for raw data + * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the * data sieving, even if the VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2095,22 +2095,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_sieve_buf_size + * Function: H5Pget_sieve_buf_size * - * Purpose: Returns the current settings for the data sieve buffer size + * Purpose: Returns the current settings for the data sieve buffer size * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2138,23 +2138,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_small_data_block_size + * Function: H5Pset_small_data_block_size * - * Purpose: Sets the minimum size of "small" raw data block allocations + * Purpose: Sets the minimum size of "small" raw data block allocations * when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver. * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. * - * The default value is set to 2048 (bytes), indicating that raw data + * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API * function will turn off the "small" raw data aggregation, even if the * VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2184,14 +2184,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_small_data_block_size + * Function: H5Pget_small_data_block_size * - * Purpose: Returns the current settings for the "small" raw data block + * Purpose: Returns the current settings for the "small" raw data block * allocation property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2223,9 +2223,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_libver_bounds + * Function: H5Pset_libver_bounds * - * Purpose: Indicates which versions of the file format the library should + * Purpose: Indicates which versions of the file format the library should * use when creating objects. LOW is the earliest version of the HDF5 * library that is guaranteed to be able to access the objects created * (the format of some objects in an HDF5 file may not have changed between @@ -2301,9 +2301,9 @@ done: * releases and then map down to the previous actual library release which * had a format change. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, December 30, 2007 * *------------------------------------------------------------------------- @@ -2341,14 +2341,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_libver_bounds + * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * *------------------------------------------------------------------------- @@ -2464,9 +2464,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_file_image * - * Purpose: Sets the initial file image. Some file drivers can initialize - * the starting data in a file from a buffer. - * + * Purpose: Sets the initial file image. Some file drivers can initialize + * the starting data in a file from a buffer. + * * Return: Non-negative on success/Negative on failure * * Programmer: Jacob Gruber @@ -2480,22 +2480,22 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) H5P_genplist_t *fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len); /* validate parameters */ if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len") - + /* Get the plist structure */ if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - + /* Get old image info */ if(H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer") - + /* Release previous buffer, if it exists */ if(image_info.buffer != NULL) { if(image_info.callbacks.image_free) { @@ -2504,8 +2504,8 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) } /* end if */ else H5MM_xfree(image_info.buffer); - } /* end if */ - + } /* end if */ + /* Update struct */ if(buf_ptr) { /* Allocate memory */ @@ -2517,15 +2517,15 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) else if(NULL == (image_info.buffer = H5MM_malloc(buf_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { - if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, - buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, + buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata)) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(image_info.buffer, buf_ptr, buf_len); } /* end if */ else @@ -2545,24 +2545,24 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, - * allocate a buffer of the correct size, copy the image into - * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks - * if defined. + * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * allocate a buffer of the correct size, copy the image into + * the new buffer, and return the buffer to the caller in + * *buf_ptr_ptr. Do this using the file image callbacks + * if defined. * - * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do - * this using free if the file image callbacks are not - * defined, or with whatever method is appropriate if - * the callbacks are defined. + * NB: It is the responsibility of the caller to free the + * buffer whose address is returned in *buf_ptr_ptr. Do + * this using free if the file image callbacks are not + * defined, or with whatever method is appropriate if + * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf_ptr_ptr is not NULL, and no image exists, set + * *buf_ptr_ptr to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal - * to the length of the file image if it exists, and - * to 0 if it does not. + * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * to the length of the file image if it exists, and + * to 0 if it does not. * * Return: Non-negative on success/Negative on failure * @@ -2590,7 +2590,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || + HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ @@ -2611,15 +2611,15 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) else if(NULL == (copy_ptr = H5MM_malloc(image_info.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, - image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ @@ -2636,7 +2636,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * and memcpys or to perform detailed logging. * @@ -2666,7 +2666,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* Make sure a file image hasn't already been set */ @@ -2675,7 +2675,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Make sure udata callbacks are going to be set if udata is going to be set */ if(callbacks_ptr->udata) @@ -2686,7 +2686,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback if(info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_free); if(info.callbacks.udata_free(info.callbacks.udata) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") } /* end if */ /* Update struct */ @@ -2713,7 +2713,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * * Return: Non-negative on success/Negative on failure @@ -2742,12 +2742,12 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Transfer values to parameters */ *callbacks_ptr = info.callbacks; @@ -2768,12 +2768,12 @@ done: * Function: H5P__file_image_info_copy * * Purpose: Copy file image info. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -2796,7 +2796,7 @@ H5P__file_image_info_copy(void *value) info = (H5FD_file_image_info_t *)value; /* verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); if(info->buffer && info->size > 0) { @@ -2815,14 +2815,14 @@ H5P__file_image_info_copy(void *value) if(NULL == (info->buffer = H5MM_malloc(info->size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory block") } /* end else */ - + /* Copy data to new buffer */ if(info->callbacks.image_memcpy) { - if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, - info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(info->buffer, old_buffer, info->size); } /* end if */ @@ -2846,8 +2846,8 @@ done: * Function: H5P__file_image_info_free * * Purpose: Free file image info. The buffer and udata may need to be - * freed, possibly using their respective callbacks, so the - * default free won't work. + * freed, possibly using their respective callbacks, so the + * default free won't work. * * Return: Success: Non-negative * Failure: Negative @@ -2868,16 +2868,16 @@ H5P__file_image_info_free(void *value) H5FD_file_image_info_t *info; /* Image info struct */ info = (H5FD_file_image_info_t *)value; - + /* Verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); /* Free buffer */ - if(info->buffer != NULL && info->size > 0) { + if(info->buffer != NULL && info->size > 0) { if(info->callbacks.image_free) { if((*info->callbacks.image_free)(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") + HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else H5MM_xfree(info->buffer); @@ -2903,7 +2903,7 @@ done: * Purpose: Compare two cache image configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: John Mainzer * June 26, 2015 @@ -2944,11 +2944,11 @@ done: * Function: H5P__facc_cache_image_config_enc * * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation - * property list is encoded. + * cache image config property in the file creation + * property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -2990,11 +2990,11 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) * Function: H5P__facc_cache_image_config_dec * * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation property - * list is decoded. + * cache image config property in the file creation property + * list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3109,7 +3109,7 @@ done: * * Purpose: Delete callback for the file image info property, called * when the property is deleted from the plist. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the default free won't work. * * Return: Non-negative on success/Negative on failure @@ -3139,7 +3139,7 @@ done: * Function: H5P__facc_file_image_info_copy * * Purpose: Copy callback for the file image info property. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Return: Non-negative on success/Negative on failure @@ -3228,7 +3228,7 @@ done: * Function: H5P__facc_file_image_info_close * * Purpose: Close callback for the file image info property. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the standard free won't work. * * Return: Non-negative on success/Negative on failure @@ -3260,7 +3260,7 @@ done: * Purpose: Compare two cache configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: Mohamad Chaarawi * September 24, 2012 @@ -3373,8 +3373,8 @@ done: * cache config property in the file creation property list is * encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3518,8 +3518,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) * cache config property in the file creation property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3653,8 +3653,8 @@ done: * degree property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3691,8 +3691,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) * degree property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3726,8 +3726,8 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) * memory type property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3764,8 +3764,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) * memory type property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3793,12 +3793,12 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * - * Purpose: Enables/disables core VFD write tracking and page + * Purpose: Enables/disables core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3834,12 +3834,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_core_write_tracking + * Function: H5Pget_core_write_tracking * - * Purpose: Gets information about core VFD write tracking and page + * Purpose: Gets information about core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3876,19 +3876,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_metadata_read_attempts - * - * Purpose: Sets the # of read attempts in the file access property list - * when reading metadata with checksum. - * The # of read attempts set via this routine will only apply - * when opening a file with SWMR access. - * The # of read attempts set via this routine does not have - * any effect when opening a file with non-SWMR access; for this - * case, the # of read attempts will be always be 1. + * Function: H5Pset_metadata_read_attempts * - * Return: Non-negative on success/Negative on failure + * Purpose: Sets the # of read attempts in the file access property list + * when reading metadata with checksum. + * The # of read attempts set via this routine will only apply + * when opening a file with SWMR access. + * The # of read attempts set via this routine does not have + * any effect when opening a file with non-SWMR access; for this + * case, the # of read attempts will be always be 1. + * + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3919,13 +3919,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_metadata_read_attempts + * Function: H5Pget_metadata_read_attempts * - * Purpose: Returns the # of metadata read attempts set in the file access property list. + * Purpose: Returns the # of metadata read attempts set in the file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3945,13 +3945,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -3960,14 +3960,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_obj_flush_cb + * Function: H5Pset_obj_flush_cb * - * Purpose: Sets the callback function to invoke and the user data when an - * object flush occurs in the file. + * Purpose: Sets the callback function to invoke and the user data when an + * object flush occurs in the file. + * + * Return: Non-negative on success/Negative on failure * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4004,14 +4004,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_obj_flush_cb - * - * Purpose: Retrieves the callback function and user data set in the - * property list for an object flush. + * Function: H5Pget_obj_flush_cb * - * Return: Non-negative on success/Negative on failure + * Purpose: Retrieves the callback function and user data set in the + * property list for an object flush. + * + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4035,9 +4035,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4045,11 +4045,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_log_options + * Function: H5Pset_mdc_log_options * - * Purpose: Set metadata cache log options. + * Purpose: Set metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4097,11 +4097,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_log_options + * Function: H5Pget_mdc_log_options * - * Purpose: Get metadata cache log options. + * Purpose: Get metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4455,8 +4455,8 @@ done: * * Purpose: Generic encoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4493,8 +4493,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) * * Purpose: Generic decoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4523,22 +4523,22 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_all_coll_metadata_ops + * Function: H5Pset_all_coll_metadata_ops * - * Purpose: Tell the library whether the metadata read operations will - * be done collectively (1) or not (0). Default is independent. - * With collective mode, the library will optimize access to - * metadata operations on the file. + * Purpose: Tell the library whether the metadata read operations will + * be done collectively (1) or not (0). Default is independent. + * With collective mode, the library will optimize access to + * metadata operations on the file. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4582,19 +4582,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_all_coll_metadata_ops + * Function: H5Pget_all_coll_metadata_ops * - * Purpose: Gets information about collective metadata read mode. + * Purpose: Gets information about collective metadata read mode. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4640,14 +4640,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_coll_metadata_write + * Function: H5Pset_coll_metadata_write * - * Purpose: Tell the library whether the metadata write operations will - * be done collectively (1) or not (0). Default is collective. + * Purpose: Tell the library whether the metadata write operations will + * be done collectively (1) or not (0). Default is collective. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4679,13 +4679,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_coll_metadata_write + * Function: H5Pget_coll_metadata_write * - * Purpose: Gets information about collective metadata write mode. + * Purpose: Gets information about collective metadata write mode. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4717,15 +4717,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_page_buffer_size + * Function: H5Pset_page_buffer_size * * Purpose: Set the maximum page buffering size. This has to be a * multiple of the page allocation size which must be enabled; * otherwise file create/open will fail. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- @@ -4765,13 +4765,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_page_buffer_size + * Function: H5Pget_page_buffer_size * - * Purpose: Retrieves the maximum page buffer size. + * Purpose: Retrieves the maximum page buffer size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index a2c0418..493a322 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,8 +420,6 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view); H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view); H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size); H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size); -H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); -H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t boundary[], H5D_append_cb_t func, void *udata); H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims, diff --git a/src/H5system.c b/src/H5system.c index 719b7e0..a8726c2 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = HDtoupper(name[0]) - 'A' + 1; + drive = name[0] - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fca2f27..973d389 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -452,6 +452,7 @@ set (test_CLEANFILES extlinks19B00026.h5 extlinks19B00027.h5 extlinks19B00028.h5 + tmp big.data big*.h5 stdio.h5 @@ -581,7 +582,6 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 - tmp/vds_src_2.h5 ) # Remove any output file left over from previous test run @@ -839,28 +839,21 @@ add_test (NAME H5TEST-clear-error_test-objects WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -if (HDF5_USE_16_API_DEFAULT) - add_test ( - NAME H5TEST-error_test-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" - ) -else () - add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-error_test PROPERTIES - DEPENDS H5TEST-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) -endif () +add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" +) +set_tests_properties (H5TEST-error_test PROPERTIES + DEPENDS H5TEST-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) #-- Adding test for links_env add_test (NAME H5TEST-clear-links_env-objects @@ -966,28 +959,21 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - if (HDF5_USE_16_API_DEFAULT) - add_test ( - NAME H5TEST-shared-error_test-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" - ) - else () - add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-shared-error_test PROPERTIES - DEPENDS H5TEST-shared-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) - endif () + add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-error_test PROPERTIES + DEPENDS H5TEST-shared-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) #-- Adding test for links_env add_test (NAME H5TEST-shared-clear-links_env-objects diff --git a/test/vds.c b/test/vds.c index eca26bc..c9b7a1b 100644 --- a/test/vds.c +++ b/test/vds.c @@ -36,12 +36,6 @@ const char *FILENAME[] = { "vds_src_1", "vds%%_src", "vds_dapl", - "vds_virt_2", - "vds_virt_3", - "vds_src_2", - "vds_src_3", - "vds%%_src2", - "vds_dapl2", NULL }; @@ -55,8 +49,6 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 -#define TMPDIR "tmp/" - /*------------------------------------------------------------------------- * Function: vds_select_equal @@ -65,7 +57,14 @@ const char *FILENAME[] = { * provided dataspaces are the same. * * Return: Success: 0 + * * Failure: -1 + * + * Programmer: Neil Fortner + * Monday, March 2, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static htri_t @@ -131,7 +130,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } + } /* end if */ /* Free buffers */ HDfree(buf1); @@ -181,7 +180,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } + } /* end if */ /* Free buffers */ HDfree(buf1); @@ -218,7 +217,14 @@ error: * parameters. * * Return: Success: 0 + * * Failure: -1 + * + * Programmer: Neil Fortner + * Monday, March 2, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -292,7 +298,8 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, error: H5E_BEGIN_TRY { - H5Sclose(space_out); + if(space_out >= 0) + (void)H5Sclose(space_out); } H5E_END_TRY return -1; @@ -305,7 +312,14 @@ error: * Purpose: Tests API functions related to virtual datasets. * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Monday, February 16, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ /* Helper function to get DCPL for examination depending on config */ @@ -356,12 +370,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, file = -1; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ /* Open dataset */ if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get DCPL from dataset */ if((*ex_dcpl = H5Dget_create_plist(dset)) < 0) @@ -380,8 +394,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(oinfo.meta_size.obj.heap_size != exp_meta_size) { printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size); TEST_ERROR - } - } + } /* end if */ + } /* end if */ else if((oinfo.meta_size.obj.heap_size != exp_meta_size) && (oinfo.meta_size.obj.heap_size != (hsize_t)0)) @@ -410,12 +424,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(H5Fclose(file) < 0) TEST_ERROR file = -1; - } + } /* end if */ else if(config == TEST_API_COPY_PLIST) { /* Copy property list */ if((*ex_dcpl = H5Pcopy(dcpl)) < 0) TEST_ERROR - } + } /* end if */ else if(config == TEST_API_ENCDEC_PLIST) { size_t plist_buf_size; @@ -434,14 +448,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, /* Free plist_buf */ HDfree(plist_buf); plist_buf = NULL; - } + } /* end if */ else { /* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl * can be closed */ if(H5Iinc_ref(dcpl) < 0) TEST_ERROR *ex_dcpl = dcpl; - } + } /* end else */ /* Verify examination DCPL is equal to original DCPL. Do not compare the * plist to itself, and do not do the comparison if we reopened the file, @@ -452,14 +466,16 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, TEST_ERROR if(!tri_ret) TEST_ERROR - } + } /* end if */ return 0; error: H5E_BEGIN_TRY { - H5Fclose(file); - H5Dclose(dset); + if(file >= 0) + (void)H5Fclose(file); + if(dset >= 0) + (void)H5Dclose(dset); } H5E_END_TRY; if(plist_buf) HDfree(plist_buf); @@ -516,7 +532,7 @@ test_api(test_api_config_t config, hid_t fapl) case TEST_API_NTESTS: default: TEST_ERROR - } + } /* end switch */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -802,7 +818,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Create virtual dataspace */ if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - } + } /* end for */ /* Select all (should not be necessary, but just to be sure) */ if(H5Sselect_all(srcspace[0]) < 0) @@ -916,7 +932,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } + } /* end for */ if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1022,7 +1038,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Add virtual layout mapping */ if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0) TEST_ERROR - } + } /* end if */ /* Get examination DCPL */ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0) @@ -1047,7 +1063,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Check that the mapping in the DCPL is correct */ if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0) TEST_ERROR - } + } /* end if */ /* Close */ if(H5Sclose(srcspace[0]) < 0) @@ -1057,7 +1073,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } + } /* end for */ if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1107,459 +1123,23 @@ test_api(test_api_config_t config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Pclose(dcpl); - H5Pclose(ex_dcpl); + for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(dcpl >= 0) + (void)H5Pclose(dcpl); + if(ex_dcpl >= 0) + (void)H5Pclose(ex_dcpl); } H5E_END_TRY; return 1; } /* end test_api() */ -/*------------------------------------------------------------------------- - * Function: vds_link_prefix - * - * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp" - * Should be able to access the target source files in tmp directory via the prefix set - * by H5Pset_virtual_prefix() - * - * Return: Success: 0 - * Failure: -1 - *------------------------------------------------------------------------- - */ -static int -test_vds_prefix(unsigned config, hid_t fapl) -{ - char srcfilename[FILENAME_BUF_SIZE]; - char srcfilename_map[FILENAME_BUF_SIZE]; - char vfilename[FILENAME_BUF_SIZE]; - char vfilename2[FILENAME_BUF_SIZE]; - char srcfilenamepct[FILENAME_BUF_SIZE]; - char srcfilenamepct_map[FILENAME_BUF_SIZE]; - const char *srcfilenamepct_map_orig = "vds%%%%_src"; - hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t vfile2 = -1; /* File with copied virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t dapl = -1; /* Dataset access property list */ - hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ - hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ - hsize_t start[4]; /* Hyperslab start */ - hsize_t stride[4]; /* Hyperslab stride */ - hsize_t count[4]; /* Hyperslab count */ - hsize_t block[4]; /* Hyperslab block */ - hssize_t offset[2] = {0, 0}; /* Selection offset */ - int buf[10][26]; /* Write and expected read buffer */ - int rbuf[10][26]; /* Read buffer */ - int rbuf99[9][9]; /* 9x9 Read buffer */ - int evbuf[10][26]; /* Expected VDS "buffer" */ - int erbuf[10][26]; /* Expected read buffer */ - int fill = -1; /* Fill value */ - herr_t ret; /* Generic return value */ - int i, j; - char buffer[1024]; /* buffer to read vds_prefix */ - - TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()") - - h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename); - h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2); - h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename); - h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map); - h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct); - h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map); - - /* create tmp directory and get current working directory path */ - if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) - TEST_ERROR - - /* Create DCPL */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - TEST_ERROR - - /* Set fill value */ - if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) - TEST_ERROR - - /* Initialize VDS prefix items */ - if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) - TEST_ERROR - - if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0) - TEST_ERROR - if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) - TEST_ERROR - - if(HDstrcmp(buffer, TMPDIR) != 0) - FAIL_PUTS_ERROR("vds prefix not set correctly"); - - /* - * Test 1: All - all selection - */ - /* Create source dataspace */ - if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Create virtual dataspace */ - if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Select all (should not be necessary, but just to be sure) */ - if(H5Sselect_all(srcspace[0]) < 0) - TEST_ERROR - if(H5Sselect_all(vspace[0]) < 0) - TEST_ERROR - - /* Add virtual layout mapping */ - if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) - TEST_ERROR - - /* Create virtual file */ - if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - - /* Create source file if requested */ - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - else { - srcfile[0] = vfile; - if(H5Iinc_ref(srcfile[0]) < 0) - TEST_ERROR - } - - /* Create source dataset */ - if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Create virtual dataset */ - if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) - TEST_ERROR - - /* Populate write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; - - /* Write data directly to source dataset */ - if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Close srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - - if(config & TEST_IO_DIFFERENT_FILE) { - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - } - } - - /* Reopen virtual dataset and file if config option specified */ - if(config & TEST_IO_REOPEN_VIRT) { - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR - if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) - TEST_ERROR - } - - /* Read data through virtual dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) { - TEST_ERROR - } - } - - /* Adjust write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); - - /* Write data through virtual dataset */ - if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Reopen srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) - TEST_ERROR - } - - /* Read data directly from source dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) - TEST_ERROR - - /* Close */ - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if(H5Sclose(srcspace[0]) < 0) - TEST_ERROR - srcspace[0] = -1; - if(H5Sclose(vspace[0]) < 0) - TEST_ERROR - vspace[0] = -1; - if(H5Pclose(dapl) < 0) - TEST_ERROR - dapl = -1; - if(H5Pclose(dcpl) < 0) - TEST_ERROR - dcpl = -1; - - /* - * Test 2: All - all selection with ENV prefix - */ - if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1)) - TEST_ERROR - - /* Create DCPL */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - TEST_ERROR - - /* Set fill value */ - if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) - TEST_ERROR - - /* Set prefix to a nonexistent directory, will be overwritten by environment variable */ - if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) - TEST_ERROR - - if(H5Pset_virtual_prefix(dapl, "someprefix") < 0) - TEST_ERROR - if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) - TEST_ERROR - - if(HDstrcmp(buffer, "someprefix") != 0) - FAIL_PUTS_ERROR("vds prefix not set correctly"); - - /* Create source dataspace */ - if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Create virtual dataspace */ - if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) - TEST_ERROR - - /* Select all (should not be necessary, but just to be sure) */ - if(H5Sselect_all(srcspace[0]) < 0) - TEST_ERROR - if(H5Sselect_all(vspace[0]) < 0) - TEST_ERROR - - /* Add virtual layout mapping */ - if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) - TEST_ERROR - - /* Create virtual file */ - if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - - /* Create source file if requested */ - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - else { - srcfile[0] = vfile; - if(H5Iinc_ref(srcfile[0]) < 0) - TEST_ERROR - } - - /* Create source dataset */ - if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - - /* Create virtual dataset */ - if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) - TEST_ERROR - - /* Populate write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; - - /* Write data directly to source dataset */ - if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Close srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - - if(config & TEST_IO_DIFFERENT_FILE) { - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - } - } - - /* Reopen virtual dataset and file if config option specified */ - if(config & TEST_IO_REOPEN_VIRT) { - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR - if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) - TEST_ERROR - } - - /* Read data through virtual dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) { - TEST_ERROR - } - } - - /* Adjust write buffer */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); - - /* Write data through virtual dataset */ - if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR - - /* Reopen srcdset and srcfile if config option specified */ - if(config & TEST_IO_CLOSE_SRC) { - if(config & TEST_IO_DIFFERENT_FILE) { - HDgetcwd(buffer, 1024); - HDchdir(TMPDIR); - if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - HDchdir(buffer); - } - if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) - TEST_ERROR - } - - /* Read data directly from source dataset */ - HDmemset(rbuf[0], 0, sizeof(rbuf)); - if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) - TEST_ERROR - - /* Verify read data */ - for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) - for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) - if(rbuf[i][j] != buf[i][j]) - TEST_ERROR - - /* Close */ - if(H5Dclose(vdset) < 0) - TEST_ERROR - vdset = -1; - if(H5Dclose(srcdset[0]) < 0) - TEST_ERROR - srcdset[0] = -1; - if(H5Fclose(srcfile[0]) < 0) - TEST_ERROR - srcfile[0] = -1; - if(H5Fclose(vfile) < 0) - TEST_ERROR - vfile = -1; - if(H5Sclose(srcspace[0]) < 0) - TEST_ERROR - srcspace[0] = -1; - if(H5Sclose(vspace[0]) < 0) - TEST_ERROR - vspace[0] = -1; - if(H5Pclose(dapl) < 0) - TEST_ERROR - dapl = -1; - if(H5Pclose(dcpl) < 0) - TEST_ERROR - dcpl = -1; - - if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) - TEST_ERROR - - PASSED(); - return 0; - - error: - H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) - H5Fclose(srcfile[i]); - H5Fclose(vfile); - H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(memspace); - H5Pclose(dcpl); - } H5E_END_TRY; - - if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) - TEST_ERROR - - return 1; -} /* end vds_link_prefix() */ - /*------------------------------------------------------------------------- * Function: test_basic_io @@ -1568,7 +1148,14 @@ test_vds_prefix(unsigned config, hid_t fapl) * pattern-matching file/dataset strings * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Tuesday, March 3, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -1651,12 +1238,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1685,8 +1272,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1700,7 +1287,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1729,7 +1316,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1813,12 +1400,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1854,8 +1441,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1869,7 +1456,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1900,7 +1487,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1949,8 +1536,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1959,7 +1546,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ /* Open v_dset2 */ if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0) @@ -1985,7 +1572,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Only copy to a different file if the source datasets are in a different * file */ @@ -2027,8 +1614,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen copied virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2037,7 +1624,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile2 = -1; if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ /* Open v_dset3 */ if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0) @@ -2063,13 +1650,13 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Close copied virtual file */ if(H5Fclose(vfile2) < 0) TEST_ERROR vfile2 = -1; - } + } /* end if */ /* Close */ if(H5Dclose(srcdset[0]) < 0) @@ -2148,12 +1735,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2195,8 +1782,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2210,7 +1797,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2241,7 +1828,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2336,12 +1923,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2377,8 +1964,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2392,7 +1979,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read first source dataset through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2445,7 +2032,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2544,12 +2131,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2577,7 +2164,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i][j] = buf[2 * i][j]; for(/* j = 13 */; j < 26; j++) evbuf[i][j] = buf[2 * i + 1][j - 13]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2594,7 +2181,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i + 5][j] = buf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) evbuf[i + 5][j] = buf[2 * i + 1][j]; - } + } /* end for */ /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2609,8 +2196,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2624,7 +2211,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2640,7 +2227,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i][j] = evbuf[2 * i][j]; for(/* j = 13 */; j < 26; j++) erbuf[i][j] = evbuf[2 * i + 1][j - 13]; - } + } /* end for */ /* Read second slice */ if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2652,7 +2239,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i + 5][j] = evbuf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) erbuf[i + 5][j] = evbuf[2 * i + 1][j]; - } + } /* end for */ /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2676,7 +2263,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j] = buf[i][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j - 13] = buf[i][j]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2693,7 +2280,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j + 13] = buf[i + 5][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j] = buf[i + 5][j]; - } + } /* end for */ /* Reopen srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2704,7 +2291,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2720,7 +2307,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j] = evbuf[i][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j - 13] = evbuf[i][j]; - } + } /* end for */ /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2732,7 +2319,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j + 13] = evbuf[i + 5][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j] = evbuf[i + 5][j]; - } + } /* end for */ /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2852,12 +2439,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2911,8 +2498,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2926,7 +2513,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2951,7 +2538,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } + } /* end for */ /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2997,7 +2584,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source datasets */ /* Reset rbuf */ @@ -3018,7 +2605,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } + } /* end for */ /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0) @@ -3193,12 +2780,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -3235,8 +2822,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3250,7 +2837,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data through virtual dataset */ /* Reset rbuf */ @@ -3356,7 +2943,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 3) && (j < 6)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -3409,7 +2996,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 6) && (j < 9)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -3627,7 +3214,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read data directly from source dataset */ /* Select hyperslab in memory space */ @@ -3702,19 +3289,32 @@ test_basic_io(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) - H5Fclose(srcfile[i]); - H5Fclose(vfile); - H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(memspace); - H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { + if(srcfile[i] >= 0) + (void)H5Fclose(srcfile[i]); + } /* end for */ + if(vfile >= 0) + (void)H5Fclose(vfile); + if(vfile2 >= 0) + (void)H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); } H5E_END_TRY; return 1; @@ -3727,7 +3327,14 @@ error: * Purpose: Tests VDS with unlimited selections * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Thursday, April 30, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -3840,12 +3447,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -3910,8 +3517,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3925,7 +3532,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3970,11 +3577,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Test H5Pget_virtual_view() */ if(H5Pget_virtual_view(dapl, &virtual_view) < 0) @@ -3994,7 +3601,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4042,11 +3649,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4055,7 +3662,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[0] = 5; @@ -4092,8 +3699,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4107,7 +3714,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4154,11 +3761,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -4172,7 +3779,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4225,11 +3832,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4238,7 +3845,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 5; @@ -4280,8 +3887,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4295,7 +3902,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4357,7 +3964,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -4422,11 +4029,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Shrink to 15 */ dims[1] = 15; @@ -4453,12 +4060,12 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end if */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4472,7 +4079,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4520,11 +4127,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -4559,11 +4166,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try setting extent manually */ /* Grow to 18 */ @@ -4591,11 +4198,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Grow to 20 */ dims[1] = 20; @@ -4621,7 +4228,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < (int)mdims[1]; j++) if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4634,12 +4241,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -4715,12 +4322,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -4785,8 +4392,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4800,7 +4407,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4844,11 +4451,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4862,7 +4469,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4904,11 +4511,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4917,7 +4524,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[1] = 7; @@ -4959,8 +4566,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4974,7 +4581,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5020,11 +4627,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5038,7 +4645,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5089,11 +4696,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5102,7 +4709,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[1] = 10; @@ -5144,8 +4751,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5159,7 +4766,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5221,7 +4828,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -5238,7 +4845,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5290,11 +4897,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -5307,12 +4914,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5407,12 +5014,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5452,7 +5059,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][6 * j] = buf[i][2 * j]; erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5468,7 +5075,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][(6 * j) + 2] = buf[i][2 * j]; erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1]; - } + } /* end for */ /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5489,7 +5096,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][4] = buf[i][0]; erbuf[i][5] = buf[i][1]; - } + } /* end for */ /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5507,8 +5114,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5522,7 +5129,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5566,11 +5173,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5584,7 +5191,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5626,11 +5233,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5639,7 +5246,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[1] = 7; @@ -5676,8 +5283,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5691,7 +5298,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5736,11 +5343,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5754,7 +5361,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5764,7 +5371,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][12] = buf[i][0]; erbuf[i][13] = buf[i][1]; erbuf[i][18] = buf[i][2]; - } + } /* end for */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5808,11 +5415,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5821,7 +5428,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[2] */ dims[1] = 5; @@ -5853,7 +5460,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][10] = buf[i][0]; erbuf[i][11] = buf[i][1]; erbuf[i][16] = buf[i][2]; - } + } /* end for */ /* Close srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5865,8 +5472,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5880,7 +5487,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5925,11 +5532,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5943,7 +5550,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5989,11 +5596,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6002,7 +5609,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[1] = 6; @@ -6033,7 +5640,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][14] = buf[i][0]; erbuf[i][15] = buf[i][1]; - } + } /* end for */ /* Close srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6045,8 +5652,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6060,7 +5667,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6104,11 +5711,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6122,7 +5729,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6164,11 +5771,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now just read middle 2 rows */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -6194,11 +5801,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != 0) TEST_ERROR @@ -6217,12 +5824,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6303,12 +5910,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -6361,8 +5968,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6376,7 +5983,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6422,11 +6029,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6440,7 +6047,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6482,11 +6089,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6495,7 +6102,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[0] */ dims[0] = 5; @@ -6533,8 +6140,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6548,7 +6155,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6594,11 +6201,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6612,7 +6219,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6660,11 +6267,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -6677,12 +6284,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6725,23 +6332,23 @@ error: for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { if(srcdset[i] >= 0) (void)H5Dclose(srcdset[i]); - } + } /* end for */ if(vdset >= 0) (void)H5Dclose(vdset); for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { if(srcfile[i] >= 0) (void)H5Fclose(srcfile[i]); - } + } /* end for */ if(vfile >= 0) (void)H5Fclose(vfile); for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { if(srcspace[i] >= 0) (void)H5Sclose(srcspace[i]); - } + } /* end for */ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(vspace[i] >= 0) (void)H5Sclose(vspace[i]); - } + } /* end for */ if(filespace >= 0) (void)H5Sclose(filespace); if(memspace >= 0) @@ -6878,12 +6485,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6895,7 +6502,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6909,7 +6516,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6995,8 +6602,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7010,7 +6617,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7054,11 +6661,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -7095,8 +6702,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7110,7 +6717,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7150,11 +6757,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try with different selections */ count[0] = 10; @@ -7181,12 +6788,12 @@ test_printf(unsigned config, hid_t fapl) if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end for */ start[1] = 0; /* Now try writing through VDS */ @@ -7222,7 +6829,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Read srcdset[0] */ count[0] = 10; @@ -7324,12 +6931,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -7341,7 +6948,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7355,7 +6962,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7493,14 +7100,14 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7514,7 +7121,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7558,11 +7165,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Test H5Pget_virtual_printf_gap() */ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) @@ -7582,7 +7189,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7634,11 +7241,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 2, reopen file as well if * config option specified */ @@ -7652,7 +7259,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7704,11 +7311,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 3, reopen file as well if * config option specified */ @@ -7722,7 +7329,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7774,11 +7381,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 4, reopen file as well if * config option specified */ @@ -7792,7 +7399,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7844,11 +7451,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -7862,7 +7469,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7908,11 +7515,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -7926,16 +7533,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8008,7 +7615,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8074,7 +7681,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8088,7 +7695,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8132,11 +7739,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8171,7 +7778,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8185,7 +7792,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8229,11 +7836,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8249,7 +7856,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8319,7 +7926,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8385,7 +7992,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8399,7 +8006,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8443,11 +8050,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8482,7 +8089,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8496,7 +8103,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8540,11 +8147,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8560,7 +8167,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8573,7 +8180,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; - } + } /* end if */ /* @@ -8631,12 +8238,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8648,7 +8255,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8662,7 +8269,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8748,8 +8355,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8763,7 +8370,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8807,11 +8414,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8847,8 +8454,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8862,7 +8469,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8906,11 +8513,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -8924,7 +8531,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8971,11 +8578,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9011,8 +8618,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9026,7 +8633,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9070,11 +8677,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9088,7 +8695,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9135,11 +8742,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf_gap set to 1, reopen file as well if * config option specified */ @@ -9153,7 +8760,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9200,11 +8807,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -9218,16 +8825,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -9303,12 +8910,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -9320,7 +8927,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9334,7 +8941,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9430,8 +9037,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9445,7 +9052,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9489,11 +9096,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9507,7 +9114,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9554,11 +9161,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9598,8 +9205,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9613,7 +9220,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9657,11 +9264,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9675,7 +9282,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9721,11 +9328,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9762,8 +9369,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9777,7 +9384,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9821,11 +9428,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9859,11 +9466,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try setting extent manually */ /* Shrink to 12 */ @@ -9889,11 +9496,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Shrink to 10 */ dims[1] = 12; @@ -9918,12 +9525,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end if */ /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9937,7 +9544,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9983,11 +9590,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -10021,11 +9628,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Now try setting extent manually */ /* Grow to 12 */ @@ -10051,11 +9658,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Grow to 15 */ dims[1] = 15; @@ -10080,12 +9687,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } - } + } /* end for */ + } /* end if */ /* Reset dapl */ if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0) @@ -10097,16 +9704,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10163,12 +9770,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -10180,7 +9787,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10194,7 +9801,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10260,8 +9867,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10275,7 +9882,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10319,11 +9926,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Close VDS and reopen with printf gap set to 127, reopen file as well if * config option specified */ @@ -10337,7 +9944,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } + } /* end if */ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -10383,11 +9990,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -10401,12 +10008,12 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10437,19 +10044,32 @@ test_printf(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) - H5Fclose(srcfile[i]); - H5Fclose(vfile); - H5Sclose(srcspace); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(filespace); - H5Sclose(memspace); - H5Pclose(dcpl); - H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { + if(srcfile[i] >= 0) + (void)H5Fclose(srcfile[i]); + } /* end for */ + if(vfile >= 0) + (void)H5Fclose(vfile); + if(srcspace >= 0) + (void)H5Sclose(srcspace); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(filespace >= 0) + (void)H5Sclose(filespace); + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); + if(dapl >= 0) + (void)H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -10463,7 +10083,14 @@ error: * VDS * * Return: Success: 0 + * * Failure: number of errors + * + * Programmer: Neil Fortner + * Friday, August 14, 2015 + * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -10585,12 +10212,12 @@ test_all(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } + } /* end if */ else { srcfile = vfile; if(H5Iinc_ref(srcfile) < 0) TEST_ERROR - } + } /* end if */ /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -10602,7 +10229,7 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10616,7 +10243,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10687,14 +10314,14 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10708,7 +10335,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10754,11 +10381,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10767,7 +10394,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 2; @@ -10802,8 +10429,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10817,7 +10444,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10863,11 +10490,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10907,8 +10534,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10922,7 +10549,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10968,11 +10595,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10981,7 +10608,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 3; @@ -11025,8 +10652,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11040,7 +10667,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11086,11 +10713,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11130,8 +10757,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11145,7 +10772,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11191,11 +10818,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -11204,7 +10831,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Extend srcdset[1] */ dims[0] = 7; @@ -11249,8 +10876,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11264,7 +10891,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11310,11 +10937,11 @@ test_all(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } + } /* end if */ else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } + } /* end for */ /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -11354,8 +10981,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } - } + } /* end if */ + } /* end if */ /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -11369,7 +10996,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } + } /* end if */ /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11421,16 +11048,16 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } + } /* end for */ if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } + } /* end if */ else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } + } /* end if */ if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -11441,12 +11068,12 @@ test_all(unsigned config, hid_t fapl) if(H5Sclose(srcspace[i]) < 0) TEST_ERROR srcspace[i] = -1; - } + } /* end for */ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } + } /* end for */ if(H5Pclose(dcpl) < 0) TEST_ERROR dcpl = -1; @@ -11462,19 +11089,32 @@ test_all(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) - H5Dclose(srcdset[i]); - H5Dclose(vdset); - H5Fclose(srcfile); - H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) - H5Sclose(srcspace[i]); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) - H5Sclose(vspace[i]); - H5Sclose(filespace); - H5Sclose(memspace); - H5Pclose(dcpl); - H5Pclose(srcdcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { + if(srcdset[i] >= 0) + (void)H5Dclose(srcdset[i]); + } /* end for */ + if(vdset >= 0) + (void)H5Dclose(vdset); + if(srcfile >= 0) + (void)H5Fclose(srcfile); + if(vfile >= 0) + (void)H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { + if(srcspace[i] >= 0) + (void)H5Sclose(srcspace[i]); + } /* end for */ + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { + if(vspace[i] >= 0) + (void)H5Sclose(vspace[i]); + } /* end for */ + if(filespace >= 0) + (void)H5Sclose(filespace); + if(memspace >= 0) + (void)H5Sclose(memspace); + if(dcpl >= 0) + (void)H5Pclose(dcpl); + if(srcdcpl >= 0) + (void)H5Pclose(srcdcpl); } H5E_END_TRY; return 1; @@ -11488,6 +11128,10 @@ error: * * Return: Success: 0 * Failure: 1 + * + * Programmer: Dana Robinson + * March 2016 + * *------------------------------------------------------------------------- */ static int @@ -11629,6 +11273,10 @@ test_dapl_values(hid_t fapl_id) * Purpose: Tests datasets with virtual layout * * Return: EXIT_SUCCESS/EXIT_FAILURE + * + * Programmer: Neil Fortner + * Tuesday, February 17, 2015 + * *------------------------------------------------------------------------- */ int @@ -11651,11 +11299,10 @@ main(void) for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); nerrors += test_basic_io(bit_config, fapl); - nerrors += test_vds_prefix(bit_config, fapl); nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); - } + } /* end for */ nerrors += test_dapl_values(fapl); diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 368471c..3addecf 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -72,14 +72,6 @@ f-3.h5 vds-eiger.h5 ) - set (HDF5_REFERENCE_PREFIX_VDS - 1_vds.h5 - 2_vds.h5 - 4_vds.h5 - 5_vds.h5 - vds-percival-unlim-maxmin.h5 - vds-eiger.h5 - ) set (HDF5_ERROR_REFERENCE_VDS ) @@ -88,21 +80,12 @@ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () - foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_VDS}) - get_filename_component(fname "${vds_h5_file}" NAME) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files") - endforeach () foreach (ddl_vds ${HDF5_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () - foreach (ddl_vds ${HDF5_REFERENCE_VDS}) - get_filename_component(fname "${ddl_vds}" NAME) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files") - endforeach () - foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") @@ -151,44 +134,6 @@ endif () endmacro () - macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - if (NOT "${resultcode}" STREQUAL "0") - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") - endif () - if (NOT "${last_vds_test}" STREQUAL "") - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) - endif () - else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_PREFIX-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - add_test ( - NAME H5DUMP_PREFIX-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" - -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects) - endif () - endmacro () - macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -316,15 +261,3 @@ ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5) ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5) endif () - - # Data read with prefix - if (USE_FILTER_DEFLATE) - ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5) - ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) - ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) - ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) - endif () - diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index f25bd98..5df61bb 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -61,17 +61,6 @@ get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files") endforeach () - - foreach (listfiles ${LIST_HDF5_TEST_FILES}) - get_filename_component(fname "${listfiles}" NAME) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") - endforeach () - - foreach (listfiles ${LIST_OTHER_TEST_FILES}) - get_filename_component(fname "${listfiles}" NAME) - HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") - endforeach () - add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -115,43 +104,6 @@ endif () endmacro () - macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") - endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () - add_test ( - NAME H5LS_PREFIX-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - add_test ( - NAME H5LS_PREFIX-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls" - -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" - -D "TEST_ENV_VALUE=\${ORIGIN}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects) - endif () - endmacro () - ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -203,10 +155,3 @@ ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5) ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5) - ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5) - diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls deleted file mode 100644 index 2830d1a..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-1.ls +++ /dev/null @@ -1,14 +0,0 @@ -Opened "vds/prefix/1_vds.h5" with sec2 driver. -vds_dset Dataset {5/Inf, 18/18, 8/8} - Location: 1:800 - Links: 1 - Maps: {6} Source { - 1_a.h5 /source_dset - 1_b.h5 /source_dset - 1_c.h5 /source_dset - 1_d.h5 /source_dset - 1_e.h5 /source_dset - 1_f.h5 /source_dset - } - Storage: 2880 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls deleted file mode 100644 index 5c6f9d3..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-2.ls +++ /dev/null @@ -1,13 +0,0 @@ -Opened "vds/prefix/2_vds.h5" with sec2 driver. -vds_dset Dataset {6/Inf, 8/8, 14/14} - Location: 1:800 - Links: 1 - Maps: {5} Source { - 2_a.h5 /source_dset - 2_b.h5 /source_dset - 2_c.h5 /source_dset - 2_d.h5 /source_dset - 2_e.h5 /source_dset - } - Storage: 2688 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls deleted file mode 100644 index f4c8e78..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-3_1.ls +++ /dev/null @@ -1,14 +0,0 @@ -Opened "vds/prefix/3_1_vds.h5" with sec2 driver. -vds_dset Dataset {5/Inf, 25/25, 8/8} - Location: 1:800 - Links: 1 - Maps: {6} Source { - 1_a.h5 /source_dset - 1_b.h5 /source_dset - 1_c.h5 /source_dset - 1_d.h5 /source_dset - 1_e.h5 /source_dset - 1_f.h5 /source_dset - } - Storage: 4000 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls deleted file mode 100644 index 5a7e2d8..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-3_2.ls +++ /dev/null @@ -1,13 +0,0 @@ -Opened "vds/prefix/3_2_vds.h5" with sec2 driver. -vds_dset Dataset {6/Inf, 13/13, 19/19} - Location: 1:800 - Links: 1 - Maps: {5} Source { - 2_a.h5 /source_dset - 2_b.h5 /source_dset - 2_c.h5 /source_dset - 2_d.h5 /source_dset - 2_e.h5 /source_dset - } - Storage: 5928 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls deleted file mode 100644 index c22d3a4..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-4.ls +++ /dev/null @@ -1,9 +0,0 @@ -Opened "vds/prefix/4_vds.h5" with sec2 driver. -vds_dset Dataset {9/Inf, 4/4, 4/4} - Location: 1:800 - Links: 1 - Maps: {1} Source { - 4_%b.h5 /source_dset - } - Storage: 576 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls deleted file mode 100644 index efba8dc..0000000 --- a/tools/test/h5ls/vds_prefix/tvds-5.ls +++ /dev/null @@ -1,11 +0,0 @@ -Opened "vds/prefix/5_vds.h5" with sec2 driver. -vds_dset Dataset {9/Inf, 4/4, 4/4} - Location: 1:800 - Links: 1 - Maps: {3} Source { - 5_a.h5 /source_dset - 5_b.h5 /source_dset - 5_c.h5 /source_dset - } - Storage: 576 logical bytes, 0 allocated bytes - Type: 32-bit little-endian integer -- cgit v0.12 From 718006f8606f784ab7795ce5e50281fe318abadc Mon Sep 17 00:00:00 2001 From: lrknox Date: Sat, 23 Dec 2017 20:46:01 -0600 Subject: Increase maximum number of retries for h5watch tests. --- hl/tools/h5watch/testh5watch.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 05e66bf..7514281 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -44,7 +44,7 @@ GEN_TEST=h5watchgentest # Generate HDF5 file with various datasets GEN_TEST_BIN=`pwd`/$GEN_TEST # Path of the binary GEN_TEST WATCHFILE=`pwd`/WATCH.h5 # The HDF5 file generated to test h5watch TESTFILE=TEST.h5 # The temporary file (a copy of WATCH.h5) used by tests -TRY_MAX=10 # Try running the test again +TRY_MAX=20 # Try running the test again # # These 3 defines should be the same as the defines in ./extend_dset.c WRITER_MESSAGE=writer_message # The message file created by the "extend" process -- cgit v0.12 From 732074d47e02c2e01fe794351c681d64b93a5f47 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Dec 2017 17:00:24 -0600 Subject: Add library INTERFACE and MPI to tools --- c++/src/CMakeLists.txt | 4 ++-- hl/c++/src/CMakeLists.txt | 12 ++---------- hl/fortran/src/CMakeLists.txt | 8 ++++---- hl/src/CMakeLists.txt | 4 ++-- java/src/jni/CMakeLists.txt | 2 +- test/CMakeLists.txt | 18 ++++++++++-------- testpar/CMakeLists.txt | 10 ++++++++-- tools/lib/CMakeLists.txt | 10 ++++++++-- 8 files changed, 37 insertions(+), 31 deletions(-) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index b147cfa..3b9a0c3 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -82,7 +82,7 @@ set (CPP_HDRS add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC) set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES @@ -94,7 +94,7 @@ set (install_targets ${HDF5_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIBSH_TARGET} ${HDF5_CPP_LIB_NAME} SHARED ${HDF5_CXX_PACKAGE_SOVERSION}) set_target_properties (${HDF5_CPP_LIBSH_TARGET} PROPERTIES diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 38604cd..70f0a79 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -12,11 +12,7 @@ set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC " " " ") -target_link_libraries ( - ${HDF5_HL_CPP_LIB_TARGET} - ${HDF5_HL_LIB_TARGET} - ${HDF5_LIB_TARGET} -) +target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES @@ -28,11 +24,7 @@ set (install_targets ${HDF5_HL_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED " " " ") - target_link_libraries ( - ${HDF5_HL_CPP_LIBSH_TARGET} - ${HDF5_HL_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} - ) + target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_HL_CPP_LIB_NAME} SHARED ${HDF5_HL_CXX_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_CPP_LIBSH_TARGET} PROPERTIES diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index c870aed..3fc66c4 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -77,7 +77,7 @@ set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) +target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES @@ -90,7 +90,7 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) + target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_HL_F90_C_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_F90_C_LIBSH_TARGET} PROPERTIES @@ -170,7 +170,7 @@ endif () add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES @@ -194,7 +194,7 @@ if (BUILD_SHARED_LIBS) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def") endif () TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) - target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) + target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 86472fb..3dd6ce8 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -31,7 +31,7 @@ set (HL_HEADERS add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl @@ -43,7 +43,7 @@ set (install_targets ${HDF5_HL_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED ${HDF5_HL_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 9e6c099..10d1b6d 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -51,7 +51,7 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) ########### JNI libraries always must be built shared ############### add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS}) TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED " " " ") -target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_JAVA_JNI_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fca864b..6e8fd78 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -32,12 +32,13 @@ set (TEST_LIB_HEADERS add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) - target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") + target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "ws2_32.lib") endif () if (MINGW) - target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") + target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test @@ -48,12 +49,13 @@ if (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib") + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "ws2_32.lib") endif () if (MINGW) - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test @@ -97,7 +99,7 @@ endif () add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) @@ -123,7 +125,7 @@ endif () add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index b116d66..997d1a1 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -30,14 +30,20 @@ set (testphdf5_SOURCES add_executable (testphdf5 ${testphdf5_SOURCES}) TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") -target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) +if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (testphdf5 PRIVATE ${MPI_C_LIBRARIES}) +endif () set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${file} PRIVATE ${MPI_C_LIBRARIES}) + endif () set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index ade7671..0fc1981 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -39,7 +39,10 @@ set (H5_TOOLS_LIB_HDRS add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) +if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES}) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC) set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES @@ -52,7 +55,10 @@ set (install_targets ${HDF5_TOOLS_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED ${HDF5_TOOLS_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES -- cgit v0.12 From bd34c9e455988ab1d4e550ff16c0410b5624298a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 28 Dec 2017 16:49:50 -0600 Subject: HDFFV-9724 Corrected files and verified tests --- CMakeLists.txt | 4 +- MANIFEST | 6 + config/cmake_ext_mod/FindMPI.cmake | 287 +++--- config/cmake_ext_mod/runTest.cmake | 1 + examples/CMakeLists.txt | 4 +- java/src/hdf/hdf5lib/H5.java | 197 +++- java/src/hdf/hdf5lib/HDF5Constants.java | 3 + java/src/hdf/overview.html | 6 +- java/src/jni/h5Constants.c | 2 + java/src/jni/h5pImp.c | 211 +++++ java/src/jni/h5pImp.h | 73 +- java/test/JUnit-interface.txt | 9 +- java/test/TestH5P.java | 53 +- java/test/TestH5Pfapl.java | 14 + java/test/TestH5Pvirtual.java | 33 + release_docs/RELEASE.txt | 32 +- src/CMakeLists.txt | 10 +- src/H5Dint.c | 78 +- src/H5Dpkg.h | 3 +- src/H5Dprivate.h | 11 +- src/H5Dvirtual.c | 271 +++++- src/H5Fprivate.h | 420 ++++----- src/H5Fquery.c | 2 +- src/H5Pdapl.c | 366 ++++++++ src/H5Pfapl.c | 938 +++++++++---------- src/H5Ppublic.h | 2 + src/H5system.c | 2 +- test/CMakeLists.txt | 12 +- test/CMakeTests.cmake | 76 +- test/vds.c | 1538 +++++++++++++++++++------------ tools/test/h5dump/CMakeTestsVDS.cmake | 67 ++ tools/test/h5ls/CMakeTestsVDS.cmake | 55 ++ tools/test/h5ls/vds_prefix/tvds-1.ls | 14 + tools/test/h5ls/vds_prefix/tvds-2.ls | 13 + tools/test/h5ls/vds_prefix/tvds-3_1.ls | 14 + tools/test/h5ls/vds_prefix/tvds-3_2.ls | 13 + tools/test/h5ls/vds_prefix/tvds-4.ls | 9 + tools/test/h5ls/vds_prefix/tvds-5.ls | 11 + 38 files changed, 3347 insertions(+), 1513 deletions(-) create mode 100644 tools/test/h5ls/vds_prefix/tvds-1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_1.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-3_2.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-4.ls create mode 100644 tools/test/h5ls/vds_prefix/tvds-5.ls diff --git a/CMakeLists.txt b/CMakeLists.txt index e22ac2e..d4e6300 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -631,6 +631,7 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS}) else () message (STATUS "Parallel libraries not found") endif () @@ -639,7 +640,6 @@ endif () # Parallel IO usage requires MPI to be Linked and Included if (H5_HAVE_PARALLEL) set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_C_LIBRARIES}) if (MPI_C_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") endif () @@ -864,7 +864,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) set (LINK_Fortran_LIBS ${LINK_LIBS}) - set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS}) if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) @@ -875,7 +874,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for # Parallel IO usage requires MPI to be Linked and Included if (H5_HAVE_PARALLEL) set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES}) - set (LINK_Fortran_SHARED_LIBS ${LINK_Fortran_SHARED_LIBS} ${MPI_Fortran_LIBRARIES}) if (MPI_Fortran_LINK_FLAGS) set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") endif () diff --git a/MANIFEST b/MANIFEST index 9b91c78..c6c7b3c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1430,6 +1430,12 @@ ./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in +./tools/test/h5ls/vds_prefix/tvds-1.ls +./tools/test/h5ls/vds_prefix/tvds-2.ls +./tools/test/h5ls/vds_prefix/tvds-3_1.ls +./tools/test/h5ls/vds_prefix/tvds-3_2.ls +./tools/test/h5ls/vds_prefix/tvds-4.ls +./tools/test/h5ls/vds_prefix/tvds-5.ls # h5copy sources ./tools/src/h5copy/Makefile.am diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 8084472..d01dd35 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -347,7 +347,7 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) # library that has invalid or missing version information there would be warning # messages emitted by ld.so in the compiler output. In either case, we'll treat # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") set(WRAPPER_RETURN 255) endif() # Ensure that no error output might be passed upwards. @@ -615,6 +615,16 @@ function (_MPI_interrogate_compiler lang) endif() endif() + if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") + endif() + if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_EXTRA_LIB_NAMES) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") + endif() + # If we found MPI, set up all of the appropriate cache entries if(NOT MPI_${LANG}_COMPILE_OPTIONS) set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) @@ -823,33 +833,43 @@ endfunction() macro(_MPI_assemble_libraries LANG) set(MPI_${LANG}_LIBRARIES "") - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() + # Only for libraries do we need to check whether the compiler's linking stage is separate. + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() + endif() endmacro() macro(_MPI_assemble_include_dirs LANG) - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_${LANG}_INCLUDE_DIRS "") + else() + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") + endforeach() endif() endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") - endforeach() - endif() endmacro() function(_MPI_split_include_dirs LANG) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + return() + endif() # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") @@ -885,6 +905,13 @@ function(_MPI_split_include_dirs LANG) endif() mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) endif() + # Remove duplicates and default system directories from the list. + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) + endforeach() + endif() set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() @@ -1014,7 +1041,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") # FreeBSD ships mpich under the normal system paths - but available openmpi implementations # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi/") + MPI_search_mpi_prefix_folder("/usr/local/mpi") endif() # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. @@ -1050,48 +1077,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE # # Once we find the new variables, we translate them back into their old # equivalents below. -foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - if(MPI_${LANG}_COMPILE_FLAGS) - unset(MPI_${LANG}_COMPILE_OPTIONS) - unset(MPI_${LANG}_COMPILE_DEFINITIONS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") +if(NOT MPI_IGNORE_LEGACY_VARIABLES) + foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") endif() endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - # If a list of libraries was given, we'll split it into new-style cache variables - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - endif() -endforeach() + # Chop the old compile flags into options and definitions + + unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + if(MPI_${LANG}_COMPILE_FLAGS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + unset(MPI_${LANG}_EXTRA_LIB_NAMES) + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + if(_MPI_LIB) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endif() + endforeach() + endif() + endforeach() +endif() #============================================================================= unset(MPI_VERSION) @@ -1100,6 +1133,11 @@ unset(MPI_VERSION_MINOR) unset(_MPI_MIN_VERSION) +# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. +if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) +endif() + # This loop finds the compilers and sends them off for interrogation. foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) @@ -1121,6 +1159,8 @@ foreach(LANG IN ITEMS C CXX Fortran) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + set(MPI_${LANG}_TRIED_IMPLICIT FALSE) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. # Cray PrgEnv. @@ -1130,80 +1170,90 @@ foreach(LANG IN ITEMS C CXX Fortran) # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. if(MPI_${LANG}_WORKS) set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) endif() + set(MPI_${LANG}_TRIED_IMPLICIT TRUE) endif() - # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. - if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) - endif() - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + endif() + + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - else() - set(MPI_PINNED_COMPILER FALSE) - endif() - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) - endif() - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_SKIP_GUESSING TRUE) - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_PINNED_COMPILER TRUE) + + # If we haven't made the implicit compiler test yet, perform it now. + if(NOT MPI_${LANG}_TRIED_IMPLICIT) + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + endif() + + # Should the MPI compiler not work implicitly for MPI, still interrogate it. + # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used + # directly during linkage instead of CMAKE__COMPILER will not work. + if(NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) + endif() + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + endif() endif() - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - endif() - if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - set(MPI_${LANG}_WRAPPER_FOUND TRUE) - elseif(NOT MPI_SKIP_GUESSING) - _MPI_guess_settings(${LANG}) + if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + else() + _MPI_guess_settings(${LANG}) + endif() endif() endif() endif() _MPI_split_include_dirs(${LANG}) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - endif() + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + _MPI_adjust_compile_definitions(${LANG}) # We always create imported targets even if they're empty _MPI_create_imported_target(${LANG}) @@ -1217,7 +1267,9 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + endif() mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) @@ -1337,7 +1389,7 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) unset(MPI_${LANG}_REQUIRED_VARS) - if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) + if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") endforeach() @@ -1448,6 +1500,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() +set(MPI_IGNORE_LEGACY_VARIABLES TRUE) #============================================================================= # unset these vars to cleanup namespace diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 2479728..5569a73 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -55,6 +55,7 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") + #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") endif () if (NOT TEST_INPUT) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d8eb1a2..04a99ce 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") - target_link_libraries (ph5example ${HDF5_LIB_TARGET}) + target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") - target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) + target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) endif () endif () diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 7b5b5c9..78ebbe2 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4451,7 +4451,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - // Generic property list routines + // /////// Generic property list routines /////// /** * H5Pget_class_name retrieves the name of a generic property list class @@ -4767,7 +4767,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; - // Object creation property list (OCPL) routines + // /////// Object creation property list (OCPL) routines /////// /** * H5Pget_attr_phase_change retrieves attribute storage phase change thresholds. @@ -5071,7 +5071,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; - // File creation property list (FCPL) routines + // /////// File creation property list (FCPL) routines /////// /** * H5Pget_userblock retrieves the size of a user block in a file creation property list. @@ -5480,7 +5480,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, IllegalArgumentException; - // File access property list (FAPL) routines + // /////// File access property list (FAPL) routines /////// /** * H5Pget_alignment retrieves the current settings for alignment properties from a file access property list. @@ -5860,6 +5860,37 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts) throws HDF5LibraryException; + /** + * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object + * will be evicted from the library's metadata cache when it is closed. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return indication if the object will be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_evict_on_close(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object. + * + * @param fapl_id + * IN: File access property list identifier + * @param evict_on_close + * IN: Whether the HDF5 object should be evicted on close. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) + throws HDF5LibraryException; + // Dataset creation property list (DCPL) routines // /** @@ -6066,6 +6097,36 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException; +// ///// unimplemented ///// +// /** +// * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * +// * @return VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException; +// +// /** +// * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache. +// * +// * @param fapl_id +// * IN: File access property list identifier +// * @param efc_size +// * IN: VDS link open file cache size in number of files. +// * +// * @exception HDF5LibraryException +// * - Error from the HDF-5 Library. +// * +// **/ +// public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size) +// throws HDF5LibraryException; + /** * H5Pget_external returns information about an external file. * @@ -6285,7 +6346,37 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, NullPointerException; - // Dataset access property list (DAPL) routines // + // /////// Dataset creation property list (DCPL) routines /////// + + /** + * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. + * + * @param dcpl_id + * IN: Dataset creation property list identifier + * @param opts + * IN: Edge chunk option flag. Valid values are: + * H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks. + * 0 - Disables option; partial edge chunks will be compressed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException; + + /** + * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list . + * + * @param dcpl_id + * IN: Dataset creation property list + + * @return The edge chunk option setting. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library + **/ + public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException; + + // /////// Dataset access property list (DAPL) routines /////// /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6388,12 +6479,76 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException; + /** + * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to virtual file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_virtual_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to virtual file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Pget_efile_prefix Retrieves prefix applied to external file paths. + * + * @param dapl_id + * IN: Link access property list identifier + * + * @return the prefix to be applied to external file paths. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native String H5Pget_efile_prefix(long dapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_efile_prefix Sets prefix to be applied to external file paths. + * + * @param dapl_id + * IN: Dataset access property list identifier + * @param prefix + * IN: Prefix to be applied to external file paths + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - prefix is null. + * + **/ + public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix) + throws HDF5LibraryException, NullPointerException; + // public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; // public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException; - // Dataset xfer property list (DXPL) routines // + // /////// Dataset xfer property list (DXPL) routines /////// /** * H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property @@ -6544,7 +6699,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; - // Link creation property list (LCPL) routines // + // /////// Link creation property list (LCPL) routines /////// /** * H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate @@ -6579,7 +6734,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group) throws HDF5LibraryException; - // Group creation property list (GCPL) routines // + // /////// Group creation property list (GCPL) routines /////// /** * H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups. @@ -6736,14 +6891,14 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags) throws HDF5LibraryException; - // String creation property list (STRCPL) routines // + // /////// String creation property list (STRCPL) routines /////// public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; - // Link access property list (LAPL) routines // + // /////// Link access property list (LAPL) routines /////// /** * H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the @@ -6896,7 +7051,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException, IllegalArgumentException; - // Object copy property list (OCPYPL) routines // + // /////// Object copy property list (OCPYPL) routines /////// /** * H5Pget_copy_object retrieves the properties to be used when an object is copied. @@ -6927,7 +7082,7 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) throws HDF5LibraryException; - // Other/Older property list routines // + // /////// Other/Older property list routines /////// /** * H5Pget_version retrieves the version information of various objects for a file creation property list. @@ -6955,7 +7110,7 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - // file drivers property list routines // + // /////// file drivers property list routines /////// public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; @@ -7102,20 +7257,28 @@ public class H5 implements java.io.Serializable { // File creation property list (FCPL) routines // // File access property list (FAPL) routines // - // herr_t H5Pset_driver( hid_t plist_id, hid_t new_driver_id, const void *new_driver_info ) - // const void *H5Pget_driver_info( hid_t plist_id ) - // herr_t H5Pget_multi_type ( hid_t fapl_id, H5FD_mem_t *type ) - // herr_t H5Pset_multi_type ( hid_t fapl_id, H5FD_mem_t type ) + // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) + // const void *H5Pget_driver_info(hid_t plist_id) + // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) + // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) // herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); // herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); // herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); + // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); + // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); + // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective); + // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); + // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); + // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); // Dataset creation property list (DCPL) routines // // Dataset access property list (DAPL) routines // + // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data); + // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data) // Dataset xfer property list (DXPL) routines // // herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg); diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 8a3d6c8..3e43ba2 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -88,6 +88,7 @@ public class HDF5Constants { public static final int H5D_VDS_ERROR = H5D_VDS_ERROR(); public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING(); public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); + public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); public static final int H5E_MAJOR = H5E_MAJOR(); public static final int H5E_MINOR = H5E_MINOR(); @@ -768,6 +769,8 @@ public class HDF5Constants { private static native final int H5D_VDS_LAST_AVAILABLE(); + private static native final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); + private static native final long H5E_ALIGNMENT(); private static native final long H5E_ALREADYEXISTS(); diff --git a/java/src/hdf/overview.html b/java/src/hdf/overview.html index 39d75b7..9c19442 100644 --- a/java/src/hdf/overview.html +++ b/java/src/hdf/overview.html @@ -47,20 +47,20 @@ which has a method: The native method is implemented in C using the Java Native Method Interface (JNI). This is written something like the following: -
JNIEXPORT jint
+
JNIEXPORT jlong
 JNICALL Java_hdf_hdf5lib_H5_H5Fopen
 (
  JNIEnv *env,
  jclass class,
  jstring hdfFile,
  jint flags,
- jint access)
+ jlong access)
  {
 
  /* ...convert Java String to (char *) */
 
  /* call the HDF library */
- retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );
+ retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access);
 
  /* ... */
 }
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index f6f8bfa..5a4b53e 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -140,6 +140,8 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1DONT_1FILTER_1PARTIAL_1CHUNKS(JNIEnv *env, jclass cls) { return H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index dcfcd82..cf27341 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5733,6 +5733,217 @@ Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_virtual_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_virtual_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_virtual_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_virtual_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +{ + herr_t retVal = -1; + const char *aName; + + PIN_JAVA_STRING(prefix, aName); + if (aName != NULL) { + retVal = H5Pset_efile_prefix((hid_t)dapl_id, aName); + + UNPIN_JAVA_STRING(prefix, aName); + + if(retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix + (JNIEnv *env, jclass clss, jlong dapl_id) +{ + size_t size = 0; + char *pre; + jlong prefix_size = -1; + jstring str = NULL; + + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)NULL, size); + if(prefix_size < 0) { + h5libraryError(env); + } /* end if */ + else { + size = (size_t)prefix_size + 1;/* add extra space for the null terminator */ + pre = (char*)HDmalloc(sizeof(char)*size); + if (pre == NULL) { + h5outOfMemory(env, "H5Pget_efile_prefix: malloc failed "); + } /* end if */ + else { + prefix_size = (jlong)H5Pget_efile_prefix((hid_t)dapl_id, (char*)pre, size); + + if (prefix_size >= 0) { + str = ENVPTR->NewStringUTF(ENVPAR pre); + HDfree(pre); + if (str == NULL) + h5JNIFatalError( env, "H5Pget_efile_prefix: return string not allocated"); + } /* end if */ + else { + HDfree(pre); + h5libraryError(env); + } /* end else */ + } /* end else */ + } /* end else */ + + return (jstring)str; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id, jboolean evict_on_close) +{ + herr_t retVal = -1; + hbool_t evict_on_close_val; + + if (evict_on_close == JNI_TRUE) + evict_on_close_val = TRUE; + else + evict_on_close_val = FALSE; + + retVal = H5Pset_evict_on_close((hid_t)fapl_id, (hbool_t)evict_on_close_val); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t evict_on_close_val = FALSE; + jboolean bval = JNI_FALSE; + + if (H5Pget_evict_on_close((hid_t)fapl_id, (hbool_t *)&evict_on_close_val) < 0) { + h5libraryError(env); + } /* end if */ + else { + if (evict_on_close_val == TRUE) + bval = JNI_TRUE; + } /* end else */ + + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id, jint opts) +{ + herr_t retVal = -1; + + retVal = H5Pset_chunk_opts((hid_t)dcpl_id, (unsigned)opts); + if (retVal < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts + (JNIEnv *env, jclass clss, jlong dcpl_id) +{ + unsigned opts = 0; + + if (H5Pget_chunk_opts((hid_t)dcpl_id, opts) < 0) + h5libraryError(env); + + return (jint)opts; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index d413f69..1d12e3d 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1533,7 +1533,6 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts (JNIEnv *, jclass, jlong); - /* * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts @@ -1543,6 +1542,78 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts (JNIEnv *, jclass, jlong, jlong); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_virtual_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_virtual_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_efile_prefix + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix +(JNIEnv *, jclass, jlong, jstring); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_efile_prefix + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_evict_on_close + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close +(JNIEnv *, jclass, jlong, jboolean); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_evict_on_close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close +(JNIEnv *, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_chunk_opts + * Signature: (JI)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts +(JNIEnv *, jclass, jlong, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_chunk_opts + * Signature: (J)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts +(JNIEnv *, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index ab2f3b1..91ea286 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -415,6 +415,7 @@ JUnit version 4.11 .testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue .testH5P_layout .testH5Pget_link_creation_order +.testH5Pget_efile_prefix .testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes .testH5P_file_space_page_size .testH5Pget_shared_mesg_index_Invalid_indexnum @@ -444,6 +445,7 @@ JUnit version 4.11 .testH5Pset_est_link_info_InvalidValues .testH5Pset_local_heap_size_hint .testH5Pget_est_link_info +.testH5Pset_efile_prefix_null .testH5Pset_scaleoffset .testH5Pset_create_intermediate_group_invalidobject .testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue @@ -466,6 +468,7 @@ JUnit version 4.11 .testH5Pget_sym_k_null .testH5Pset_nlinks .testH5P_obj_track_times +.testH5Pset_efile_prefix .testH5P_userblock .testH5Pget_local_heap_size_hint .testH5Pset_shared_mesg_index_Invalid_indexnum @@ -504,6 +507,7 @@ JUnit version 4.11 .testH5Pset_mdc_config .testH5P_small_data_block_size .testH5Pset_fapl_log +.testH5P_evict_on_close .testH5Pset_libver_bounds .testH5P_sieve_buf_size .testH5P_elink_file_cache_size @@ -530,11 +534,14 @@ JUnit version 4.11 .testH5Pget_source_datasetname .testH5Pvirtual_storage .testH5Pget_selection_source_dataset +.testH5Pget_virtual_prefix .testH5Pget_source_filename .testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count +.testH5Pset_virtual_prefix .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters +.testH5Pset_virtual_prefix_null .testH5P_genprop_basic_class .testH5P_genprop_class_iter .testH5P_genprop_basic_class_prop @@ -640,7 +647,7 @@ JUnit version 4.11 Time: XXXX -OK (638 tests) +OK (645 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 5aafb5b..9e45e4c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -28,6 +28,7 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; @@ -852,7 +853,7 @@ public class TestH5P { } catch (Throwable err) { err.printStackTrace(); - fail("H5Pset_est_link_info: " + err); + fail("H5Pset_elink_prefix: " + err); } assertTrue("H5Pset_elink_prefix", ret_val >= 0); } @@ -1232,4 +1233,54 @@ public class TestH5P { fail("testH5P_file_space_page_size: " + err); } } + + @Test + public void testH5Pset_efile_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_efile_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_efile_prefix_null() throws Throwable{ + H5.H5Pset_efile_prefix(lapl_id, null); + } + + @Test + public void testH5Pget_efile_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_efile_prefix(lapl_id, prefix); + pre = H5.H5Pget_efile_prefix(lapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_efile_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } + + @Ignore + public void testH5P_chunk_opts() { + int chunk_opts = -1; + + try { + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == 0); + H5.H5Pset_chunk_opts(ocpl_id, HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + chunk_opts = H5.H5Pget_chunk_opts(ocpl_id); + assertTrue("chunk_opts: "+chunk_opts, chunk_opts == HDF5Constants.H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_lchunk_opts: " + err); + } + } } diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index d4a2231..48a5986 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1376,4 +1376,18 @@ public class TestH5Pfapl { deleteH5file(); _deleteLogFile(); } + + @Test + public void testH5P_evict_on_close() { + boolean ret_val_id = false; + try { + H5.H5Pset_evict_on_close(fapl_id, true); + ret_val_id = H5.H5Pget_evict_on_close(fapl_id); + assertTrue("H5P_evict_on_close", ret_val_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_evict_on_close: " + err); + } + } } diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 40cfbac..ff2e4dc 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -429,4 +429,37 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } } + + @Test + public void testH5Pset_virtual_prefix() { + String prefix = "tmp"; + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pset_virtual_prefix: " + err); + } + } + + @Test(expected = NullPointerException.class) + public void testH5Pset_virtual_prefix_null() throws Throwable{ + H5.H5Pset_virtual_prefix(H5dapl_id, null); + } + + @Test + public void testH5Pget_virtual_prefix() { + String prefix = "tmp"; + String pre = ""; + + try { + H5.H5Pset_virtual_prefix(H5dapl_id, prefix); + pre = H5.H5Pget_virtual_prefix(H5dapl_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5Pget_virtual_prefix: " + err); + } + assertTrue("The prefix: ", prefix.equals(pre)); + } } diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7498d01..3882c4c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -58,7 +58,21 @@ New Features Library: -------- - - + - Add prefix option to VDS files. + + Currently, VDS source files must be in the active directory to be + found by the virtual file. Adding the option of a prefix to be set + on the virtual file, using a data access property list (DAPL), + allows the source files to located at an absolute or relative path + to the virtual file. + + New public APIs: + herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); + ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); + The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. + + (ADB - 2017/12/12, HDFFV-9724) + Parallel Library: ----------------- @@ -119,6 +133,20 @@ New Features ------------ - + Java Library: + ---------------- + - Wrappers added for the following APIs: + H5Pset_evict_on_close + H5Pget_evict_on_close + H5Pset_chunk_opts + H5Pget_chunk_opts + H5Pset_efile_prefix + H5Pget_efile_prefix + H5Pset_virtual_prefix + H5Pget_virtual_prefix + + (ADB - 2017/12/20) + Tools: ------ - h5diff @@ -213,7 +241,7 @@ Bug Fixes since HDF5-1.10.1 release CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. - Reworked the CMake MPI code to properly create CMake targets.Also merged + Reworked the CMake MPI code to properly create CMake targets. Also merged the latest CMake FindMPI.cmake changes to the local copy. This is necessary until HDF changes the CMake minimum to 3.9 or greater. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b163b8a..0552244 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -885,10 +885,7 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HE TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) -endif () -if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -929,10 +926,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) - endif () - if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) diff --git a/src/H5Dint.c b/src/H5Dint.c index b6c0341..bfe1497 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -61,8 +61,8 @@ static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, - char **extfile_prefix); +static herr_t H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type, + char **file_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); @@ -963,24 +963,25 @@ done: } /* end H5D__update_oh_info() */ + /*-------------------------------------------------------------------------- - * Function: H5D_build_extfile_prefix + * Function: H5D_build_file_prefix * - * Purpose: Determine the external file prefix to be used and store - * it in extfile_prefix. Stores an empty string if no prefix + * Purpose: Determine the file prefix to be used and store + * it in file_prefix. Stores an empty string if no prefix * should be used. * * Return: SUCCEED/FAIL *-------------------------------------------------------------------------- */ static herr_t -H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) +H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ - char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ - size_t extpath_len; /* length of extpath */ + char *filepath = NULL; /* absolute path of directory the HDF5 file is in */ + size_t filepath_len; /* length of file path */ size_t prefix_len; /* length of prefix */ - size_t extfile_prefix_len; /* length of expanded prefix */ + size_t file_prefix_len; /* length of expanded prefix */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -990,20 +991,25 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix HDassert(dset); HDassert(dset->oloc.file); - extpath = H5F_EXTPATH(dset->oloc.file); - HDassert(extpath); + filepath = H5F_EXTPATH(dset->oloc.file); + HDassert(filepath); /* XXX: Future thread-safety note - getenv is not required * to be reentrant. */ - prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_VDS_PREFIX"); + else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0) + prefix = HDgetenv("HDF5_EXTFILE_PREFIX"); + else + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible") if(prefix == NULL || *prefix == '\0') { - /* Set prefix to value of H5D_ACS_EFILE_PREFIX_NAME property */ + /* Set prefix to value of prefix_type property */ if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file prefix") + if(H5P_peek(plist, prefix_type, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix") } /* end if */ /* Prefix has to be checked for NULL / empty string again because the @@ -1013,29 +1019,29 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /* filename is interpreted as relative to the current directory, * does not need to be expanded */ - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(""))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(""))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ else { if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) { /* Replace ${ORIGIN} at beginning of prefix by directory of HDF5 file */ - extpath_len = HDstrlen(extpath); + filepath_len = HDstrlen(filepath); prefix_len = HDstrlen(prefix); - extfile_prefix_len = extpath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; + file_prefix_len = filepath_len + prefix_len - HDstrlen("${ORIGIN}") + 1; - if(NULL == (*extfile_prefix = (char *)H5MM_malloc(extfile_prefix_len))) + if(NULL == (*file_prefix = (char *)H5MM_malloc(file_prefix_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") - HDsnprintf(*extfile_prefix, extfile_prefix_len, "%s%s", extpath, prefix + HDstrlen("${ORIGIN}")); + HDsnprintf(*file_prefix, file_prefix_len, "%s%s", filepath, prefix + HDstrlen("${ORIGIN}")); } /* end if */ else { - if(NULL == (*extfile_prefix = (char *)H5MM_strdup(prefix))) + if(NULL == (*file_prefix = (char *)H5MM_strdup(prefix))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end else */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_extfile_prefix() */ +} /* H5D_build_file_prefix() */ /*------------------------------------------------------------------------- @@ -1217,9 +1223,13 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Set the vds file prefix */ + if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Add the dataset to the list of opened objects in the file */ if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count") @@ -1265,6 +1275,7 @@ done: if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix); + new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix); new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared); } /* end if */ new_dset->oloc.file = NULL; @@ -1351,6 +1362,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; char *extfile_prefix = NULL; /* Expanded external file prefix */ + char *vds_prefix = NULL; /* Expanded vds prefix */ H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1371,9 +1383,13 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") + /* Get the vds prefix */ + if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix") + /* Check if dataset was already open */ if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) { /* Clear any errors from H5FO_opened() */ @@ -1399,6 +1415,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* Prevent string from being freed during done: */ extfile_prefix = NULL; + /* Set the vds file prefix */ + dataset->shared->vds_prefix = vds_prefix; + /* Prevent string from being freed during done: */ + vds_prefix = NULL; + } /* end if */ else { /* Point to shared info */ @@ -1430,12 +1451,14 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) done: extfile_prefix = (char *)H5MM_xfree(extfile_prefix); + vds_prefix = (char *)H5MM_xfree(vds_prefix); if(ret_value == NULL) { /* Free the location--casting away const*/ if(dataset) { if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); } @@ -1818,6 +1841,9 @@ H5D_close(H5D_t *dataset) /* Free the external file prefix */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); + /* Free the vds file prefix */ + dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix); + /* Release layout, fill-value, efl & pipeline messages */ if(dataset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) free_failed |= (H5O_msg_reset(H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline) < 0) || @@ -3360,6 +3386,10 @@ H5D_get_access_plist(H5D_t *dset) if(H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap") + /* Set the vds prefix option */ + if(H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vds prefix") + /* Set the external file prefix option */ if(H5P_set(new_plist, H5D_ACS_EFILE_PREFIX_NAME, &(dset->shared->extfile_prefix)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file prefix") diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 542abd0..45f2d3a 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -476,6 +476,7 @@ typedef struct H5D_shared_t { H5D_append_flush_t append_flush; /* Append flush property information */ char *extfile_prefix; /* expanded external file prefix */ + char *vds_prefix; /* expanded vds prefix */ } H5D_shared_t; struct H5D_t { @@ -598,7 +599,7 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ -H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index fb994d8..ed13467 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -47,12 +47,13 @@ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" /* External file list */ /* ======== Dataset access property names ======== */ -#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ -#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ -#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ -#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ +#define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ +#define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ +#define H5D_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ +#define H5D_ACS_VDS_VIEW_NAME "vds_view" /* VDS view option */ #define H5D_ACS_VDS_PRINTF_GAP_NAME "vds_printf_gap" /* VDS printf gap size */ -#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ +#define H5D_ACS_VDS_PREFIX_NAME "vds_prefix" /* VDS file prefix */ +#define H5D_ACS_APPEND_FLUSH_NAME "append_flush" /* Append flush actions */ #define H5D_ACS_EFILE_PREFIX_NAME "external file prefix" /* External file prefix */ /* ======== Data transfer properties ======== */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3be2353..8d861c9 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -55,6 +55,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ +#include "H5Pprivate.h" /* Property Lists */ #include "H5Sprivate.h" /* Dataspaces */ @@ -731,6 +732,255 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_delete */ + +/*-------------------------------------------------------------------------- + * Function: H5D__virtual_build_name + * + * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME + * + * Return: Non-negative on success/Negative on failure + *--------------------------------------------------------------------------*/ +static herr_t +H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) +{ + size_t prefix_len; /* length of prefix */ + size_t fname_len; /* Length of external link file name */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + prefix_len = HDstrlen(prefix); + fname_len = HDstrlen(file_name); + + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") + + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_build_name() */ + + +/*-------------------------------------------------------------------------- + * Function: H5D_getenv_prefix_name -- + * + * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, + * which is separated by the environment delimiter. + * env_prefix is modified to point to the remaining pathnames + * in the list. + * + * Return: A pointer to a pathname +--------------------------------------------------------------------------*/ +static char * +H5D_getenv_prefix_name(char **env_prefix/*in,out*/) +{ + char *retptr=NULL; + char *strret=NULL; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); + if (strret == NULL) { + retptr = *env_prefix; + *env_prefix = strret; + } else { + retptr = *env_prefix; + *env_prefix = strret + 1; + *strret = '\0'; + } + + FUNC_LEAVE_NOAPI(retptr) +} /* end H5D_getenv_prefix_name() */ + +/*------------------------------------------------------------------------- + * Function: H5D__virtual_open_file + * + * Purpose: Attempts to open a source dataset file. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +static H5F_t * +H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, + const char *file_name, + hid_t fapl_id, hid_t dxpl_id) +{ + H5F_t *src_file = NULL; /* Source file */ + H5F_t *ret_value = NULL; /* Actual return value */ + char *full_name = NULL; /* File name with prefix */ + char *my_prefix; /* Library's copy of the prefix */ + unsigned intent; /* File access permissions */ + char *actual_file_name = NULL; /* Virtual file's actual name */ + char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ + + FUNC_ENTER_STATIC + + /* Simplify intent flags for open calls */ + intent = H5F_INTENT(vdset_file); + intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); + + /* Copy the file name to use */ + if(NULL == (temp_file_name = H5MM_strdup(file_name))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); + + /* target file_name is an absolute pathname: see RM for detailed description */ + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + char *ptr; + + H5E_clear_stack(NULL); + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(file_name, ptr) + HDassert(ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + + H5E_clear_stack(NULL); + + /* strip ":" */ + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + + /* try searching from paths set in the environment variable */ + if(src_file == NULL) { + char *env_prefix; + + if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { + char *tmp_env_prefix, *saved_env; + + if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + while((tmp_env_prefix) && (*tmp_env_prefix)) { + char *out_prefix_name; + + out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + if(out_prefix_name && (*out_prefix_name)) { + if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + saved_env = (char *)H5MM_xfree(saved_env); + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + } /* end if */ + + src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + full_name = (char *)H5MM_xfree(full_name); + if(src_file != NULL) + break; + H5E_clear_stack(NULL); + } /* end if */ + } /* end while */ + saved_env = (char *)H5MM_xfree(saved_env); + } /* end if */ + } /* end if */ + + /* try searching from property list */ + if(src_file == NULL) { + size_t size = 0; + H5E_BEGIN_TRY { + size = H5Pget_virtual_prefix(plist_id, NULL, 0); + } H5E_END_TRY; + if(size < 0) + my_prefix = NULL; + else { + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer") + if(H5Pget_virtual_prefix(plist_id, my_prefix, size+1) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") + if(my_prefix) { + if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + my_prefix = (char *)H5MM_xfree(my_prefix); + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } + } /* end if */ + } /* end if */ + + /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ + if(src_file == NULL) { + char *vdspath; + + if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { + if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try the relative file_name stored in temp_file_name */ + if(src_file == NULL) { + if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + } /* end if */ + + /* try the 'resolved' name for the virtual file */ + if(src_file == NULL) { + char *ptr = NULL; + + /* Copy resolved file name */ + if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(actual_file_name, ptr) + if(!ptr) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + + /* Truncate filename portion from actual file name path */ + *ptr = '\0'; + + /* Build new file name for the external file */ + if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + /* Try opening with the resolved name */ + if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + + /* Success */ + ret_value = src_file; +done: + if((NULL == ret_value) && src_file) + if(H5F_try_close(src_file, NULL) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, NULL, "can't close source file") + if(my_prefix) + my_prefix = (char *)H5MM_xfree(my_prefix); + if(full_name) + full_name = (char *)H5MM_xfree(full_name); + if(temp_file_name) + temp_file_name = (char *)H5MM_xfree(temp_file_name); + if(actual_file_name) + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__virtual_open_file() */ + /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset @@ -750,9 +1000,13 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ + char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ + char *full_name = NULL; /* File name with prefix */ + unsigned intent; /* File access permissions */ + hid_t plist_id = -1; /* Property list pointer */ FUNC_ENTER_STATIC @@ -765,8 +1019,9 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + if((plist_id = H5D_get_access_plist(vdset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") + if(NULL == (src_file = H5D__virtual_open_file(plist_id, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -803,6 +1058,8 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, } /* end if */ done: + if(plist_id >= 0) + H5Pclose(plist_id); /* Close source file */ if(src_file_open) if(H5F_try_close(src_file, NULL) < 0) @@ -1407,7 +1664,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection") } /* end if */ - /* Update cached values unlim_extent_source and + /* Update cached values unlim_extent_source and * clip_size_virtual */ storage->list[i].unlim_extent_source = curr_dims[storage->list[i].unlim_dim_source]; storage->list[i].clip_size_virtual = clip_size; @@ -1559,7 +1816,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") /* Mark the space as dirty, for later writing to the file */ - if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) + if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2246,7 +2503,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected memory space") storage->list[i].sub_dset[j].projected_mem_space = NULL; } /* end if */ - else + else *tot_nelmts += (hsize_t)select_nelmts; } /* end if */ } /* end for */ @@ -2265,7 +2522,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Check if anything is selected */ if(select_nelmts > (hssize_t)0) { /* Open source dataset */ - if(!storage->list[i].source_dset.dset) + if(!storage->list[i].source_dset.dset) /* Try to open dataset */ if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") @@ -2506,7 +2763,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index daf0a52..96b8e36 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -25,13 +25,13 @@ typedef struct H5F_t H5F_t; #include "H5Fpublic.h" /* Public headers needed by this file */ -#include "H5FDpublic.h" /* File drivers */ +#include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ #ifdef H5_HAVE_PARALLEL -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /**************************/ @@ -43,68 +43,68 @@ typedef struct H5F_t H5F_t; * Currently, all file meta-data is little-endian. */ -# define INT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define INT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define UINT16ENCODE(p, i) { \ - *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ +# define UINT16ENCODE(p, i) { \ + *(p) = (uint8_t)( (unsigned)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((unsigned)(i) >> 8) & 0xff); (p)++; \ } -# define INT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ +# define INT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (uint32_t)(i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((uint32_t)(i) >> 24) & 0xff); (p)++; \ } -# define UINT32ENCODE(p, i) { \ - *(p) = (uint8_t)( (i) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ - *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ +# define UINT32ENCODE(p, i) { \ + *(p) = (uint8_t)( (i) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 8) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 16) & 0xff); (p)++; \ + *(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \ } /* Encode an unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define ENCODE_VAR(p, typ, n, l) { \ - typ _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for(_i = 0; _i < l; _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t*)(p) + l; \ +# define ENCODE_VAR(p, typ, n, l) { \ + typ _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for(_i = 0; _i < l; _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t*)(p) + l; \ } /* Encode a 32-bit unsigned integer into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT32ENCODE_VAR(p, n, l) ENCODE_VAR(p, uint32_t, n, l) -# define INT64ENCODE(p, n) { \ - int64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = (n) < 0 ? 0xff : 0; \ - (p) = (uint8_t*)(p)+8; \ +# define INT64ENCODE(p, n) { \ + int64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = (n) < 0 ? 0xff : 0; \ + (p) = (uint8_t*)(p)+8; \ } -# define UINT64ENCODE(p, n) { \ - uint64_t _n = (n); \ - size_t _i; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - for (/*void*/; _i < 8; _i++) \ - *_p++ = 0; \ - (p) = (uint8_t*)(p) + 8; \ +# define UINT64ENCODE(p, n) { \ + uint64_t _n = (n); \ + size_t _i; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + for (_i = 0; _i < sizeof(uint64_t); _i++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + for (/*void*/; _i < 8; _i++) \ + *_p++ = 0; \ + (p) = (uint8_t*)(p) + 8; \ } /* Encode a 64-bit unsigned integer into a variable-sized buffer */ @@ -113,31 +113,31 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ -# define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ +# define UINT64ENCODE_VARLEN(p, n) { \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } -# define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ +# define H5_ENCODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_ENCODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - uint8_t *_p = (uint8_t*)(p); \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - HDmemcpy(&_n, &n, sizeof(double)); \ - for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ - *_p++ = (uint8_t)(_n & 0xff); \ - (p) = (uint8_t *)(p) + 8; \ +# define H5_ENCODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + uint8_t *_p = (uint8_t*)(p); \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + HDmemcpy(&_n, &n, sizeof(double)); \ + for(_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \ + *_p++ = (uint8_t)(_n & 0xff); \ + (p) = (uint8_t *)(p) + 8; \ } /* DECODE converts little endian bytes pointed by p to integer values and store @@ -148,68 +148,68 @@ typedef struct H5F_t H5F_t; * correctly even if i is actually a 64bit int like in a Cray. */ -# define INT16DECODE(p, i) { \ - (i) = (int16_t)((*(p) & 0xff)); (p)++; \ +# define INT16DECODE(p, i) { \ + (i) = (int16_t)((*(p) & 0xff)); (p)++; \ (i) |= (int16_t)(((*(p) & 0xff) << 8) | \ - ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ + ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \ } -# define UINT16DECODE(p, i) { \ - (i) = (uint16_t) (*(p) & 0xff); (p)++; \ - (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ +# define UINT16DECODE(p, i) { \ + (i) = (uint16_t) (*(p) & 0xff); (p)++; \ + (i) |= (uint16_t)((*(p) & 0xff) << 8); (p)++; \ } -# define INT32DECODE(p, i) { \ - (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ - (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ +# define INT32DECODE(p, i) { \ + (i) = ((int32_t)(*(p) & (unsigned)0xff)); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 8); (p)++; \ + (i) |= ((int32_t)(*(p) & (unsigned)0xff) << 16); (p)++; \ (i) |= ((int32_t)(((*(p) & (unsigned)0xff) << 24) | \ ((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \ } -# define UINT32DECODE(p, i) { \ - (i) = (uint32_t)(*(p) & 0xff); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ - (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ +# define UINT32DECODE(p, i) { \ + (i) = (uint32_t)(*(p) & 0xff); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ + (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ } /* Decode a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define DECODE_VAR(p, n, l) { \ - size_t _i; \ - \ - n = 0; \ - (p) += l; \ - for (_i = 0; _i < l; _i++) \ - n = (n << 8) | *(--p); \ - (p) += l; \ +# define DECODE_VAR(p, n, l) { \ + size_t _i; \ + \ + n = 0; \ + (p) += l; \ + for (_i = 0; _i < l; _i++) \ + n = (n << 8) | *(--p); \ + (p) += l; \ } /* Decode a variable-sized buffer into a 32-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ # define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) -# define INT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(int64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define INT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(int64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } -# define UINT64DECODE(p, n) { \ - /* WE DON'T CHECK FOR OVERFLOW! */ \ - size_t _i; \ - \ - n = 0; \ - (p) += 8; \ - for (_i = 0; _i < sizeof(uint64_t); _i++) \ - n = (n << 8) | *(--p); \ - (p) += 8; \ +# define UINT64DECODE(p, n) { \ + /* WE DON'T CHECK FOR OVERFLOW! */ \ + size_t _i; \ + \ + n = 0; \ + (p) += 8; \ + for (_i = 0; _i < sizeof(uint64_t); _i++) \ + n = (n << 8) | *(--p); \ + (p) += 8; \ } /* Decode a variable-sized buffer into a 64-bit unsigned integer */ @@ -218,58 +218,58 @@ typedef struct H5F_t H5F_t; /* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT64DECODE_VARLEN(p, n) { \ - unsigned _s = *(p)++; \ - \ - UINT64DECODE_VAR(p, n, _s); \ +# define UINT64DECODE_VARLEN(p, n) { \ + unsigned _s = *(p)++; \ + \ + UINT64DECODE_VAR(p, n, _s); \ } -# define H5_DECODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32DECODE(p, n) \ +# define H5_DECODE_UNSIGNED(p, n) { \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32DECODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ -# define H5_DECODE_DOUBLE(p, n) { \ - uint64_t _n; \ - size_t _u; \ - \ - HDcompile_assert(sizeof(double) == 8); \ - HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ - _n = 0; \ - (p) += 8; \ - for(_u = 0; _u < sizeof(uint64_t); _u++) \ - _n = (_n << 8) | *(--p); \ - HDmemcpy(&(n), &_n, sizeof(double)); \ - (p) += 8; \ +# define H5_DECODE_DOUBLE(p, n) { \ + uint64_t _n; \ + size_t _u; \ + \ + HDcompile_assert(sizeof(double) == 8); \ + HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \ + _n = 0; \ + (p) += 8; \ + for(_u = 0; _u < sizeof(uint64_t); _u++) \ + _n = (_n << 8) | *(--p); \ + HDmemcpy(&(n), &_n, sizeof(double)); \ + (p) += 8; \ } /* Address-related macros */ -#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ - HADDR_UNDEF==(X)+(haddr_t)(Z) || \ - (X)+(haddr_t)(Z)<(X)) -#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) +#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ + HADDR_UNDEF==(X)+(haddr_t)(Z) || \ + (X)+(haddr_t)(Z)<(X)) +#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) /* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making * certain that X is not HADDR_UNDEF and then checking that X equals Y */ -#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ - (X)==(Y)) -#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) -#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<(Y)) -#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)<=(Y)) -#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>(Y)) -#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ - (X)>=(Y)) -#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ - (H5F_addr_lt((X), (Y)) ? -1 : 1)) -#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) +#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ + (X)==(Y)) +#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) +#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<(Y)) +#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)<=(Y)) +#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>(Y)) +#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ + (X)>=(Y)) +#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ + (H5F_addr_lt((X), (Y)) ? -1 : 1)) +#define H5F_addr_pow2(N) ((haddr_t)1<<(N)) #define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) @@ -294,7 +294,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) #define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k) #define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id]) -#define H5F_NREFS(F) ((F)->shared->nrefs) +#define H5F_NREFS(F) ((F)->shared->nrefs) #define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) #define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) #define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr) @@ -325,8 +325,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) ((F)->shared->use_mdc_logging) #define H5F_START_MDC_LOG_ON_ACCESS(F) ((F)->shared->start_mdc_log_on_access) #define H5F_MDC_LOG_LOCATION(F) ((F)->shared->mdc_log_location) -#define H5F_ALIGNMENT(F) ((F)->shared->alignment) -#define H5F_THRESHOLD(F) ((F)->shared->threshold) +#define H5F_ALIGNMENT(F) ((F)->shared->alignment) +#define H5F_THRESHOLD(F) ((F)->shared->threshold) #define H5F_PGEND_META_THRES(F) ((F)->shared->fs.pgend_meta_thres) #define H5F_POINT_OF_NO_RETURN(F) ((F)->shared->fs.point_of_no_return) #define H5F_FIRST_ALLOC_DEALLOC(F) ((F)->shared->first_alloc_dealloc) @@ -351,7 +351,7 @@ typedef struct H5F_t H5F_t; #define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) #define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F)) #define H5F_KVALUE(F,T) (H5F_Kvalue(F,T)) -#define H5F_NREFS(F) (H5F_get_nrefs(F)) +#define H5F_NREFS(F) (H5F_get_nrefs(F)) #define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) #define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) #define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F)) @@ -382,8 +382,8 @@ typedef struct H5F_t H5F_t; #define H5F_USE_MDC_LOGGING(F) (H5F_use_mdc_logging(F)) #define H5F_START_MDC_LOG_ON_ACCESS(F) (H5F_start_mdc_log_on_access(F)) #define H5F_MDC_LOG_LOCATION(F) (H5F_mdc_log_location(F)) -#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) -#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) +#define H5F_ALIGNMENT(F) (H5F_get_alignment(F)) +#define H5F_THRESHOLD(F) (H5F_get_threshold(F)) #define H5F_PGEND_META_THRES(F) (H5F_get_pgend_meta_thres(F)) #define H5F_POINT_OF_NO_RETURN(F) (H5F_get_point_of_no_return(F)) #define H5F_FIRST_ALLOC_DEALLOC(F) (H5F_get_first_alloc_dealloc(F)) @@ -392,32 +392,32 @@ typedef struct H5F_t H5F_t; /* Macros to encode/decode offset/length's for storing in the file */ -#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ - case 4: UINT32ENCODE(p,o); break; \ - case 8: UINT64ENCODE(p,o); break; \ - case 2: UINT16ENCODE(p,o); break; \ +#define H5F_ENCODE_OFFSET(f,p,o) switch(H5F_SIZEOF_ADDR(f)) { \ + case 4: UINT32ENCODE(p,o); break; \ + case 8: UINT64ENCODE(p,o); break; \ + case 2: UINT16ENCODE(p,o); break; \ } -#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ - case 4: UINT32DECODE(p, o); break; \ - case 8: UINT64DECODE(p, o); break; \ - case 2: UINT16DECODE(p, o); break; \ +#define H5F_DECODE_OFFSET(f,p,o) switch (H5F_SIZEOF_ADDR (f)) { \ + case 4: UINT32DECODE(p, o); break; \ + case 8: UINT64DECODE(p, o); break; \ + case 2: UINT16DECODE(p, o); break; \ } -#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32ENCODE(p,l); break; \ - case 8: UINT64ENCODE(p,l); break; \ - case 2: UINT16ENCODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32ENCODE(p,l); break; \ + case 8: UINT64ENCODE(p,l); break; \ + case 2: UINT16ENCODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) -#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ - case 4: UINT32DECODE(p,l); break; \ - case 8: UINT64DECODE(p,l); break; \ - case 2: UINT16DECODE(p,l); break; \ - default: HDassert("bad sizeof size" && 0); \ +#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ + case 4: UINT32DECODE(p,l); break; \ + case 8: UINT64DECODE(p,l); break; \ + case 2: UINT16DECODE(p,l); break; \ + default: HDassert("bad sizeof size" && 0); \ } #define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) @@ -427,13 +427,13 @@ typedef struct H5F_t H5F_t; * with. */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_SIZET2OFFT(X) \ +# define H5F_OVERFLOW_SIZET2OFFT(X) \ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1))) #else # define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif #if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) -# define H5F_OVERFLOW_HSIZET2OFFT(X) \ +# define H5F_OVERFLOW_HSIZET2OFFT(X) \ ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1))) #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 @@ -461,14 +461,14 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */ #define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */ #define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */ -#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ +#define H5F_CRT_FREE_SPACE_PERSIST_NAME "free_space_persist" /* Free-space persisting status */ #define H5F_CRT_FREE_SPACE_THRESHOLD_NAME "free_space_threshold" /* Free space section threshold */ #define H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME "file_space_page_size" /* File space page size */ /* ========= File Access properties ============ */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ +#define H5F_ACS_META_CACHE_INIT_CONFIG_NAME "mdc_initCacheCfg" /* Initial metadata cache resize configuration */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME "rdcc_nslots" /* Size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" /* Preemption read chunks first */ @@ -487,7 +487,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ @@ -504,7 +504,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ /* ======================== File Mount properties ====================*/ -#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ +#define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ #ifdef H5_HAVE_PARALLEL @@ -513,20 +513,20 @@ typedef struct H5F_t H5F_t; #endif /* H5_HAVE_PARALLEL */ /* Define the HDF5 file signature */ -#define H5F_SIGNATURE "\211HDF\r\n\032\n" +#define H5F_SIGNATURE "\211HDF\r\n\032\n" #define H5F_SIGNATURE_LEN 8 /* Version #'s of the major components of the file format */ -#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ -#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ -#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ -#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ -#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ +#define HDF5_SUPERBLOCK_VERSION_DEF 0 /* The default super block format */ +#define HDF5_SUPERBLOCK_VERSION_1 1 /* Version with non-default B-tree 'K' value */ +#define HDF5_SUPERBLOCK_VERSION_2 2 /* Revised version with superblock extension and checksum */ +#define HDF5_SUPERBLOCK_VERSION_3 3 /* With file locking and consistency flags (at least this version for SWMR support) */ +#define HDF5_SUPERBLOCK_VERSION_LATEST HDF5_SUPERBLOCK_VERSION_3 /* The maximum super block format */ #define HDF5_SUPERBLOCK_VERSION_V18_LATEST HDF5_SUPERBLOCK_VERSION_2 /* The latest superblock version for v18 */ -#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ -#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ -#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ -#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ +#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ +#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ +#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ +#define HDF5_DRIVERINFO_VERSION_0 0 /* of the Driver Information Block*/ /* B-tree internal 'K' values */ #define HDF5_BTREE_SNODE_IK_DEF 16 @@ -536,54 +536,54 @@ typedef struct H5F_t H5F_t; if it is changed, the code must compensate. -QAK */ -#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ - /* See format specification on version 1 B-trees */ +#define HDF5_BTREE_IK_MAX_ENTRIES 65536 /* 2^16 - 2 bytes for storing entries (children) */ + /* See format specification on version 1 B-trees */ /* Default file space handling strategy */ -#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_PERSIST_DEF FALSE +#define H5F_FREE_SPACE_PERSIST_DEF FALSE /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_THRESHOLD_DEF 1 +#define H5F_FREE_SPACE_THRESHOLD_DEF 1 /* For paged aggregation: default file space page size when not set */ -#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 +#define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 /* For paged aggregation: minimum value for file space page size */ -#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512 +#define H5F_FILE_SPACE_PAGE_SIZE_MIN 512 /* For paged aggregation: maxiumum value for file space page size: 1 gigabyte */ -#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024 +#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024 /* For paged aggregation: drop free-space with size <= this threshold for small meta section */ #define H5F_FILE_SPACE_PGEND_META_THRES 0 /* Default for threshold for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_DEF 1 +#define H5F_ALIGN_DEF 1 /* Default for alignment (can be set via H5Pset_alignment()) */ -#define H5F_ALIGN_THRHD_DEF 1 +#define H5F_ALIGN_THRHD_DEF 1 /* Default size for meta data aggregation block (can be set via H5Pset_meta_block_size()) */ -#define H5F_META_BLOCK_SIZE_DEF 2048 +#define H5F_META_BLOCK_SIZE_DEF 2048 /* Default size for small data aggregation block (can be set via H5Pset_small_data_block_size()) */ -#define H5F_SDATA_BLOCK_SIZE_DEF 2048 +#define H5F_SDATA_BLOCK_SIZE_DEF 2048 /* Check for file using paged aggregation */ #define H5F_PAGED_AGGR(F) (F->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE && F->shared->fs_page_size) /* Metadata read attempt values */ -#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ -#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ +#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ +#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ /* Macros to define signatures of all objects in the file */ /* Size of signature information (on disk) */ /* (all on-disk signatures should be this length) */ -#define H5_SIZEOF_MAGIC 4 +#define H5_SIZEOF_MAGIC 4 /* Size of checksum information (on disk) */ /* (all on-disk checksums should be this length) */ -#define H5_SIZEOF_CHKSUM 4 +#define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ #define H5B_MAGIC "TREE" @@ -704,11 +704,11 @@ typedef enum H5F_fs_state_t { typedef enum H5F_mem_page_t { H5F_MEM_PAGE_DEFAULT = 0, /* Not used */ H5F_MEM_PAGE_SUPER = 1, - H5F_MEM_PAGE_BTREE = 2, - H5F_MEM_PAGE_DRAW = 3, - H5F_MEM_PAGE_GHEAP = 4, - H5F_MEM_PAGE_LHEAP = 5, - H5F_MEM_PAGE_OHDR = 6, + H5F_MEM_PAGE_BTREE = 2, + H5F_MEM_PAGE_DRAW = 3, + H5F_MEM_PAGE_GHEAP = 4, + H5F_MEM_PAGE_LHEAP = 5, + H5F_MEM_PAGE_OHDR = 6, H5F_MEM_PAGE_LARGE_SUPER = 7, H5F_MEM_PAGE_LARGE_BTREE = 8, H5F_MEM_PAGE_LARGE_DRAW = 9, diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 61b4183..4765d00 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -144,7 +144,7 @@ H5F_get_actual_name(const H5F_t *f) * Function: H5F_get_extpath * * Purpose: Retrieve the file's 'extpath' flags - * This is used by H5L_extern_traverse() and H5D_build_extfile_prefix() to retrieve the main file's location + * This is used by H5L_extern_traverse() and H5D_build_file_prefix() to retrieve the main file's location * when searching the target file. * * Return: 'extpath' on success/abort on failure (shouldn't fail) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 494de3e..da06297 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -71,6 +71,17 @@ #define H5D_ACS_VDS_PRINTF_GAP_DEF (hsize_t)0 #define H5D_ACS_VDS_PRINTF_GAP_ENC H5P__encode_hsize_t #define H5D_ACS_VDS_PRINTF_GAP_DEC H5P__decode_hsize_t +/* Definitions for VDS file prefix */ +#define H5D_ACS_VDS_PREFIX_SIZE sizeof(char *) +#define H5D_ACS_VDS_PREFIX_DEF NULL /*default is no prefix */ +#define H5D_ACS_VDS_PREFIX_SET H5P__dapl_vds_file_pref_set +#define H5D_ACS_VDS_PREFIX_GET H5P__dapl_vds_file_pref_get +#define H5D_ACS_VDS_PREFIX_ENC H5P__dapl_vds_file_pref_enc +#define H5D_ACS_VDS_PREFIX_DEC H5P__dapl_vds_file_pref_dec +#define H5D_ACS_VDS_PREFIX_DEL H5P__dapl_vds_file_pref_del +#define H5D_ACS_VDS_PREFIX_COPY H5P__dapl_vds_file_pref_copy +#define H5D_ACS_VDS_PREFIX_CMP H5P__dapl_vds_file_pref_cmp +#define H5D_ACS_VDS_PREFIX_CLOSE H5P__dapl_vds_file_pref_close /* Definition for append flush */ #define H5D_ACS_APPEND_FLUSH_SIZE sizeof(H5D_append_flush_t) #define H5D_ACS_APPEND_FLUSH_DEF {0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},NULL,NULL} @@ -112,6 +123,14 @@ static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value); /* Property list callbacks */ static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value); +static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__dapl_vds_file_pref_dec(const void **_pp, void *value); +static herr_t H5P__dapl_vds_file_pref_del(hid_t prop_id, const char* name, size_t size, void* value); +static herr_t H5P__dapl_vds_file_pref_copy(const char* name, size_t size, void* value); +static int H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* value); /* Property list callbacks */ static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value); @@ -160,6 +179,7 @@ const H5P_libclass_t H5P_CLS_DACC[1] = {{ /* Property value defaults */ static const H5D_append_flush_t H5D_def_append_flush_g = H5D_ACS_APPEND_FLUSH_DEF; /* Default setting for append flush */ static const char *H5D_def_efile_prefix_g = H5D_ACS_EFILE_PREFIX_DEF; /* Default external file prefix string */ +static const char *H5D_def_vds_prefix_g = H5D_ACS_VDS_PREFIX_DEF; /* Default vds prefix string */ /*------------------------------------------------------------------------- @@ -210,6 +230,12 @@ H5P__dacc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register property for vds prefix */ + if(H5P_register_real(pclass, H5D_ACS_VDS_PREFIX_NAME, H5D_ACS_VDS_PREFIX_SIZE, &H5D_def_vds_prefix_g, + NULL, H5D_ACS_VDS_PREFIX_SET, H5D_ACS_VDS_PREFIX_GET, H5D_ACS_VDS_PREFIX_ENC, H5D_ACS_VDS_PREFIX_DEC, + H5D_ACS_VDS_PREFIX_DEL, H5D_ACS_VDS_PREFIX_COPY, H5D_ACS_VDS_PREFIX_CMP, H5D_ACS_VDS_PREFIX_CLOSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register info for append flush */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_ACS_APPEND_FLUSH_NAME, H5D_ACS_APPEND_FLUSH_SIZE, &H5D_def_append_flush_g, @@ -226,6 +252,254 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dacc_reg_prop() */ + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_set + * + * Purpose: Copies a vds file prefix property when it's set + * for a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_set() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_get + * + * Purpose: Copies a vds file prefix property when it's retrieved + * from a property list + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + /* Copy the prefix */ + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_get() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_enc + * + * Purpose: Callback routine which is called whenever the vds file flags + * property in the dataset access property list is + * encoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) +{ + const char *vds_file_pref = *(const char * const *)value; + uint8_t **pp = (uint8_t **)_pp; + size_t len = 0; + uint64_t enc_value; + unsigned enc_size; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* calculate prefix length */ + if(NULL != vds_file_pref) + len = HDstrlen(vds_file_pref); + + enc_value = (uint64_t)len; + enc_size = H5VM_limit_enc_size(enc_value); + HDassert(enc_size < 256); + + if(NULL != *pp) { + /* encode the length of the prefix */ + *(*pp)++ = (uint8_t)enc_size; + UINT64ENCODE_VAR(*pp, enc_value, enc_size); + + /* encode the prefix */ + if(NULL != vds_file_pref) { + HDmemcpy(*(char **)pp, vds_file_pref, len); + *pp += len; + } /* end if */ + } /* end if */ + + *size += (1 + enc_size); + if(NULL != vds_file_pref) + *size += len; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_enc() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_dec + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset access property list is + * decoded. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) +{ + char **vds_file_pref = (char **)_value; + const uint8_t **pp = (const uint8_t **)_pp; + size_t len; + uint64_t enc_value; /* Decoded property value */ + unsigned enc_size; /* Size of encoded property */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(pp); + HDassert(*pp); + HDassert(vds_file_pref); + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* Decode the size */ + enc_size = *(*pp)++; + HDassert(enc_size < 256); + + /* Decode the value */ + UINT64DECODE_VAR(*pp, enc_value, enc_size); + len = (size_t)enc_value; + + if(0 != len) { + /* Make a copy of the user's prefix string */ + if(NULL == (*vds_file_pref = (char *)H5MM_malloc(len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for prefix") + HDstrncpy(*vds_file_pref, *(const char **)pp, len); + (*vds_file_pref)[len] = '\0'; + + *pp += len; + } /* end if */ + else + *vds_file_pref = NULL; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_dec() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_del + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED (Can't fail) + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_del() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_copy + * + * Purpose: Creates a copy of the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + *(char **)value = H5MM_xstrdup(*(const char **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_copy() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_cmp + * + * Purpose: Callback routine which is called whenever the vds file prefix + * property in the dataset creation property list is + * compared. + * + * Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise. + *------------------------------------------------------------------------- + */ +static int +H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) +{ + const char *pref1 = *(const char * const *)value1; + const char *pref2 = *(const char * const *)value2; + int ret_value = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(NULL == pref1 && NULL != pref2) + HGOTO_DONE(1); + if(NULL != pref1 && NULL == pref2) + HGOTO_DONE(-1); + if(NULL != pref1 && NULL != pref2) + ret_value = HDstrcmp(pref1, pref2); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dapl_vds_file_pref_cmp() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dapl_vds_file_pref_close + * + * Purpose: Frees memory used to store the vds file prefix string + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(value); + + H5MM_xfree(*(void **)value); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__dapl_vds_file_pref_close() */ + /*------------------------------------------------------------------------- * Function: H5P__dapl_efile_pref_set @@ -1220,3 +1494,95 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_efile_prefix() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_virtual_prefix + * + * Purpose: Set a prefix to be applied to the path of any vds files + * traversed. + * + * If the prefix starts with ${ORIGIN}, this will be replaced by + * the absolute path of the directory of the HDF5 file containing + * the dataset. + * + * If the prefix is ".", no prefix will be applied. + * + * This property can be overwritten by the environment variable + * HDF5_VDS_PREFIX. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_virtual_prefix(hid_t plist_id, const char *prefix) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*s", plist_id, prefix); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Set prefix */ + if(H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set prefix info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_virtual_prefix() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_virtual_prefix + * + * Purpose: Gets the prefix to be applied to any vds file + * traversals made using this property list. + * + * If the pointer is not NULL, it points to a user-allocated + * buffer. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +ssize_t +H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + char *my_prefix; /* Library's copy of the prefix */ + size_t len; /* Length of prefix string */ + ssize_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "i*sz", plist_id, prefix, size); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get the current prefix */ + if(H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vds file prefix") + + /* Check for prefix being set */ + if(my_prefix) { + /* Copy to user's buffer, if given */ + len = HDstrlen(my_prefix); + if(prefix) { + HDstrncpy(prefix, my_prefix, MIN(len + 1, size)); + if(len >= size) + prefix[size - 1] = '\0'; + } /* end if */ + } /* end if */ + else + len = 0; + + /* Set return value */ + ret_value = (ssize_t)len; + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_virtual_prefix() */ + diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 915aa38..ea9bfb4 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -13,9 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Pfapl.c + * Created: H5Pfapl.c * - * Purpose: File access property list class routines + * Purpose: File access property list class routines * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ #include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ #include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Win32 I/O */ @@ -54,10 +54,10 @@ /* ========= File Access properties ============ */ /* Definitions for the initial metadata cache resize configuration */ -#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG -#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc -#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec +#define H5F_ACS_META_CACHE_INIT_CONFIG_SIZE sizeof(H5AC_cache_config_t) +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEF H5AC__DEFAULT_CACHE_CONFIG +#define H5F_ACS_META_CACHE_INIT_CONFIG_ENC H5P__facc_cache_config_enc +#define H5F_ACS_META_CACHE_INIT_CONFIG_DEC H5P__facc_cache_config_dec #define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp /* Definitions for size of raw data chunk cache(slots) */ #define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t) @@ -118,10 +118,10 @@ #define H5F_ACS_FILE_DRV_CMP H5P__facc_file_driver_cmp #define H5F_ACS_FILE_DRV_CLOSE H5P__facc_file_driver_close /* Definition for file close degree */ -#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) -#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT -#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc -#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec +#define H5F_CLOSE_DEGREE_SIZE sizeof(H5F_close_degree_t) +#define H5F_CLOSE_DEGREE_DEF H5F_CLOSE_DEFAULT +#define H5F_CLOSE_DEGREE_ENC H5P__facc_fclose_degree_enc +#define H5F_CLOSE_DEGREE_DEC H5P__facc_fclose_degree_dec /* Definition for offset position in file for family file driver */ #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 @@ -175,12 +175,12 @@ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC H5P__encode_size_t #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC H5P__decode_size_t /* Definition for # of metadata read attempts */ -#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 -#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned -#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 +#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned /* Definition for object flush callback */ -#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) +#define H5F_ACS_OBJECT_FLUSH_CB_SIZE sizeof(H5F_object_flush_t) #define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL} /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) @@ -309,21 +309,21 @@ static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); /* File access property list class library initialization object */ const H5P_libclass_t H5P_CLS_FACC[1] = {{ - "file access", /* Class name for debugging */ + "file access", /* Class name for debugging */ H5P_TYPE_FILE_ACCESS, /* Class type */ - &H5P_CLS_ROOT_g, /* Parent class */ - &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ - &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ - &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ - H5P__facc_reg_prop, /* Default property registration routine */ - - NULL, /* Class creation callback */ - NULL, /* Class creation callback info */ - NULL, /* Class copy callback */ - NULL, /* Class copy callback info */ - NULL, /* Class close callback */ - NULL /* Class close callback info */ + &H5P_CLS_ROOT_g, /* Parent class */ + &H5P_CLS_FILE_ACCESS_g, /* Pointer to class */ + &H5P_CLS_FILE_ACCESS_ID_g, /* Pointer to class ID */ + &H5P_LST_FILE_ACCESS_ID_g, /* Pointer to default property list ID */ + H5P__facc_reg_prop, /* Default property registration routine */ + + NULL, /* Class creation callback */ + NULL, /* Class creation callback info */ + NULL, /* Class copy callback */ + NULL, /* Class copy callback info */ + NULL, /* Class close callback */ + NULL /* Class close callback info */ }}; @@ -395,149 +395,149 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the initial metadata cache resize configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &H5F_def_mdc_initCacheCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &H5F_def_rdcc_nslots_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC, H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, - NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &H5F_def_rdcc_nbytes_g, + NULL, NULL, NULL, H5F_ACS_DATA_CACHE_BYTE_SIZE_ENC, H5F_ACS_DATA_CACHE_BYTE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, - NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, + if(H5P_register_real(pclass, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &H5F_def_rdcc_w0_g, + NULL, NULL, NULL, H5F_ACS_PREEMPT_READ_CHUNKS_ENC, H5F_ACS_PREEMPT_READ_CHUNKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_THRHD_NAME, H5F_ACS_ALIGN_THRHD_SIZE, &H5F_def_threshold_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_THRHD_ENC, H5F_ACS_ALIGN_THRHD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, - NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, + if(H5P_register_real(pclass, H5F_ACS_ALIGN_NAME, H5F_ACS_ALIGN_SIZE, &H5F_def_alignment_g, + NULL, NULL, NULL, H5F_ACS_ALIGN_ENC, H5F_ACS_ALIGN_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, - NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_BLOCK_SIZE_NAME, H5F_ACS_META_BLOCK_SIZE_SIZE, &H5F_def_meta_block_size_g, + NULL, NULL, NULL, H5F_ACS_META_BLOCK_SIZE_ENC, H5F_ACS_META_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, - NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SIEVE_BUF_SIZE_NAME, H5F_ACS_SIEVE_BUF_SIZE_SIZE, &H5F_def_sieve_buf_size_g, + NULL, NULL, NULL, H5F_ACS_SIEVE_BUF_SIZE_ENC, H5F_ACS_SIEVE_BUF_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, - NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_SDATA_BLOCK_SIZE_NAME, H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &H5F_def_sdata_block_size_g, + NULL, NULL, NULL, H5F_ACS_SDATA_BLOCK_SIZE_ENC, H5F_ACS_SDATA_BLOCK_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, - NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, + if(H5P_register_real(pclass, H5F_ACS_GARBG_COLCT_REF_NAME, H5F_ACS_GARBG_COLCT_REF_SIZE, &H5F_def_gc_ref_g, + NULL, NULL, NULL, H5F_ACS_GARBG_COLCT_REF_ENC, H5F_ACS_GARBG_COLCT_REF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID & info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, + if(H5P_register_real(pclass, H5F_ACS_FILE_DRV_NAME, H5F_ACS_FILE_DRV_SIZE, &def_driver_prop, H5F_ACS_FILE_DRV_CRT, H5F_ACS_FILE_DRV_SET, H5F_ACS_FILE_DRV_GET, NULL, NULL, H5F_ACS_FILE_DRV_DEL, H5F_ACS_FILE_DRV_COPY, H5F_ACS_FILE_DRV_CMP, H5F_ACS_FILE_DRV_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ - if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, - NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CLOSE_DEGREE_NAME, H5F_CLOSE_DEGREE_SIZE, &H5F_def_close_degree_g, + NULL, NULL, NULL, H5F_CLOSE_DEGREE_ENC, H5F_CLOSE_DEGREE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the offset of family driver info */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, - NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_OFFSET_NAME, H5F_ACS_FAMILY_OFFSET_SIZE, &H5F_def_family_offset_g, + NULL, NULL, NULL, H5F_ACS_FAMILY_OFFSET_ENC, H5F_ACS_FAMILY_OFFSET_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of new family file size. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_NEWSIZE_NAME, H5F_ACS_FAMILY_NEWSIZE_SIZE, &H5F_def_family_newsize_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether convert family to sec2 driver. It's used by h5repart only. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, + if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the data type of multi driver info */ - if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, - NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, + if(H5P_register_real(pclass, H5F_ACS_MULTI_TYPE_NAME, H5F_ACS_MULTI_TYPE_SIZE, &H5F_def_mem_type_g, + NULL, NULL, NULL, H5F_ACS_MULTI_TYPE_ENC, H5F_ACS_MULTI_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'use the latest version of the format' flag */ - if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, - NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, + if(H5P_register_real(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &H5F_def_latest_format_g, + NULL, NULL, NULL, H5F_ACS_LATEST_FORMAT_ENC, H5F_ACS_LATEST_FORMAT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the private property of whether to retrieve the file descriptor from the core VFD */ /* (used internally to the library only) */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, + if(H5P_register_real(pclass, H5F_ACS_WANT_POSIX_FD_NAME, H5F_ACS_WANT_POSIX_FD_SIZE, &H5F_def_want_posix_fd_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the external file cache size */ - if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, - NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &H5F_def_efc_size_g, + NULL, NULL, NULL, H5F_ACS_EFC_SIZE_ENC, H5F_ACS_EFC_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the initial file image info */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, + if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &H5F_def_file_image_info_g, NULL, H5F_ACS_FILE_IMAGE_INFO_SET, H5F_ACS_FILE_IMAGE_INFO_GET, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, H5F_ACS_FILE_IMAGE_INFO_CMP, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the core VFD backing store write tracking flag */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME, H5F_ACS_CORE_WRITE_TRACKING_FLAG_SIZE, &H5F_def_core_write_tracking_flag_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_FLAG_ENC, H5F_ACS_CORE_WRITE_TRACKING_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the core VFD backing store page size */ - if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, - NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_SIZE, &H5F_def_core_write_tracking_page_size_g, + NULL, NULL, NULL, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_ENC, H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, - NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object flush callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, + if(H5P_register_real(pclass, H5F_ACS_OBJECT_FLUSH_CB_NAME, H5F_ACS_OBJECT_FLUSH_CB_SIZE, &H5F_def_object_flush_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -563,44 +563,44 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the evict on close flag */ - if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, - NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE, &H5F_def_evict_on_close_flag_g, + NULL, NULL, NULL, H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC, H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, + if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5F_ACS_COLL_MD_READ_FLAG_SIZE, &H5F_def_coll_md_read_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_READ_FLAG_ENC, H5F_ACS_COLL_MD_READ_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the metadata collective write flag */ - if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, - NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, + if(H5P_register_real(pclass, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, H5F_ACS_COLL_MD_WRITE_FLAG_SIZE, &H5F_def_coll_md_write_flag_g, + NULL, NULL, NULL, H5F_ACS_COLL_MD_WRITE_FLAG_ENC, H5F_ACS_COLL_MD_WRITE_FLAG_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ /* Register the initial metadata cache image configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_SIZE_NAME, H5F_ACS_PAGE_BUFFER_SIZE_SIZE, &H5F_def_page_buf_size_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_SIZE_ENC, H5F_ACS_PAGE_BUFFER_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum metadata size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_SIZE, &H5F_def_page_buf_min_meta_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of the page buffer minimum raw data size */ - if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, - NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, + if(H5P_register_real(pclass, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_SIZE, &H5F_def_page_buf_min_raw_perc_g, + NULL, NULL, NULL, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -610,33 +610,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_alignment + * Function: H5Pset_alignment * - * Purpose: Sets the alignment properties of a file access property list - * so that any file object >= THRESHOLD bytes will be aligned on - * an address which is a multiple of ALIGNMENT. The addresses - * are relative to the end of the user block; the alignment is - * calculated by subtracting the user block size from the - * absolute file address and then adjusting the address to be a - * multiple of ALIGNMENT. + * Purpose: Sets the alignment properties of a file access property list + * so that any file object >= THRESHOLD bytes will be aligned on + * an address which is a multiple of ALIGNMENT. The addresses + * are relative to the end of the user block; the alignment is + * calculated by subtracting the user block size from the + * absolute file address and then adjusting the address to be a + * multiple of ALIGNMENT. * - * Default values for THRESHOLD and ALIGNMENT are one, implying - * no alignment. Generally the default values will result in - * the best performance for single-process access to the file. - * For MPI-IO and other parallel systems, choose an alignment - * which is a multiple of the disk block size. + * Default values for THRESHOLD and ALIGNMENT are one, implying + * no alignment. Generally the default values will result in + * the best performance for single-process access to the file. + * For MPI-IO and other parallel systems, choose an alignment + * which is a multiple of the disk block size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed file access property list mechanism to the new + * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -668,15 +668,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_alignment + * Function: H5Pget_alignment * - * Purpose: Returns the current settings for alignment properties from a - * file access property list. The THRESHOLD and/or ALIGNMENT - * pointers may be null pointers. + * Purpose: Returns the current settings for alignment properties from a + * file access property list. The THRESHOLD and/or ALIGNMENT + * pointers may be null pointers. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -709,20 +709,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_set_driver + * Function: H5P_set_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -757,20 +757,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_driver + * Function: H5Pset_driver * - * Purpose: Set the file driver (DRIVER_ID) for a file access - * property list (PLIST_ID) and supply an optional - * struct containing the driver-specific properites - * (DRIVER_INFO). The driver properties will be copied into the - * property list and the reference count on the driver will be - * incremented, allowing the caller to close the driver ID but - * still use the property list. + * Purpose: Set the file driver (DRIVER_ID) for a file access + * property list (PLIST_ID) and supply an optional + * struct containing the driver-specific properites + * (DRIVER_INFO). The driver properties will be copied into the + * property list and the reference count on the driver will be + * incremented, allowing the caller to close the driver ID but + * still use the property list. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 3, 1999 * *------------------------------------------------------------------------- @@ -800,20 +800,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver + * Function: H5P_peek_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Return: Success: A low-level driver ID which is the same ID - * used when the driver was set for the property - * list. The driver ID is only valid as long as - * the file driver remains registered. + * Return: Success: A low-level driver ID which is the same ID + * used when the driver was set for the property + * list. The driver ID is only valid as long as + * the file driver remains registered. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -844,22 +844,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver + * Function: H5Pget_driver * - * Purpose: Return the ID of the low-level file driver. PLIST_ID should - * be a file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * - * Note: The ID returned should not be closed. + * Note: The ID returned should not be closed. * - * Return: Success: A low-level driver ID which is the same ID - * used when the driver was set for the property - * list. The driver ID is only valid as long as - * the file driver remains registered. + * Return: Success: A low-level driver ID which is the same ID + * used when the driver was set for the property + * list. The driver ID is only valid as long as + * the file driver remains registered. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, February 26, 1998 + * Programmer: Robb Matzke + * Thursday, February 26, 1998 * *------------------------------------------------------------------------- */ @@ -867,7 +867,7 @@ hid_t H5Pget_driver(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); @@ -885,20 +885,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_peek_driver_info + * Function: H5P_peek_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -927,20 +927,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_driver_info + * Function: H5Pget_driver_info * - * Purpose: Returns a pointer directly to the file driver-specific - * information of a file access. + * Purpose: Returns a pointer directly to the file driver-specific + * information of a file access. * - * Return: Success: Ptr to *uncopied* driver specific data - * structure if any. + * Return: Success: Ptr to *uncopied* driver specific data + * structure if any. * - * Failure: NULL. Null is also returned if the driver has - * not registered any driver-specific properties - * although no error is pushed on the stack in - * this case. + * Failure: NULL. Null is also returned if the driver has + * not registered any driver-specific properties + * although no error is pushed on the stack in + * this case. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -973,7 +973,7 @@ done: * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -1486,30 +1486,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_cache + * Function: H5Pset_cache * - * Purpose: Set the number of objects in the meta data cache and the - * maximum number of chunks and bytes in the raw data chunk - * cache. + * Purpose: Set the number of objects in the meta data cache and the + * maximum number of chunks and bytes in the raw data chunk + * cache. * - * The RDCC_W0 value should be between 0 and 1 inclusive and - * indicates how much chunks that have been fully read or fully - * written are favored for preemption. A value of zero means - * fully read or written chunks are treated no differently than - * other chunks (the preemption is strictly LRU) while a value - * of one means fully read chunks are always preempted before - * other chunks. + * The RDCC_W0 value should be between 0 and 1 inclusive and + * indicates how much chunks that have been fully read or fully + * written are favored for preemption. A value of zero means + * fully read or written chunks are treated no differently than + * other chunks (the preemption is strictly LRU) while a value + * of one means fully read chunks are always preempted before + * other chunks. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, - size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) + size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1540,24 +1540,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_cache + * Function: H5Pget_cache * - * Purpose: Retrieves the maximum possible number of elements in the meta - * data cache and the maximum possible number of elements and - * bytes and the RDCC_W0 value in the raw data chunk cache. Any - * (or all) arguments may be null pointers in which case the - * corresponding datum is not returned. + * Purpose: Retrieves the maximum possible number of elements in the meta + * data cache and the maximum possible number of elements and + * bytes and the RDCC_W0 value in the raw data chunk cache. Any + * (or all) arguments may be null pointers in which case the + * corresponding datum is not returned. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, May 19, 1998 * *------------------------------------------------------------------------- */ herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, - size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) + size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -1592,14 +1592,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_image_config + * Function: H5Pset_mdc_image_config * - * Purpose: Set the initial metadata cache image configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache image configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, June 25, 2015 * *------------------------------------------------------------------------- @@ -1636,18 +1636,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_image_config + * Function: H5Pget_mdc_image_config * - * Purpose: Retrieve the metadata cache initial image configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial image configuration + * from the target FAPL. * - * Observe that the function will fail if config_ptr is - * NULL, or if config_ptr->version specifies an unknown - * version of H5AC_cache_image_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_image_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Friday, June 26, 2015 * *------------------------------------------------------------------------- @@ -1687,14 +1687,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_config + * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the - * target FAPL. + * Purpose: Set the initial metadata cache resize configuration in the + * target FAPL. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1731,18 +1731,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_config + * Function: H5Pget_mdc_config * - * Purpose: Retrieve the metadata cache initial resize configuration - * from the target FAPL. + * Purpose: Retrieve the metadata cache initial resize configuration + * from the target FAPL. * - * Observe that the function will fail if config_ptr is - * NULL, or if config_ptr->version specifies an unknown - * version of H5AC_cache_config_t. + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_config_t. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: J. Mainzer + * Programmer: J. Mainzer * Thursday, April 7, 2005 * *------------------------------------------------------------------------- @@ -1782,33 +1782,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_gc_references + * Function: H5Pset_gc_references * - * Purpose: Sets the flag for garbage collecting references for the file. - * Dataset region references (and other reference types - * probably) use space in the file heap. If garbage collection - * is on and the user passes in an uninitialized value in a - * reference structure, the heap might get corrupted. When - * garbage collection is off however and the user re-uses a - * reference, the previous heap block will be orphaned and not - * returned to the free heap space. When garbage collection is - * on, the user must initialize the reference structures to 0 or - * risk heap corruption. + * Purpose: Sets the flag for garbage collecting references for the file. + * Dataset region references (and other reference types + * probably) use space in the file heap. If garbage collection + * is on and the user passes in an uninitialized value in a + * reference structure, the heap might get corrupted. When + * garbage collection is off however and the user re-uses a + * reference, the previous heap block will be orphaned and not + * returned to the free heap space. When garbage collection is + * on, the user must initialize the reference structures to 0 or + * risk heap corruption. * - * Default value for garbage collecting references is off, just - * to be on the safe side. + * Default value for garbage collecting references is off, just + * to be on the safe side. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * June, 1999 + * Programmer: Quincey Koziol + * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1835,22 +1835,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_gc_references + * Function: H5Pget_gc_references * - * Purpose: Returns the current setting for the garbage collection - * references property from a file access property list. + * Purpose: Returns the current setting for the garbage collection + * references property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June, 1999 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1949,31 +1949,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_meta_block_size + * Function: H5Pset_meta_block_size * - * Purpose: Sets the minimum size of metadata block allocations when + * Purpose: Sets the minimum size of metadata block allocations when * the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver. * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. * - * The default value is set to 2048 (bytes), indicating that metadata + * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will * turn off the metadata aggregation, even if the VFL driver attempts to * use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2000,22 +2000,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_meta_block_size + * Function: H5Pget_meta_block_size * - * Purpose: Returns the current settings for the metadata block allocation + * Purpose: Returns the current settings for the metadata block allocation * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 29, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2044,31 +2044,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_sieve_buf_size + * Function: H5Pset_sieve_buf_size * - * Purpose: Sets the maximum size of the data seive buffer used for file + * Purpose: Sets the maximum size of the data seive buffer used for file * drivers which are capable of using data sieving. The data sieve * buffer is used when performing I/O on datasets in the file. Using a * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. * - * The default value is set to 64KB, indicating that file I/O for raw data + * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the * data sieving, even if the VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2095,22 +2095,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_sieve_buf_size + * Function: H5Pget_sieve_buf_size * - * Purpose: Returns the current settings for the data sieve buffer size + * Purpose: Returns the current settings for the data sieve buffer size * property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 21, 2000 * * Modifications: * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -2138,23 +2138,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_small_data_block_size + * Function: H5Pset_small_data_block_size * - * Purpose: Sets the minimum size of "small" raw data block allocations + * Purpose: Sets the minimum size of "small" raw data block allocations * when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver. * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. * - * The default value is set to 2048 (bytes), indicating that raw data + * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API * function will turn off the "small" raw data aggregation, even if the * VFL driver attempts to use that strategy. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2184,14 +2184,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_small_data_block_size + * Function: H5Pget_small_data_block_size * - * Purpose: Returns the current settings for the "small" raw data block + * Purpose: Returns the current settings for the "small" raw data block * allocation property from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * * Modifications: @@ -2223,9 +2223,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_libver_bounds + * Function: H5Pset_libver_bounds * - * Purpose: Indicates which versions of the file format the library should + * Purpose: Indicates which versions of the file format the library should * use when creating objects. LOW is the earliest version of the HDF5 * library that is guaranteed to be able to access the objects created * (the format of some objects in an HDF5 file may not have changed between @@ -2301,9 +2301,9 @@ done: * releases and then map down to the previous actual library release which * had a format change. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, December 30, 2007 * *------------------------------------------------------------------------- @@ -2341,14 +2341,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_libver_bounds + * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * *------------------------------------------------------------------------- @@ -2464,9 +2464,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_file_image * - * Purpose: Sets the initial file image. Some file drivers can initialize - * the starting data in a file from a buffer. - * + * Purpose: Sets the initial file image. Some file drivers can initialize + * the starting data in a file from a buffer. + * * Return: Non-negative on success/Negative on failure * * Programmer: Jacob Gruber @@ -2480,22 +2480,22 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) H5P_genplist_t *fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len); /* validate parameters */ if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len") - + /* Get the plist structure */ if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - + /* Get old image info */ if(H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer") - + /* Release previous buffer, if it exists */ if(image_info.buffer != NULL) { if(image_info.callbacks.image_free) { @@ -2504,8 +2504,8 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) } /* end if */ else H5MM_xfree(image_info.buffer); - } /* end if */ - + } /* end if */ + /* Update struct */ if(buf_ptr) { /* Allocate memory */ @@ -2517,15 +2517,15 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) else if(NULL == (image_info.buffer = H5MM_malloc(buf_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { - if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, - buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, + buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata)) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(image_info.buffer, buf_ptr, buf_len); } /* end if */ else @@ -2545,24 +2545,24 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, - * allocate a buffer of the correct size, copy the image into - * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks - * if defined. + * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * allocate a buffer of the correct size, copy the image into + * the new buffer, and return the buffer to the caller in + * *buf_ptr_ptr. Do this using the file image callbacks + * if defined. * - * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do - * this using free if the file image callbacks are not - * defined, or with whatever method is appropriate if - * the callbacks are defined. + * NB: It is the responsibility of the caller to free the + * buffer whose address is returned in *buf_ptr_ptr. Do + * this using free if the file image callbacks are not + * defined, or with whatever method is appropriate if + * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf_ptr_ptr is not NULL, and no image exists, set + * *buf_ptr_ptr to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal - * to the length of the file image if it exists, and - * to 0 if it does not. + * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * to the length of the file image if it exists, and + * to 0 if it does not. * * Return: Non-negative on success/Negative on failure * @@ -2590,7 +2590,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || + HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ @@ -2611,15 +2611,15 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) else if(NULL == (copy_ptr = H5MM_malloc(image_info.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy") - + /* Copy data */ if(image_info.callbacks.image_memcpy) { if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, - image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ @@ -2636,7 +2636,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * and memcpys or to perform detailed logging. * @@ -2666,7 +2666,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* Make sure a file image hasn't already been set */ @@ -2675,7 +2675,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Make sure udata callbacks are going to be set if udata is going to be set */ if(callbacks_ptr->udata) @@ -2686,7 +2686,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback if(info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_free); if(info.callbacks.udata_free(info.callbacks.udata) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") } /* end if */ /* Update struct */ @@ -2713,7 +2713,7 @@ done: * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and - * copying the drivers internal buffer, potentially allowing a + * copying the drivers internal buffer, potentially allowing a * clever user to do optimizations such as avoiding large mallocs * * Return: Non-negative on success/Negative on failure @@ -2742,12 +2742,12 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistancy */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || + HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* verify that callbacks_ptr is not NULL */ if(NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") /* Transfer values to parameters */ *callbacks_ptr = info.callbacks; @@ -2768,12 +2768,12 @@ done: * Function: H5P__file_image_info_copy * * Purpose: Copy file image info. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Note: This is an "in-place" copy, since this routine gets called * after the top-level copy has been performed and this routine - * finishes the "deep" part of the copy. + * finishes the "deep" part of the copy. * * Return: Success: Non-negative * Failure: Negative @@ -2796,7 +2796,7 @@ H5P__file_image_info_copy(void *value) info = (H5FD_file_image_info_t *)value; /* verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); if(info->buffer && info->size > 0) { @@ -2815,14 +2815,14 @@ H5P__file_image_info_copy(void *value) if(NULL == (info->buffer = H5MM_malloc(info->size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory block") } /* end else */ - + /* Copy data to new buffer */ if(info->callbacks.image_memcpy) { - if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, - info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") } /* end if */ - else + else HDmemcpy(info->buffer, old_buffer, info->size); } /* end if */ @@ -2846,8 +2846,8 @@ done: * Function: H5P__file_image_info_free * * Purpose: Free file image info. The buffer and udata may need to be - * freed, possibly using their respective callbacks, so the - * default free won't work. + * freed, possibly using their respective callbacks, so the + * default free won't work. * * Return: Success: Non-negative * Failure: Negative @@ -2868,16 +2868,16 @@ H5P__file_image_info_free(void *value) H5FD_file_image_info_t *info; /* Image info struct */ info = (H5FD_file_image_info_t *)value; - + /* Verify file image field consistancy */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || + HDassert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); /* Free buffer */ - if(info->buffer != NULL && info->size > 0) { + if(info->buffer != NULL && info->size > 0) { if(info->callbacks.image_free) { if((*info->callbacks.image_free)(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") + HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else H5MM_xfree(info->buffer); @@ -2903,7 +2903,7 @@ done: * Purpose: Compare two cache image configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: John Mainzer * June 26, 2015 @@ -2944,11 +2944,11 @@ done: * Function: H5P__facc_cache_image_config_enc * * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation - * property list is encoded. + * cache image config property in the file creation + * property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -2990,11 +2990,11 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) * Function: H5P__facc_cache_image_config_dec * * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation property - * list is decoded. + * cache image config property in the file creation property + * list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: John Mainzer * June 26, 2015 @@ -3109,7 +3109,7 @@ done: * * Purpose: Delete callback for the file image info property, called * when the property is deleted from the plist. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the default free won't work. * * Return: Non-negative on success/Negative on failure @@ -3139,7 +3139,7 @@ done: * Function: H5P__facc_file_image_info_copy * * Purpose: Copy callback for the file image info property. The buffer - * and udata may need to be copied, possibly using their + * and udata may need to be copied, possibly using their * respective callbacks so the default copy won't work. * * Return: Non-negative on success/Negative on failure @@ -3228,7 +3228,7 @@ done: * Function: H5P__facc_file_image_info_close * * Purpose: Close callback for the file image info property. The buffer - * and udata may need to be freed, possibly using their + * and udata may need to be freed, possibly using their * respective callbacks so the standard free won't work. * * Return: Non-negative on success/Negative on failure @@ -3260,7 +3260,7 @@ done: * Purpose: Compare two cache configurations. * * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. * * Programmer: Mohamad Chaarawi * September 24, 2012 @@ -3373,8 +3373,8 @@ done: * cache config property in the file creation property list is * encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3518,8 +3518,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) * cache config property in the file creation property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * August 09, 2012 @@ -3653,8 +3653,8 @@ done: * degree property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3691,8 +3691,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) * degree property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3726,8 +3726,8 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) * memory type property in the file access property list * is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3764,8 +3764,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) * memory type property in the file access property list * is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Wednesday, August 15, 2012 @@ -3793,12 +3793,12 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * - * Purpose: Enables/disables core VFD write tracking and page + * Purpose: Enables/disables core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3834,12 +3834,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_core_write_tracking + * Function: H5Pget_core_write_tracking * - * Purpose: Gets information about core VFD write tracking and page + * Purpose: Gets information about core VFD write tracking and page * aggregation size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Dana Robinson * Tuesday, April 8, 2014 @@ -3876,19 +3876,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_metadata_read_attempts + * Function: H5Pset_metadata_read_attempts + * + * Purpose: Sets the # of read attempts in the file access property list + * when reading metadata with checksum. + * The # of read attempts set via this routine will only apply + * when opening a file with SWMR access. + * The # of read attempts set via this routine does not have + * any effect when opening a file with non-SWMR access; for this + * case, the # of read attempts will be always be 1. * - * Purpose: Sets the # of read attempts in the file access property list - * when reading metadata with checksum. - * The # of read attempts set via this routine will only apply - * when opening a file with SWMR access. - * The # of read attempts set via this routine does not have - * any effect when opening a file with non-SWMR access; for this - * case, the # of read attempts will be always be 1. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3919,13 +3919,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_metadata_read_attempts + * Function: H5Pget_metadata_read_attempts * - * Purpose: Returns the # of metadata read attempts set in the file access property list. + * Purpose: Returns the # of metadata read attempts set in the file access property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Sept 2013 + * Programmer: Vailin Choi; Sept 2013 * *------------------------------------------------------------------------- */ @@ -3945,13 +3945,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -3960,14 +3960,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_obj_flush_cb + * Function: H5Pset_obj_flush_cb * - * Purpose: Sets the callback function to invoke and the user data when an - * object flush occurs in the file. - * - * Return: Non-negative on success/Negative on failure + * Purpose: Sets the callback function to invoke and the user data when an + * object flush occurs in the file. * - * Programmer: Vailin Choi; Dec 2013 + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4004,14 +4004,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_obj_flush_cb + * Function: H5Pget_obj_flush_cb + * + * Purpose: Retrieves the callback function and user data set in the + * property list for an object flush. * - * Purpose: Retrieves the callback function and user data set in the - * property list for an object flush. - * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Dec 2013 + * Programmer: Vailin Choi; Dec 2013 * *------------------------------------------------------------------------- */ @@ -4035,9 +4035,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4045,11 +4045,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_log_options + * Function: H5Pset_mdc_log_options * - * Purpose: Set metadata cache log options. + * Purpose: Set metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4097,11 +4097,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_mdc_log_options + * Function: H5Pget_mdc_log_options * - * Purpose: Get metadata cache log options. + * Purpose: Get metadata cache log options. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -4455,8 +4455,8 @@ done: * * Purpose: Generic encoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4493,8 +4493,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) * * Purpose: Generic decoding callback routine for 'coll_md_read_flag' properties. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 @@ -4523,22 +4523,22 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_all_coll_metadata_ops + * Function: H5Pset_all_coll_metadata_ops * - * Purpose: Tell the library whether the metadata read operations will - * be done collectively (1) or not (0). Default is independent. - * With collective mode, the library will optimize access to - * metadata operations on the file. + * Purpose: Tell the library whether the metadata read operations will + * be done collectively (1) or not (0). Default is independent. + * With collective mode, the library will optimize access to + * metadata operations on the file. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4582,19 +4582,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_all_coll_metadata_ops + * Function: H5Pget_all_coll_metadata_ops * - * Purpose: Gets information about collective metadata read mode. + * Purpose: Gets information about collective metadata read mode. * - * Note: This routine accepts file access property lists, link - * access property lists, attribute access property lists, - * dataset access property lists, group access property lists, - * named datatype access property lists, - * and dataset transfer property lists. + * Note: This routine accepts file access property lists, link + * access property lists, attribute access property lists, + * dataset access property lists, group access property lists, + * named datatype access property lists, + * and dataset transfer property lists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4640,14 +4640,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_coll_metadata_write + * Function: H5Pset_coll_metadata_write * - * Purpose: Tell the library whether the metadata write operations will - * be done collectively (1) or not (0). Default is collective. + * Purpose: Tell the library whether the metadata write operations will + * be done collectively (1) or not (0). Default is collective. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4679,13 +4679,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_coll_metadata_write + * Function: H5Pget_coll_metadata_write * - * Purpose: Gets information about collective metadata write mode. + * Purpose: Gets information about collective metadata write mode. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * Sunday, June 21, 2015 * *------------------------------------------------------------------------- @@ -4717,15 +4717,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_page_buffer_size + * Function: H5Pset_page_buffer_size * * Purpose: Set the maximum page buffering size. This has to be a * multiple of the page allocation size which must be enabled; * otherwise file create/open will fail. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- @@ -4765,13 +4765,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_page_buffer_size + * Function: H5Pget_page_buffer_size * - * Purpose: Retrieves the maximum page buffer size. + * Purpose: Retrieves the maximum page buffer size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * June 2015 * *------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 493a322..a2c0418 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,6 +420,8 @@ H5_DLL herr_t H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view); H5_DLL herr_t H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view); H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size); H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size); +H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); +H5_DLL ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); H5_DLL herr_t H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t boundary[], H5D_append_cb_t func, void *udata); H5_DLL herr_t H5Pget_append_flush(hid_t plist_id, unsigned dims, diff --git a/src/H5system.c b/src/H5system.c index a8726c2..719b7e0 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1043,7 +1043,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) * Unix: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { - drive = name[0] - 'A' + 1; + drive = HDtoupper(name[0]) - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, &name[2], name_len); } /* end if */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6e8fd78..713f2bd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,7 +37,7 @@ endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS}) target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES @@ -54,7 +54,7 @@ if (BUILD_SHARED_LIBS) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS}) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES @@ -174,13 +174,13 @@ set (testhdf5_SOURCES add_executable (testhdf5 ${testhdf5_SOURCES}) TARGET_NAMING (testhdf5 STATIC) TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") -target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (testhdf5-shared ${testhdf5_SOURCES}) TARGET_NAMING (testhdf5-shared SHARED) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") - target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) endif () @@ -188,13 +188,13 @@ MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file}-shared SHARED) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") - target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) endif () ENDMACRO () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 973d389..fca2f27 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -452,7 +452,6 @@ set (test_CLEANFILES extlinks19B00026.h5 extlinks19B00027.h5 extlinks19B00028.h5 - tmp big.data big*.h5 stdio.h5 @@ -582,6 +581,7 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 + tmp/vds_src_2.h5 ) # Remove any output file left over from previous test run @@ -839,21 +839,28 @@ add_test (NAME H5TEST-clear-error_test-objects WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" -) -set_tests_properties (H5TEST-error_test PROPERTIES - DEPENDS H5TEST-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST -) +if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) +else () + add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-error_test PROPERTIES + DEPENDS H5TEST-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) +endif () #-- Adding test for links_env add_test (NAME H5TEST-clear-links_env-objects @@ -959,21 +966,28 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_MASK_ERROR=true" - -D "TEST_OUTPUT=error_test.txt" - -D "TEST_REFERENCE=error_test_1" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5TEST-shared-error_test PROPERTIES - DEPENDS H5TEST-shared-clear-error_test-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) + if (HDF5_USE_16_API_DEFAULT) + add_test ( + NAME H5TEST-shared-error_test-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP $" + ) + else () + add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-error_test PROPERTIES + DEPENDS H5TEST-shared-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endif () #-- Adding test for links_env add_test (NAME H5TEST-shared-clear-links_env-objects diff --git a/test/vds.c b/test/vds.c index c9b7a1b..a882698 100644 --- a/test/vds.c +++ b/test/vds.c @@ -36,6 +36,12 @@ const char *FILENAME[] = { "vds_src_1", "vds%%_src", "vds_dapl", + "vds_virt_2", + "vds_virt_3", + "vds_src_2", + "vds_src_3", + "vds%%_src2", + "vds_dapl2", NULL }; @@ -49,6 +55,8 @@ const char *FILENAME[] = { #define FILENAME_BUF_SIZE 1024 +#define TMPDIR "tmp/" + /*------------------------------------------------------------------------- * Function: vds_select_equal @@ -57,14 +65,7 @@ const char *FILENAME[] = { * provided dataspaces are the same. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t @@ -130,7 +131,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -180,7 +181,7 @@ vds_select_equal(hid_t space1, hid_t space2) if(buf1[i] != buf2[i]) { ret_value = FALSE; break; - } /* end if */ + } /* Free buffers */ HDfree(buf1); @@ -217,14 +218,7 @@ error: * parameters. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Neil Fortner - * Monday, March 2, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -298,8 +292,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, error: H5E_BEGIN_TRY { - if(space_out >= 0) - (void)H5Sclose(space_out); + H5Sclose(space_out); } H5E_END_TRY return -1; @@ -312,14 +305,7 @@ error: * Purpose: Tests API functions related to virtual datasets. * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Monday, February 16, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ /* Helper function to get DCPL for examination depending on config */ @@ -370,12 +356,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, file = -1; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open dataset */ if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get DCPL from dataset */ if((*ex_dcpl = H5Dget_create_plist(dset)) < 0) @@ -394,8 +380,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(oinfo.meta_size.obj.heap_size != exp_meta_size) { printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size); TEST_ERROR - } /* end if */ - } /* end if */ + } + } else if((oinfo.meta_size.obj.heap_size != exp_meta_size) && (oinfo.meta_size.obj.heap_size != (hsize_t)0)) @@ -424,12 +410,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, if(H5Fclose(file) < 0) TEST_ERROR file = -1; - } /* end if */ + } else if(config == TEST_API_COPY_PLIST) { /* Copy property list */ if((*ex_dcpl = H5Pcopy(dcpl)) < 0) TEST_ERROR - } /* end if */ + } else if(config == TEST_API_ENCDEC_PLIST) { size_t plist_buf_size; @@ -448,14 +434,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, /* Free plist_buf */ HDfree(plist_buf); plist_buf = NULL; - } /* end if */ + } else { /* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl * can be closed */ if(H5Iinc_ref(dcpl) < 0) TEST_ERROR *ex_dcpl = dcpl; - } /* end else */ + } /* Verify examination DCPL is equal to original DCPL. Do not compare the * plist to itself, and do not do the comparison if we reopened the file, @@ -466,16 +452,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, TEST_ERROR if(!tri_ret) TEST_ERROR - } /* end if */ + } return 0; error: H5E_BEGIN_TRY { - if(file >= 0) - (void)H5Fclose(file); - if(dset >= 0) - (void)H5Dclose(dset); + H5Fclose(file); + H5Dclose(dset); } H5E_END_TRY; if(plist_buf) HDfree(plist_buf); @@ -532,7 +516,7 @@ test_api(test_api_config_t config, hid_t fapl) case TEST_API_NTESTS: default: TEST_ERROR - } /* end switch */ + } h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -818,7 +802,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Create virtual dataspace */ if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - } /* end for */ + } /* Select all (should not be necessary, but just to be sure) */ if(H5Sselect_all(srcspace[0]) < 0) @@ -932,7 +916,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1038,7 +1022,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Add virtual layout mapping */ if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0) TEST_ERROR - } /* end if */ + } /* Get examination DCPL */ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0) @@ -1063,7 +1047,7 @@ test_api(test_api_config_t config, hid_t fapl) /* Check that the mapping in the DCPL is correct */ if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0) TEST_ERROR - } /* end if */ + } /* Close */ if(H5Sclose(srcspace[0]) < 0) @@ -1073,7 +1057,7 @@ test_api(test_api_config_t config, hid_t fapl) if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(ex_dcpl) < 0) TEST_ERROR ex_dcpl = -1; @@ -1123,23 +1107,460 @@ test_api(test_api_config_t config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(ex_dcpl >= 0) - (void)H5Pclose(ex_dcpl); + for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Pclose(dcpl); + H5Pclose(ex_dcpl); } H5E_END_TRY; return 1; } /* end test_api() */ +/*------------------------------------------------------------------------- + * Function: vds_link_prefix + * + * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp" + * Should be able to access the target source files in tmp directory via the prefix set + * by H5Pset_virtual_prefix() + * + * Return: Success: 0 + * Failure: -1 + *------------------------------------------------------------------------- + */ +static int +test_vds_prefix(unsigned config, hid_t fapl) +{ + char srcfilename[FILENAME_BUF_SIZE]; + char srcfilename_map[FILENAME_BUF_SIZE]; + char vfilename[FILENAME_BUF_SIZE]; + char vfilename2[FILENAME_BUF_SIZE]; + char srcfilenamepct[FILENAME_BUF_SIZE]; + char srcfilenamepct_map[FILENAME_BUF_SIZE]; + const char *srcfilenamepct_map_orig = "vds%%%%_src"; + hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ + hid_t vfile = -1; /* File with virtual dset */ + hid_t vfile2 = -1; /* File with copied virtual dset */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dapl = -1; /* Dataset access property list */ + hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ + hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ + hid_t memspace = -1; /* Memory dataspace */ + hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */ + hid_t vdset = -1; /* Virtual dataset */ + hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ + hsize_t start[4]; /* Hyperslab start */ + hsize_t stride[4]; /* Hyperslab stride */ + hsize_t count[4]; /* Hyperslab count */ + hsize_t block[4]; /* Hyperslab block */ + hssize_t offset[2] = {0, 0}; /* Selection offset */ + int buf[10][26]; /* Write and expected read buffer */ + int rbuf[10][26]; /* Read buffer */ + int rbuf99[9][9]; /* 9x9 Read buffer */ + int evbuf[10][26]; /* Expected VDS "buffer" */ + int erbuf[10][26]; /* Expected read buffer */ + int fill = -1; /* Fill value */ + herr_t ret; /* Generic return value */ + int i, j; + char buffer[1024]; /* buffer to read vds_prefix */ + + TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()") + + h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename); + h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2); + h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename); + h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map); + h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct); + h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map); + + /* create tmp directory and get current working directory path */ + if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Initialize VDS prefix items */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, TMPDIR) != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* + * Test 1: All - all selection + */ + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } + } + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + /* + * Test 2: All - all selection with ENV prefix + */ + if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1)) + TEST_ERROR + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set fill value */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0) + TEST_ERROR + + /* Set prefix to a nonexistent directory, will be overwritten by environment variable */ + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) + TEST_ERROR + + if(H5Pset_virtual_prefix(dapl, "someprefix") < 0) + TEST_ERROR + if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0) + TEST_ERROR + + if(HDstrcmp(buffer, "someprefix") != 0) + FAIL_PUTS_ERROR("vds prefix not set correctly"); + + /* Create source dataspace */ + if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR + + /* Select all (should not be necessary, but just to be sure) */ + if(H5Sselect_all(srcspace[0]) < 0) + TEST_ERROR + if(H5Sselect_all(vspace[0]) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0) + TEST_ERROR + + /* Create virtual file */ + if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create source file if requested */ + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + else { + srcfile[0] = vfile; + if(H5Iinc_ref(srcfile[0]) < 0) + TEST_ERROR + } + + /* Create source dataset */ + if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create virtual dataset */ + if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) + TEST_ERROR + + /* Populate write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j; + + /* Write data directly to source dataset */ + if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Close srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + + if(config & TEST_IO_DIFFERENT_FILE) { + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + } + } + + /* Reopen virtual dataset and file if config option specified */ + if(config & TEST_IO_REOPEN_VIRT) { + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR + if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) + TEST_ERROR + } + + /* Read data through virtual dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) { + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) { + TEST_ERROR + } + } + + /* Adjust write buffer */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); + + /* Write data through virtual dataset */ + if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + TEST_ERROR + + /* Reopen srcdset and srcfile if config option specified */ + if(config & TEST_IO_CLOSE_SRC) { + if(config & TEST_IO_DIFFERENT_FILE) { + HDgetcwd(buffer, 1024); + HDchdir(TMPDIR); + if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR + HDchdir(buffer); + } + if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) + TEST_ERROR + } + + /* Read data directly from source dataset */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) + for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++) + if(rbuf[i][j] != buf[i][j]) + TEST_ERROR + + /* Close */ + if(H5Dclose(vdset) < 0) + TEST_ERROR + vdset = -1; + if(H5Dclose(srcdset[0]) < 0) + TEST_ERROR + srcdset[0] = -1; + if(H5Fclose(srcfile[0]) < 0) + TEST_ERROR + srcfile[0] = -1; + if(H5Fclose(vfile) < 0) + TEST_ERROR + vfile = -1; + if(H5Sclose(srcspace[0]) < 0) + TEST_ERROR + srcspace[0] = -1; + if(H5Sclose(vspace[0]) < 0) + TEST_ERROR + vspace[0] = -1; + if(H5Pclose(dapl) < 0) + TEST_ERROR + dapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR + + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dapl); + H5Pclose(dcpl); + } H5E_END_TRY; + + if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) + TEST_ERROR + + return 1; +} /* end vds_link_prefix() */ + /*------------------------------------------------------------------------- * Function: test_basic_io @@ -1148,14 +1569,7 @@ error: * pattern-matching file/dataset strings * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Tuesday, March 3, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1238,12 +1652,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1272,8 +1686,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1287,7 +1701,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1316,7 +1730,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1400,12 +1814,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1441,8 +1855,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1456,7 +1870,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1487,7 +1901,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1536,8 +1950,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1546,7 +1960,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset2 */ if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0) @@ -1572,7 +1986,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Only copy to a different file if the source datasets are in a different * file */ @@ -1614,8 +2028,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen copied virtual file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1624,7 +2038,7 @@ test_basic_io(unsigned config, hid_t fapl) vfile2 = -1; if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } /* Open v_dset3 */ if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0) @@ -1650,13 +2064,13 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Close copied virtual file */ if(H5Fclose(vfile2) < 0) TEST_ERROR vfile2 = -1; - } /* end if */ + } /* Close */ if(H5Dclose(srcdset[0]) < 0) @@ -1735,12 +2149,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1782,8 +2196,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1797,7 +2211,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1828,7 +2242,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -1923,12 +2337,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -1964,8 +2378,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -1979,7 +2393,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read first source dataset through virtual dataset */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2032,7 +2446,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -2131,12 +2545,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2164,7 +2578,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i][j] = buf[2 * i][j]; for(/* j = 13 */; j < 26; j++) evbuf[i][j] = buf[2 * i + 1][j - 13]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2181,7 +2595,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[i + 5][j] = buf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) evbuf[i + 5][j] = buf[2 * i + 1][j]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2196,8 +2610,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2211,7 +2625,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2227,7 +2641,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i][j] = evbuf[2 * i][j]; for(/* j = 13 */; j < 26; j++) erbuf[i][j] = evbuf[2 * i + 1][j - 13]; - } /* end for */ + } /* Read second slice */ if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2239,7 +2653,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[i + 5][j] = evbuf[2 * i][j + 13]; for(/* j = 13 */; j < 26; j++) erbuf[i + 5][j] = evbuf[2 * i + 1][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2263,7 +2677,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j] = buf[i][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j - 13] = buf[i][j]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2280,7 +2694,7 @@ test_basic_io(unsigned config, hid_t fapl) evbuf[2 * i][j + 13] = buf[i + 5][j]; for(/* j = 13 */; j < 26; j++) evbuf[2 * i + 1][j] = buf[i + 5][j]; - } /* end for */ + } /* Reopen srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -2291,7 +2705,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2307,7 +2721,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j] = evbuf[i][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j - 13] = evbuf[i][j]; - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0) @@ -2319,7 +2733,7 @@ test_basic_io(unsigned config, hid_t fapl) erbuf[2 * i][j + 13] = evbuf[i + 5][j]; for(/* j = 13 */; j < 26; j++) erbuf[2 * i + 1][j] = evbuf[i + 5][j]; - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2439,12 +2853,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2498,8 +2912,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2513,7 +2927,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset by hyperslab */ /* Reset rbuf */ @@ -2538,7 +2952,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Verify read data */ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) @@ -2584,7 +2998,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source datasets */ /* Reset rbuf */ @@ -2605,7 +3019,7 @@ test_basic_io(unsigned config, hid_t fapl) for(j = 0; j < 26; j++) { erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0])); erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0])); - } /* end for */ + } /* Read second dataset */ if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0) @@ -2780,12 +3194,12 @@ test_basic_io(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source dataset */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -2822,8 +3236,8 @@ test_basic_io(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -2837,7 +3251,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data through virtual dataset */ /* Reset rbuf */ @@ -2943,7 +3357,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 3) && (j < 6)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -2996,7 +3410,7 @@ test_basic_io(unsigned config, hid_t fapl) if((j >= 6) && (j < 9)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -3214,7 +3628,7 @@ test_basic_io(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read data directly from source dataset */ /* Select hyperslab in memory space */ @@ -3289,32 +3703,19 @@ test_basic_io(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(vfile2 >= 0) - (void)H5Fclose(vfile2); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Fclose(vfile2); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(memspace); + H5Pclose(dcpl); } H5E_END_TRY; return 1; @@ -3327,14 +3728,7 @@ error: * Purpose: Tests VDS with unlimited selections * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Thursday, April 30, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3447,12 +3841,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -3517,8 +3911,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3532,7 +3926,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3577,11 +3971,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_view() */ if(H5Pget_virtual_view(dapl, &virtual_view) < 0) @@ -3601,7 +3995,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -3649,11 +4043,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -3662,7 +4056,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -3699,8 +4093,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3714,7 +4108,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3761,11 +4155,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -3779,7 +4173,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -3832,11 +4226,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -3845,7 +4239,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 5; @@ -3887,8 +4281,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -3902,7 +4296,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -3964,7 +4358,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -4029,11 +4423,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 15 */ dims[1] = 15; @@ -4060,12 +4454,12 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4079,7 +4473,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4127,11 +4521,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -4166,11 +4560,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 18 */ @@ -4198,11 +4592,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 20 */ dims[1] = 20; @@ -4228,7 +4622,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < (int)mdims[1]; j++) if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4241,12 +4635,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -4322,12 +4716,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -4392,8 +4786,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4407,7 +4801,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4451,11 +4845,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -4469,7 +4863,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4511,11 +4905,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4524,7 +4918,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -4566,8 +4960,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4581,7 +4975,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4627,11 +5021,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -4645,7 +5039,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4696,11 +5090,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -4709,7 +5103,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 10; @@ -4751,8 +5145,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -4766,7 +5160,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -4828,7 +5222,7 @@ test_unlim(unsigned config, hid_t fapl) if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -4845,7 +5239,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -4897,11 +5291,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -4914,12 +5308,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5014,12 +5408,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5059,7 +5453,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][6 * j] = buf[i][2 * j]; erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5075,7 +5469,7 @@ test_unlim(unsigned config, hid_t fapl) for(j = 0; j < 2; j++) { erbuf[i][(6 * j) + 2] = buf[i][2 * j]; erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1]; - } /* end for */ + } /* Adjust write buffer */ for(i = 0; i < (int)mdims[0]; i++) @@ -5096,7 +5490,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][4] = buf[i][0]; erbuf[i][5] = buf[i][1]; - } /* end for */ + } /* Close srcdsets and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5114,8 +5508,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5129,7 +5523,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5173,11 +5567,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5191,7 +5585,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5233,11 +5627,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5246,7 +5640,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[1] = 7; @@ -5283,8 +5677,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5298,7 +5692,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5343,11 +5737,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5361,7 +5755,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5371,7 +5765,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][12] = buf[i][0]; erbuf[i][13] = buf[i][1]; erbuf[i][18] = buf[i][2]; - } /* end for */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5415,11 +5809,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5428,7 +5822,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[2] */ dims[1] = 5; @@ -5460,7 +5854,7 @@ test_unlim(unsigned config, hid_t fapl) erbuf[i][10] = buf[i][0]; erbuf[i][11] = buf[i][1]; erbuf[i][16] = buf[i][2]; - } /* end for */ + } /* Close srcdset[2] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5472,8 +5866,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5487,7 +5881,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5532,11 +5926,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -5550,7 +5944,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5596,11 +5990,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5609,7 +6003,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[1] = 6; @@ -5640,7 +6034,7 @@ test_unlim(unsigned config, hid_t fapl) for(i = 0; i < 10; i++) { erbuf[i][14] = buf[i][0]; erbuf[i][15] = buf[i][1]; - } /* end for */ + } /* Close srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -5652,8 +6046,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5667,7 +6061,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -5711,11 +6105,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -5729,7 +6123,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -5771,11 +6165,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now just read middle 2 rows */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -5801,11 +6195,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if((i == 4) || (i == 5)) { if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != 0) TEST_ERROR @@ -5824,12 +6218,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -5910,12 +6304,12 @@ test_unlim(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create source datasets */ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0) @@ -5968,8 +6362,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -5983,7 +6377,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6029,11 +6423,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -6047,7 +6441,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6089,11 +6483,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[0] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -6102,7 +6496,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[0] */ dims[0] = 5; @@ -6140,8 +6534,8 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6155,7 +6549,7 @@ test_unlim(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6201,11 +6595,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -6219,7 +6613,7 @@ test_unlim(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -6267,11 +6661,11 @@ test_unlim(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -6284,12 +6678,12 @@ test_unlim(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -6329,36 +6723,21 @@ test_unlim(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(srcdcpl >= 0) - (void)H5Pclose(srcdcpl); - if(dapl >= 0) - (void)H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(srcdcpl); + H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -6372,14 +6751,7 @@ error: * source dataset resolution * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Tuesday, May 26, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6485,12 +6857,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6502,7 +6874,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6516,7 +6888,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6602,8 +6974,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6617,7 +6989,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6661,11 +7033,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -6702,8 +7074,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6717,7 +7089,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -6757,11 +7129,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try with different selections */ count[0] = 10; @@ -6788,12 +7160,12 @@ test_printf(unsigned config, hid_t fapl) if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end for */ + } + } start[1] = 0; /* Now try writing through VDS */ @@ -6829,7 +7201,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Read srcdset[0] */ count[0] = 10; @@ -6931,12 +7303,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -6948,7 +7320,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -6962,7 +7334,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7100,14 +7472,14 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7121,7 +7493,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7165,11 +7537,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Test H5Pget_virtual_printf_gap() */ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) @@ -7189,7 +7561,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7241,11 +7613,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 2, reopen file as well if * config option specified */ @@ -7259,7 +7631,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7311,11 +7683,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 3, reopen file as well if * config option specified */ @@ -7329,7 +7701,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7381,11 +7753,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 4, reopen file as well if * config option specified */ @@ -7399,7 +7771,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7451,11 +7823,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -7469,7 +7841,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -7515,11 +7887,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -7533,16 +7905,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -7615,7 +7987,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7681,7 +8053,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7695,7 +8067,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7739,11 +8111,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -7778,7 +8150,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -7792,7 +8164,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7836,11 +8208,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -7856,7 +8228,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -7926,7 +8298,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -7992,7 +8364,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8006,7 +8378,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8050,11 +8422,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile[1] if config option specified */ if(config & TEST_IO_CLOSE_SRC) @@ -8089,7 +8461,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8103,7 +8475,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8147,11 +8519,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { @@ -8167,7 +8539,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[1]) < 0) TEST_ERROR srcfile[1] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8180,7 +8552,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Sclose(vspace[0]) < 0) TEST_ERROR vspace[0] = -1; - } /* end if */ + } /* @@ -8238,12 +8610,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8255,7 +8627,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8269,7 +8641,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8355,8 +8727,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8370,7 +8742,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8414,11 +8786,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8454,8 +8826,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8469,7 +8841,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8513,11 +8885,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -8531,7 +8903,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8578,11 +8950,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -8618,8 +8990,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8633,7 +9005,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -8677,11 +9049,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -8695,7 +9067,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8742,11 +9114,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf_gap set to 1, reopen file as well if * config option specified */ @@ -8760,7 +9132,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -8807,11 +9179,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -8825,16 +9197,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -8910,12 +9282,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -8927,7 +9299,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -8941,7 +9313,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9037,8 +9409,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9052,7 +9424,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9096,11 +9468,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9114,7 +9486,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9161,11 +9533,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9205,8 +9577,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9220,7 +9592,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9264,11 +9636,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file * as well if config option specified */ @@ -9282,7 +9654,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9328,11 +9700,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -9369,8 +9741,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9384,7 +9756,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9428,11 +9800,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9466,11 +9838,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Shrink to 12 */ @@ -9496,11 +9868,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Shrink to 10 */ dims[1] = 12; @@ -9525,12 +9897,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file * as well if config option specified */ @@ -9544,7 +9916,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9590,11 +9962,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now test reopening virtual dataset without calling H5Dget_space, if * REOPEN_VIRT flag set */ @@ -9628,11 +10000,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Now try setting extent manually */ /* Grow to 12 */ @@ -9658,11 +10030,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Grow to 15 */ dims[1] = 15; @@ -9687,12 +10059,12 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ - } /* end if */ + } + } /* Reset dapl */ if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0) @@ -9704,16 +10076,16 @@ test_printf(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -9770,12 +10142,12 @@ test_printf(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile[0] = vfile; if(H5Iinc_ref(srcfile[0]) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0) @@ -9787,7 +10159,7 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9801,7 +10173,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9867,8 +10239,8 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -9882,7 +10254,7 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -9926,11 +10298,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Close VDS and reopen with printf gap set to 127, reopen file as well if * config option specified */ @@ -9944,7 +10316,7 @@ test_printf(unsigned config, hid_t fapl) vfile = -1; if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR - } /* end if */ + } if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR @@ -9990,11 +10362,11 @@ test_printf(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reset dapl */ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0) @@ -10008,12 +10380,12 @@ test_printf(unsigned config, hid_t fapl) if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile[0]) < 0) TEST_ERROR srcfile[0] = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -10044,32 +10416,19 @@ test_printf(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) { - if(srcfile[i] >= 0) - (void)H5Fclose(srcfile[i]); - } /* end for */ - if(vfile >= 0) - (void)H5Fclose(vfile); - if(srcspace >= 0) - (void)H5Sclose(srcspace); - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(dapl >= 0) - (void)H5Pclose(dapl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) + H5Fclose(srcfile[i]); + H5Fclose(vfile); + H5Sclose(srcspace); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(dapl); } H5E_END_TRY; return 1; @@ -10083,14 +10442,7 @@ error: * VDS * * Return: Success: 0 - * * Failure: number of errors - * - * Programmer: Neil Fortner - * Friday, August 14, 2015 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -10212,12 +10564,12 @@ test_all(unsigned config, hid_t fapl) if(config & TEST_IO_DIFFERENT_FILE) { if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - } /* end if */ + } else { srcfile = vfile; if(H5Iinc_ref(srcfile) < 0) TEST_ERROR - } /* end if */ + } /* Create virtual dataset */ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -10229,7 +10581,7 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10243,7 +10595,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10314,14 +10666,14 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(config & TEST_IO_DIFFERENT_FILE) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10335,7 +10687,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10381,11 +10733,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10394,7 +10746,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 2; @@ -10429,8 +10781,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10444,7 +10796,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10490,11 +10842,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10534,8 +10886,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10549,7 +10901,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10595,11 +10947,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10608,7 +10960,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 3; @@ -10652,8 +11004,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10667,7 +11019,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10713,11 +11065,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10757,8 +11109,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10772,7 +11124,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10818,11 +11170,11 @@ test_all(unsigned config, hid_t fapl) if((i >= (int)dims[0]) || (j >= (int)dims[1])) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcdset[1] and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -10831,7 +11183,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Extend srcdset[1] */ dims[0] = 7; @@ -10876,8 +11228,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10891,7 +11243,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -10937,11 +11289,11 @@ test_all(unsigned config, hid_t fapl) if(j >= (int)dims[1]) { if(rbuf[i][j] != 0) TEST_ERROR - } /* end if */ + } else if(rbuf[i][j] != erbuf[i][j]) TEST_ERROR - } /* end for */ + } /* Reopen srcfile if config option specified */ if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE)) @@ -10981,8 +11333,8 @@ test_all(unsigned config, hid_t fapl) if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ - } /* end if */ + } + } /* Reopen virtual dataset and file if config option specified */ if(config & TEST_IO_REOPEN_VIRT) { @@ -10996,7 +11348,7 @@ test_all(unsigned config, hid_t fapl) TEST_ERROR if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0) TEST_ERROR - } /* end if */ + } /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) @@ -11048,16 +11400,16 @@ test_all(unsigned config, hid_t fapl) if(H5Dclose(srcdset[i]) < 0) TEST_ERROR srcdset[i] = -1; - } /* end for */ + } if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } else if(!(config & TEST_IO_DIFFERENT_FILE)) { if(H5Fclose(srcfile) < 0) TEST_ERROR srcfile = -1; - } /* end if */ + } if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; @@ -11068,12 +11420,12 @@ test_all(unsigned config, hid_t fapl) if(H5Sclose(srcspace[i]) < 0) TEST_ERROR srcspace[i] = -1; - } /* end for */ + } for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { if(H5Sclose(vspace[i]) < 0) TEST_ERROR vspace[i] = -1; - } /* end for */ + } if(H5Pclose(dcpl) < 0) TEST_ERROR dcpl = -1; @@ -11089,32 +11441,19 @@ test_all(unsigned config, hid_t fapl) error: H5E_BEGIN_TRY { - for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) { - if(srcdset[i] >= 0) - (void)H5Dclose(srcdset[i]); - } /* end for */ - if(vdset >= 0) - (void)H5Dclose(vdset); - if(srcfile >= 0) - (void)H5Fclose(srcfile); - if(vfile >= 0) - (void)H5Fclose(vfile); - for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) { - if(srcspace[i] >= 0) - (void)H5Sclose(srcspace[i]); - } /* end for */ - for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) { - if(vspace[i] >= 0) - (void)H5Sclose(vspace[i]); - } /* end for */ - if(filespace >= 0) - (void)H5Sclose(filespace); - if(memspace >= 0) - (void)H5Sclose(memspace); - if(dcpl >= 0) - (void)H5Pclose(dcpl); - if(srcdcpl >= 0) - (void)H5Pclose(srcdcpl); + for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) + H5Dclose(srcdset[i]); + H5Dclose(vdset); + H5Fclose(srcfile); + H5Fclose(vfile); + for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) + H5Sclose(srcspace[i]); + for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) + H5Sclose(vspace[i]); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Pclose(srcdcpl); } H5E_END_TRY; return 1; @@ -11128,10 +11467,6 @@ error: * * Return: Success: 0 * Failure: 1 - * - * Programmer: Dana Robinson - * March 2016 - * *------------------------------------------------------------------------- */ static int @@ -11273,10 +11608,6 @@ test_dapl_values(hid_t fapl_id) * Purpose: Tests datasets with virtual layout * * Return: EXIT_SUCCESS/EXIT_FAILURE - * - * Programmer: Neil Fortner - * Tuesday, February 17, 2015 - * *------------------------------------------------------------------------- */ int @@ -11299,10 +11630,11 @@ main(void) for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); nerrors += test_basic_io(bit_config, fapl); + nerrors += test_vds_prefix(bit_config, fapl); nerrors += test_unlim(bit_config, fapl); nerrors += test_printf(bit_config, fapl); nerrors += test_all(bit_config, fapl); - } /* end for */ + } nerrors += test_dapl_values(fapl); diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 3addecf..368471c 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -72,6 +72,14 @@ f-3.h5 vds-eiger.h5 ) + set (HDF5_REFERENCE_PREFIX_VDS + 1_vds.h5 + 2_vds.h5 + 4_vds.h5 + 5_vds.h5 + vds-percival-unlim-maxmin.h5 + vds-eiger.h5 + ) set (HDF5_ERROR_REFERENCE_VDS ) @@ -80,12 +88,21 @@ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () + foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_VDS}) + get_filename_component(fname "${vds_h5_file}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files") + endforeach () foreach (ddl_vds ${HDF5_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach () + foreach (ddl_vds ${HDF5_REFERENCE_VDS}) + get_filename_component(fname "${ddl_vds}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files") + endforeach () + foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") @@ -134,6 +151,44 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_vds_test}" STREQUAL "") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) + endif () + else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + add_test ( + NAME H5DUMP_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -261,3 +316,15 @@ ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5) ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5) endif () + + # Data read with prefix + if (USE_FILTER_DEFLATE) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) + ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) + endif () + diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 5df61bb..f25bd98 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -61,6 +61,17 @@ get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files") endforeach () + + foreach (listfiles ${LIST_HDF5_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + + foreach (listfiles ${LIST_OTHER_TEST_FILES}) + get_filename_component(fname "${listfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files") + endforeach () + add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -104,6 +115,43 @@ endif () endmacro () + macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + if ("${resultcode}" STREQUAL "1") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + else () + add_test ( + NAME H5LS_PREFIX-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + add_test ( + NAME H5LS_PREFIX-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=vds/prefix/${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls" + -D "TEST_ENV_VAR=HDF5_VDS_PREFIX" + -D "TEST_ENV_VALUE=\${ORIGIN}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -155,3 +203,10 @@ ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5) ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5) + ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5) + diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls new file mode 100644 index 0000000..2830d1a --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 18/18, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 2880 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls new file mode 100644 index 0000000..5c6f9d3 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 8/8, 14/14} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 2688 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls new file mode 100644 index 0000000..f4c8e78 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_1.ls @@ -0,0 +1,14 @@ +Opened "vds/prefix/3_1_vds.h5" with sec2 driver. +vds_dset Dataset {5/Inf, 25/25, 8/8} + Location: 1:800 + Links: 1 + Maps: {6} Source { + 1_a.h5 /source_dset + 1_b.h5 /source_dset + 1_c.h5 /source_dset + 1_d.h5 /source_dset + 1_e.h5 /source_dset + 1_f.h5 /source_dset + } + Storage: 4000 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls new file mode 100644 index 0000000..5a7e2d8 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-3_2.ls @@ -0,0 +1,13 @@ +Opened "vds/prefix/3_2_vds.h5" with sec2 driver. +vds_dset Dataset {6/Inf, 13/13, 19/19} + Location: 1:800 + Links: 1 + Maps: {5} Source { + 2_a.h5 /source_dset + 2_b.h5 /source_dset + 2_c.h5 /source_dset + 2_d.h5 /source_dset + 2_e.h5 /source_dset + } + Storage: 5928 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls new file mode 100644 index 0000000..c22d3a4 --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-4.ls @@ -0,0 +1,9 @@ +Opened "vds/prefix/4_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {1} Source { + 4_%b.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls new file mode 100644 index 0000000..efba8dc --- /dev/null +++ b/tools/test/h5ls/vds_prefix/tvds-5.ls @@ -0,0 +1,11 @@ +Opened "vds/prefix/5_vds.h5" with sec2 driver. +vds_dset Dataset {9/Inf, 4/4, 4/4} + Location: 1:800 + Links: 1 + Maps: {3} Source { + 5_a.h5 /source_dset + 5_b.h5 /source_dset + 5_c.h5 /source_dset + } + Storage: 576 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer -- cgit v0.12 From f5f2c36d98a6bfeb41363e38f1a34036264d1036 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 09:05:30 -0600 Subject: HDFFV-9724 prefix of 0 length should be null value --- src/H5Dvirtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 8d861c9..24623e4 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -898,7 +898,7 @@ H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, H5E_BEGIN_TRY { size = H5Pget_virtual_prefix(plist_id, NULL, 0); } H5E_END_TRY; - if(size < 0) + if(size <= 0) my_prefix = NULL; else { /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ -- cgit v0.12 From 6d3f7dea8683053cad86c04ac800ecf78361590f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 11:53:11 -0600 Subject: Fix memory leak due to addition of FORMAT check loop --- test/filter_plugin.c | 204 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 126 insertions(+), 78 deletions(-) diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 8b7e0e4..9897c84 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -134,7 +134,7 @@ allocate_and_init_2D_array(int ***arr, const hsize_t *sizes, int **initial_value return SUCCEED; error: free_2D_array(arr); - + return FAIL; } /* end allocate_and_init_2D_array() */ @@ -165,7 +165,7 @@ compare_2D_arrays(int **dset1, int **dset2, const hsize_t *sizes, /*OUT*/ hbool_ } return SUCCEED; - + } /* end compare_2D_arrays() */ @@ -612,7 +612,7 @@ test_read_data(hid_t did, int *origin_data) free_2D_array(&check); PASSED(); - + return SUCCEED; error: @@ -943,14 +943,14 @@ error: * paths. * * Return: SUCCEED/FAIL - * + * *------------------------------------------------------------------------- */ static herr_t test_path_api_calls(void) { unsigned int n_starting_paths; - unsigned int u; + unsigned int u; unsigned int n_paths; herr_t ret; ssize_t path_len = -1; @@ -1319,7 +1319,7 @@ error: * Purpose: Turns the chunk cache off * * Return: SUCCEED/FAIL - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1360,37 +1360,36 @@ main(void) unsigned new_format; int nerrors = 0; - /* Testing setup */ - h5_reset(); - /*******************************************************************/ /* ENSURE THAT WRITING TO DATASETS AND CREATING GROUPS WORKS */ /*******************************************************************/ + /* Test with old & new format groups */ + for (new_format = FALSE; new_format <= TRUE; new_format++) { + hid_t my_fapl_id; - /* Get a VFD-dependent filename */ - if ((old_ff_fapl_id = h5_fileaccess()) < 0) - TEST_ERROR; - - /* Turn off the chunk cache, so all the chunks are immediately written to disk */ - if (disable_chunk_cache(old_ff_fapl_id) < 0) - TEST_ERROR; + /* Testing setup */ + h5_reset(); - /* Copy the file access property list and set the latest file format on it */ - if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) - TEST_ERROR; - if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - TEST_ERROR; + /* Get a VFD-dependent filename */ + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; - /* Fix up the filename for the VFD */ - h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename)); + /* Turn off the chunk cache, so all the chunks are immediately written to disk */ + if (disable_chunk_cache(old_ff_fapl_id) < 0) + TEST_ERROR; - /* Test with old & new format groups */ - for (new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t my_fapl_id; + /* Fix up the filename for the VFD */ + h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename)); /* Set the FAPL for the type of format */ if (new_format) { HDputs("\nTesting with new file format:"); + /* Copy the file access property list and set the latest file format on it */ + if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) + TEST_ERROR; + if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; + my_fapl_id = new_ff_fapl_id; } else { @@ -1410,61 +1409,121 @@ main(void) if (H5Fclose(fid) < 0) TEST_ERROR; - } /* end for */ - /* Close FAPLs */ - if (H5Pclose(old_ff_fapl_id) < 0) - TEST_ERROR; - if (H5Pclose(new_ff_fapl_id) < 0) - TEST_ERROR; + /* Close FAPLs */ + if (H5Pclose(old_ff_fapl_id) < 0) + TEST_ERROR; + if (new_format) { + if (H5Pclose(new_ff_fapl_id) < 0) + TEST_ERROR; + } - /* Restore the default error handler (set in h5_reset()) */ - h5_restore_err(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); - /*******************************************************************/ - /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */ - /*******************************************************************/ + /*******************************************************************/ + /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */ + /*******************************************************************/ - HDputs("\nTesting reading data with with dynamic plugin filters:"); + HDputs("\nTesting reading data with with dynamic plugin filters:"); - /* Close the library so that all loaded plugin libraries are unloaded */ - h5_reset(); - if ((old_ff_fapl_id = h5_fileaccess()) < 0) - TEST_ERROR; + /* Close the library so that all loaded plugin libraries are unloaded */ + h5_reset(); + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; - /* Reopen the file for testing data reading */ - if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0) - TEST_ERROR; + /* Set the FAPL for the type of format */ + if (new_format) { + /* Copy the file access property list and set the latest file format on it */ + if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) + TEST_ERROR; + if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; - /* Read the data with filters */ - nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0); + my_fapl_id = new_ff_fapl_id; + } + else + my_fapl_id = old_ff_fapl_id; - /* Test creating groups using dynamically-loaded plugin filters */ - nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0); + /* Reopen the file for testing data reading */ + if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0) + TEST_ERROR; - /* Restore the default error handler (set in h5_reset()) */ - h5_restore_err(); + /* Read the data with filters */ + nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0); - /*******************************************************************/ - /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */ - /*******************************************************************/ + /* Test creating groups using dynamically-loaded plugin filters */ + nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0); - /* Close the library so that all loaded plugin libraries are unloaded */ - h5_reset(); - if ((old_ff_fapl_id = h5_fileaccess()) < 0) - TEST_ERROR; + /* Close FAPLs */ + if (H5Pclose(old_ff_fapl_id) < 0) + TEST_ERROR; + if (new_format) { + if (H5Pclose(new_ff_fapl_id) < 0) + TEST_ERROR; + } - /* Reopen the file for testing data reading */ - if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, old_ff_fapl_id)) < 0) - TEST_ERROR; + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); - /* When filters are disabled, make sure we can't read data from a - * dataset that requires a filter plugin. - */ - nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0); + /*******************************************************************/ + /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */ + /*******************************************************************/ - if (H5Fclose(fid) < 0) - TEST_ERROR; + /* Close the library so that all loaded plugin libraries are unloaded */ + h5_reset(); + if ((old_ff_fapl_id = h5_fileaccess()) < 0) + TEST_ERROR; + + /* Set the FAPL for the type of format */ + if (new_format) { + /* Copy the file access property list and set the latest file format on it */ + if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0) + TEST_ERROR; + if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; + + my_fapl_id = new_ff_fapl_id; + } + else + my_fapl_id = old_ff_fapl_id; + + /* Reopen the file for testing data reading */ + if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0) + TEST_ERROR; + + /* When filters are disabled, make sure we can't read data from a + * dataset that requires a filter plugin. + */ + nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0); + + if (H5Fclose(fid) < 0) + TEST_ERROR; + + /*********************/ + /* CLEAN UP */ + /*********************/ + /* Close FAPLs */ + if (new_format) { + if (H5Pclose(new_ff_fapl_id) < 0) + TEST_ERROR; + } + else { + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + if (H5Pclose(old_ff_fapl_id) < 0) + TEST_ERROR; + } + + /* Free up saved arrays */ + free_2D_array(&orig_deflate_g); + free_2D_array(&orig_dynlib1_g); + free_2D_array(&orig_dynlib2_g); + free_2D_array(&orig_dynlib4_g); + } /* end for */ + + h5_cleanup(FILENAME, old_ff_fapl_id); /************************************/ /* TEST THE FILTER PLUGIN API CALLS */ @@ -1473,21 +1532,10 @@ main(void) /* Test the APIs for access to the filter plugin path table */ nerrors += (test_path_api_calls() < 0 ? 1 : 0); - /*********************/ - /* CLEAN UP AND EXIT */ - /*********************/ - - /* Free up saved arrays */ - free_2D_array(&orig_deflate_g); - free_2D_array(&orig_dynlib1_g); - free_2D_array(&orig_dynlib2_g); - free_2D_array(&orig_dynlib4_g); - if (nerrors) TEST_ERROR; HDprintf("All plugin tests passed.\n"); - h5_cleanup(FILENAME, old_ff_fapl_id); HDexit(EXIT_SUCCESS); -- cgit v0.12 From 9a477bef3a55718fbc886a70576f90c8329f7f12 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 13:13:30 -0600 Subject: HDFFV-9724 add valgrind ENV --- tools/test/h5dump/CMakeTestsVDS.cmake | 5 ++++- tools/test/h5ls/CMakeTestsVDS.cmake | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 368471c..922e79e 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -155,7 +155,10 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES + ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + ) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") endif () diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index f25bd98..00e7d28 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -119,7 +119,10 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") + set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES + ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + ) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") endif () -- cgit v0.12 From fa1ae9f312aad7fa51e01961ce255a4ce08539e0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Dec 2017 13:42:16 -0600 Subject: HDFFV-9724 init var to null --- src/H5Dvirtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 24623e4..306fe62 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -812,7 +812,7 @@ H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, H5F_t *src_file = NULL; /* Source file */ H5F_t *ret_value = NULL; /* Actual return value */ char *full_name = NULL; /* File name with prefix */ - char *my_prefix; /* Library's copy of the prefix */ + char *my_prefix = NULL; /* Library's copy of the prefix */ unsigned intent; /* File access permissions */ char *actual_file_name = NULL; /* Virtual file's actual name */ char *temp_file_name = NULL; /* Temporary pointer to file name */ -- cgit v0.12 From 17b8f0bb936633f01bf6deba247e37bcadbc6b82 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 09:39:09 -0600 Subject: Fix valgrind issues --- config/cmake/CTestCustom.cmake | 81 ++++++++++++++++++++++++++++++++++++- tools/test/h5ls/CMakeTestsVDS.cmake | 2 +- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 7aff076..33e6d4c 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -45,11 +45,13 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-clear-objects H5TEST-clear-cache-objects H5TEST-clear-cache_api-objects + H5TEST-clear-cache_image-objects H5TEST-clear-cache_tagging-objects - H5TEST-clear-ttsafe-objects H5TEST-clear-err_compat-objects H5TEST-clear-error_test-objects + H5TEST-clear-filenotclosed-objects H5TEST-clear-links_env-objects + H5TEST-clear-ttsafe-objects PERFORM_h5perform-clear-objects HL_TOOLS-clear-objects HL_test-clear-objects @@ -58,6 +60,18 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE CPP_testhdf5-clear-objects ######### tools/h5clear ######### H5CLEAR-clearall-objects + H5CLEAR-copy_h5clear_log_v3.h5 + H5CLEAR-copy_h5clear_mdc_image.h5 + H5CLEAR-copy_h5clear_sec2_v0.h5 + H5CLEAR-copy_h5clear_sec2_v2.h5 + H5CLEAR-copy_h5clear_sec2_v3.h5 + H5CLEAR-copy_latest_h5clear_log_v3.h5 + H5CLEAR-copy_latest_h5clear_sec2_v3.h5 + H5CLEAR-copy_mod_h5clear_mdc_image.h5 + H5CLEAR-copy_mod_h5clr_mdc_image2.h5 + H5CLEAR-copy_orig_h5clear_sec2_v0.h5 + H5CLEAR-copy_orig_h5clear_sec2_v2.h5 + H5CLEAR-copy_orig_h5clear_sec2_v3.h5 H5CLEAR-h5clear_gentest # does not close ids by design ######### tools/h5copy ######### H5COPY-clearall-objects @@ -209,6 +223,68 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5LS_VDS-clearall-objects ######### tools/h5repack ######### H5REPACK-clearall-objects + H5REPACK-add_alignment-clear-objects + H5REPACK-add_userblock-clear-objects + H5REPACK-all_filters-clear-objects + H5REPACK-attr-clear-objects + H5REPACK-committed_dt-clear-objects + H5REPACK-deflate_convert-clear-objects + H5REPACK-deflate_copy-clear-objects + H5REPACK-deflate_file-clear-objects + H5REPACK-deflate_remove-clear-objects + H5REPACK-early-clear-objects + H5REPACK-error4-clear-objects + H5REPACK-family-clear-objects + H5REPACK-fill-clear-objects + H5REPACK-fletcher_all-clear-objects + H5REPACK-fletcher_copy-clear-objects + H5REPACK-fletcher_individual-clear-objects + H5REPACK-fletcher_remove-clear-objects + H5REPACK-global_filters-clear-objects + H5REPACK-gt_mallocsize-clear-objects + H5REPACK-gzip_all-clear-objects + H5REPACK-gzip_individual-clear-objects + H5REPACK-hlink-clear-objects + H5REPACK-layout-clear-objects + H5REPACK-native_attr-clear-objects + H5REPACK-native_fill-clear-objects + H5REPACK-nbit_add-clear-objects + H5REPACK-nbit_copy-clear-objects + H5REPACK-nbit_remove-clear-objects + H5REPACK-nested_8bit_enum-clear-objects + H5REPACK-objs-clear-objects + H5REPACK-remove_all-clear-objects + H5REPACK-scale_add-clear-objects + H5REPACK-scale_copy-clear-objects + H5REPACK-scale_remove-clear-objects + H5REPACK-shuffle_all-clear-objects + H5REPACK-shuffle_copy-clear-objects + H5REPACK-shuffle_individual-clear-objects + H5REPACK-shuffle_remove-clear-objects + H5REPACK-szip_all-clear-objects + H5REPACK-szip_convert-clear-objects + H5REPACK-szip_copy-clear-objects + H5REPACK-szip_individual-clear-objects + H5REPACK-szip_remove-clear-objects + H5REPACK-upgrade_layout-clear-objects + H5REPACK_DMP-crtorder-clear-objects + H5REPACK_DMP-deflate_limit-clear-objects + H5REPACK-bug1814-clear-objects + H5REPACK-HDFFV-5932-clear-objects + H5REPACK-HDFFV-7840-clear-objects + H5REPACK_META-meta_long_N-clear-objects + H5REPACK_META-meta_short_N-clear-objects + H5REPACK_OLD-old_style_layout_short_switches-clear-objects + H5REPACK_STAT-GS_AGGR-clear-objects + H5REPACK_STAT-S_AGGR-clear-objects + H5REPACK_STAT-SP_NONE-clear-objects + H5REPACK_STAT-SP_PAGE-clear-objects + H5REPACK_STAT-SPT_FSM_AGGR-clear-objects + H5REPACK_STAT-STG_PAGE-clear-objects + ######### + H5REPACK_META-meta_long + H5REPACK_META-meta_short + ######### H5REPACK-gzip_verbose_filters #uses runTest.cmake H5REPACK_VERIFY_LAYOUT-dset2_chunk_20x10 #uses grepTest.cmake H5REPACK_VERIFY_LAYOUT_ALL-chunk_20x10 #uses grepTest.cmake @@ -236,6 +312,8 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE ######### tools/misc ######### H5REPART-clearall-objects H5MKGRP-clearall-objects + ######### tools/perform ######### + PERFORM_h5perform-clearall-objects ######### hl/tools/h5watch ######### H5WATCH-clearall-objects ######### examples ######### @@ -244,5 +322,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE CPP_ex_tutr-clear-objects HL_ex-clear-objects f90_ex-clear-objects + HL_CPP_ex_ptExampleFL-clear-objects HL_FORTRAN_f90_ex-clear-objects ) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 00e7d28..2b6f61e 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -121,7 +121,7 @@ add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}" - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") -- cgit v0.12 From 5f4676f3c8f077b1667611b78d2cb19deec1f37a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 14:39:32 -0600 Subject: HDFFV-8745 - fix implementation of 8625 --- MANIFEST | 2 +- tools/lib/h5diff_attr.c | 20 -------------------- tools/lib/h5diff_dset.c | 19 +++++++++++++++++++ tools/test/h5diff/CMakeTests.cmake | 12 +++++++----- tools/test/h5diff/testfiles/h5diff_8625.txt | 10 ++++++++++ tools/test/h5diff/testfiles/h5diff_tmp1.txt | 5 ----- tools/test/h5diff/testh5diff.sh.in | 8 ++++---- 7 files changed, 41 insertions(+), 35 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_8625.txt delete mode 100644 tools/test/h5diff/testfiles/h5diff_tmp1.txt diff --git a/MANIFEST b/MANIFEST index c6c7b3c..45b6912 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2425,7 +2425,7 @@ ./tools/test/h5diff/testfiles/non_comparables2.h5 ./tools/test/h5diff/testfiles/tmptest2.he5 ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 -./tools/test/h5diff/testfiles/h5diff_tmp1.txt +./tools/test/h5diff/testfiles/h5diff_8625.txt ./tools/test/h5diff/testfiles/tmptest.he5 ./tools/test/h5diff/testfiles/h5diff_tmp2.txt ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 6019738..4e4b40d 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -385,28 +385,8 @@ hsize_t diff_attr(hid_t loc1_id, /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); - vstrtype1 = H5Tis_variable_str(ftype1_id); if((ftype2_id = H5Aget_type(attr2_id)) < 0) HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); - vstrtype2 = H5Tis_variable_str(ftype2_id); - - /* no compare if either one but not both are variable string type */ - if (vstrtype1 != vstrtype2) { - if((opts->m_verbose || opts->m_list_not_cmp)) - parallel_print("Not comparable: one of attribute <%s/%s> or <%s/%s> is of variable length type\n", - path1, name1, path2, name2); - opts->not_cmp = 1; - if (H5Tclose(ftype1_id) < 0) - HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); - if (H5Tclose(ftype2_id) < 0) - HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); - if (H5Aclose(attr1_id) < 0) - HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed"); - if (H5Aclose(attr2_id) < 0) - HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose second attribute failed"); - - continue; - } if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0) HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type first attribute ftype failed"); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index ee42b99..55e9839 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -767,12 +767,31 @@ int diff_can_type(hid_t f_tid1, /* file data type */ } } + if(tclass1 == H5T_STRING) { + hid_t vstrtype1 = -1; + hid_t vstrtype2 = -1; + h5difftrace("diff_can_type end - H5T_STRING\n"); + + vstrtype1 = H5Tis_variable_str(f_tid1); + vstrtype2 = H5Tis_variable_str(f_tid2); + + /* no compare if either one but not both are variable string type */ + if (vstrtype1 != vstrtype2) { + if((opts->m_verbose || opts->m_list_not_cmp)) + parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n", + obj1_name, obj2_name); + opts->not_cmp = 1; + HGOTO_DONE(0); + } + } + if(tclass1 == H5T_COMPOUND) { int nmembs1; int nmembs2; int j; hid_t memb_type1 = -1; hid_t memb_type2 = -1; + h5difftrace("diff_can_type end - H5T_COMPOUND\n"); nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index bbc39d8..773b03d 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -293,7 +293,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_800.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_801.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp1.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8625.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt @@ -1021,6 +1021,8 @@ h5diff_800.out.err h5diff_801.out h5diff_801.out.err + h5diff_8625.out + h5diff_8625.out.err h5diff_90.out h5diff_90.out.err h5diff_v1.out @@ -1281,9 +1283,7 @@ ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/f # 7. attributes # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) -# temporary test to verify HDF5-8625 -ADD_H5_TEST (h5diff_tmp1 0 tmptest2.he5 tmptest.he5) -# temporary test to verify HDF5-8639 +# temporary test to verify HDFFV-8639 ADD_H5_TEST (h5diff_tmp2 1 tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5) # ################################################## @@ -1613,7 +1613,9 @@ ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 # ############################################################################## # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## -ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) +ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) +# test to verify HDFFV-8625 +ADD_H5_TEST (h5diff_8625 0 -v --enable-error-stack ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group/Compound_dset1 /group_copy/Compound_dset3) ADD_H5_TEST (h5diff_vlstr 0 -v tvlstr.h5 tvlstr2.h5) # ############################################################################## diff --git a/tools/test/h5diff/testfiles/h5diff_8625.txt b/tools/test/h5diff/testfiles/h5diff_8625.txt new file mode 100644 index 0000000..a7ddb86 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_8625.txt @@ -0,0 +1,10 @@ +dataset: and +Warning: different storage datatype +Warning: different storage datatype +Not comparable: or is of mixed string type +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. +EXIT CODE: 0 diff --git a/tools/test/h5diff/testfiles/h5diff_tmp1.txt b/tools/test/h5diff/testfiles/h5diff_tmp1.txt deleted file mode 100644 index 40e3fb6..0000000 --- a/tools/test/h5diff/testfiles/h5diff_tmp1.txt +++ /dev/null @@ -1,5 +0,0 @@ --------------------------------- -Some objects are not comparable --------------------------------- -Use -c for a list of objects. -EXIT CODE: 0 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index df472d4..2f04ab2 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -337,7 +337,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_709.txt $SRC_H5DIFF_TESTFILES/h5diff_710.txt $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt -$SRC_H5DIFF_TESTFILES/h5diff_tmp1.txt +$SRC_H5DIFF_TESTFILES/h5diff_8625.txt $SRC_H5DIFF_TESTFILES/h5diff_tmp2.txt $SRC_H5DIFF_TESTFILES/h5diff_v1.txt $SRC_H5DIFF_TESTFILES/h5diff_v2.txt @@ -820,9 +820,7 @@ TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # 7. attributes # ############################################################################## TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 -# temporary test to verify HDF5-8625 -TOOLTEST h5diff_tmp1.txt tmptest2.he5 tmptest.he5 -# temporary test to verify HDF5-8639 +# temporary test to verify HDFFV-8639 TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5 # ################################################## @@ -1145,6 +1143,8 @@ TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5 # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy +# test to verify HDFFV-8625 +TOOLTEST h5diff_8625.txt -v --enable-error-stack h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group/Compound_dset1 /group_copy/Compound_dset3 TOOLTEST h5diff_vlstr.txt -v tvlstr.h5 tvlstr2.h5 # ############################################################################## -- cgit v0.12 From ccf044135c675baa95e79a0623216c644ed6b657 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 14:43:28 -0600 Subject: HDFFV-8745 remove obsolete files --- MANIFEST | 2 -- tools/test/h5diff/testfiles/tmptest.he5 | Bin 4740424 -> 0 bytes tools/test/h5diff/testfiles/tmptest2.he5 | Bin 4734280 -> 0 bytes 3 files changed, 2 deletions(-) delete mode 100644 tools/test/h5diff/testfiles/tmptest.he5 delete mode 100644 tools/test/h5diff/testfiles/tmptest2.he5 diff --git a/MANIFEST b/MANIFEST index 45b6912..3b729ff 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2423,10 +2423,8 @@ ./tools/test/h5diff/testfiles/compounds_array_vlen2.h5 ./tools/test/h5diff/testfiles/non_comparables1.h5 ./tools/test/h5diff/testfiles/non_comparables2.h5 -./tools/test/h5diff/testfiles/tmptest2.he5 ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 ./tools/test/h5diff/testfiles/h5diff_8625.txt -./tools/test/h5diff/testfiles/tmptest.he5 ./tools/test/h5diff/testfiles/h5diff_tmp2.txt ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 ./tools/test/h5diff/testfiles/tudfilter.h5 diff --git a/tools/test/h5diff/testfiles/tmptest.he5 b/tools/test/h5diff/testfiles/tmptest.he5 deleted file mode 100644 index edcfcd2..0000000 Binary files a/tools/test/h5diff/testfiles/tmptest.he5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/tmptest2.he5 b/tools/test/h5diff/testfiles/tmptest2.he5 deleted file mode 100644 index a6ab02b..0000000 Binary files a/tools/test/h5diff/testfiles/tmptest2.he5 and /dev/null differ -- cgit v0.12 From 0ec1e5eeeea9667c267a88814381de4242447da9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 15:08:43 -0600 Subject: HDFFV-8745 remove files from test scripts --- tools/test/h5diff/CMakeTests.cmake | 2 -- tools/test/h5diff/testh5diff.sh.in | 2 -- 2 files changed, 4 deletions(-) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 773b03d..0a8d40f 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -63,8 +63,6 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmptest.he5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmptest2.he5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.reference.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.output.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 2f04ab2..d9cb857 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -118,8 +118,6 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 $SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 -$SRC_H5DIFF_TESTFILES/tmptest.he5 -$SRC_H5DIFF_TESTFILES/tmptest2.he5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.reference.h5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.output.h5 $SRC_H5DIFF_TESTFILES/diff_strings1.h5 -- cgit v0.12 From f8e84c55092d71b491cf86292a981f6122c78cfa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Jan 2018 16:25:03 -0600 Subject: HDFFV-8745 cleanup vl resource usage --- tools/lib/h5diff_dset.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 55e9839..86aa543 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -192,7 +192,8 @@ hsize_t diff_datasetid(hid_t did1, hid_t sm_space = -1; /*stripmine data space */ size_t need; /* bytes needed for malloc */ int i; - unsigned int vl_data = 0; /*contains VL datatypes */ + unsigned int vl_data1 = 0; /*contains VL datatypes */ + unsigned int vl_data2 = 0; /*contains VL datatypes */ h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ @@ -320,7 +321,9 @@ hsize_t diff_datasetid(hid_t did1, * VLEN memory buffer later */ if(TRUE == h5tools_detect_vlen(m_tid1)) - vl_data = TRUE; + vl_data1 = TRUE; + if(TRUE == h5tools_detect_vlen(m_tid2)) + vl_data2 = TRUE; h5diffdebug2("h5tools_detect_vlen - errstat:%d\n", opts->err_stat); /*------------------------------------------------------------------------ @@ -411,11 +414,12 @@ hsize_t diff_datasetid(hid_t did1, h5diffdebug2("diff_array nfound:%d\n", nfound); /* reclaim any VL memory, if necessary */ - if(vl_data) { - h5difftrace("check vl_data\n"); + h5diffdebug2("check vl_data1:%d\n", vl_data1); + if(vl_data1) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); + h5diffdebug2("check vl_data2:%d\n", vl_data2); + if(vl_data2) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - } /* end if */ if(buf1 != NULL) { HDfree(buf1); buf1 = NULL; @@ -505,10 +509,10 @@ hsize_t diff_datasetid(hid_t did1, dadims, opts, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ - if(vl_data) { + if(vl_data1) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); - H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); - } /* end if */ + if(vl_data2) + H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); /* calculate the next hyperslab offset */ for(i = rank1, carry = 1; i > 0 && carry; --i) { @@ -545,29 +549,29 @@ done: /* free */ if(buf1 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data1) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); HDfree(buf1); buf1 = NULL; } if(buf2 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data2) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); HDfree(buf2); buf2 = NULL; } if(sm_buf1 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data1) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); HDfree(sm_buf1); sm_buf1 = NULL; } if(sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) - H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); + if(vl_data2) + H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); HDfree(sm_buf2); sm_buf2 = NULL; } @@ -576,6 +580,7 @@ done: H5E_BEGIN_TRY { H5Sclose(sid1); H5Sclose(sid2); + H5Sclose(sm_space); H5Tclose(f_tid1); H5Tclose(f_tid2); H5Tclose(m_tid1); -- cgit v0.12 From 7d13e53294dc5e5161da49bc2654ecb1fbe207b8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Jan 2018 10:09:03 -0600 Subject: HDFFV-9745 Create test and files to verify fixes --- MANIFEST | 5 +- tools/test/h5diff/CMakeTests.cmake | 11 +- tools/test/h5diff/h5diffgentest.c | 6776 +++++++++++++++------------ tools/test/h5diff/testfiles/h5diff_8639.txt | 72 + tools/test/h5diff/testfiles/h5diff_attr1.h5 | Bin 26000 -> 27480 bytes tools/test/h5diff/testfiles/h5diff_attr2.h5 | Bin 26000 -> 27480 bytes tools/test/h5diff/testfiles/h5diff_attr3.h5 | Bin 0 -> 27440 bytes tools/test/h5diff/testfiles/h5diff_tmp2.txt | 13 - tools/test/h5diff/testh5diff.sh.in | 9 +- 9 files changed, 3748 insertions(+), 3138 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_8639.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_attr3.h5 delete mode 100644 tools/test/h5diff/testfiles/h5diff_tmp2.txt diff --git a/MANIFEST b/MANIFEST index 3b729ff..2db6d6b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2382,6 +2382,7 @@ ./tools/test/h5diff/testfiles/h5diff_attr1.h5 ./tools/test/h5diff/testfiles/h5diff_attr2.h5 +./tools/test/h5diff/testfiles/h5diff_attr3.h5 ./tools/test/h5diff/testfiles/h5diff_attr_v_level1.h5 ./tools/test/h5diff/testfiles/h5diff_attr_v_level2.h5 ./tools/test/h5diff/testfiles/h5diff_basic1.h5 @@ -2423,10 +2424,8 @@ ./tools/test/h5diff/testfiles/compounds_array_vlen2.h5 ./tools/test/h5diff/testfiles/non_comparables1.h5 ./tools/test/h5diff/testfiles/non_comparables2.h5 -./tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 ./tools/test/h5diff/testfiles/h5diff_8625.txt -./tools/test/h5diff/testfiles/h5diff_tmp2.txt -./tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 +./tools/test/h5diff/testfiles/h5diff_8639.txt ./tools/test/h5diff/testfiles/tudfilter.h5 ./tools/test/h5diff/testfiles/tudfilter2.h5 ./tools/test/h5diff/testfiles/h5diff_ud.txt diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 0a8d40f..e06f069 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -26,6 +26,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dtypes.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr3.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset3.h5 @@ -63,8 +64,6 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.reference.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.output.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 @@ -292,7 +291,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_801.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8625.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8639.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v1.txt @@ -1021,6 +1020,8 @@ h5diff_801.out.err h5diff_8625.out h5diff_8625.out.err + h5diff_8639.out + h5diff_8639.out.err h5diff_90.out h5diff_90.out.err h5diff_v1.out @@ -1281,8 +1282,6 @@ ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/f # 7. attributes # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) -# temporary test to verify HDFFV-8639 -ADD_H5_TEST (h5diff_tmp2 1 tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5) # ################################################## # attrs with verbose option level @@ -1614,6 +1613,8 @@ ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) # test to verify HDFFV-8625 ADD_H5_TEST (h5diff_8625 0 -v --enable-error-stack ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group/Compound_dset1 /group_copy/Compound_dset3) +# test to verify HDFFV-8639 +ADD_H5_TEST (h5diff_8639 0 -v h5diff_attr3.h5 h5diff_attr2.h5 /g1) ADD_H5_TEST (h5diff_vlstr 0 -v tvlstr.h5 tvlstr2.h5) # ############################################################################## diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 459a37e..2e98436 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Copyright by The HDF Group. * -* Copyright by the Board of Trustees of the University of Illinois. * -* All rights reserved. * -* * -* This file is part of HDF5. The full HDF5 copyright notice, including * -* terms governing use, modification, and redistribution, is contained in * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * 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. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include @@ -29,16 +29,16 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /*------------------------------------------------------------------------- -* Program: h5diffgentest -* -* Purpose: generate files for h5diff testing -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: November 12, 2003 -* -*------------------------------------------------------------------------- -*/ + * Program: h5diffgentest + * + * Purpose: generate files for h5diff testing + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: November 12, 2003 + * + *------------------------------------------------------------------------- + */ #define FILE1 "h5diff_basic1.h5" #define FILE2 "h5diff_basic2.h5" @@ -46,6 +46,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define FILE4 "h5diff_dtypes.h5" #define FILE5 "h5diff_attr1.h5" #define FILE6 "h5diff_attr2.h5" +#define FILE6a "h5diff_attr3.h5" #define FILE7 "h5diff_dset1.h5" #define FILE8 "h5diff_dset2.h5" #define FILE8A "h5diff_dset3.h5" @@ -110,37 +111,36 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define SPACE1_DIM2 0 /* A UD link traversal function. Shouldn't actually be called. */ -static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, - H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) -{ +static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, + H5_ATTR_UNUSED hid_t cur_group, H5_ATTR_UNUSED const void * udata, + H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) { return -1; } -const H5L_class_t UD_link_class[1] = {{ - H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - (H5L_type_t)MY_LINKCLASS, /* Link type id number */ - "UD link class", /* name for debugging */ - NULL, /* Creation callback */ - NULL, /* Move/rename callback */ - NULL, /* Copy callback */ - UD_traverse, /* The actual traversal function */ - NULL, /* Deletion callback */ - NULL /* Query callback */ -}}; - +const H5L_class_t UD_link_class[1] = { { + H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ + (H5L_type_t) MY_LINKCLASS, /* Link type id number */ + "UD link class", /* name for debugging */ + NULL, /* Creation callback */ + NULL, /* Move/rename callback */ + NULL, /* Copy callback */ + UD_traverse, /* The actual traversal function */ + NULL, /* Deletion callback */ + NULL /* Query callback */ +} }; /*------------------------------------------------------------------------- -* prototypes -*------------------------------------------------------------------------- -*/ + * prototypes + *------------------------------------------------------------------------- + */ /* tests called in main() */ static int test_basic(const char *fname1, const char *fname2, const char *fname3); static int test_types(const char *fname); static int test_datatypes(const char *fname); -static int test_attributes(const char *fname,int make_diffs); -static int test_datasets(const char *fname,int make_diffs); -static int test_special_datasets(const char *fname,int make_diffs); -static int test_hyperslab(const char *fname,int make_diffs); +static int test_attributes(const char *fname, int make_diffs); +static int test_datasets(const char *fname, int make_diffs); +static int test_special_datasets(const char *fname, int make_diffs); +static int test_hyperslab(const char *fname, int make_diffs); static int test_link_name(const char *fname1); static int test_soft_links(const char *fname1); static int test_linked_softlinks(const char *fname1); @@ -155,54 +155,60 @@ static int test_exclude_obj3(const char *fname1, const char *fname2); static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new); static int test_attributes_verbose_level(const char *fname1, const char *fname2); static int test_enums(const char *fname); -static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new); -static void test_comps_vlen (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); -static void test_comps_array_vlen (const char *fname, const char *dset, const char *attr, int diff, int is_file_new); -static void test_comps_vlen_arry (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); -static void test_data_nocomparables (const char *fname, int diff); -static void test_objs_nocomparables (const char *fname1, const char *fname2); -static void test_objs_strings (const char *fname, const char *fname2); +static void test_comps_array(const char *fname, const char *dset, + const char *attr, int diff, int is_file_new); +static void test_comps_vlen(const char *fname, const char *dset, + const char *attr, int diff, int is_file_new); +static void test_comps_array_vlen(const char *fname, const char *dset, + const char *attr, int diff, int is_file_new); +static void test_comps_vlen_arry(const char *fname, const char *dset, + const char *attr, int diff, int is_file_new); +static void test_data_nocomparables(const char *fname, int diff); +static void test_objs_nocomparables(const char *fname1, const char *fname2); +static void test_objs_strings(const char *fname, const char *fname2); /* called by test_attributes() and test_datasets() */ -static void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); -static void write_dset_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); -static void gen_datareg(hid_t fid,int make_diffs); +static void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs); +static void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs); +static void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs); +static void gen_datareg(hid_t fid, int make_diffs); /* utilities */ -static int write_attr(hid_t loc_id,int rank,hsize_t *dims,const char *name,hid_t tid,void *buf); -static int write_dset(hid_t loc_id,int rank,hsize_t *dims,const char *name,hid_t tid,void *buf); +static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf); +static int write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf); static int gen_dataset_idx(const char *file, int format); - /*------------------------------------------------------------------------- -* Function: main -* -* Purpose: main program -* -*------------------------------------------------------------------------- -*/ + * Function: main + * + * Purpose: main program + * + *------------------------------------------------------------------------- + */ int main(void) { test_basic(FILE1, FILE2, FILE11); - test_types (FILE3); + test_types(FILE3); test_datatypes(FILE4); /* generate 2 files, the second call creates a similar file with differences */ - test_attributes(FILE5,0); - test_attributes(FILE6,1); + test_attributes(FILE5, 0); + test_attributes(FILE6, 1); + /* generate file with string datatypes swapped */ + test_attributes(FILE6a, 2); /* test attributes with verbose level */ test_attributes_verbose_level(ATTR_VERBOSE_LEVEL_FILE1, ATTR_VERBOSE_LEVEL_FILE2); /* generate 2 files, the second call creates a similar file with differences */ - test_datasets(FILE7,0); - test_datasets(FILE8,1); - test_datasets(FILE8A,2); + test_datasets(FILE7, 0); + test_datasets(FILE8, 1); + test_datasets(FILE8A, 2); /* generate 2 files, the second call creates a similar file with differences */ - test_hyperslab(FILE9,0); - test_hyperslab(FILE10,1); + test_hyperslab(FILE9, 0); + test_hyperslab(FILE10, 1); test_link_name(FILE12); @@ -215,15 +221,15 @@ int main(void) test_ext2soft_links(FILE17, FILE18); /* generate 2 files, the second call creates a similar file with differences */ - test_special_datasets(FILE19,0); - test_special_datasets(FILE20,1); + test_special_datasets(FILE19, 0); + test_special_datasets(FILE20, 1); /* - * Generate 2 files: FILE21 with old format; FILE22 with new format - * Create 2 datasets in each file: - * One dataset: chunked layout, w/o filters, fixed dimension - * One dataset: chunked layout, w/ filters, fixed dimension - */ + * Generate 2 files: FILE21 with old format; FILE22 with new format + * Create 2 datasets in each file: + * One dataset: chunked layout, w/o filters, fixed dimension + * One dataset: chunked layout, w/ filters, fixed dimension + */ gen_dataset_idx(FILE21, 0); gen_dataset_idx(FILE22, 1); @@ -241,34 +247,34 @@ int main(void) test_comp_vlen_strings(COMP_VL_STRS_FILE, "group_copy", 0); /* diff when invalid enum values are present. - * This will probably grow to involve more extensive testing of - * enums so it has been given its own test file and test (apart - * from the basic type testing). - */ + * This will probably grow to involve more extensive testing of + * enums so it has been given its own test file and test (apart + * from the basic type testing). + */ test_enums(ENUM_INVALID_VALUES); /* ------------------------------------------------- - * Create test files with dataset and attribute with container types - * (array, vlen) with multiple nested compound types. - */ + * Create test files with dataset and attribute with container types + * (array, vlen) with multiple nested compound types. + */ /* file1 */ - test_comps_array(COMPS_COMPLEX1,"dset1", "attr1", 0, 1); - test_comps_vlen(COMPS_COMPLEX1,"dset2", "attr2", 0, 0); - test_comps_array_vlen(COMPS_COMPLEX1,"dset3", "attr3", 0, 0); - test_comps_vlen_arry(COMPS_COMPLEX1,"dset4", "attr4", 0, 0); + test_comps_array(COMPS_COMPLEX1, "dset1", "attr1", 0, 1); + test_comps_vlen(COMPS_COMPLEX1, "dset2", "attr2", 0, 0); + test_comps_array_vlen(COMPS_COMPLEX1, "dset3", "attr3", 0, 0); + test_comps_vlen_arry(COMPS_COMPLEX1, "dset4", "attr4", 0, 0); /* file2 */ - test_comps_array(COMPS_COMPLEX2,"dset1", "attr1", 5, 1); - test_comps_vlen(COMPS_COMPLEX2,"dset2", "attr2",5, 0); - test_comps_array_vlen(COMPS_COMPLEX2,"dset3", "attr3", 5, 0); - test_comps_vlen_arry(COMPS_COMPLEX2,"dset4", "attr4", 5, 0); + test_comps_array(COMPS_COMPLEX2, "dset1", "attr1", 5, 1); + test_comps_vlen(COMPS_COMPLEX2, "dset2", "attr2", 5, 0); + test_comps_array_vlen(COMPS_COMPLEX2, "dset3", "attr3", 5, 0); + test_comps_vlen_arry(COMPS_COMPLEX2, "dset4", "attr4", 5, 0); /*------------------------------------------------- - * Create test files with non-comparable dataset and attributes with - * comparable datasets and attributes. All the comparables should display - * differences. - */ - test_data_nocomparables(NON_COMPARBLES1,0); - test_data_nocomparables(NON_COMPARBLES2,5); + * Create test files with non-comparable dataset and attributes with + * comparable datasets and attributes. All the comparables should display + * differences. + */ + test_data_nocomparables(NON_COMPARBLES1, 0); + test_data_nocomparables(NON_COMPARBLES2, 5); /* common objects (same name) with different object types. HDFFV-7644 */ test_objs_nocomparables(NON_COMPARBLES1, NON_COMPARBLES2); @@ -280,28 +286,28 @@ int main(void) } /*------------------------------------------------------------------------- -* Function: test_basic -* -* Purpose: Create basic test files, first two contains different data, the -* third one is just an empty file. -* -*------------------------------------------------------------------------- -*/ + * Function: test_basic + * + * Purpose: Create basic test files, first two contains different data, the + * third one is just an empty file. + * + *------------------------------------------------------------------------- + */ static int test_basic(const char *fname1, const char *fname2, const char *fname3) { - hid_t fid1, fid2; - hid_t gid1, gid2, gid3; + hid_t fid1 = -1, fid2 = -1; + hid_t gid1 = -1, gid2 = -1, gid3 = -1; hsize_t dims1[1] = { 6 }; - hsize_t dims2[2] = { 3,2 }; + hsize_t dims2[2] = { 3, 2 }; /* create the empty file */ - if ((fid1=H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0){ + if ((fid1 = H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "empty file (%s) creation failed.\n", fname3); goto out; } - if (H5Fclose(fid1) < 0){ + if (H5Fclose(fid1) < 0) { fprintf(stderr, "empty file (%s) close failed.\n", fname3); goto out; } @@ -311,9 +317,9 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ - if (( fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) + if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if (( fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) + if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /*------------------------------------------------------------------------- @@ -336,16 +342,20 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) */ { - double data1[3][2] = {{ 1.0F, 1.0F}, { 1.00F, 1.000F}, { 0.0F, 0.0F}}; - double data2[3][2] = {{ 0.0F, 1.1F}, { 1.01F, 1.001F}, { 0.0F, 1.0F}}; - double data3[3][2] = {{100.0F, 100.0F}, {100.00F, 100.000F}, {100.0F, 100.0F}}; - double data4[3][2] = {{105.0F, 120.0F}, {160.00F, 95.000F}, { 80.0F, 40.0F}}; + double data1[3][2] = + { { 1.0F, 1.0F }, { 1.00F, 1.000F }, { 0.0F, 0.0F } }; + double data2[3][2] = + { { 0.0F, 1.1F }, { 1.01F, 1.001F }, { 0.0F, 1.0F } }; + double data3[3][2] = { { 100.0F, 100.0F }, { 100.00F, 100.000F }, { + 100.0F, 100.0F } }; + double data4[3][2] = { { 105.0F, 120.0F }, { 160.00F, 95.000F }, { + 80.0F, 40.0F } }; - write_dset(gid1,2,dims2,"dset1",H5T_NATIVE_DOUBLE,data1); - write_dset(gid2,2,dims2,"dset2",H5T_NATIVE_DOUBLE,data2); - write_dset(gid1,2,dims2,"dset3",H5T_NATIVE_DOUBLE,data3); - write_dset(gid2,2,dims2,"dset4",H5T_NATIVE_DOUBLE,data4); - write_dset(gid2,2,dims2,"dset1",H5T_NATIVE_DOUBLE,data2); + write_dset(gid1, 2, dims2, "dset1", H5T_NATIVE_DOUBLE, data1); + write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_DOUBLE, data2); + write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_DOUBLE, data3); + write_dset(gid2, 2, dims2, "dset4", H5T_NATIVE_DOUBLE, data4); + write_dset(gid2, 2, dims2, "dset1", H5T_NATIVE_DOUBLE, data2); } /*------------------------------------------------------------------------- @@ -354,11 +364,11 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - int data5[3][2] = {{100,100},{100,0},{0,100}}; - int data6[3][2] = {{120,80}, {0,100},{0,50}}; + int data5[3][2] = { { 100, 100 }, { 100, 0 }, { 0, 100 } }; + int data6[3][2] = { { 120, 80 }, { 0, 100 }, { 0, 50 } }; - write_dset(gid1,2,dims2,"dset5",H5T_NATIVE_INT,data5); - write_dset(gid1,2,dims2,"dset6",H5T_NATIVE_INT,data6); + write_dset(gid1, 2, dims2, "dset5", H5T_NATIVE_INT, data5); + write_dset(gid1, 2, dims2, "dset6", H5T_NATIVE_INT, data6); } @@ -368,11 +378,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - unsigned long long data7[3][2] = {{100,100},{100,0},{0,100}}; - unsigned long long data8[3][2] = {{120,80}, {0,100},{0,50}}; + unsigned long long data7[3][2] = + { { 100, 100 }, { 100, 0 }, { 0, 100 } }; + unsigned long long data8[3][2] = { { 120, 80 }, { 0, 100 }, { 0, 50 } }; - write_dset(gid1,2,dims2,"dset7",H5T_NATIVE_ULLONG,data7); - write_dset(gid1,2,dims2,"dset8",H5T_NATIVE_ULLONG,data8); + write_dset(gid1, 2, dims2, "dset7", H5T_NATIVE_ULLONG, data7); + write_dset(gid1, 2, dims2, "dset8", H5T_NATIVE_ULLONG, data8); } @@ -390,45 +401,47 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - double data9[3][2] = {{100.0F, 100.0F}, {100.0F, 0.0F}, {0.0F, 100.0F}}; - double data10[3][2] ={{120.0F, 80.0F}, { 0.0F, 100.0F}, {0.0F, 50.0F}}; + double data9[3][2] = { { 100.0F, 100.0F }, { 100.0F, 0.0F }, { 0.0F, + 100.0F } }; + double data10[3][2] = { { 120.0F, 80.0F }, { 0.0F, 100.0F }, { 0.0F, + 50.0F } }; - write_dset(gid1,2,dims2,"dset9",H5T_NATIVE_DOUBLE,data9); - write_dset(gid1,2,dims2,"dset10",H5T_NATIVE_DOUBLE,data10); + write_dset(gid1, 2, dims2, "dset9", H5T_NATIVE_DOUBLE, data9); + write_dset(gid1, 2, dims2, "dset10", H5T_NATIVE_DOUBLE, data10); } - /*------------------------------------------------------------------------- * test floating point comparison *------------------------------------------------------------------------- */ { /* epsilon = 0.0000001 = 1e-7 - * system epsilon for float : FLT_EPSILON = 1.19209E-07 - */ - float data11[3][2] ={{0.000000f,0.0000001f},{0.0000001f, 0.00000022f},{0.0000001f,0.0000001f}}; - float data12[3][2] ={{0.000000f,0.0000002f},{0.0000003f,0.0000001f},{0.000000f,0.0000001f}}; + * system epsilon for float : FLT_EPSILON = 1.19209E-07 + */ + float data11[3][2] = { { 0.000000f, 0.0000001f }, { 0.0000001f, + 0.00000022f }, { 0.0000001f, 0.0000001f } }; + float data12[3][2] = { { 0.000000f, 0.0000002f }, { 0.0000003f, + 0.0000001f }, { 0.000000f, 0.0000001f } }; /* epsilon = 0.0000000000000001 = 1e-16 - * system epsilon for double : DBL_EPSILON = 2.22045E-16 - */ - double data13[3][2] ={ - {H5_DOUBLE(0.0000000000000000), H5_DOUBLE(0.0000000000000001)}, - {H5_DOUBLE(0.0000000000000001), H5_DOUBLE(0.0000000000000000)}, - {H5_DOUBLE(0.00000000000000033), H5_DOUBLE(0.0000000000000001)}}; - double data14[3][2] ={ - {H5_DOUBLE(0.0000000000000000), H5_DOUBLE(0.0000000000000004)}, - {H5_DOUBLE(0.0000000000000002), H5_DOUBLE(0.0000000000000001)}, - {H5_DOUBLE(0.0000000000000001), H5_DOUBLE(0.00000000000000000)}}; + * system epsilon for double : DBL_EPSILON = 2.22045E-16 + */ + double data13[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE( + 0.0000000000000001) }, { H5_DOUBLE(0.0000000000000001), + H5_DOUBLE(0.0000000000000000) }, { H5_DOUBLE( + 0.00000000000000033), H5_DOUBLE(0.0000000000000001) } }; + double data14[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE( + 0.0000000000000004) }, { H5_DOUBLE(0.0000000000000002), + H5_DOUBLE(0.0000000000000001) }, { H5_DOUBLE( + 0.0000000000000001), H5_DOUBLE(0.00000000000000000) } }; - write_dset(gid1,2,dims2,"fp1",H5T_NATIVE_FLOAT,data11); - write_dset(gid1,2,dims2,"fp2",H5T_NATIVE_FLOAT,data12); - write_dset(gid1,2,dims2,"d1",H5T_NATIVE_DOUBLE,data13); - write_dset(gid1,2,dims2,"d2",H5T_NATIVE_DOUBLE,data14); + write_dset(gid1, 2, dims2, "fp1", H5T_NATIVE_FLOAT, data11); + write_dset(gid1, 2, dims2, "fp2", H5T_NATIVE_FLOAT, data12); + write_dset(gid1, 2, dims2, "d1", H5T_NATIVE_DOUBLE, data13); + write_dset(gid1, 2, dims2, "d2", H5T_NATIVE_DOUBLE, data14); } - #if H5_SIZEOF_LONG_DOUBLE !=0 { @@ -437,15 +450,13 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ - long double data15[3][2] ={{1.0L,1.0L},{1.0L,1.0L},{1.0L,1.0L}}; + long double data15[3][2] = { {1.0L,1.0L}, {1.0L,1.0L}, {1.0L,1.0L}}; write_dset(gid1,2,dims2,"ld",H5T_NATIVE_LDOUBLE,data15); } #endif - - /*------------------------------------------------------------------------- * NaNs in H5T_NATIVE_FLOAT *------------------------------------------------------------------------- @@ -455,22 +466,22 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) float data15[6]; float data16[6]; - data15[0] = (float)HDsqrt(-1.0F); + data15[0] = (float) HDsqrt(-1.0F); data15[1] = 1.0F; - data15[2] = (float)HDsqrt(-1.0F); + data15[2] = (float) HDsqrt(-1.0F); data15[3] = 1.0F; data15[4] = 1.0F; data15[5] = 1.0F; - data16[0] = (float)HDsqrt(-1.0F); - data16[1] = (float)HDsqrt(-1.0F); + data16[0] = (float) HDsqrt(-1.0F); + data16[1] = (float) HDsqrt(-1.0F); data16[2] = 1.0F; data16[3] = 1.0F; data16[4] = 1.0F; data16[5] = 1.0F; - write_dset(gid1,1,dims1,"fp15",H5T_NATIVE_FLOAT,data15); - write_dset(gid1,1,dims1,"fp16",H5T_NATIVE_FLOAT,data16); + write_dset(gid1, 1, dims1, "fp15", H5T_NATIVE_FLOAT, data15); + write_dset(gid1, 1, dims1, "fp16", H5T_NATIVE_FLOAT, data16); } @@ -497,29 +508,29 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) data18[4] = 1.0F; data18[5] = 1.0F; - write_dset(gid1,1,dims1,"fp17",H5T_NATIVE_DOUBLE,data17); - write_dset(gid1,1,dims1,"fp18",H5T_NATIVE_DOUBLE,data18); - write_dset(gid1,1,dims1,"fp18_COPY",H5T_NATIVE_DOUBLE,data18); + write_dset(gid1, 1, dims1, "fp17", H5T_NATIVE_DOUBLE, data17); + write_dset(gid1, 1, dims1, "fp18", H5T_NATIVE_DOUBLE, data18); + write_dset(gid1, 1, dims1, "fp18_COPY", H5T_NATIVE_DOUBLE, data18); } /*------------------------------------------------------------------------ - * INFINITY values - *------------------------------------------------------------------------ - */ + * INFINITY values + *------------------------------------------------------------------------ + */ { - float data19[6]; + float data19[6]; double data20[6]; - data19[0] = data19[1] = data19[2] = (float)HDlog(0.0F); - data19[3] = data19[4] = data19[5] = (float)-HDlog(0.0F); + data19[0] = data19[1] = data19[2] = (float) HDlog(0.0F); + data19[3] = data19[4] = data19[5] = (float) -HDlog(0.0F); data20[0] = data20[1] = data20[2] = HDlog(0.0F); data20[3] = data20[4] = data20[5] = -HDlog(0.0F); - write_dset(gid1,1,dims1,"fp19",H5T_NATIVE_FLOAT,data19); - write_dset(gid1,1,dims1,"fp19_COPY",H5T_NATIVE_FLOAT,data19); - write_dset(gid1,1,dims1,"fp20",H5T_NATIVE_DOUBLE,data20); - write_dset(gid1,1,dims1,"fp20_COPY",H5T_NATIVE_DOUBLE,data20); + write_dset(gid1, 1, dims1, "fp19", H5T_NATIVE_FLOAT, data19); + write_dset(gid1, 1, dims1, "fp19_COPY", H5T_NATIVE_FLOAT, data19); + write_dset(gid1, 1, dims1, "fp20", H5T_NATIVE_DOUBLE, data20); + write_dset(gid1, 1, dims1, "fp20_COPY", H5T_NATIVE_DOUBLE, data20); } /*------------------------------------------------------------------------- @@ -527,105 +538,97 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - typedef struct cmp1_t - { + typedef struct cmp1_t { double d; - float f; + float f; } cmp1_t; - cmp1_t buf1[2]; - cmp1_t buf2[2]; - hsize_t dims[1] = {2}; - size_t type_size; - hid_t tid; + cmp1_t buf1[2]; + cmp1_t buf2[2]; + hsize_t dims[1] = { 2 }; + size_t type_size; + hid_t tid; buf1[0].d = HDsqrt(-1.0F); - buf1[0].f = (float)HDsqrt(-1.0F); + buf1[0].f = (float) HDsqrt(-1.0F); buf2[0].d = HDsqrt(-1.0F); - buf2[0].f = (float)HDsqrt(-1.0F); + buf2[0].f = (float) HDsqrt(-1.0F); buf1[1].d = HDsqrt(-1.0F); - buf1[1].f = (float)HDsqrt(-1.0F); + buf1[1].f = (float) HDsqrt(-1.0F); buf2[1].d = 0.0F; buf2[1].f = 0.0F; - type_size = sizeof( cmp1_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "d", HOFFSET( cmp1_t, d ), H5T_NATIVE_DOUBLE ); - H5Tinsert(tid, "f", HOFFSET( cmp1_t, f ), H5T_NATIVE_FLOAT ); - write_dset(gid1,1,dims,"dset11",tid,buf1); - write_dset(gid1,1,dims,"dset12",tid,buf2); + type_size = sizeof(cmp1_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "d", HOFFSET(cmp1_t, d), H5T_NATIVE_DOUBLE); + H5Tinsert(tid, "f", HOFFSET(cmp1_t, f), H5T_NATIVE_FLOAT); + write_dset(gid1, 1, dims, "dset11", tid, buf1); + write_dset(gid1, 1, dims, "dset12", tid, buf2); H5Tclose(tid); - } /* not comparable objects */ { - typedef struct cmp1_t - { + typedef struct cmp1_t { double d; - int i; + int i; } cmp1_t; - typedef struct cmp2_t - { - int i; + typedef struct cmp2_t { + int i; double d; } cmp2_t; - typedef struct cmp3_t - { + typedef struct cmp3_t { int i; } cmp3_t; - double data2[6] = {0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; - int data3[6] = {0,0,0,0,0,0}; - int data4[3][2] = {{0,0},{0,0},{0,0}}; - int data5[2][2] = {{0,0},{0,0}}; - unsigned int data6[3][2] = {{0,0},{0,0},{0,0}}; - cmp1_t data7[1] = {{1.0f, 2}}; - cmp2_t data8[1] = {{1, 2.0f}}; - hsize_t dims3[2] = {2, 2}; - hsize_t dims4[1] = {1}; - size_t type_size; - hid_t tid; - - - - write_dset(gid3,1,dims1,"dset1",H5T_NATIVE_DOUBLE,NULL); - write_dset(gid3,1,dims1,"dset2",H5T_NATIVE_DOUBLE,data2); - write_dset(gid3,1,dims1,"dset3",H5T_NATIVE_INT,data3); - write_dset(gid3,2,dims2,"dset4",H5T_NATIVE_INT,data4); - write_dset(gid3,2,dims3,"dset5",H5T_NATIVE_INT,data5); - write_dset(gid3,2,dims2,"dset6",H5T_NATIVE_UINT,data6); + double data2[6] = { 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }; + int data3[6] = { 0, 0, 0, 0, 0, 0 }; + int data4[3][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 } }; + int data5[2][2] = { { 0, 0 }, { 0, 0 } }; + unsigned int data6[3][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 } }; + cmp1_t data7[1] = { { 1.0f, 2 } }; + cmp2_t data8[1] = { { 1, 2.0f } }; + hsize_t dims3[2] = { 2, 2 }; + hsize_t dims4[1] = { 1 }; + size_t type_size; + hid_t tid; + + write_dset(gid3, 1, dims1, "dset1", H5T_NATIVE_DOUBLE, NULL); + write_dset(gid3, 1, dims1, "dset2", H5T_NATIVE_DOUBLE, data2); + write_dset(gid3, 1, dims1, "dset3", H5T_NATIVE_INT, data3); + write_dset(gid3, 2, dims2, "dset4", H5T_NATIVE_INT, data4); + write_dset(gid3, 2, dims3, "dset5", H5T_NATIVE_INT, data5); + write_dset(gid3, 2, dims2, "dset6", H5T_NATIVE_UINT, data6); /* case of compound with different type members */ - type_size = sizeof( cmp1_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "d", HOFFSET( cmp1_t, d ), H5T_NATIVE_DOUBLE ); - H5Tinsert(tid, "i", HOFFSET( cmp1_t, i ), H5T_NATIVE_INT ); - write_dset(gid3,1,dims4,"dset7",tid,data7); + type_size = sizeof(cmp1_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "d", HOFFSET(cmp1_t, d), H5T_NATIVE_DOUBLE); + H5Tinsert(tid, "i", HOFFSET(cmp1_t, i), H5T_NATIVE_INT); + write_dset(gid3, 1, dims4, "dset7", tid, data7); H5Tclose(tid); - type_size = sizeof( cmp2_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT ); - H5Tinsert(tid, "d", HOFFSET( cmp2_t, d ), H5T_NATIVE_DOUBLE ); - write_dset(gid3,1,dims4,"dset8",tid,data8); + type_size = sizeof(cmp2_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "i", HOFFSET(cmp2_t, i), H5T_NATIVE_INT); + H5Tinsert(tid, "d", HOFFSET(cmp2_t, d), H5T_NATIVE_DOUBLE); + write_dset(gid3, 1, dims4, "dset8", tid, data8); H5Tclose(tid); /* case of compound with different number of members */ - type_size = sizeof( cmp3_t ); - tid = H5Tcreate (H5T_COMPOUND, type_size ); - H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT ); - write_dset(gid3,1,dims4,"dset9",tid,NULL); + type_size = sizeof(cmp3_t); + tid = H5Tcreate(H5T_COMPOUND, type_size); + H5Tinsert(tid, "i", HOFFSET(cmp2_t, i), H5T_NATIVE_INT); + write_dset(gid3, 1, dims4, "dset9", tid, NULL); H5Tclose(tid); } - /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- @@ -642,46 +645,43 @@ out: return FAIL; } - /*------------------------------------------------------------------------- -* Function: test_types -* -* Purpose: Compare different HDF5 object & link types: -* H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK, H5G_UDLINK -* -*------------------------------------------------------------------------- -*/ + * Function: test_types + * + * Purpose: Compare different HDF5 object & link types: + * H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK, H5G_UDLINK + * + *------------------------------------------------------------------------- + */ static int test_types(const char *fname) { - hid_t fid1; - hid_t gid1; - hid_t gid2; - hid_t tid1; - hid_t tid2; - herr_t status; - hsize_t dims[1]={1}; - typedef struct s1_t - { - int a; - float b; + hid_t fid1 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t tid1 = -1; + hid_t tid2 = -1; + herr_t status; + hsize_t dims[1] = { 1 }; + typedef struct s1_t { + int a; + float b; } s1_t; - typedef struct s2_t - { - int a; + typedef struct s2_t { + int a; } s2_t; /*------------------------------------------------------------------------- * Create one file *------------------------------------------------------------------------- */ - fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid1 = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * H5G_DATASET *------------------------------------------------------------------------- */ - write_dset(fid1,1,dims,"dset",H5T_NATIVE_INT,0); + write_dset(fid1, 1, dims, "dset", H5T_NATIVE_INT, 0); /*------------------------------------------------------------------------- * H5G_GROUP @@ -723,7 +723,7 @@ int test_types(const char *fname) */ H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); H5Lregister(UD_link_class); - H5Lcreate_ud(fid1, "ud_link", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_ud(fid1, "ud_link", (H5L_type_t) MY_LINKCLASS, NULL, (size_t) 0, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * Close @@ -733,195 +733,192 @@ int test_types(const char *fname) return status; } - /* -# ############################################################################## -# # not comparable types -# ############################################################################## + # ############################################################################## + # # not comparable types + # ############################################################################## -# 2.0 -TOOLTEST h5diff_20.txt file3.h5 file3.h5 -v dset g1 + # 2.0 + TOOLTEST h5diff_20.txt file3.h5 file3.h5 -v dset g1 -# 2.1 -TOOLTEST h5diff_21.txt file3.h5 file3.h5 -v dset l1 + # 2.1 + TOOLTEST h5diff_21.txt file3.h5 file3.h5 -v dset l1 -# 2.2 -TOOLTEST h5diff_22.txt file3.h5 file3.h5 -v dset t1 + # 2.2 + TOOLTEST h5diff_22.txt file3.h5 file3.h5 -v dset t1 -# ############################################################################## -# # compare groups, types, links (no differences and differences) -# ############################################################################## + # ############################################################################## + # # compare groups, types, links (no differences and differences) + # ############################################################################## -# 2.3 -TOOLTEST h5diff_23.txt file3.h5 file3.h5 -v g1 g1 + # 2.3 + TOOLTEST h5diff_23.txt file3.h5 file3.h5 -v g1 g1 -# 2.4 -TOOLTEST h5diff_24.txt file3.h5 file3.h5 -v t1 t1 + # 2.4 + TOOLTEST h5diff_24.txt file3.h5 file3.h5 -v t1 t1 -# 2.5 -TOOLTEST h5diff_25.txt file3.h5 file3.h5 -v l1 l1 + # 2.5 + TOOLTEST h5diff_25.txt file3.h5 file3.h5 -v l1 l1 -# 2.6 -TOOLTEST h5diff_26.txt file3.h5 file3.h5 -v g1 g2 + # 2.6 + TOOLTEST h5diff_26.txt file3.h5 file3.h5 -v g1 g2 -# 2.7 -TOOLTEST h5diff_27.txt file3.h5 file3.h5 -v t1 t2 + # 2.7 + TOOLTEST h5diff_27.txt file3.h5 file3.h5 -v t1 t2 -# 2.8 -TOOLTEST h5diff_28.txt file3.h5 file3.h5 -v l1 l2 -*/ + # 2.8 + TOOLTEST h5diff_28.txt file3.h5 file3.h5 -v l1 l2 + */ /*------------------------------------------------------------------------- -* Function: test_datatypes -* -* Purpose: test dataset datatypes -* -*------------------------------------------------------------------------- -*/ + * Function: test_datatypes + * + * Purpose: test dataset datatypes + * + *------------------------------------------------------------------------- + */ static int test_datatypes(const char *fname) { - - hid_t fid1; - hid_t dset; - hsize_t dims[2]={3,2}; - herr_t status; - char buf1a[3][2] = {{1,1},{1,1},{1,1}}; - char buf1b[3][2] = {{1,1},{3,4},{5,6}}; - short buf2a[3][2] = {{1,1},{1,1},{1,1}}; - short buf2b[3][2] = {{1,1},{3,4},{5,6}}; - int buf3a[3][2] = {{1,1},{1,1},{1,1}}; - int buf3b[3][2] = {{1,1},{3,4},{5,6}}; - long buf4a[3][2] = {{1,1},{1,1},{1,1}}; - long buf4b[3][2] = {{1,1},{3,4},{5,6}}; - float buf5a[3][2] = {{1.0F, 1.0F}, {1.0F, 1.0F}, {1.0F, 1.0F}}; - float buf5b[3][2] = {{1.0F, 1.0F}, {3.0F, 4.0F}, {5.0F, 6.0F}}; - double buf6a[3][2] = {{1.0F, 1.0F}, {1.0F, 1.0F}, {1.0F, 1.0F}}; - double buf6b[3][2] = {{1.0F, 1.0F}, {3.0F, 4.0F}, {5.0F, 6.0F}}; + hid_t fid1 = -1; + hid_t dset = -1; + hsize_t dims[2] = { 3, 2 }; + herr_t status; + char buf1a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + char buf1b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + short buf2a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + short buf2b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + int buf3a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + int buf3b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + long buf4a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + long buf4b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + float buf5a[3][2] = { { 1.0F, 1.0F }, { 1.0F, 1.0F }, { 1.0F, 1.0F } }; + float buf5b[3][2] = { { 1.0F, 1.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; + double buf6a[3][2] = { { 1.0F, 1.0F }, { 1.0F, 1.0F }, { 1.0F, 1.0F } }; + double buf6b[3][2] = { { 1.0F, 1.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /*unsigned/signed test signed char -128 to 127 unsigned char 0 to 255 */ - char buf7a[3][2] = {{-1,-128},{-1,-1},{-1,-1}}; - unsigned char buf7b[3][2] = {{1,128},{1,1},{1,1}}; + char buf7a[3][2] = { { -1, -128 }, { -1, -1 }, { -1, -1 } }; + unsigned char buf7b[3][2] = { { 1, 128 }, { 1, 1 }, { 1, 1 } }; /* long long test */ - long long buf8a[3][2] = {{1,1},{1,1},{1,1}}; - long long buf8b[3][2] = {{1,1},{3,4},{5,6}}; - unsigned long long buf9a[3][2] = {{1,1},{1,1},{1,1}}; - unsigned long long buf9b[3][2] = {{1,1},{3,4},{5,6}}; + long long buf8a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + long long buf8b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; + unsigned long long buf9a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } }; + unsigned long long buf9b[3][2] = { { 1, 1 }, { 3, 4 }, { 5, 6 } }; - unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}}; - unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}}; - - unsigned short buf11a[3][2] = {{204,205},{2,3},{1,1}}; - unsigned int buf11b[3][2] = {{204,205},{2,3},{1,1}}; + unsigned int buf10a[3][2] = { { UIMAX, 1 }, { 1, 1 }, { 1, 1 } }; + unsigned int buf10b[3][2] = { { UIMAX - 1, 1 }, { 3, 4 }, { 5, 6 } }; + unsigned short buf11a[3][2] = { { 204, 205 }, { 2, 3 }, { 1, 1 } }; + unsigned int buf11b[3][2] = { { 204, 205 }, { 2, 3 }, { 1, 1 } }; /*------------------------------------------------------------------------- * Create a file *------------------------------------------------------------------------- */ - fid1 = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid1 = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * Check for different storage order. Give a warning if they are different *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset0a",H5T_STD_I16LE,buf2a); - write_dset(fid1,2,dims,"dset0b",H5T_STD_I32LE,buf3b); + write_dset(fid1, 2, dims, "dset0a", H5T_STD_I16LE, buf2a); + write_dset(fid1, 2, dims, "dset0b", H5T_STD_I32LE, buf3b); /*------------------------------------------------------------------------- * H5T_NATIVE_CHAR *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset1a",H5T_NATIVE_CHAR,buf1a); - write_dset(fid1,2,dims,"dset1b",H5T_NATIVE_CHAR,buf1b); + write_dset(fid1, 2, dims, "dset1a", H5T_NATIVE_CHAR, buf1a); + write_dset(fid1, 2, dims, "dset1b", H5T_NATIVE_CHAR, buf1b); /*------------------------------------------------------------------------- * H5T_NATIVE_SHORT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset2a",H5T_NATIVE_SHORT,buf2a); - write_dset(fid1,2,dims,"dset2b",H5T_NATIVE_SHORT,buf2b); + write_dset(fid1, 2, dims, "dset2a", H5T_NATIVE_SHORT, buf2a); + write_dset(fid1, 2, dims, "dset2b", H5T_NATIVE_SHORT, buf2b); /*------------------------------------------------------------------------- * H5T_NATIVE_INT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset3a",H5T_NATIVE_INT,buf3a); - write_dset(fid1,2,dims,"dset3b",H5T_NATIVE_INT,buf3b); + write_dset(fid1, 2, dims, "dset3a", H5T_NATIVE_INT, buf3a); + write_dset(fid1, 2, dims, "dset3b", H5T_NATIVE_INT, buf3b); /*------------------------------------------------------------------------- * H5T_NATIVE_LONG *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset4a",H5T_NATIVE_LONG,buf4a); - write_dset(fid1,2,dims,"dset4b",H5T_NATIVE_LONG,buf4b); + write_dset(fid1, 2, dims, "dset4a", H5T_NATIVE_LONG, buf4a); + write_dset(fid1, 2, dims, "dset4b", H5T_NATIVE_LONG, buf4b); /*------------------------------------------------------------------------- * H5T_NATIVE_FLOAT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset5a",H5T_NATIVE_FLOAT,buf5a); - write_dset(fid1,2,dims,"dset5b",H5T_NATIVE_FLOAT,buf5b); + write_dset(fid1, 2, dims, "dset5a", H5T_NATIVE_FLOAT, buf5a); + write_dset(fid1, 2, dims, "dset5b", H5T_NATIVE_FLOAT, buf5b); /*------------------------------------------------------------------------- * H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset6a",H5T_NATIVE_DOUBLE,buf6a); - write_dset(fid1,2,dims,"dset6b",H5T_NATIVE_DOUBLE,buf6b); + write_dset(fid1, 2, dims, "dset6a", H5T_NATIVE_DOUBLE, buf6a); + write_dset(fid1, 2, dims, "dset6b", H5T_NATIVE_DOUBLE, buf6b); /*------------------------------------------------------------------------- * H5T_NATIVE_CHAR and H5T_NATIVE_UCHAR *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset7a",H5T_NATIVE_CHAR,buf7a); - write_dset(fid1,2,dims,"dset7b",H5T_NATIVE_UCHAR,buf7b); + write_dset(fid1, 2, dims, "dset7a", H5T_NATIVE_CHAR, buf7a); + write_dset(fid1, 2, dims, "dset7b", H5T_NATIVE_UCHAR, buf7b); /*------------------------------------------------------------------------- * H5T_NATIVE_LLONG *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset8a",H5T_NATIVE_LLONG,buf8a); - write_dset(fid1,2,dims,"dset8b",H5T_NATIVE_LLONG,buf8b); + write_dset(fid1, 2, dims, "dset8a", H5T_NATIVE_LLONG, buf8a); + write_dset(fid1, 2, dims, "dset8b", H5T_NATIVE_LLONG, buf8b); /*------------------------------------------------------------------------- * H5T_NATIVE_ULLONG *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset9a",H5T_NATIVE_ULLONG,buf9a); - write_dset(fid1,2,dims,"dset9b",H5T_NATIVE_ULLONG,buf9b); + write_dset(fid1, 2, dims, "dset9a", H5T_NATIVE_ULLONG, buf9a); + write_dset(fid1, 2, dims, "dset9b", H5T_NATIVE_ULLONG, buf9b); /*------------------------------------------------------------------------- * H5T_NATIVE_INT *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset10a",H5T_NATIVE_UINT,buf10a); - write_dset(fid1,2,dims,"dset10b",H5T_NATIVE_UINT,buf10b); + write_dset(fid1, 2, dims, "dset10a", H5T_NATIVE_UINT, buf10a); + write_dset(fid1, 2, dims, "dset10b", H5T_NATIVE_UINT, buf10b); /*------------------------------------------------------------------------- * Same type class, different size *------------------------------------------------------------------------- */ - write_dset(fid1,2,dims,"dset11a",H5T_STD_U16LE,buf11a); - dset=H5Dopen2 (fid1, "dset11a", H5P_DEFAULT); - write_attr(dset,2,dims,"attr",H5T_STD_U16LE,buf11a); - H5Dclose (dset); + write_dset(fid1, 2, dims, "dset11a", H5T_STD_U16LE, buf11a); + dset = H5Dopen2(fid1, "dset11a", H5P_DEFAULT); + write_attr(dset, 2, dims, "attr", H5T_STD_U16LE, buf11a); + H5Dclose(dset); - write_dset(fid1,2,dims,"dset11b",H5T_STD_U32LE,buf11b); - dset=H5Dopen2 (fid1, "dset11b", H5P_DEFAULT); - write_attr(dset,2,dims,"attr",H5T_STD_U32LE,buf11b); - H5Dclose (dset); + write_dset(fid1, 2, dims, "dset11b", H5T_STD_U32LE, buf11b); + dset = H5Dopen2(fid1, "dset11b", H5P_DEFAULT); + write_attr(dset, 2, dims, "attr", H5T_STD_U32LE, buf11b); + H5Dclose(dset); /*------------------------------------------------------------------------- * Close @@ -932,59 +929,58 @@ int test_datatypes(const char *fname) } /* -# ############################################################################## -# # Dataset datatypes -# ############################################################################## + # ############################################################################## + # # Dataset datatypes + # ############################################################################## -# 5.0 -TOOLTEST h5diff_50.txt file4.h5 file4.h5 -v dset0a dset0b + # 5.0 + TOOLTEST h5diff_50.txt file4.h5 file4.h5 -v dset0a dset0b -# 5.1 -TOOLTEST h5diff_51.txt file4.h5 file4.h5 -v dset1a dset1b + # 5.1 + TOOLTEST h5diff_51.txt file4.h5 file4.h5 -v dset1a dset1b -# 5.2 -TOOLTEST h5diff_52.txt file4.h5 file4.h5 -v dset2a dset2b + # 5.2 + TOOLTEST h5diff_52.txt file4.h5 file4.h5 -v dset2a dset2b -# 5.3 -TOOLTEST h5diff_53.txt file4.h5 file4.h5 -v dset3a dset4b + # 5.3 + TOOLTEST h5diff_53.txt file4.h5 file4.h5 -v dset3a dset4b -# 5.4 -TOOLTEST h5diff_54.txt file4.h5 file4.h5 -v dset4a dset4b + # 5.4 + TOOLTEST h5diff_54.txt file4.h5 file4.h5 -v dset4a dset4b -# 5.5 -TOOLTEST h5diff_55.txt file4.h5 file4.h5 -v dset5a dset5b + # 5.5 + TOOLTEST h5diff_55.txt file4.h5 file4.h5 -v dset5a dset5b -# 5.6 -TOOLTEST h5diff_56.txt file4.h5 file4.h5 -v dset6a dset6b + # 5.6 + TOOLTEST h5diff_56.txt file4.h5 file4.h5 -v dset6a dset6b -# 5.7 -TOOLTEST h5diff_57.txt file4.h5 file4.h5 -v dset7a dset7b + # 5.7 + TOOLTEST h5diff_57.txt file4.h5 file4.h5 -v dset7a dset7b -# 5.8 (region reference) -TOOLTEST h5diff_58.txt file7.h5 file8.h5 -v refreg -*/ + # 5.8 (region reference) + TOOLTEST h5diff_58.txt file7.h5 file8.h5 -v refreg + */ /*------------------------------------------------------------------------- -* Function: test_attributes -* -* Purpose: test attributes -* -*------------------------------------------------------------------------- -*/ + * Function: test_attributes + * + * Purpose: test attributes + * + *------------------------------------------------------------------------- + */ static -int test_attributes(const char *file, - int make_diffs /* flag to modify data buffers */) +int test_attributes(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid; - hid_t did; - hid_t gid; - hid_t root_id; - hid_t sid; - hsize_t dims[1]={2}; - herr_t status; + hid_t fid = -1; + hid_t did = -1; + hid_t gid = -1; + hid_t root_id = -1; + hid_t sid = -1; + hsize_t dims[1] = { 2 }; + herr_t status; /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a 1D dataset */ @@ -994,18 +990,23 @@ int test_attributes(const char *file, assert(status >= 0); /* Create groups */ - gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - root_id = H5Gopen2(fid, "/", H5P_DEFAULT); + gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + root_id = H5Gopen2(fid, "/", H5P_DEFAULT); /*------------------------------------------------------------------------- * write a series of attributes on the dataset, group, and root group *------------------------------------------------------------------------- */ - - write_attr_in(did,"dset",fid,make_diffs); - write_attr_in(gid,NULL,(hid_t)0,make_diffs); - write_attr_in(root_id,NULL,(hid_t)0,make_diffs); - + if (make_diffs > 1) { + write_attr_strings(did, "dset", fid, make_diffs); + write_attr_strings(gid, NULL, (hid_t) 0, make_diffs); + write_attr_strings(root_id, NULL, (hid_t) 0, make_diffs); + } + else { + write_attr_in(did, "dset", fid, make_diffs); + write_attr_in(gid, NULL, (hid_t) 0, make_diffs); + write_attr_in(root_id, NULL, (hid_t) 0, make_diffs); + } /* Close */ status = H5Dclose(did); @@ -1021,338 +1022,313 @@ int test_attributes(const char *file, return status; } - /*------------------------------------------------------------------------- -* Function: test_attributes_verbose_level -* -* Purpose: Cresting test files for testing attributes along with -* levels of verbos option -* -*------------------------------------------------------------------------- -*/ + * Function: test_attributes_verbose_level + * + * Purpose: Cresting test files for testing attributes along with + * levels of verbos option + * + *------------------------------------------------------------------------- + */ static int test_attributes_verbose_level(const char *fname1, const char *fname2) { - herr_t status = SUCCEED; - hid_t fid1 = -1, fid2 = -1; - hid_t f1_gid = -1, f2_gid = -1; - hid_t f1_gid2 = -1, f2_gid2 = -1; - hid_t f1_gid3 = -1, f2_gid3 = -1; - hid_t f1_gid4 = -1, f2_gid4 = -1; - hid_t f1_did = -1, f2_did = -1; - hid_t f1_sid = -1, f2_sid = -1; - hid_t f1_tid = -1, f2_tid = -1; + herr_t status = SUCCEED; + hid_t fid1 = -1, fid2 = -1; + hid_t f1_gid = -1, f2_gid = -1; + hid_t f1_gid2 = -1, f2_gid2 = -1; + hid_t f1_gid3 = -1, f2_gid3 = -1; + hid_t f1_gid4 = -1, f2_gid4 = -1; + hid_t f1_did = -1, f2_did = -1; + hid_t f1_sid = -1, f2_sid = -1; + hid_t f1_tid = -1, f2_tid = -1; /* dset */ - hsize_t dset_dims[1]={3}; - int dset_data[3] = {0,1,2}; + hsize_t dset_dims[1] = { 3 }; + int dset_data[3] = { 0, 1, 2 }; /* common attrs dim */ - hsize_t attr_dims[1]={2}; + hsize_t attr_dims[1] = { 2 }; /* file1 attr */ - int f1_attr_idata[2]= {1,2}; /* integer */ - float f1_attr_fdata[2]= {1.1F,2.2F}; /* float */ + int f1_attr_idata[2] = { 1, 2 }; /* integer */ + float f1_attr_fdata[2] = { 1.1F, 2.2F }; /* float */ /* file2 attr */ - int f2_attr_idata[2]= {2,3}; /* integer */ - float f2_attr_fdata[2]= {2.1F,3.2F}; /* float */ - + int f2_attr_idata[2] = { 2, 3 }; /* integer */ + float f2_attr_fdata[2] = { 2.1F, 3.2F }; /* float */ /*---------------------------------------------------------------------- * Create file1 *-----------------------------------------------------------------------*/ - if((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Groups */ f1_gid = H5Gcreate2(fid1, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid < 0) - { + if (f1_gid < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid2 < 0) - { + if (f1_gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid3 = H5Gcreate2(fid1, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid3 < 0) - { + if (f1_gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid4 = H5Gcreate2(fid1, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_gid4 < 0) - { + if (f1_gid4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Datasets */ f1_sid = H5Screate_simple(1, dset_dims, NULL); f1_did = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, f1_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f1_did == FAIL) - { + if (f1_did == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = H5Dwrite(f1_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Named Datatype */ f1_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid1, "ntype", f1_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); status = FAIL; goto out; } - - - /*---------------------------------------------------------------------- * Create file2 *-----------------------------------------------------------------------*/ - if((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Groups */ f2_gid = H5Gcreate2(fid2, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid < 0) - { + if (f2_gid < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid2 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid2 < 0) - { + if (f2_gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid3 = H5Gcreate2(fid2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid3 < 0) - { + if (f2_gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid4 = H5Gcreate2(fid2, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_gid4 < 0) - { + if (f2_gid4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Datasets */ f2_sid = H5Screate_simple(1, dset_dims, NULL); f2_did = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, f2_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (f2_did == FAIL) - { + if (f2_did == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = H5Dwrite(f2_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * Named Datatype */ f2_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid2, "ntype", f2_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); status = FAIL; goto out; } - /*---------------------------------- + /*---------------------------------- * CASE1 - Same attr number, all Same attr name * add attr to group */ - write_attr(f1_gid,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_gid,1,attr_dims,"float1",H5T_NATIVE_FLOAT,f1_attr_fdata); + write_attr(f1_gid, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_gid, 1, attr_dims, "float1", H5T_NATIVE_FLOAT, f1_attr_fdata); - write_attr(f2_gid,1,attr_dims,"integer1",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_gid,1,attr_dims,"float1",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f2_gid, 1, attr_dims, "integer1", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_gid, 1, attr_dims, "float1", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE2 - Same attr number, some Same attr name * add attr to dset */ - write_attr(f1_did,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_did,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); + write_attr(f1_did, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_did, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f1_attr_fdata); - write_attr(f2_did,1,attr_dims,"integer1",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_did,1,attr_dims,"float3",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f2_did, 1, attr_dims, "integer1", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_did, 1, attr_dims, "float3", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE3 - Same attr number, all different attr name * add attr to ntype */ - write_attr(f1_tid,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_tid,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); - write_attr(f1_tid,1,attr_dims,"float3",H5T_NATIVE_FLOAT,f1_attr_fdata); + write_attr(f1_tid, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_tid, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f1_tid, 1, attr_dims, "float3", H5T_NATIVE_FLOAT, f1_attr_fdata); - write_attr(f2_tid,1,attr_dims,"integer4",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_tid,1,attr_dims,"float5",H5T_NATIVE_FLOAT,f2_attr_fdata); - write_attr(f2_tid,1,attr_dims,"float6",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f2_tid, 1, attr_dims, "integer4", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_tid, 1, attr_dims, "float5", H5T_NATIVE_FLOAT, f2_attr_fdata); + write_attr(f2_tid, 1, attr_dims, "float6", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE4 - Different attr number, some same attr name (vs file2-g2) * add attr to g2 */ - write_attr(f1_gid2,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_gid2,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); - write_attr(f1_gid2,1,attr_dims,"float3",H5T_NATIVE_FLOAT,f1_attr_fdata); - - write_attr(f2_gid2,1,attr_dims,"integer1",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_gid2,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f1_gid2, 1, attr_dims, "integer1", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_gid2, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f1_gid2, 1, attr_dims, "float3", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f2_gid2, 1, attr_dims, "integer1", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_gid2, 1, attr_dims, "float2", H5T_NATIVE_FLOAT, f2_attr_fdata); - /*---------------------------------- + /*---------------------------------- * CASE5 - Different attr number, all different attr name * add attr to g3 */ - write_attr(f1_gid3,1,attr_dims,"integer10",H5T_NATIVE_INT,f1_attr_idata); - write_attr(f1_gid3,1,attr_dims,"float11",H5T_NATIVE_FLOAT,f1_attr_fdata); - write_attr(f1_gid3,1,attr_dims,"float12",H5T_NATIVE_FLOAT,f1_attr_fdata); - - write_attr(f2_gid3,1,attr_dims,"integer3",H5T_NATIVE_INT,f2_attr_idata); - write_attr(f2_gid3,1,attr_dims,"float4",H5T_NATIVE_FLOAT,f2_attr_fdata); + write_attr(f1_gid3, 1, attr_dims, "integer10", H5T_NATIVE_INT, f1_attr_idata); + write_attr(f1_gid3, 1, attr_dims, "float11", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f1_gid3, 1, attr_dims, "float12", H5T_NATIVE_FLOAT, f1_attr_fdata); + write_attr(f2_gid3, 1, attr_dims, "integer3", H5T_NATIVE_INT, f2_attr_idata); + write_attr(f2_gid3, 1, attr_dims, "float4", H5T_NATIVE_FLOAT, f2_attr_fdata); out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1 > 0) + if (fid1 > 0) H5Fclose(fid1); - if(fid2 > 0) + if (fid2 > 0) H5Fclose(fid2); - if(f1_gid > 0) + if (f1_gid > 0) H5Gclose(f1_gid); - if(f2_gid > 0) + if (f2_gid > 0) H5Gclose(f2_gid); - if(f1_gid2 > 0) + if (f1_gid2 > 0) H5Gclose(f1_gid2); - if(f2_gid2 > 0) + if (f2_gid2 > 0) H5Gclose(f2_gid2); - if(f1_gid3 > 0) + if (f1_gid3 > 0) H5Gclose(f1_gid3); - if(f2_gid3 > 0) + if (f2_gid3 > 0) H5Gclose(f2_gid3); - if(f1_gid4 > 0) + if (f1_gid4 > 0) H5Gclose(f1_gid4); - if(f2_gid4 > 0) + if (f2_gid4 > 0) H5Gclose(f2_gid4); - if(f1_did > 0) + if (f1_did > 0) H5Dclose(f1_did); - if(f2_did > 0) + if (f2_did > 0) H5Dclose(f2_did); - if(f1_sid > 0) + if (f1_sid > 0) H5Sclose(f1_sid); - if(f2_sid > 0) + if (f2_sid > 0) H5Sclose(f2_sid); - if(f1_tid > 0) + if (f1_tid > 0) H5Tclose(f1_tid); - if(f2_tid > 0) + if (f2_tid > 0) H5Tclose(f2_tid); return status; } - /*------------------------------------------------------------------------- -* Function: test_datasets -* -* Purpose: Check all HDF5 classes -* H5T_INTEGER, H5T_FLOAT -* H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, -* H5T_ENUM, H5T_VLEN, H5T_ARRAY -* -*------------------------------------------------------------------------- -*/ + * Function: test_datasets + * + * Purpose: Check all HDF5 classes + * H5T_INTEGER, H5T_FLOAT + * H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, + * H5T_ENUM, H5T_VLEN, H5T_ARRAY + * + *------------------------------------------------------------------------- + */ static -int test_datasets(const char *file, - int make_diffs /* flag to modify data buffers */) +int test_datasets(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid; - hid_t did; - hid_t gid; - hid_t sid; - hsize_t dims[1]={2}; - herr_t status; - int buf[2]={1,2}; - - if(make_diffs > 0) + hid_t fid = -1; + hid_t did = -1; + hid_t gid = -1; + hid_t sid = -1; + hsize_t dims[1] = { 2 }; + herr_t status; + int buf[2] = { 1, 2 }; + + if (make_diffs > 0) memset(buf, 0, sizeof buf); /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a 1D dataset */ sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); status = H5Sclose(sid); assert(status >= 0); /* Create a group */ - gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * write a series of datasets on the group *------------------------------------------------------------------------- */ - write_dset_in(gid,"/dset",fid,make_diffs); + write_dset_in(gid, "/dset", fid, make_diffs); /* close */ status = H5Dclose(did); @@ -1367,29 +1343,29 @@ int test_datasets(const char *file, } /*------------------------------------------------------------------------- -* Function: test_special_datasets -* -* Purpose: Check datasets with datasapce of zero dimension size. -*------------------------------------------------------------------------- -*/ + * Function: test_special_datasets + * + * Purpose: Check datasets with datasapce of zero dimension size. + *------------------------------------------------------------------------- + */ static -int test_special_datasets(const char *file, - int make_diffs /* flag to modify data buffers */) +int test_special_datasets(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t fid; - hid_t did; - hid_t sid0, sid; - hsize_t dims0[SPACE1_RANK]={SPACE1_DIM1, SPACE1_DIM2}; - hsize_t dims[SPACE1_RANK]={SPACE1_DIM1, SPACE1_DIM2}; - herr_t status; + hid_t fid = -1; + hid_t did = -1; + hid_t sid0 = -1; + hid_t sid = -1; + hsize_t dims0[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 }; + hsize_t dims[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 }; + herr_t status; /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* Create a dataset with zero dimension size */ sid0 = H5Screate_simple(SPACE1_RANK, dims0, NULL); - did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid0, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid0, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* close dataset */ status = H5Dclose(did); @@ -1400,12 +1376,12 @@ int test_special_datasets(const char *file, assert(status >= 0); /* Create a dataset with zero dimension size in one file but the other one - * has a dataset with a non-zero dimension size */ - if(make_diffs) + * has a dataset with a non-zero dimension size */ + if (make_diffs) dims[1] = SPACE1_DIM2 + 4; sid = H5Screate_simple(SPACE1_RANK, dims, NULL); - did = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* close dataspace */ status = H5Sclose(sid); @@ -1422,26 +1398,25 @@ int test_special_datasets(const char *file, } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare links, one has longer name than -* the other and short name is subset of long name. -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare links, one has longer name than + * the other and short name is subset of long name. + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_link_name(const char *fname1) { - hid_t fid1=0; - hid_t gid1=0; - hid_t gid2=0; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; @@ -1451,16 +1426,15 @@ static int test_link_name(const char *fname1) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } - gid2 = H5Gcreate2(fid1, "group_longname", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + gid2 = H5Gcreate2(fid1, "group_longname", H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -1470,16 +1444,14 @@ static int test_link_name(const char *fname1) * Soft Links *------------------------------------------------------------------------*/ status = H5Lcreate_soft("group", fid1, "link_g1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("group_longname", fid1, "link_g2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -1489,38 +1461,37 @@ out: /*----------------------------------------------------------------------- * Close *------------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare soft links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare soft links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_soft_links(const char *fname1) { - hid_t fid1=0; - hid_t gid1=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t gid1 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; @@ -1530,8 +1501,7 @@ static int test_soft_links(const char *fname1) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -1541,25 +1511,22 @@ static int test_soft_links(const char *fname1) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"target_dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"target_dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; @@ -1570,48 +1537,42 @@ static int test_soft_links(const char *fname1) *------------------------------------------------------------------------*/ /* file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/no_obj", fid1, "softlink_noexist", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -1621,38 +1582,37 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(gid1) + if (gid1) H5Gclose(gid1); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare linked soft links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare linked soft links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_linked_softlinks(const char *fname1) { - hid_t fid1=0; - hid_t gid1=0; - hid_t gid2=0; - hid_t gid3=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t gid3 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; @@ -1662,24 +1622,21 @@ static int test_linked_softlinks(const char *fname1) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2 = H5Gcreate2(fid1, "target_group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3 = H5Gcreate2(fid1, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3 < 0) - { + if (gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -1689,24 +1646,21 @@ static int test_linked_softlinks(const char *fname1) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"target_dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"target_dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; @@ -1716,98 +1670,86 @@ static int test_linked_softlinks(const char *fname1) * Soft Links (Linked) *------------------------------------------------------------------------*/ /*--------- - * file 1 */ + * file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink1_to_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_dset1", fid1, "softlink1_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_slink1", fid1, "softlink1_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink2_to_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_dset2", fid1, "softlink2_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_slink1", fid1, "softlink2_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group1", fid1, "softlink3_to_group1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_group1", fid1, "softlink3_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_slink1", fid1, "softlink3_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group2", fid1, "softlink4_to_group2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_group2", fid1, "softlink4_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_slink1", fid1, "softlink4_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -1817,52 +1759,50 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(gid3) + if (gid3) H5Gclose(gid3); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare external links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare external links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_external_links(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hid_t gid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ /* source file */ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } /* target file */ - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; @@ -1872,18 +1812,16 @@ static int test_external_links(const char *fname1, const char *fname2) * Groups *------------------------------------------------------------------------*/ /*-------------- - * target file */ + * target file */ gid1 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2 = H5Gcreate2(fid2, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -1892,26 +1830,23 @@ static int test_external_links(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /*-------------- - * target file */ - status = write_dset(fid2,2,dims2,"target_dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + * target file */ + status = write_dset(fid2, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"x_dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "x_dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"x_dset",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "x_dset", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -1923,48 +1858,42 @@ static int test_external_links(const char *fname1, const char *fname2) /*--------------*/ /* source file */ status = H5Lcreate_external(fname2, "/target_group/x_dset", fid1, "ext_link_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group2/x_dset", fid1, "ext_link_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group", fid1, "/ext_link_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group2", fid1, "/ext_link_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link_noexist1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link_noexist2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -1974,52 +1903,50 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare external links which point to -* soft link in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare external links which point to + * soft link in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_ext2soft_links(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ /* source file */ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } /* target file */ - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; @@ -2030,8 +1957,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* target file */ gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -2041,18 +1967,16 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /*-------------- - * target file */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + * target file */ + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -2062,18 +1986,16 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * Soft Links (Linked) *------------------------------------------------------------------------*/ /*--------------- - * target file */ + * target file */ status = H5Lcreate_soft("/dset1", fid2, "softlink_to_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "softlink_to_dset2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; @@ -2083,26 +2005,23 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * External Links *------------------------------------------------------------------------*/ /*--------------- - * source file */ + * source file */ status = H5Lcreate_external(fname2, "/target_group", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/softlink_to_dset1", fid1, "ext_link_to_slink1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/softlink_to_dset2", fid1, "ext_link_to_slink2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -2112,56 +2031,57 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* Function: gen_dataset_idx -* -* Purpose: Create a file with either the new or old format -* Create two datasets in the file: -* one dataset: fixed dimension, chunked layout, w/o filters -* one dataset: fixed dimension, chunked layout, w/ filters -* -*------------------------------------------------------------------------- -*/ + * Function: gen_dataset_idx + * + * Purpose: Create a file with either the new or old format + * Create two datasets in the file: + * one dataset: fixed dimension, chunked layout, w/o filters + * one dataset: fixed dimension, chunked layout, w/ filters + * + *------------------------------------------------------------------------- + */ static int gen_dataset_idx(const char *file, int format) { - hid_t fid; /* file id */ - hid_t did, did2; /* dataset id */ - hid_t sid; /* space id */ - hid_t fapl; /* file access property id */ - hid_t dcpl; /* dataset creation property id */ - hsize_t dims[1] = {10}; /* dataset dimension */ - hsize_t c_dims[1] = {2}; /* chunk dimension */ - herr_t status; /* return status */ - int buf[10]; /* data buffer */ - int i; /* local index variable */ + hid_t fid = -1; /* file id */ + hid_t did = -1; + hid_t did2 = -1; /* dataset id */ + hid_t sid = -1; /* space id */ + hid_t fapl = -1; /* file access property id */ + hid_t dcpl = -1; /* dataset creation property id */ + hsize_t dims[1] = { 10 }; /* dataset dimension */ + hsize_t c_dims[1] = { 2 }; /* chunk dimension */ + herr_t status; /* return status */ + int buf[10]; /* data buffer */ + int i; /* local index variable */ /* Get a copy of the file aaccess property */ fapl = H5Pcreate(H5P_FILE_ACCESS); /* Set the "use the latest format" bounds for creating objects in the file */ - if(format) { - status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - assert(status >= 0); + if (format) { + status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + assert(status >= 0); } /* Create a file */ - if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) return -1; /* Create data */ - for(i = 0; i < 10; i++) - buf[i] = i; + for (i = 0; i < 10; i++) + buf[i] = i; /* Set chunk */ dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -2170,7 +2090,7 @@ int gen_dataset_idx(const char *file, int format) /* Create a 1D dataset */ sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); /* Write to the dataset */ status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -2182,7 +2102,7 @@ int gen_dataset_idx(const char *file, int format) assert(status >= 0); /* Create and write the dataset */ - did2 = H5Dcreate2(fid, "dset_filter", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + did2 = H5Dcreate2(fid, "dset_filter", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); assert(status >= 0); @@ -2212,35 +2132,33 @@ int gen_dataset_idx(const char *file, int format) } /*------------------------------------------------------------------------- -* -* Purpose: Create test files to compare dangling links in various way -* -* Programmer: Jonathan Kim (Feb 17, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files to compare dangling links in various way + * + * Programmer: Jonathan Kim (Feb 17, 2010) + * + *-------------------------------------------------------------------------*/ static int test_dangle_links(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - int data2[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; @@ -2250,34 +2168,30 @@ static int test_dangle_links(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -2288,32 +2202,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file 1 */ status = H5Lcreate_soft("no_obj", fid1, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/dset1", fid1, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid1, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -2321,32 +2231,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid2, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; @@ -2357,32 +2263,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/dset1", fid1, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -2390,32 +2292,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/dset2", fid2, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; @@ -2425,47 +2323,45 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: For testing comparing group member objects recursively -* -* Programmer: Jonathan Kim (Aug 19, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: For testing comparing group member objects recursively + * + * Programmer: Jonathan Kim (Aug 19, 2010) + * + *-------------------------------------------------------------------------*/ static int test_group_recurse(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1_f1=0, gid2_f1=0, gid3_f1=0, gid10_f1=0; - hid_t gid1_f2=0, gid2_f2=0, gid3_f2=0, gid11_f2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,1},{0,1},{1,0},{1,0}}; - int data2[4][2] = {{0,2},{0,2},{2,0},{2,0}}; - int data3[4][2] = {{0,3},{0,3},{3,0},{3,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1_f1 = -1, gid2_f1 = -1, gid3_f1 = -1, gid10_f1 = -1; + hid_t gid1_f2 = -1, gid2_f2 = -1, gid3_f2 = -1, gid11_f2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 } }; + int data2[4][2] = { { 0, 2 }, { 0, 2 }, { 2, 0 }, { 2, 0 } }; + int data3[4][2] = { { 0, 3 }, { 0, 3 }, { 3, 0 }, { 3, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; @@ -2476,32 +2372,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ gid1_f1 = H5Gcreate2(fid1, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1_f1 < 0) - { + if (gid1_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2_f1 = H5Gcreate2(fid1, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2_f1 < 0) - { + if (gid2_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3_f1 = H5Gcreate2(fid1, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3_f1 < 0) - { + if (gid3_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid10_f1 = H5Gcreate2(fid1, "/grp10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid10_f1 < 0) - { + if (gid10_f1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -2509,32 +2401,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ gid1_f2 = H5Gcreate2(fid2, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1_f2 < 0) - { + if (gid1_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2_f2 = H5Gcreate2(fid2, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2_f2 < 0) - { + if (gid2_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid3_f2 = H5Gcreate2(fid2, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3_f2 < 0) - { + if (gid3_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid11_f2 = H5Gcreate2(fid2, "/grp11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid11_f2 < 0) - { + if (gid11_f2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -2544,50 +2432,44 @@ static int test_group_recurse(const char *fname1, const char *fname2) * Datasets under root *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(fid2,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -2597,163 +2479,142 @@ static int test_group_recurse(const char *fname1, const char *fname2) * Datasets under group *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(gid1_f1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid2_f1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid2_f1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid3_f1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid3_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid3_f1,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid3_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid3_f1,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(gid3_f1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid10_f1,2,dims2,"dset4",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid10_f1, 2, dims2, "dset4", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid10_f1,2,dims2,"dset5",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(gid10_f1, 2, dims2, "dset5", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(gid1_f2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2_f2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2_f2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3_f2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid3_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3_f2,2,dims2,"dset2",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid3_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3_f2,2,dims2,"dset3",H5T_NATIVE_INT,data3); - if (status == FAIL) - { + status = write_dset(gid3_f2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid11_f2,2,dims2,"dset4",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid11_f2, 2, dims2, "dset4", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid11_f2,2,dims2,"dset5",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid11_f2, 2, dims2, "dset5", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - /*----------------------------------------------------------------------- * Soft Links *------------------------------------------------------------------------*/ /* file 1 */ status = H5Lcreate_soft("/grp1", fid1, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid1, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid1, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp10", fid1, "slink_grp10", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; @@ -2761,32 +2622,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("/grp1", fid2, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid2, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid2, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp11", fid2, "slink_grp11", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; @@ -2797,24 +2654,21 @@ static int test_group_recurse(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ status = H5Lcreate_external(fname2, "/grp1", fid1, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2", fid1, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2/grp3", fid1, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; @@ -2822,225 +2676,210 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "/grp1", fid2, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2", fid2, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2/grp3", fid2, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } /*------------------------------ - * external circle route test - * file1/grp11 <-> file2/grp10 via elink_grp_circle link - */ + * external circle route test + * file1/grp11 <-> file2/grp10 via elink_grp_circle link + */ /* file1 */ status = H5Lcreate_external(fname2, "/grp11", gid10_f1, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } /* file2 */ status = H5Lcreate_external(fname1, "/grp10", gid11_f2, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } - out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1_f1) + if (gid1_f1) H5Gclose(gid1_f1); - if(gid2_f1) + if (gid2_f1) H5Gclose(gid2_f1); - if(gid3_f1) + if (gid3_f1) H5Gclose(gid3_f1); - if(gid1_f2) + if (gid1_f2) H5Gclose(gid1_f2); - if(gid2_f2) + if (gid2_f2) H5Gclose(gid2_f2); - if(gid3_f2) + if (gid3_f2) H5Gclose(gid3_f2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: -* For testing comparing group member objects recursively via multiple -* linked external links -* -* Programmer: Jonathan Kim (Sep 16, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: + * For testing comparing group member objects recursively via multiple + * linked external links + * + * Programmer: Jonathan Kim (Sep 16, 2010) + * + *-------------------------------------------------------------------------*/ #define GRP_R_DSETNAME1 "dset1" #define GRP_R_DSETNAME2 "dset2" static int test_group_recurse2(void) { - hid_t fileid1 = -1; - hid_t grp1 = -1; - hid_t grp2 = -1; - hid_t grp3 = -1; - hid_t grp4 = -1; - hid_t dset1 = -1; - hid_t dset2 = -1; - hid_t datatype = -1; - hid_t dataspace = -1; - hid_t fileid2 = -1; - hid_t fileid3 = -1; - hid_t fileid4 = -1; - hsize_t dimsf[2]; /* dataset dimensions */ - herr_t status=0; - int data1[4][2] = {{0,0},{1,1},{2,2},{3,3}}; - int data2[4][2] = {{0,0},{0,1},{0,2},{3,3}}; - - /*----------------------------------------------------------------------- + hid_t fileid1 = -1; + hid_t grp1 = -1; + hid_t grp2 = -1; + hid_t grp3 = -1; + hid_t grp4 = -1; + hid_t dset1 = -1; + hid_t dset2 = -1; + hid_t datatype = -1; + hid_t dataspace = -1; + hid_t fileid2 = -1; + hid_t fileid3 = -1; + hid_t fileid4 = -1; + hsize_t dimsf[2]; /* dataset dimensions */ + herr_t status = 0; + int data1[4][2] = { { 0, 0 }, { 1, 1 }, { 2, 2 }, { 3, 3 } }; + int data2[4][2] = { { 0, 0 }, { 0, 1 }, { 0, 2 }, { 3, 3 } }; + + /*----------------------------------------------------------------------- * FILE 1 *------------------------------------------------------------------------*/ /* - * Create a new file using H5F_ACC_TRUNC access, - * default file creation properties, and default file - * access properties. - */ + * Create a new file using H5F_ACC_TRUNC access, + * default file creation properties, and default file + * access properties. + */ fileid1 = H5Fcreate(GRP_RECURSE1_EXT, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Groups *------------------------------------------------------------------------*/ grp1 = H5Gcreate2(fileid1, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp1 < 0) - { + if (grp1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp2 = H5Gcreate2(grp1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp2 < 0) - { + if (grp2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp3 < 0) - { + if (grp3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp4 = H5Gcreate2(grp3, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp4 < 0) - { + if (grp4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Datasets *------------------------------------------------------------------------*/ /* - * Describe the size of the array and create the data space for fixed - * size dataset. - */ + * Describe the size of the array and create the data space for fixed + * size dataset. + */ dimsf[0] = 4; dimsf[1] = 2; dataspace = H5Screate_simple(2, dimsf, NULL); /* - * Define datatype for the data in the file. - * We will store little endian INT numbers. - */ + * Define datatype for the data in the file. + * We will store little endian INT numbers. + */ datatype = H5Tcopy(H5T_NATIVE_INT); status = H5Tset_order(datatype, H5T_ORDER_LE); /*--------------- - * dset1 - */ + * dset1 + */ /* - * Create a new dataset within the file using defined dataspace and - * datatype and default dataset creation properties. - */ - dset1 = H5Dcreate2(fileid1, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the file using defined dataspace and + * datatype and default dataset creation properties. + */ + dset1 = H5Dcreate2(fileid1, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); H5Dclose(dset1); /*--------------- - * dset1 - */ + * dset1 + */ /* - * Create a new dataset within the file using defined dataspace and - * datatype and default dataset creation properties. - */ - dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the file using defined dataspace and + * datatype and default dataset creation properties. + */ + dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); /*--------------- - * dset2 - */ + * dset2 + */ /* - * Create a new dataset within the fileid1 using defined dataspace and - * datatype and default dataset creation properties. - */ - dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the fileid1 using defined dataspace and + * datatype and default dataset creation properties. + */ + dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Soft links *------------------------------------------------------------------------*/ /* - * under '/' root - */ + * under '/' root + */ /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; @@ -3053,90 +2892,83 @@ static int test_group_recurse2(void) H5Gclose(grp3); H5Gclose(grp4); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * FILE 2-3 *------------------------------------------------------------------------*/ /* crate target file */ fileid4 = H5Fcreate(GRP_RECURSE2_EXT3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------- + /*----------------------------------------------- * Groups */ grp4 = H5Gcreate2(fileid4, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp4 < 0) - { + if (grp4 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3); status = FAIL; goto out; } /*--------------- - * dset2 - */ + * dset2 + */ /* - * Create a new dataset within the fileid1 using defined dataspace and - * datatype and default dataset creation properties. - */ - dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the fileid1 using defined dataspace and + * datatype and default dataset creation properties. + */ + dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); H5Gclose(grp4); H5Dclose(dset2); - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * FILE 2-2 *------------------------------------------------------------------------*/ /* crate target file */ fileid3 = H5Fcreate(GRP_RECURSE2_EXT2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------- + /*----------------------------------------------- * Groups */ grp2 = H5Gcreate2(fileid3, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp2 < 0) - { + if (grp2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp3 < 0) - { + if (grp3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } /*--------------- - * dset1 - */ + * dset1 + */ /* - * Create a new dataset within the fileid1 using defined dataspace and - * datatype and default dataset creation properties. - */ - dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * Create a new dataset within the fileid1 using defined dataspace and + * datatype and default dataset creation properties. + */ + dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); - /*----------------------------------------------- + /*----------------------------------------------- * extlink to $GRP_RECURSE2_EXT3/g4 */ status = H5Lcreate_external(GRP_RECURSE2_EXT3, "/g4", fileid3, "/g2/g3/g4", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; @@ -3146,56 +2978,52 @@ static int test_group_recurse2(void) H5Gclose(grp2); H5Gclose(grp3); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * FILE 2-1 *------------------------------------------------------------------------*/ /* crate target file */ fileid2 = H5Fcreate(GRP_RECURSE2_EXT1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /*----------------------------------------------- + /*----------------------------------------------- * Groups */ grp1 = H5Gcreate2(fileid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (grp1 < 0) - { + if (grp1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } /*--------------- - * dset1 - */ - dset1 = H5Dcreate2(fileid2, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * dset1 + */ + dset1 = H5Dcreate2(fileid2, GRP_R_DSETNAME1, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* - * Write the data to the dataset using default transfer properties. - */ + * Write the data to the dataset using default transfer properties. + */ status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Soft links *------------------------------------------------------------------------*/ /* - * under '/' root - */ + * under '/' root + */ /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid2, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; } - /*----------------------------------------------- + /*----------------------------------------------- * extlink to $GRP_RECURSE2_EXT2/g2 */ status = H5Lcreate_external(GRP_RECURSE2_EXT2, "/g2", fileid2, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; @@ -3206,72 +3034,67 @@ static int test_group_recurse2(void) out: /* - * Close/release resources. - */ - if(dataspace > 0) + * Close/release resources. + */ + if (dataspace > 0) H5Sclose(dataspace); - if(datatype > 0) + if (datatype > 0) H5Tclose(datatype); - if(fileid1 > 0) + if (fileid1 > 0) H5Fclose(fileid1); - if(fileid2 > 0) + if (fileid2 > 0) H5Fclose(fileid2); - if(fileid3 > 0) + if (fileid3 > 0) H5Fclose(fileid3); - if(fileid4 > 0) + if (fileid4 > 0) H5Fclose(fileid4); return status; } - /*------------------------------------------------------------------------- -* -* Purpose: Create test files for excluding obj. -* Same structure, same obj names -* Test : exclude obj with different value to verify the rest are same -* -* Programmer: Jonathan Kim (July, 21, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for excluding obj. + * Same structure, same obj names + * Test : exclude obj with different value to verify the rest are same + * + * Programmer: Jonathan Kim (July, 21, 2010) + * + *-------------------------------------------------------------------------*/ static int test_exclude_obj1(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hid_t gid2=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - int data2[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Group *------------------------------------------------------------------------*/ /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3280,133 +3103,119 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) /* file2 */ gid2 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*----------------------------------------------------------------------- * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset3",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"dset3",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "dset3", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files for excluding obj. -* different structure and name -* Test : exclude different objs to verify the rest are same -* -* Programmer: Jonathan Kim (July, 21, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for excluding obj. + * different structure and name + * Test : exclude different objs to verify the rest are same + * + * Programmer: Jonathan Kim (July, 21, 2010) + * + *-------------------------------------------------------------------------*/ static int test_exclude_obj2(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hid_t gid2=0; - hid_t gid3=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - int data2[4][2] = {{0,1},{2,3},{1,2},{3,4}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t gid3 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Group *------------------------------------------------------------------------*/ /* file1 */ gid1 = H5Gcreate2(fid1, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3414,9 +3223,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* file2 */ gid2 = H5Gcreate2(fid2, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -3425,133 +3232,118 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* subset name from group10 */ gid3 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid3 < 0) - { + if (gid3 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } - /*----------------------------------------------------------------------- * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset10",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset10", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - /* file2 */ - status = write_dset(fid2,2,dims2,"dset10",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset10", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid2,2,dims2,"dset2",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - status = write_dset(gid3,2,dims2,"dset3",H5T_NATIVE_INT,data2); - if (status == FAIL) - { + status = write_dset(gid3, 2, dims2, "dset3", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } - out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(gid3) + if (gid3) H5Gclose(gid3); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files for excluding obj. -* Only one file contains unique objs. Common objs are same. -* Test : exclude unique objs to verify the rest are same -* - HDFFV-7837 -* -* Programmer: Jonathan Kim (Mar, 19, 2012) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for excluding obj. + * Only one file contains unique objs. Common objs are same. + * Test : exclude unique objs to verify the rest are same - HDFFV-7837 + * + * Programmer: Jonathan Kim (Mar, 19, 2012) + * + *-------------------------------------------------------------------------*/ static int test_exclude_obj3(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t gid1=0; - hsize_t dims2[2] = {2,4}; - int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; - herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t gid1 = -1; + hsize_t dims2[2] = { 2, 4 }; + int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Group *------------------------------------------------------------------------*/ /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3561,26 +3353,23 @@ static int test_exclude_obj3(const char *fname1, const char *fname2) * Datasets *------------------------------------------------------------------------*/ /* file1 */ - status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } - status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } /* file2 */ - status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); - if (status == FAIL) - { + status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; @@ -3590,25 +3379,25 @@ out: /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(gid1) + if (gid1) H5Gclose(gid1); return status; } /*------------------------------------------------------------------------- -* -* Purpose: Create test files for multiple variable length string/string array -* along with fixed length string/string array types in -* a compound type dataset. -* -* Programmer: Jonathan Kim (Oct, 26, 2010) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: Create test files for multiple variable length string/string array + * along with fixed length string/string array types in + * a compound type dataset. + * + * Programmer: Jonathan Kim (Oct, 26, 2010) + * + *-------------------------------------------------------------------------*/ #define STR_RANK 1 #define VLEN_STR_DIM 1 #define FIXLEN_STR_SIZE 21 @@ -3621,187 +3410,170 @@ out: static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new) { int i; - - hid_t fid1 = -1; /* file id */ - hid_t gid = -1; + hid_t fid1 = -1; /* file id */ + hid_t gid = -1; /* compound1 datatype */ - typedef struct comp1_t - { - char *str_vlen; /* vlen string */ - char *str_vlen_repeat; /* vlen string */ - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + typedef struct comp1_t { + char *str_vlen; /* vlen string */ + char *str_vlen_repeat; /* vlen string */ + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ } comp1_t; /* compound2 datatype */ - typedef struct comp2_t - { - char *str_vlen; /* vlen string */ - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen_repeat; /* vlen string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + typedef struct comp2_t { + char *str_vlen; /* vlen string */ + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen_repeat; /* vlen string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ } comp2_t; /* compound3 datatype */ - typedef struct comp3_t - { - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen; /* vlen string */ - char *str_vlen_repeat; /* vlen string */ - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + typedef struct comp3_t { + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen; /* vlen string */ + char *str_vlen_repeat; /* vlen string */ + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ } comp3_t; /* compound4 datatype */ - typedef struct comp4_t - { - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen; /* vlen string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen_repeat; /* vlen string */ - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + typedef struct comp4_t { + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen; /* vlen string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen_repeat; /* vlen string */ + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ } comp4_t; /* compound5 datatype */ - typedef struct comp5_t - { - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen; /* vlen string */ - char *str_vlen_repeat; /* vlen string */ - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + typedef struct comp5_t { + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + char *str_vlen; /* vlen string */ + char *str_vlen_repeat; /* vlen string */ + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ } comp5_t; /* compound6 datatype */ - typedef struct comp6_t - { - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen; /* vlen string */ - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen_repeat; /* vlen string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + typedef struct comp6_t { + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + char *str_vlen; /* vlen string */ + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen_repeat; /* vlen string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ } comp6_t; /* compound7 datatype */ - typedef struct comp7_t - { - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen; /* vlen string */ - char *str_vlen_repeat; /* vlen string */ + typedef struct comp7_t { + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen; /* vlen string */ + char *str_vlen_repeat; /* vlen string */ } comp7_t; /* compound8 datatype */ - typedef struct comp8_t - { - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen; /* vlen string */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_vlen_repeat; /* vlen string */ + typedef struct comp8_t { + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen; /* vlen string */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + char *str_vlen_repeat; /* vlen string */ } comp8_t; /* compound9 datatype */ - typedef struct comp9_t - { - char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ - int int_data1; - hobj_ref_t objref1; /* reference */ - char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - hobj_ref_t objref2; /* reference */ - char *str_vlen; /* vlen string */ - int int_data2; - char *str_vlen_repeat; /* vlen string */ - hobj_ref_t objref3; /* reference */ - int int_data3; + typedef struct comp9_t { + char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ + int int_data1; + hobj_ref_t objref1; /* reference */ + char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ + hobj_ref_t objref2; /* reference */ + char *str_vlen; /* vlen string */ + int int_data2; + char *str_vlen_repeat; /* vlen string */ + hobj_ref_t objref3; /* reference */ + int int_data3; } comp9_t; /* vlen string */ - hid_t sid_vlen_str=0; /* dataspace ID */ - hid_t tid_vlen_str=0; /* datatype ID */ - char vlen_str_buf[]= { - "Variable length string" - }; - hsize_t dims_vlen_str[] = {VLEN_STR_DIM}; + hid_t sid_vlen_str = -1; /* dataspace ID */ + hid_t tid_vlen_str = -1; /* datatype ID */ + char vlen_str_buf[] = { "Variable length string" }; + hsize_t dims_vlen_str[] = { VLEN_STR_DIM }; /* fixlen string */ - hid_t sid_fixlen_str=0; /* dataspace ID */ - hid_t tid_fixlen_str=0; /* datatype ID */ - const char fixlen_str_buf[FIXLEN_STR_SIZE]= { - "Fixed length string" - }; - hsize_t dims_fixlen_str[] = {FIXLEN_STR_DIM}; + hid_t sid_fixlen_str = -1; /* dataspace ID */ + hid_t tid_fixlen_str = -1; /* datatype ID */ + const char fixlen_str_buf[FIXLEN_STR_SIZE] = { "Fixed length string" }; + hsize_t dims_fixlen_str[] = { FIXLEN_STR_DIM }; /* vlen string array */ - hid_t sid_vlen_str_array=0; /* dataspace ID */ - hid_t tid_vlen_str_array_pre=0; /* datatype ID */ - hid_t tid_vlen_str_array=0; /* datatype ID */ - const char *vlen_str_array_buf[VLEN_STR_ARRY_DIM]= { - "1 - Variable length string Array", - "2 - Testing variable length string array in compound type", - "3 - Four score and seven\n years ago our forefathers brought forth on this continent a new nation," - }; - hsize_t dims_vlen_str_array[] = {VLEN_STR_ARRY_DIM}; + hid_t sid_vlen_str_array = -1; /* dataspace ID */ + hid_t tid_vlen_str_array_pre = -1; /* datatype ID */ + hid_t tid_vlen_str_array = -1; /* datatype ID */ + const char *vlen_str_array_buf[VLEN_STR_ARRY_DIM] = + { "1 - Variable length string Array", + "2 - Testing variable length string array in compound type", + "3 - Four score and seven\n years ago our forefathers brought forth on this continent a new nation," }; + hsize_t dims_vlen_str_array[] = { VLEN_STR_ARRY_DIM }; /* fixlen string array */ - hid_t sid_fixlen_str_array=0; /* dataspace ID */ - hid_t tid_fixlen_str_array_pre=0; /* datatype ID */ - hid_t tid_fixlen_str_array=0; /* datatype ID */ - const char *fixlen_str_array_buf[FIXLEN_STR_ARRY_DIM]= { - "1 - Fixed length string Array", - "2 - Fixed length string Array", - "3 - Fixed length string Array" - }; - hsize_t dims_fixlen_str_array[] = {FIXLEN_STR_ARRY_DIM}; + hid_t sid_fixlen_str_array = -1; /* dataspace ID */ + hid_t tid_fixlen_str_array_pre = -1; /* datatype ID */ + hid_t tid_fixlen_str_array = -1; /* datatype ID */ + const char *fixlen_str_array_buf[FIXLEN_STR_ARRY_DIM] = { + "1 - Fixed length string Array", "2 - Fixed length string Array", + "3 - Fixed length string Array" }; + hsize_t dims_fixlen_str_array[] = { FIXLEN_STR_ARRY_DIM }; /*------------------------------------------ - * compound dataset - *------------------------------------------*/ - hid_t sid_comp=0; /* dataspace ID */ - hid_t tid1_comp=0; /* datatype ID */ - hid_t tid2_comp=0; /* datatype ID */ - hid_t tid3_comp=0; /* datatype ID */ - hid_t tid4_comp=0; /* datatype ID */ - hid_t tid5_comp=0; /* datatype ID */ - hid_t tid6_comp=0; /* datatype ID */ - hid_t tid7_comp=0; /* datatype ID */ - hid_t tid8_comp=0; /* datatype ID */ - hid_t tid9_comp=0; /* datatype ID */ - hid_t did_comp=0; /* dataset ID */ - hsize_t dims_comp[] = {COMP_DIM}; - herr_t status = SUCCEED; + * compound dataset + *------------------------------------------*/ + hid_t sid_comp = -1; /* dataspace ID */ + hid_t tid1_comp = -1; /* datatype ID */ + hid_t tid2_comp = -1; /* datatype ID */ + hid_t tid3_comp = -1; /* datatype ID */ + hid_t tid4_comp = -1; /* datatype ID */ + hid_t tid5_comp = -1; /* datatype ID */ + hid_t tid6_comp = -1; /* datatype ID */ + hid_t tid7_comp = -1; /* datatype ID */ + hid_t tid8_comp = -1; /* datatype ID */ + hid_t tid9_comp = -1; /* datatype ID */ + hid_t did_comp = -1; /* dataset ID */ + hsize_t dims_comp[] = { COMP_DIM }; + herr_t status = SUCCEED; /* make compound strings data */ comp1_t comp1_buf; @@ -3857,23 +3629,30 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int HDstrcpy(comp9_buf.str_fixlen_repeat, fixlen_str_buf); /* copy vlen string array data to compound buffers */ - for (i=0; i < VLEN_STR_ARRY_DIM; i++) - { - comp1_buf.str_array_vlen[i] = comp1_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp2_buf.str_array_vlen[i] = comp2_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp3_buf.str_array_vlen[i] = comp3_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp4_buf.str_array_vlen[i] = comp4_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp5_buf.str_array_vlen[i] = comp5_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp6_buf.str_array_vlen[i] = comp6_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp7_buf.str_array_vlen[i] = comp7_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp8_buf.str_array_vlen[i] = comp8_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; - comp9_buf.str_array_vlen[i] = comp9_buf.str_vlen_array_again[i] = vlen_str_array_buf[i]; + for (i = 0; i < VLEN_STR_ARRY_DIM; i++) { + comp1_buf.str_array_vlen[i] = comp1_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp2_buf.str_array_vlen[i] = comp2_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp3_buf.str_array_vlen[i] = comp3_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp4_buf.str_array_vlen[i] = comp4_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp5_buf.str_array_vlen[i] = comp5_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp6_buf.str_array_vlen[i] = comp6_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp7_buf.str_array_vlen[i] = comp7_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp8_buf.str_array_vlen[i] = comp8_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; + comp9_buf.str_array_vlen[i] = comp9_buf.str_vlen_array_again[i] = + vlen_str_array_buf[i]; } /* copy fixlen string attay data to compound buffers */ - for (i=0; i < FIXLEN_STR_ARRY_DIM; i++) - { + for (i = 0; i < FIXLEN_STR_ARRY_DIM; i++) { HDstrcpy(comp1_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); HDstrcpy(comp1_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); @@ -3907,25 +3686,20 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int comp9_buf.int_data2 = 20; comp9_buf.int_data3 = 30; - /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - if (is_file_new == 1) - { - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { + if (is_file_new == 1) { + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } } - else - { - fid1 = H5Fopen (fname1, H5F_ACC_RDWR, H5P_DEFAULT); - if (fid1 < 0) - { + else { + fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); status = FAIL; goto out; @@ -3936,8 +3710,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Create group *------------------------------------------------------------------------*/ gid = H5Gcreate2(fid1, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid < 0) - { + if (gid < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -3947,8 +3720,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Variable length String1 - Create space and type *------------------------------------------------------------------------*/ sid_vlen_str = H5Screate_simple(STR_RANK, dims_vlen_str, NULL); - if (sid_vlen_str < 0) - { + if (sid_vlen_str < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -3956,8 +3728,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_vlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str, H5T_VARIABLE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; @@ -3967,8 +3738,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Fixed length String2 - Create space and type *------------------------------------------------------------------------*/ sid_fixlen_str = H5Screate_simple(STR_RANK, dims_fixlen_str, NULL); - if (sid_fixlen_str < 0) - { + if (sid_fixlen_str < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -3976,8 +3746,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_fixlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str, FIXLEN_STR_SIZE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; @@ -3987,8 +3756,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Fixed length String3 array - Create space and type *------------------------------------------------------------------------*/ sid_vlen_str_array = H5Screate_simple(STR_RANK, dims_vlen_str_array, NULL); - if (sid_vlen_str_array < 0) - { + if (sid_vlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -3996,17 +3764,15 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_vlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str_array_pre, H5T_VARIABLE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } - /* Create the array data type for the string array */ + /* Create the array data type for the string array */ tid_vlen_str_array = H5Tarray_create2(tid_vlen_str_array_pre, COMP_RANK, dims_vlen_str_array); - if (tid_vlen_str_array < 0) - { + if (tid_vlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; @@ -4016,8 +3782,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int * Variable length String4 array - Create space and type *------------------------------------------------------------------------*/ sid_fixlen_str_array = H5Screate_simple(STR_RANK, dims_fixlen_str_array, NULL); - if (sid_fixlen_str_array < 0) - { + if (sid_fixlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; @@ -4025,126 +3790,123 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_fixlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str_array_pre, FIXLEN_STR_ARRY_SIZE); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } - /* Create the array data type for the string array */ + /* Create the array data type for the string array */ tid_fixlen_str_array = H5Tarray_create2(tid_fixlen_str_array_pre, COMP_RANK, dims_fixlen_str_array); - if (tid_fixlen_str_array < 0) - { + if (tid_fixlen_str_array < 0) { fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; } - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * Compound dataset *------------------------------------------------------------------------*/ sid_comp = H5Screate_simple(COMP_RANK, dims_comp, NULL); - if (sid_comp < 0) - { + if (sid_comp < 0) { fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } - tid1_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp1_t)); - tid2_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp2_t)); - tid3_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp3_t)); - tid4_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp4_t)); - tid5_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp5_t)); - tid6_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp6_t)); - tid7_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp7_t)); - tid8_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp8_t)); - tid9_comp = H5Tcreate (H5T_COMPOUND, sizeof(comp9_t)); + tid1_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp1_t)); + tid2_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp2_t)); + tid3_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp3_t)); + tid4_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp4_t)); + tid5_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp5_t)); + tid6_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp6_t)); + tid7_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp7_t)); + tid8_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp8_t)); + tid9_comp = H5Tcreate(H5T_COMPOUND, sizeof(comp9_t)); /* compound 1 */ - H5Tinsert(tid1_comp, "VLEN_STR1", HOFFSET(comp1_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid1_comp, "VLEN_STR2", HOFFSET(comp1_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid1_comp, "FIXLEN_STR1", HOFFSET(comp1_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid1_comp, "FIXLEN_STR2", HOFFSET(comp1_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid1_comp, "VLEN_STR1", HOFFSET(comp1_t, str_vlen), tid_vlen_str); + H5Tinsert(tid1_comp, "VLEN_STR2", HOFFSET(comp1_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid1_comp, "FIXLEN_STR1", HOFFSET(comp1_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid1_comp, "FIXLEN_STR2", HOFFSET(comp1_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid1_comp, "VLEN_STR_ARRAY1", HOFFSET(comp1_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid1_comp, "VLEN_STR_ARRAY2", HOFFSET(comp1_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid1_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp1_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid1_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp1_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 2 */ - H5Tinsert(tid2_comp, "VLEN_STR1", HOFFSET(comp2_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid2_comp, "VLEN_STR2", HOFFSET(comp2_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid2_comp, "FIXLEN_STR1", HOFFSET(comp2_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid2_comp, "FIXLEN_STR2", HOFFSET(comp2_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid2_comp, "VLEN_STR1", HOFFSET(comp2_t, str_vlen), tid_vlen_str); + H5Tinsert(tid2_comp, "VLEN_STR2", HOFFSET(comp2_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid2_comp, "FIXLEN_STR1", HOFFSET(comp2_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid2_comp, "FIXLEN_STR2", HOFFSET(comp2_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid2_comp, "VLEN_STR_ARRAY1", HOFFSET(comp2_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid2_comp, "VLEN_STR_ARRAY2", HOFFSET(comp2_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid2_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp2_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid2_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp2_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 3 */ - H5Tinsert(tid3_comp, "VLEN_STR1", HOFFSET(comp3_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid3_comp, "VLEN_STR2", HOFFSET(comp3_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid3_comp, "FIXLEN_STR1", HOFFSET(comp3_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid3_comp, "FIXLEN_STR2", HOFFSET(comp3_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid3_comp, "VLEN_STR1", HOFFSET(comp3_t, str_vlen), tid_vlen_str); + H5Tinsert(tid3_comp, "VLEN_STR2", HOFFSET(comp3_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid3_comp, "FIXLEN_STR1", HOFFSET(comp3_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid3_comp, "FIXLEN_STR2", HOFFSET(comp3_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid3_comp, "VLEN_STR_ARRAY1", HOFFSET(comp3_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid3_comp, "VLEN_STR_ARRAY2", HOFFSET(comp3_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid3_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp3_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid3_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp3_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 4 */ - H5Tinsert(tid4_comp, "VLEN_STR1", HOFFSET(comp4_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid4_comp, "VLEN_STR2", HOFFSET(comp4_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid4_comp, "FIXLEN_STR1", HOFFSET(comp4_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid4_comp, "FIXLEN_STR2", HOFFSET(comp4_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid4_comp, "VLEN_STR1", HOFFSET(comp4_t, str_vlen), tid_vlen_str); + H5Tinsert(tid4_comp, "VLEN_STR2", HOFFSET(comp4_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid4_comp, "FIXLEN_STR1", HOFFSET(comp4_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid4_comp, "FIXLEN_STR2", HOFFSET(comp4_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid4_comp, "VLEN_STR_ARRAY1", HOFFSET(comp4_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid4_comp, "VLEN_STR_ARRAY2", HOFFSET(comp4_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid4_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp4_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid4_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp4_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 5 */ - H5Tinsert(tid5_comp, "VLEN_STR1", HOFFSET(comp5_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid5_comp, "VLEN_STR2", HOFFSET(comp5_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid5_comp, "FIXLEN_STR1", HOFFSET(comp5_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid5_comp, "FIXLEN_STR2", HOFFSET(comp5_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid5_comp, "VLEN_STR1", HOFFSET(comp5_t, str_vlen), tid_vlen_str); + H5Tinsert(tid5_comp, "VLEN_STR2", HOFFSET(comp5_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid5_comp, "FIXLEN_STR1", HOFFSET(comp5_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid5_comp, "FIXLEN_STR2", HOFFSET(comp5_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid5_comp, "VLEN_STR_ARRAY1", HOFFSET(comp5_t, str_array_vlen), tid_vlen_str_array); - H5Tinsert(tid5_comp, "VLEN_STR_ARRAY2", HOFFSET(comp5_t, str_vlen_array_again), tid_vlen_str_array); + H5Tinsert(tid5_comp, "VLEN_STR_ARRAY2", HOFFSET(comp5_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid5_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp5_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid5_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp5_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 6 */ - H5Tinsert(tid6_comp, "VLEN_STR1", HOFFSET(comp6_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid6_comp, "VLEN_STR2", HOFFSET(comp6_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid6_comp, "FIXLEN_STR1", HOFFSET(comp6_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid6_comp, "FIXLEN_STR2", HOFFSET(comp6_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid6_comp, "VLEN_STR1", HOFFSET(comp6_t, str_vlen), tid_vlen_str); + H5Tinsert(tid6_comp, "VLEN_STR2", HOFFSET(comp6_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid6_comp, "FIXLEN_STR1", HOFFSET(comp6_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid6_comp, "FIXLEN_STR2", HOFFSET(comp6_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid6_comp, "VLEN_STR_ARRAY1", HOFFSET(comp6_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid6_comp, "VLEN_STR_ARRAY2", HOFFSET(comp6_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid6_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp6_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid6_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp6_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 7 */ - H5Tinsert(tid7_comp, "VLEN_STR1", HOFFSET(comp7_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid7_comp, "VLEN_STR2", HOFFSET(comp7_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid7_comp, "FIXLEN_STR1", HOFFSET(comp7_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid7_comp, "FIXLEN_STR2", HOFFSET(comp7_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid7_comp, "VLEN_STR1", HOFFSET(comp7_t, str_vlen), tid_vlen_str); + H5Tinsert(tid7_comp, "VLEN_STR2", HOFFSET(comp7_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid7_comp, "FIXLEN_STR1", HOFFSET(comp7_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid7_comp, "FIXLEN_STR2", HOFFSET(comp7_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid7_comp, "VLEN_STR_ARRAY1", HOFFSET(comp7_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid7_comp, "VLEN_STR_ARRAY2", HOFFSET(comp7_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid7_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp7_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid7_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp7_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 8 */ - H5Tinsert(tid8_comp, "VLEN_STR1", HOFFSET(comp8_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid8_comp, "VLEN_STR2", HOFFSET(comp8_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid8_comp, "FIXLEN_STR1", HOFFSET(comp8_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid8_comp, "FIXLEN_STR2", HOFFSET(comp8_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid8_comp, "VLEN_STR1", HOFFSET(comp8_t, str_vlen), tid_vlen_str); + H5Tinsert(tid8_comp, "VLEN_STR2", HOFFSET(comp8_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid8_comp, "FIXLEN_STR1", HOFFSET(comp8_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid8_comp, "FIXLEN_STR2", HOFFSET(comp8_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid8_comp, "VLEN_STR_ARRAY1", HOFFSET(comp8_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid8_comp, "VLEN_STR_ARRAY2", HOFFSET(comp8_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid8_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp8_t, str_array_fixlen), tid_fixlen_str_array); H5Tinsert(tid8_comp, "FIXLEN_STR_ARRAY2", HOFFSET(comp8_t, str_fixlen_array_again), tid_fixlen_str_array); /* compound 9 */ - H5Tinsert(tid9_comp, "VLEN_STR1", HOFFSET(comp9_t, str_vlen), tid_vlen_str ); - H5Tinsert(tid9_comp, "VLEN_STR2", HOFFSET(comp9_t, str_vlen_repeat), tid_vlen_str ); - H5Tinsert(tid9_comp, "FIXLEN_STR1", HOFFSET(comp9_t, str_fixlen), tid_fixlen_str ); - H5Tinsert(tid9_comp, "FIXLEN_STR2", HOFFSET(comp9_t, str_fixlen_repeat), tid_fixlen_str ); + H5Tinsert(tid9_comp, "VLEN_STR1", HOFFSET(comp9_t, str_vlen), tid_vlen_str); + H5Tinsert(tid9_comp, "VLEN_STR2", HOFFSET(comp9_t, str_vlen_repeat), tid_vlen_str); + H5Tinsert(tid9_comp, "FIXLEN_STR1", HOFFSET(comp9_t, str_fixlen), tid_fixlen_str); + H5Tinsert(tid9_comp, "FIXLEN_STR2", HOFFSET(comp9_t, str_fixlen_repeat), tid_fixlen_str); H5Tinsert(tid9_comp, "VLEN_STR_ARRAY1", HOFFSET(comp9_t, str_array_vlen), tid_vlen_str_array); H5Tinsert(tid9_comp, "VLEN_STR_ARRAY2", HOFFSET(comp9_t, str_vlen_array_again), tid_vlen_str_array); H5Tinsert(tid9_comp, "FIXLEN_STR_ARRAY1", HOFFSET(comp9_t, str_array_fixlen), tid_fixlen_str_array); @@ -4156,12 +3918,10 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int H5Tinsert(tid9_comp, "OBJREF2", HOFFSET(comp9_t, objref2), H5T_STD_REF_OBJ); H5Tinsert(tid9_comp, "OBJREF3", HOFFSET(comp9_t, objref3), H5T_STD_REF_OBJ); - /* Write data to compound 1 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid1_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp1_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4171,8 +3931,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 2 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid2_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp2_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4182,8 +3941,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 3 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid3_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp3_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4193,8 +3951,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 4 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid4_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp4_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4204,8 +3961,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 5 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid5_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp5_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4215,8 +3971,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 6 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid6_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp6_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4226,8 +3981,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 7 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid7_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp7_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4237,8 +3991,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Write data to compound 8 dataset buffer */ did_comp = H5Dcreate2(gid, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid8_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp8_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; @@ -4249,166 +4002,158 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset9", tid9_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* obj references */ - status=H5Rcreate(&(comp9_buf.objref1),gid,"Compound_dset2",H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&(comp9_buf.objref2),gid,"Compound_dset3",H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&(comp9_buf.objref3),gid,"Compound_dset4",H5R_OBJECT,(hid_t)-1); + status = H5Rcreate(&(comp9_buf.objref1), gid, "Compound_dset2", H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&(comp9_buf.objref2), gid, "Compound_dset3", H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&(comp9_buf.objref3), gid, "Compound_dset4", H5R_OBJECT, (hid_t) -1); status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } - H5Dclose(did_comp); + did_comp = -1; - did_comp=0; out: - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Close *-----------------------------------------------------------------------*/ - if(fid1 > 0) + if (fid1 > 0) H5Fclose(fid1); - if(gid > 0) + if (gid > 0) H5Gclose(gid); /* vlen string */ - if(tid_vlen_str > 0) + if (tid_vlen_str > 0) H5Tclose(tid_vlen_str); - if(sid_vlen_str > 0) + if (sid_vlen_str > 0) H5Sclose(sid_vlen_str); /* fixed len string */ - if(tid_fixlen_str > 0) + if (tid_fixlen_str > 0) H5Tclose(tid_fixlen_str); - if(sid_fixlen_str > 0) + if (sid_fixlen_str > 0) H5Sclose(sid_fixlen_str); /* vlen string array */ - if(tid_vlen_str_array_pre > 0) + if (tid_vlen_str_array_pre > 0) H5Tclose(tid_vlen_str_array_pre); - if(tid_vlen_str_array > 0) + if (tid_vlen_str_array > 0) H5Tclose(tid_vlen_str_array); - if(sid_vlen_str_array > 0) + if (sid_vlen_str_array > 0) H5Sclose(sid_vlen_str_array); /* fixed len string array */ - if(tid_fixlen_str_array_pre > 0) + if (tid_fixlen_str_array_pre > 0) H5Tclose(tid_fixlen_str_array_pre); - if(tid_fixlen_str_array > 0) + if (tid_fixlen_str_array > 0) H5Tclose(tid_fixlen_str_array); - if(sid_fixlen_str_array > 0) + if (sid_fixlen_str_array > 0) H5Sclose(sid_fixlen_str_array); /* compound */ - if(tid1_comp > 0) + if (tid1_comp > 0) H5Tclose(tid1_comp); - if(tid2_comp > 0) + if (tid2_comp > 0) H5Tclose(tid2_comp); - if(tid3_comp > 0) + if (tid3_comp > 0) H5Tclose(tid3_comp); - if(tid4_comp > 0) + if (tid4_comp > 0) H5Tclose(tid4_comp); - if(tid5_comp > 0) + if (tid5_comp > 0) H5Tclose(tid5_comp); - if(tid6_comp > 0) + if (tid6_comp > 0) H5Tclose(tid6_comp); - if(tid7_comp > 0) + if (tid7_comp > 0) H5Tclose(tid7_comp); - if(tid8_comp > 0) + if (tid8_comp > 0) H5Tclose(tid8_comp); - if(tid9_comp > 0) + if (tid9_comp > 0) H5Tclose(tid9_comp); - if(did_comp > 0) + if (did_comp > 0) H5Dclose(did_comp); - if(sid_comp > 0) + if (sid_comp > 0) H5Sclose(sid_comp); return status; } /* end test_comp_vlen_strings() */ - /*------------------------------------------------------------------------- -* -* Purpose: Test diffs of enum values which may include invalid values. -* -* Programmer: Dana Robinson -* -*-------------------------------------------------------------------------*/ - -static int -test_enums(const char *fname) + * + * Purpose: Test diffs of enum values which may include invalid values. + * + * Programmer: Dana Robinson + * + *-------------------------------------------------------------------------*/ + +static int test_enums(const char *fname) { - hid_t fid = -1; + hid_t fid = -1; - hid_t tid = -1; - int enum_val = -1; + hid_t tid = -1; + int enum_val = -1; /* The data in the two arrays cover the following cases: - * - * V = valid enum value, I = invalid enum value - * - * 0: I-I (same value) - * 1: V-I - * 2: I-V - * 3: V-V (same value) - * 4: I-I (different values) SKIPPED FOR NOW - * 5: V-V (different values) - */ + * + * V = valid enum value, I = invalid enum value + * + * 0: I-I (same value) + * 1: V-I + * 2: I-V + * 3: V-V (same value) + * 4: I-I (different values) SKIPPED FOR NOW + * 5: V-V (different values) + */ /* *** NOTE *** - * - * There is a bug in H5Dread() where invalid enum values are always - * returned as -1 so two different invalid enum values cannot be - * properly compared. Test 4 has been adjusted to pass here - * while we fix the issue. - */ - int data1[6] = {9, 0, 9, 0, 9, 0}; + * + * There is a bug in H5Dread() where invalid enum values are always + * returned as -1 so two different invalid enum values cannot be + * properly compared. Test 4 has been adjusted to pass here + * while we fix the issue. + */ + int data1[6] = { 9, 0, 9, 0, 9, 0 }; /*int data1[6] = {9, 0, 9, 0, 8, 0}; */ - int data2[6] = {9, 9, 0, 0, 9, 1}; + int data2[6] = { 9, 9, 0, 0, 9, 1 }; - hsize_t dims = 6; + hsize_t dims = 6; - herr_t status = SUCCEED; + herr_t status = SUCCEED; /*----------------------------------------------------------------------- - * Create the file - *---------------------------------------------------------------------*/ + * Create the file + *---------------------------------------------------------------------*/ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*----------------------------------------------------------------------- - * Create enum types - *---------------------------------------------------------------------*/ + * Create enum types + *---------------------------------------------------------------------*/ tid = H5Tenum_create(H5T_NATIVE_INT); enum_val = 0; status = H5Tenum_insert(tid, "YIN", &enum_val); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } enum_val = 1; status = H5Tenum_insert(tid, "YANG", &enum_val); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } /*----------------------------------------------------------------------- - * Create datasets containing enum data. - *---------------------------------------------------------------------*/ + * Create datasets containing enum data. + *---------------------------------------------------------------------*/ status = write_dset(fid, 1, &dims, "dset1", tid, data1); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; } status = write_dset(fid, 1, &dims, "dset2", tid, data2); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; @@ -4416,41 +4161,41 @@ test_enums(const char *fname) out: /*----------------------------------------------------------------------- - * Close - *---------------------------------------------------------------------*/ - if(fid) + * Close + *---------------------------------------------------------------------*/ + if (fid) H5Fclose(fid); - if(tid) + if (tid) H5Tclose(tid); return status; } /*------------------------------------------------------------------------- -* -* Purpose: -* Create test files with dataset and attribute with container types -* (array, vlen) with multiple nested compound types. -* -* Function: test_comps_array() -* - type: compound->array->compound -* -* Function: test_comps_vlen() -* - type: compound->vlen->compound -* -* Function: test_comps_array_vlen() -* - type: compound->array->compound->vlen->compound -* -* Function: test_comps_vlen_arry() -* - type: compound->vlen->compound->array->compound -* -* Programmer: Jonathan Kim (Sep, 1, 2011) -* -*-------------------------------------------------------------------------*/ + * + * Purpose: + * Create test files with dataset and attribute with container types + * (array, vlen) with multiple nested compound types. + * + * Function: test_comps_array() + * - type: compound->array->compound + * + * Function: test_comps_vlen() + * - type: compound->vlen->compound + * + * Function: test_comps_array_vlen() + * - type: compound->array->compound->vlen->compound + * + * Function: test_comps_vlen_arry() + * - type: compound->vlen->compound->array->compound + * + * Programmer: Jonathan Kim (Sep, 1, 2011) + * + *-------------------------------------------------------------------------*/ #define SDIM_DSET 2 #define SDIM_CMPD_ARRAY 2 -static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new) +static void test_comps_array(const char *fname, const char *dset, const char *attr, int diff, int is_file_new) { /* sub compound 2 */ typedef struct { @@ -4464,42 +4209,39 @@ static void test_comps_array (const char *fname, const char *dset, const char *a cmpd2_t cmpd2[SDIM_CMPD_ARRAY]; } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* dataset with compound1 */ + cmpd1_t wdata[SDIM_DSET]; /* dataset with compound1 */ - hid_t fid; /* HDF5 File IDs */ - hid_t did_dset; /* Dataset ID */ - hid_t sid_dset; /* Dataset space ID */ - hid_t tid_cmpd1; /* Compound1 type ID */ - hid_t tid_arry1; /* Array type ID in compound1 */ - hid_t tid_cmpd2; /* Compound2 type ID */ - hid_t tid_attr; - hsize_t sdims_dset[] = {SDIM_DSET}; - hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; - int i,j; - herr_t ret; /* Generic return value */ + hid_t fid = -1; /* HDF5 File IDs */ + hid_t did_dset = -1; /* Dataset ID */ + hid_t sid_dset = -1; /* Dataset space ID */ + hid_t tid_cmpd1 = -1; /* Compound1 type ID */ + hid_t tid_arry1 = -1; /* Array type ID in compound1 */ + hid_t tid_cmpd2 = -1; /* Compound2 type ID */ + hid_t tid_attr = -1; + hsize_t sdims_dset[] = { SDIM_DSET }; + hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; + int i, j; + herr_t ret; /* Generic return value */ /* Initialize array data to write */ - for(i=0; i < SDIM_DSET; i++) - { + for (i = 0; i < SDIM_DSET; i++) { wdata[i].i1 = i; - for(j=0; j < SDIM_CMPD_ARRAY; j++) - { + for (j = 0; j < SDIM_CMPD_ARRAY; j++) { wdata[i].cmpd2[j].i2 = i * 10 + diff; - wdata[i].cmpd2[j].f2 = (float)i * 10.5F + (float)diff; + wdata[i].cmpd2[j].f2 = (float) i * 10.5F + (float) diff; } /* end for */ } - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); - + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* ------------------------------- - * Create a sub compound2 datatype */ + * Create a sub compound2 datatype */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); /* Insert integer field */ @@ -4511,9 +4253,9 @@ static void test_comps_array (const char *fname, const char *dset, const char *a assert(ret >= 0); /*----------------------------------- - * Create a top compound1. - */ - tid_cmpd1 = H5Tcreate (H5T_COMPOUND, sizeof(cmpd1_t)); + * Create a top compound1. + */ + tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); ret = H5Tinsert(tid_cmpd1, "int1", HOFFSET(cmpd1_t, i1), H5T_NATIVE_INT); assert(ret >= 0); @@ -4524,10 +4266,9 @@ static void test_comps_array (const char *fname, const char *dset, const char *a ret = H5Tinsert(tid_cmpd1, "array_cmpd1", HOFFSET(cmpd1_t, cmpd2), tid_arry1); assert(ret >= 0); - /* ------------------- - * Create a dataset - */ + * Create a dataset + */ /* Create dataspace for datasets */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4538,15 +4279,15 @@ static void test_comps_array (const char *fname, const char *dset, const char *a assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); assert(ret >= 0); /* ---------------- - * Close Dataset */ + * Close Dataset */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Tclose(tid_arry1); @@ -4563,9 +4304,7 @@ static void test_comps_array (const char *fname, const char *dset, const char *a assert(ret >= 0); } - - -static void test_comps_vlen (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) +static void test_comps_vlen(const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { /* sub compound 2 */ typedef struct { @@ -4576,44 +4315,46 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a /* top compound 1 */ typedef struct { int i1; - hvl_t vl; /* VL information for compound2 */ + hvl_t vl; /* VL information for compound2 */ } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ + cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ - hid_t fid; /* HDF5 File ID */ - hid_t did_dset; /* dataset ID */ - hid_t sid_dset; /* dataset space ID */ - hid_t tid_attr; - hid_t tid_cmpd2; /* compound2 type ID */ - hid_t tid_cmpd1; /* compound1 type ID */ - hid_t tid_cmpd1_vlen; - hsize_t sdims_dset[] = {SDIM_DSET}; + hid_t fid = -1; /* HDF5 File ID */ + hid_t did_dset = -1; /* dataset ID */ + hid_t sid_dset = -1; /* dataset space ID */ + hid_t tid_attr = -1; + hid_t tid_cmpd2 = -1; /* compound2 type ID */ + hid_t tid_cmpd1 = -1; /* compound1 type ID */ + hid_t tid_cmpd1_vlen = -1; + hsize_t sdims_dset[] = { SDIM_DSET }; - unsigned i,j; /* counting variables */ - herr_t ret; /* Generic return value */ + unsigned i, j; /* counting variables */ + herr_t ret; /* Generic return value */ /* Allocate and initialize VL data to write */ - for(i = 0; i < SDIM_DSET; i++) { - wdata[i].i1 = (int)i; + for (i = 0; i < SDIM_DSET; i++) { + wdata[i].i1 = (int) i; wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; - for(j = 0; j < (i + 1); j++) { - ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)(i * 10 + (unsigned)diff); - ((cmpd2_t *)wdata[i].vl.p)[j].f2 = (float)i * 10.5F + (float)diff; + for (j = 0; j < (i + 1); j++) { + ((cmpd2_t *) wdata[i].vl.p)[j].i2 = + (int) (i * 10 + (unsigned) diff); + ((cmpd2_t *) wdata[i].vl.p)[j].f2 = (float) i * 10.5F + + (float) diff; } /* end for */ } /* end for */ /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ + * Create file(s) + *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* ----------------------------- - * Create sub compound2 type */ + * Create sub compound2 type */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); /* Insert fields */ @@ -4623,7 +4364,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /* --------------------------- - * Create top compound1 type */ + * Create top compound1 type */ tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); /* Insert fields */ ret = H5Tinsert(tid_cmpd1, "int1", HOFFSET(cmpd1_t, i1), H5T_NATIVE_INT); @@ -4635,8 +4376,8 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /* ------------------------------- - * Create dataset with compound1 - */ + * Create dataset with compound1 + */ /* Create dataspace for dataset */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4648,8 +4389,8 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); @@ -4660,7 +4401,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /* ---------------- - * Close IDs */ + * Close IDs */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Dclose(did_dset); @@ -4677,17 +4418,16 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); } - -static void test_comps_array_vlen (const char * fname, const char *dset,const char *attr, int diff, int is_file_new) +static void test_comps_array_vlen(const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { typedef struct { int i3; float f3; } cmpd3_t; - typedef struct { /* Typedef for compound datatype */ + typedef struct { /* Typedef for compound datatype */ int i2; - hvl_t vl; /* VL information to write */ + hvl_t vl; /* VL information to write */ } cmpd2_t; typedef struct { @@ -4695,53 +4435,53 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch cmpd2_t cmpd2[SDIM_CMPD_ARRAY]; } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* Information to write */ - hid_t fid; /* HDF5 File IDs */ - hid_t did_dset; /* Dataset ID */ - hid_t sid_dset; /* Dataspace ID */ - hid_t tid_attr; - hid_t tid_cmpd1; /* Compound1 Datatype ID */ - hid_t tid_arry1; /* Array Datatype ID */ - hid_t tid_cmpd2; /* Compound2 Datatype ID */ - hid_t tid_cmpd2_vlen; - hid_t tid_cmpd3; /* Compound3 Datatype ID */ - hsize_t sdims_dset[] = {SDIM_DSET}; - hsize_t sdims_arry[] = {SDIM_CMPD_ARRAY}; - unsigned i, j, k; /* counting variables */ - herr_t ret; /* Generic return value */ - - + cmpd1_t wdata[SDIM_DSET]; /* Information to write */ + hid_t fid = -1; /* HDF5 File IDs */ + hid_t did_dset = -1; /* Dataset ID */ + hid_t sid_dset = -1; /* Dataspace ID */ + hid_t tid_attr = -1; + hid_t tid_cmpd1 = -1; /* Compound1 Datatype ID */ + hid_t tid_arry1 = -1; /* Array Datatype ID */ + hid_t tid_cmpd2 = -1; /* Compound2 Datatype ID */ + hid_t tid_cmpd2_vlen = -1; + hid_t tid_cmpd3 = -1; /* Compound3 Datatype ID */ + hsize_t sdims_dset[] = { SDIM_DSET }; + hsize_t sdims_arry[] = { SDIM_CMPD_ARRAY }; + unsigned i, j, k; /* counting variables */ + herr_t ret; /* Generic return value */ /* Initialize array data to write in compound1 */ - for(i = 0; i < SDIM_DSET; i++) { - wdata[i].i1 = (int)i; + for (i = 0; i < SDIM_DSET; i++) { + wdata[i].i1 = (int) i; /* Allocate and initialize VL data to write in compound2 */ - for(j = 0; j < SDIM_CMPD_ARRAY; j++) { - wdata[i].cmpd2[j].i2 = (int)(j * 10); + for (j = 0; j < SDIM_CMPD_ARRAY; j++) { + wdata[i].cmpd2[j].i2 = (int) (j * 10); wdata[i].cmpd2[j].vl.p = HDmalloc((j + 1) * sizeof(cmpd3_t)); wdata[i].cmpd2[j].vl.len = j + 1; - for(k = 0; k < (j + 1); k++) { + for (k = 0; k < (j + 1); k++) { /* Initialize data of compound3 */ - ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].i3 = (int)j * 10 + diff; - ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].f3 = (float)j * 10.5F + (float)diff; + ((cmpd3_t *) wdata[i].cmpd2[j].vl.p)[k].i3 = (int) j * 10 + + diff; + ((cmpd3_t *) wdata[i].cmpd2[j].vl.p)[k].f3 = (float) j * 10.5F + + (float) diff; } /* end for */ } /* end for */ } /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ + * Create file(s) + *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* Create dataspace for datasets */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); /*------------------------------------- - * Create a sub compound3 datatype */ + * Create a sub compound3 datatype */ tid_cmpd3 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd3_t)); /* Insert integer field */ @@ -4752,9 +4492,8 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch ret = H5Tinsert(tid_cmpd3, "float", HOFFSET(cmpd3_t, f3), H5T_NATIVE_FLOAT); assert(ret >= 0); - /*------------------------------------- - * Create a sub compound2 datatype */ + * Create a sub compound2 datatype */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); /* Insert integer field */ @@ -4765,20 +4504,18 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch ret = H5Tinsert(tid_cmpd2, "vlen", HOFFSET(cmpd2_t, vl), tid_cmpd2_vlen); assert(ret >= 0); - /*----------------------------------- - * Create a top compound1 datatype for dataset. - */ - tid_cmpd1 = H5Tcreate (H5T_COMPOUND, sizeof(cmpd1_t)); + * Create a top compound1 datatype for dataset. + */ + tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); /* Create an array datatype */ tid_arry1 = H5Tarray_create2(tid_cmpd2, 1, sdims_arry); /* insert the array */ H5Tinsert(tid_cmpd1, "array_comp", HOFFSET(cmpd1_t, cmpd2), tid_arry1); - /* ---------------------- - * Create a dataset */ + * Create a dataset */ did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ @@ -4786,8 +4523,8 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); @@ -4798,7 +4535,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch assert(ret >= 0); /*------------------- - * Close IDs */ + * Close IDs */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Tclose(tid_arry1); @@ -4819,8 +4556,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch assert(ret >= 0); } - -static void test_comps_vlen_arry (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) +static void test_comps_vlen_arry(const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { /* sub compound 3 */ typedef struct { @@ -4837,53 +4573,53 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch /* top compound 1 */ typedef struct { int i1; - hvl_t vl; /* VL information for compound2 */ + hvl_t vl; /* VL information for compound2 */ } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ + cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ - hid_t fid; /* HDF5 File ID */ - hid_t did_dset; /* dataset ID */ - hid_t sid_dset; /* dataset space ID */ - hid_t tid_attr; - hid_t tid_cmpd3; /* compound3 type ID */ - hid_t tid_cmpd2; /* compound2 type ID */ - hid_t tid_cmpd2_arry; - hid_t tid_cmpd1; /* compound1 type ID */ - hid_t tid_cmpd1_vlen; - hsize_t sdims_dset[] = {SDIM_DSET}; - hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; + hid_t fid = -1; /* HDF5 File ID */ + hid_t did_dset = -1; /* dataset ID */ + hid_t sid_dset = -1; /* dataset space ID */ + hid_t tid_attr = -1; + hid_t tid_cmpd3 = -1; /* compound3 type ID */ + hid_t tid_cmpd2 = -1; /* compound2 type ID */ + hid_t tid_cmpd2_arry = -1; + hid_t tid_cmpd1 = -1; /* compound1 type ID */ + hid_t tid_cmpd1_vlen = -1; + hsize_t sdims_dset[] = { SDIM_DSET }; + hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; - unsigned i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + unsigned i, j, k; /* counting variables */ + herr_t ret; /* Generic return value */ /* Allocate and initialize VL data to write */ - for(i = 0; i < SDIM_DSET; i++) { + for (i = 0; i < SDIM_DSET; i++) { /* compound 1 data */ - wdata[i].i1 = (int)i; + wdata[i].i1 = (int) i; wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; - for(j = 0; j < (i + 1); j++) { + for (j = 0; j < (i + 1); j++) { /* compound2 data */ - ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)i * 10 + diff; - for(k = 0; k < SDIM_CMPD_ARRAY; k++) { + ((cmpd2_t *) wdata[i].vl.p)[j].i2 = (int) i * 10 + diff; + for (k = 0; k < SDIM_CMPD_ARRAY; k++) { /* compound 3 data */ - ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].i3 = (int)((float)k * 10.5F) + diff; - ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].f3 = (float)k * 10.5F + (float)diff; + ((cmpd2_t *) (wdata[i].vl.p))[j].cmpd3[k].i3 = (int) ((float) k * 10.5F) + diff; + ((cmpd2_t *) (wdata[i].vl.p))[j].cmpd3[k].f3 = (float) k * 10.5F + (float) diff; } /* end for */ } /* end for */ } /* end for */ /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ + * Create file(s) + *------------------------------------------------------------------------*/ if (is_file_new == 1) fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); else - fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); /* ----------------------------- - * Create sub compound3 type */ + * Create sub compound3 type */ tid_cmpd3 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd3_t)); /* Insert fields */ @@ -4893,7 +4629,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* ----------------------------- - * Create sub compound2 type */ + * Create sub compound2 type */ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); ret = H5Tinsert(tid_cmpd2, "int2", HOFFSET(cmpd2_t, i2), H5T_NATIVE_INT); @@ -4904,8 +4640,8 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* --------------------------- - * Create top compound1 type - */ + * Create top compound1 type + */ /* Create a VL datatype */ tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); /* Insert fields */ @@ -4916,21 +4652,22 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* ------------------------------- - * Create dataset with compound1 - */ + * Create dataset with compound1 + */ /* Create dataspace for dataset */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); /* Create a dataset */ - did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, + H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); assert(ret >= 0); /*----------------------------------- - * Create an attribute in root group - */ + * Create an attribute in root group + */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); @@ -4941,7 +4678,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* ---------------- - * Close IDs */ + * Close IDs */ ret = H5Aclose(tid_attr); assert(ret >= 0); ret = H5Dclose(did_dset); @@ -4962,99 +4699,95 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); } - /*------------------------------------------------------------------------- -* Function: test_data_nocomparables -* -* Purpose: -* Create test files with non-comparable dataset and attributes with -* comparable datasets and attributes. All the comparables should display -* differences. -* -*-------------------------------------------------------------------------*/ + * Function: test_data_nocomparables + * + * Purpose: + * Create test files with non-comparable dataset and attributes with + * comparable datasets and attributes. All the comparables should display + * differences. + * + *-------------------------------------------------------------------------*/ #define DIM_ARRY 3 -static void test_data_nocomparables (const char * fname, int make_diffs) +static void test_data_nocomparables(const char * fname, int make_diffs) { - hid_t fid=0; - hid_t gid1=0; - hid_t gid2=0; - hid_t did1=0; - hid_t did2=0; - hid_t sid1=0; - hid_t tid_dset1=0; - hid_t tid_attr1=0; - hsize_t dims1_1[1] = {DIM_ARRY}; - hsize_t dims1_2[1] = {DIM_ARRY+1}; - hsize_t dims2[2] = {DIM_ARRY, 1}; - int data1[DIM_ARRY] = {0,0,0}; - int data2[DIM_ARRY] = {1,1,1}; - int data3[DIM_ARRY+1] = {1,1,1,1}; - int data1_dim2[DIM_ARRY][1] = {{0},{0},{0}}; + hid_t fid = -1; + hid_t gid1 = -1; + hid_t gid2 = -1; + hid_t did1 = -1; + hid_t did2 = -1; + hid_t sid1 = -1; + hid_t tid_dset1 = -1; + hid_t tid_attr1 = -1; + hsize_t dims1_1[1] = { DIM_ARRY }; + hsize_t dims1_2[1] = { DIM_ARRY + 1 }; + hsize_t dims2[2] = { DIM_ARRY, 1 }; + int data1[DIM_ARRY] = { 0, 0, 0 }; + int data2[DIM_ARRY] = { 1, 1, 1 }; + int data3[DIM_ARRY + 1] = { 1, 1, 1, 1 }; + int data1_dim2[DIM_ARRY][1] = { { 0 }, { 0 }, { 0 } }; int rank_attr; - char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"}; - herr_t status = SUCCEED; - void *dset_data_ptr1=NULL; - void *dset_data_ptr2=NULL; - void *dset_data_ptr3=NULL; - void *attr_data_ptr1=NULL; - void *attr_data_ptr2=NULL; - void *attr_data_ptr3=NULL; - void *attr_data_ptr4=NULL; - void *attr2_dim_ptr=NULL; - void *attr3_dim_ptr=NULL; + char data1_str[DIM_ARRY][STR_SIZE] = { "ab", "cd", "ef" }; + herr_t status = SUCCEED; + void *dset_data_ptr1 = NULL; + void *dset_data_ptr2 = NULL; + void *dset_data_ptr3 = NULL; + void *attr_data_ptr1 = NULL; + void *attr_data_ptr2 = NULL; + void *attr_data_ptr3 = NULL; + void *attr_data_ptr4 = NULL; + void *attr2_dim_ptr = NULL; + void *attr3_dim_ptr = NULL; /* init */ - tid_dset1=H5Tcopy(H5T_NATIVE_INT); - dset_data_ptr1=(int*)&data1; - dset_data_ptr2=(int*)&data1; - dset_data_ptr3=(int*)&data1; - tid_attr1=H5Tcopy(H5T_NATIVE_INT); - attr_data_ptr1=(int*)&data1; - attr_data_ptr3=(int*)&data1; - attr_data_ptr4=(int*)&data1; - attr2_dim_ptr=(hsize_t*)&dims1_1; - attr3_dim_ptr=(hsize_t*)&dims1_1; - rank_attr=1; - - if (make_diffs) - { + tid_dset1 = H5Tcopy(H5T_NATIVE_INT); + dset_data_ptr1 = (int*) &data1; + dset_data_ptr2 = (int*) &data1; + dset_data_ptr3 = (int*) &data1; + tid_attr1 = H5Tcopy(H5T_NATIVE_INT); + attr_data_ptr1 = (int*) &data1; + attr_data_ptr3 = (int*) &data1; + attr_data_ptr4 = (int*) &data1; + attr2_dim_ptr = (hsize_t*) &dims1_1; + attr3_dim_ptr = (hsize_t*) &dims1_1; + rank_attr = 1; + + if (make_diffs) { /* ------------ - * group1 */ - tid_dset1=H5Tcopy(H5T_C_S1); - H5Tset_size(tid_dset1, (size_t)STR_SIZE); - dset_data_ptr1=(char*)&data1_str; - dset_data_ptr2=(int*)&data2; - attr_data_ptr1=(int*)&data2; + * group1 */ + tid_dset1 = H5Tcopy(H5T_C_S1); + H5Tset_size(tid_dset1, (size_t) STR_SIZE); + dset_data_ptr1 = (char*) &data1_str; + dset_data_ptr2 = (int*) &data2; + attr_data_ptr1 = (int*) &data2; /* ----------- - * group2 - */ - dset_data_ptr3=(int*)&data2; + * group2 + */ + dset_data_ptr3 = (int*) &data2; /* dset1/attr1 */ - tid_attr1=H5Tcopy(H5T_C_S1); - H5Tset_size(tid_attr1, (size_t)STR_SIZE); - attr_data_ptr2=(char*)&data1_str; + tid_attr1 = H5Tcopy(H5T_C_S1); + H5Tset_size(tid_attr1, (size_t) STR_SIZE); + attr_data_ptr2 = (char*) &data1_str; /* dset1/attr2 */ - attr2_dim_ptr=(hsize_t*)&dims1_2; + attr2_dim_ptr = (hsize_t*) &dims1_2; /* dset1/attr3 */ - attr_data_ptr3=(int*)&data1_dim2; - attr3_dim_ptr=(hsize_t*)&dims2; - rank_attr=2; + attr_data_ptr3 = (int*) &data1_dim2; + attr3_dim_ptr = (hsize_t*) &dims2; + rank_attr = 2; /* dset1/attr4 */ - attr_data_ptr4=(int*)&data2; + attr_data_ptr4 = (int*) &data2; } - - /*----------------------------------------------------------------------- + /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid < 0) - { + fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname); status = FAIL; goto out; @@ -5064,16 +4797,14 @@ static void test_data_nocomparables (const char * fname, int make_diffs) * Groups *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; } gid2 = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; @@ -5082,29 +4813,26 @@ static void test_data_nocomparables (const char * fname, int make_diffs) /*----------------------------------------------------------------------- * Datasets in /g1 *------------------------------------------------------------------------*/ - if((sid1 = H5Screate_simple(1, dims1_1, NULL)) < 0) - goto out; + if ((sid1 = H5Screate_simple(1, dims1_1, NULL)) < 0) + goto out; /* dset1 */ - if((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + if ((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } - if(H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) - { + if (H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } - write_attr(did1,1,dims1_1,"attr", H5T_NATIVE_INT, attr_data_ptr1); + write_attr(did1, 1, dims1_1, "attr", H5T_NATIVE_INT, attr_data_ptr1); /* dset2 */ - status = write_dset(gid1, 1, dims1_1,"dset2", H5T_NATIVE_INT, dset_data_ptr2); - if (status == FAIL) - { + status = write_dset(gid1, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } @@ -5113,108 +4841,100 @@ static void test_data_nocomparables (const char * fname, int make_diffs) * Datasets in /g2 *------------------------------------------------------------------------*/ /* --------- - * dset1 */ - if((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - { + * dset1 */ + if ((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } - if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) - { + if (H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } /* attr1 - non-compatible : different type */ - write_attr(did2,1,dims1_1,"attr1", tid_attr1, attr_data_ptr2); - + write_attr(did2, 1, dims1_1, "attr1", tid_attr1, attr_data_ptr2); /* attr2 - non-compatible : same rank, different dimention */ - write_attr(did2,1,(hsize_t *)attr2_dim_ptr,"attr2", H5T_NATIVE_INT, data3); + write_attr(did2, 1, (hsize_t *) attr2_dim_ptr, "attr2", H5T_NATIVE_INT, data3); /* attr3 - non-compatible : different rank */ - write_attr(did2, rank_attr,(hsize_t *)attr3_dim_ptr,"attr3", H5T_NATIVE_INT, attr_data_ptr3); + write_attr(did2, rank_attr, (hsize_t *) attr3_dim_ptr, "attr3", H5T_NATIVE_INT, attr_data_ptr3); /* attr4 - compatible : different data values */ - write_attr(did2,1,dims1_1,"attr4", H5T_NATIVE_INT, attr_data_ptr4); + write_attr(did2, 1, dims1_1, "attr4", H5T_NATIVE_INT, attr_data_ptr4); /*---------- - * dset2 */ - status = write_dset(gid2, 1, dims1_1,"dset2", H5T_NATIVE_INT, dset_data_ptr3); - if (status == FAIL) - { + * dset2 */ + status = write_dset(gid2, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr3); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } - - out: /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ - if(fid) + if (fid) H5Fclose(fid); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(did1) + if (did1) H5Dclose(did1); - if(did2) + if (did2) H5Dclose(did2); - if(sid1) + if (sid1) H5Sclose(sid1); - if(tid_dset1) + if (tid_dset1) H5Tclose(tid_dset1); - if(tid_attr1) + if (tid_attr1) H5Tclose(tid_attr1); } /*------------------------------------------------------------------------- -* Function: test_objs_nocomparables -* -* Purpose: -* Create test files with common objects (same name) but different object -* types. -* h5diff should show non-comparable output from these common objects. -*-------------------------------------------------------------------------*/ + * Function: test_objs_nocomparables + * + * Purpose: + * Create test files with common objects (same name) but different object + * types. + * h5diff should show non-comparable output from these common objects. + *-------------------------------------------------------------------------*/ static void test_objs_nocomparables(const char *fname1, const char *fname2) { - herr_t status = SUCCEED; - hid_t fid1=0; - hid_t fid2=0; - hid_t topgid1=0; - hid_t topgid2=0; - hid_t gid1=0; - hid_t did1=0; - hid_t tid1=0; - hid_t gid2=0; - hid_t did2=0; - hid_t tid2=0; - hsize_t dims[1] = {DIM_ARRY}; - int data1[DIM_ARRY] = {1,1,1}; - int data2[DIM_ARRY] = {2,2,2}; - - /*----------------------------------------------------------------------- + herr_t status = SUCCEED; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t topgid1 = -1; + hid_t topgid2 = -1; + hid_t gid1 = -1; + hid_t did1 = -1; + hid_t tid1 = -1; + hid_t gid2 = -1; + hid_t did2 = -1; + hid_t tid2 = -1; + hsize_t dims[1] = { DIM_ARRY }; + int data1[DIM_ARRY] = { 1, 1, 1 }; + int data2[DIM_ARRY] = { 2, 2, 2 }; + + /*----------------------------------------------------------------------- * Open file(s) to add objects *------------------------------------------------------------------------*/ /* file1 */ - fid1 = H5Fopen (fname1, H5F_ACC_RDWR, H5P_DEFAULT); - if (fid1 < 0) - { + fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); status = FAIL; goto out; } /* file2 */ - fid2 = H5Fopen (fname2, H5F_ACC_RDWR, H5P_DEFAULT); - if (fid2 < 0) - { + fid2 = H5Fopen(fname2, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname2); status = FAIL; goto out; @@ -5225,25 +4945,22 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* parent group */ topgid1 = H5Gcreate2(fid1, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (topgid1 < 0) - { + if (topgid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } /* dataset */ - status = write_dset(topgid1, 1, dims,"obj1", H5T_NATIVE_INT, data1); - if (status == FAIL) - { + status = write_dset(topgid1, 1, dims, "obj1", H5T_NATIVE_INT, data1); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname1); goto out; } /* group */ gid1 = H5Gcreate2(topgid1, "obj2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid1 < 0) - { + if (gid1 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; @@ -5252,8 +4969,7 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) /* committed type */ tid1 = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(topgid1, "obj3", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); goto out; } @@ -5263,8 +4979,7 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* parent group */ topgid2 = H5Gcreate2(fid2, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (topgid2 < 0) - { + if (topgid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -5272,8 +4987,7 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) /* group */ gid2 = H5Gcreate2(topgid2, "obj1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid2 < 0) - { + if (gid2 < 0) { fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; @@ -5282,16 +4996,14 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2) /* committed type */ tid2 = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(topgid2, "obj2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { + if (status < 0) { fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); goto out; } /* dataset */ - status = write_dset(topgid2, 1, dims,"obj3", H5T_NATIVE_INT, data2); - if (status == FAIL) - { + status = write_dset(topgid2, 1, dims, "obj3", H5T_NATIVE_INT, data2); + if (status == FAIL) { fprintf(stderr, "Error: %s> write_dset failed\n", fname2); goto out; } @@ -5300,113 +5012,109 @@ out: /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); - if(topgid1) + if (topgid1) H5Gclose(topgid1); - if(topgid2) + if (topgid2) H5Gclose(topgid2); - if(did1) + if (did1) H5Dclose(did1); - if(did2) + if (did2) H5Dclose(did2); - if(gid1) + if (gid1) H5Gclose(gid1); - if(gid2) + if (gid2) H5Gclose(gid2); - if(tid1) + if (tid1) H5Tclose(tid1); - if(tid2) + if (tid2) H5Tclose(tid2); } -static hid_t mkstr(int size, H5T_str_t pad) { +static hid_t mkstr(int size, H5T_str_t pad) +{ hid_t type; - if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; - if(H5Tset_size(type, (size_t)size) < 0) return -1; - if(H5Tset_strpad(type, pad) < 0) return -1; + if ((type = H5Tcopy(H5T_C_S1)) < 0) + return -1; + if (H5Tset_size(type, (size_t) size) < 0) + return -1; + if (H5Tset_strpad(type, pad) < 0) + return -1; return type; } /*------------------------------------------------------------------------- -* Function: test_objs_strings -* -* Purpose: -* Create test files with common objects (same name) but different string -* types. -* h5diff should show differences output from these common objects. -*-------------------------------------------------------------------------*/ + * Function: test_objs_strings + * + * Purpose: + * Create test files with common objects (same name) but different string + * types. + * h5diff should show differences output from these common objects. + *-------------------------------------------------------------------------*/ static void test_objs_strings(const char *fname1, const char *fname2) { - hid_t fid1=0; - hid_t fid2=0; - hid_t dataset=0; - hid_t space=0; - hid_t f_type=0; - hid_t m_type=0; - hsize_t dims1[] = {3, 4}; - char string1A[12][3] = {"s1","s2","s3","s4","s5","s6","s","s","s9", - "s0","s1","s2"}; - char string1B[12][3] = {"s1","s2","s3","s4","s","s","s7","s8","s9", - "s0","s1","s2"}; - - hsize_t dims2[]={20}; - char string2A[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", - "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", - "ab cd 9", "ab cd 0", "ab cd 1", "ab cd 2", - "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", - "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; - char string2B[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", - "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", - "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", - "ab cd 3", "ab cd 4", "ab cd 5", "ab cd 6", - "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; - - hsize_t dims3[] = {27}; - char string3A[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", - "abcd4", "abcd5", "abcd6", "abcd7", - "abcd8", "abcd9", "abcd0", "abcd1", - "abd2", "abc3", "bcd4", "acd5", - "abcd6", "abcd7", "abcd8", "abcd9", - "abcd0", "abcd1", "abcd2", "abcd3", - "abc4", "abc5", "abc6"}; - char string3B[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", - "abcd4", "abcd5", "abcd6", "abcd7", - "abcd8", "abcd9", "abcd0", "abcd1", - "abcd2", "abcd3", "abcd4", "abcd5", - "abd6", "abc7", "bcd8", "acd9", - "abcd0", "abcd1", "abcd2", "abcd3", - "abd4", "abd5", "abd6"}; - - hsize_t dims4[] = {3}; + hid_t fid1 = -1; + hid_t fid2 = -1; + hid_t dataset = -1; + hid_t space = -1; + hid_t f_type = -1; + hid_t m_type = -1; + hsize_t dims1[] = { 3, 4 }; + char string1A[12][3] = { "s1", "s2", "s3", "s4", "s5", "s6", "s", "s", "s9", + "s0", "s1", "s2" }; + char string1B[12][3] = { "s1", "s2", "s3", "s4", "s", "s", "s7", "s8", "s9", + "s0", "s1", "s2" }; + + hsize_t dims2[] = { 20 }; + char string2A[20][10] = { "ab cd ef1", "ab cd ef2", "ab cd ef3", + "ab cd ef4", "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd 9", "ab cd 0", "ab cd 1", "ab cd 2", "ab cd ef3", + "ab cd ef4", "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd ef9", "ab cd ef0" }; + char string2B[20][10] = { "ab cd ef1", "ab cd ef2", "ab cd ef3", + "ab cd ef4", "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", "ab cd 3", + "ab cd 4", "ab cd 5", "ab cd 6", "ab cd ef7", "ab cd ef8", + "ab cd ef9", "ab cd ef0" }; + + hsize_t dims3[] = { 27 }; + char string3A[27][6] = { "abcd0", "abcd1", "abcd2", "abcd3", "abcd4", + "abcd5", "abcd6", "abcd7", "abcd8", "abcd9", "abcd0", "abcd1", + "abd2", "abc3", "bcd4", "acd5", "abcd6", "abcd7", "abcd8", "abcd9", + "abcd0", "abcd1", "abcd2", "abcd3", "abc4", "abc5", "abc6" }; + char string3B[27][6] = { "abcd0", "abcd1", "abcd2", "abcd3", "abcd4", + "abcd5", "abcd6", "abcd7", "abcd8", "abcd9", "abcd0", "abcd1", + "abcd2", "abcd3", "abcd4", "abcd5", "abd6", "abc7", "bcd8", "acd9", + "abcd0", "abcd1", "abcd2", "abcd3", "abd4", "abd5", "abd6" }; + + hsize_t dims4[] = { 3 }; char string4A[3][21] = { "s1234567890123456789", "s1234567890123456789", - "s12345678901234567"}; + "s12345678901234567" }; char string4B[3][21] = { "s1234567890123456789", "s12345678901234567", - "s1234567890123456789"}; + "s1234567890123456789" }; /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ - /* file1 */ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); - goto out; - } - - /* file2 */ - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); - goto out; - } + * Create file(s) + *------------------------------------------------------------------------*/ + /* file1 */ + fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + goto out; + } + + /* file2 */ + fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + goto out; + } /* string 1 : nullterm string */ space = H5Screate_simple(2, dims1, NULL); @@ -5496,88 +5204,82 @@ out: /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ - if(fid1) + if (fid1) H5Fclose(fid1); - if(fid2) + if (fid2) H5Fclose(fid2); } /*------------------------------------------------------------------------- -* Function: write_attr_in -* -* Purpose: write attributes in LOC_ID (dataset, group, named datatype) -* -*------------------------------------------------------------------------- -*/ + * Function: write_attr_strings + * + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * swap VL strings + * + *------------------------------------------------------------------------- + */ static -void write_attr_in(hid_t loc_id, - const char* dset_name, /* for saving reference to dataset*/ - hid_t fid, - int make_diffs /* flag to modify data buffers */) +void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t - { - char a; + typedef struct s_t { + char a; double b; } s_t; - typedef enum - { - RED, - GREEN + typedef enum { + RED, GREEN } e_t; - hid_t aid; - hid_t sid; - hid_t tid; - herr_t status; - int val, i, j, k, l, n; - float f; + hid_t aid = -1; + hid_t sid = -1; + hid_t tid = -1; + herr_t status; + int val, i, j, k, l, n; + float f; /* create 1D attributes with dimension [2], 2 elements */ - hsize_t dims[1]={2}; - char buf1[2][STR_SIZE]= {"ab","de"}; /* string */ - char *buf1a[2]; /* VL string */ - char buf2[2]= {1,2}; /* bitfield, opaque */ - s_t buf3[2]= {{1,2.0F},{3,4.0F}}; /* compound */ - hobj_ref_t buf4[2]; /* reference */ - e_t buf45[2]= {RED,RED}; /* enum */ - hvl_t buf5[2]; /* vlen */ - hsize_t dimarray[1]={3}; /* array dimension */ - int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int buf7[2]= {1,2}; /* integer */ - float buf8[2]= {1.0F, 2.0F}; /* float */ + hsize_t dims[1] = { 2 }; + char buf1[2][STR_SIZE] = { "ab", "de" }; /* string */ + char *buf1a[2]; /* VL string */ + char buf2[2] = { 1, 2 }; /* bitfield, opaque */ + s_t buf3[2] = { { 1, 2.0F }, { 3, 4.0F } }; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2] = { RED, RED }; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1] = { 3 }; /* array dimension */ + int buf6[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } }; /* array */ + int buf7[2] = { 1, 2 }; /* integer */ + float buf8[2] = { 1.0F, 2.0F }; /* float */ /* create 2D attributes with dimension [3][2], 6 elements */ - hsize_t dims2[2]={3,2}; - char buf12[3][2][STR_SIZE]= {{"ab","cd"},{"ef","gh"},{"ij","kl"}}; /* string */ - char *buf12a[3][2]; /* VL string */ - char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ - s_t buf32[6]= {{1,2.0F},{3,4.0F},{5,6.0F},{7,8.0F},{9,10.0F},{11,12.0F}}; /* compound */ - hobj_ref_t buf42[3][2]; /* reference */ - e_t buf452[3][2]; /* enum */ - hvl_t buf52[3][2]; /* vlen */ - int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ - int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ - float buf82[3][2]= {{1.0F,2.0F},{3.0F,4.0F},{5.0F,6.0F}}; /* float */ + hsize_t dims2[2] = { 3, 2 }; + char buf12[3][2][STR_SIZE] = { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }; /* string */ + char *buf12a[3][2]; /* VL string */ + char buf22[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* bitfield, opaque */ + s_t buf32[6] = { { 1, 2.0F }, { 3, 4.0F }, { 5, 6.0F }, { 7, 8.0F }, { 9, 10.0F }, { 11, 12.0F } }; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + e_t buf452[3][2]; /* enum */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15 }, { 16, 17, 18 } }; /* array */ + int buf72[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* integer */ + float buf82[3][2] = { { 1.0F, 2.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /* float */ /* create 3D attributes with dimension [4][3][2], 24 elements */ - hsize_t dims3[3]={4,3,2}; - char buf13[4][3][2][STR_SIZE]= {{{"ab","cd"},{"ef","gh"},{"ij","kl"}}, - {{"mn","pq"},{"rs","tu"},{"vw","xz"}}, - {{"AB","CD"},{"EF","GH"},{"IJ","KL"}}, - {{"MN","PQ"},{"RS","TU"},{"VW","XZ"}}}; /* string */ - char *buf13a[4][3][2]; /* VL string */ - char buf23[4][3][2]; /* bitfield, opaque */ - s_t buf33[4][3][2]; /* compound */ - hobj_ref_t buf43[4][3][2]; /* reference */ - e_t buf453[4][3][2]; /* enum */ - hvl_t buf53[4][3][2]; /* vlen */ - int buf63[24][3]; /* array */ - int buf73[4][3][2]; /* integer */ - float buf83[4][3][2]; /* float */ - + hsize_t dims3[3] = { 4, 3, 2 }; + char buf13[4][3][2][STR_SIZE] = { { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }, + { { "mn", "pq" }, { "rs", "tu" }, { "vw", "xz" } }, + { { "AB", "CD" }, { "EF", "GH" }, { "IJ", "KL" } }, + { { "MN", "PQ" }, { "RS", "TU" }, { "VW", "XZ" } } }; /* string */ + char *buf13a[4][3][2]; /* VL string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + e_t buf453[4][3][2]; /* enum */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ /*------------------------------------------------------------------------- * 1D attributes @@ -5590,15 +5292,10 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - for (j=0; j<2; j++) - { - buf1[i][j]='z'; - } - } - } + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + buf1[i][j] = 'z'; + /* buf1[2][2]= {"ab","de"}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -5611,16 +5308,17 @@ void write_attr_in(hid_t loc_id, [ 1 ] d z [ 1 ] e z */ + for (i = 0; i < 2; i++) + buf1a[i] = buf1[i]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, (size_t)STR_SIZE); - write_attr(loc_id,1,dims,"string",tid,buf1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 1, dims, "string", tid, buf1a); status = H5Tclose(tid); - for (i=0; i<2; i++) - buf1a[i]=buf1[i]; tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_attr(loc_id,1,dims,"VLstring",tid,buf1a); + status = H5Tset_size(tid, (size_t)STR_SIZE); + write_attr(loc_id, 1, dims, "VLstring", tid, buf1); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5629,10 +5327,8 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - buf2[i]=buf2[1]=0; - } + for (i = 0; i < 2; i++) + buf2[i] = buf2[1] = 0; /* buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v @@ -5646,7 +5342,7 @@ void write_attr_in(hid_t loc_id, */ tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,1,dims,"bitfield",tid,buf2); + write_attr(loc_id, 1, dims, "bitfield", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5666,9 +5362,9 @@ void write_attr_in(hid_t loc_id, [ 1 ] 2 0 2 */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,1,dims,"opaque",tid,buf2); + write_attr(loc_id, 1, dims, "opaque", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5677,12 +5373,10 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf3[i].a=0; buf3[i].b=0; + for (i = 0; i < 2; i++) { + buf3[i].a = 0; + buf3[i].b = 0; } - } /* buf3[2]= {{1,2},{3,4}}; @@ -5697,10 +5391,10 @@ void write_attr_in(hid_t loc_id, [ 1 ] 4 5 1 */ - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,1,dims,"compound",tid,buf3); + write_attr(loc_id, 1, dims, "compound", tid, buf3); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5708,70 +5402,64 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); - write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + if (dset_name) { + status = H5Rcreate(&buf4[0], fid, dset_name, H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&buf4[1], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 1, dims, "reference", H5T_STD_REF_OBJ, buf4); } /*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ + * H5T_ENUM + *------------------------------------------------------------------------- + */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf45[i]=GREEN; - } - } + for (i = 0; i < 2; i++) + buf45[i] = GREEN; /* - buf45[2]= {RED,RED}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - Attribute: and - position enum of enum of difference - ------------------------------------------------------------ - [ 0 ] RED GREEN - [ 1 ] RED GREEN - */ + buf45[2]= {RED,RED}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position enum of enum of difference + ------------------------------------------------------------ + [ 0 ] RED GREEN + [ 1 ] RED GREEN + */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,1,dims,"enum",tid,buf45); + write_attr(loc_id, 1, dims, "enum", tid, buf45); status = H5Tclose(tid); /*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + * H5T_VLEN + *------------------------------------------------------------------------- + */ /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc( 1 * sizeof(int)); - ((int *)buf5[0].p)[0]=1; + buf5[0].p = HDmalloc(1 * sizeof(int)); + ((int *) buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc( 2 * sizeof(int)); - ((int *)buf5[1].p)[0]=2; - ((int *)buf5[1].p)[1]=3; + buf5[1].p = HDmalloc(2 * sizeof(int)); + ((int *) buf5[1].p)[0] = 2; + ((int *) buf5[1].p)[1] = 3; - if (make_diffs) - { - ((int *)buf5[0].p)[0]=0; - ((int *)buf5[1].p)[0]=0; - ((int *)buf5[1].p)[1]=0; + if (make_diffs) { + ((int *) buf5[0].p)[0] = 0; + ((int *) buf5[1].p)[0] = 0; + ((int *) buf5[1].p)[1] = 0; } /* - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - position vlen of vlen of difference - ------------------------------------------------------------ - [ 0 ] 1 0 1 - [ 1 ] 2 0 2 - [ 1 ] 3 0 3 - */ + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position vlen of vlen of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + [ 1 ] 3 0 3 + */ sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -5785,31 +5473,1016 @@ void write_attr_in(hid_t loc_id, status = H5Sclose(sid); /*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ + * H5T_ARRAY + *------------------------------------------------------------------------- + */ if (make_diffs) - { - for (i=0; i<2; i++) - for (j=0; j<3; j++) - { - buf6[i][j]=0; - } - } + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + buf6[i][j] = 0; /* - buf6[2][3]= {{1,2,3},{4,5,6}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - Attribute: and - position array of array of difference - ------------------------------------------------------------ - [ 0 ] 1 0 1 - [ 0 ] 2 0 2 - [ 0 ] 3 0 3 - [ 1 ] 4 0 4 - [ 1 ] 5 0 5 - [ 1 ] 6 0 6 + buf6[2][3]= {{1,2,3},{4,5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array of array of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 0 ] 2 0 2 + [ 0 ] 3 0 3 + [ 1 ] 4 0 4 + [ 1 ] 5 0 5 + [ 1 ] 6 0 6 + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 1, dims, "array", tid, buf6); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) { + buf7[i] = 0; + buf8[i] = 0; + } + /* + buf7[2]= {1,2}; + buf8[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position integer of integer of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + position float of float of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + write_attr(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_attr(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); + + /*------------------------------------------------------------------------- + * 2D attributes + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + if (make_diffs) + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + for (k = 0; k < 2; k++) + buf12[i][j][k] = 'z'; + + /* + buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position string2D of string2D of difference + ------------------------------------------------------------ + [ 0 0 ] a z + [ 0 0 ] b z + [ 0 1 ] c z + [ 0 1 ] d z + [ 1 0 ] e z + [ 1 0 ] f z + [ 1 1 ] g z + [ 1 1 ] h z + [ 2 0 ] i z + [ 2 0 ] j z + [ 2 1 ] k z + [ 2 1 ] l z + */ + + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + buf12a[i][j] = buf12[i][j]; + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 2, dims2, "string2D", tid, buf12a); + status = H5Tclose(tid); + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 2, dims2, "VLstring2D", tid, buf12); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + if (make_diffs) + memset(buf22, 0, sizeof buf22); + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position bitfield2D of bitfield2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id, 2, dims2, "bitfield2D", tid, buf22); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id, 2, dims2, "opaque2D", tid, buf22); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + if (make_diffs) + memset(buf32, 0, sizeof buf32); + + /* + buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id, 2, dims2, "compound2D", tid, buf32); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_REFERENCE (H5R_OBJECT object reference) + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + status = H5Rcreate(&buf42[i][j], fid, dset_name, H5R_OBJECT, + (hid_t) -1); + write_attr(loc_id, 2, dims2, "reference2D", H5T_STD_REF_OBJ, buf42); + } + + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + if (make_diffs) + buf452[i][j] = GREEN; + else + buf452[i][j] = RED; + + /* + Attribute: and + position enum2D of enum2D of difference + ------------------------------------------------------------ + [ 0 0 ] RED GREEN + [ 0 1 ] RED GREEN + [ 1 0 ] RED GREEN + [ 1 1 ] RED GREEN + [ 2 0 ] RED GREEN + [ 2 1 ] RED GREEN + */ + + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id, 2, dims2, "enum2D", tid, buf452); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n = 0; + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { + buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].len = (size_t)(i + 1); + for (l = 0; l < i + 1; l++) + if (make_diffs) + ((int *) buf52[i][j].p)[l] = 0; + else + ((int *) buf52[i][j].p)[l] = n++; + } + } + + /* + position vlen2D of vlen2D of difference + ------------------------------------------------------------ + [ 0 1 ] 1 0 1 + [ 1 0 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 1 1 ] 5 0 5 + [ 2 0 ] 6 0 6 + [ 2 0 ] 7 0 7 + [ 2 0 ] 8 0 8 + [ 2 1 ] 9 0 9 + [ 2 1 ] 10 0 10 + [ 2 1 ] 11 0 11 + */ + + sid = H5Screate_simple(2, dims2, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf52); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); + assert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) + memset(buf62, 0, sizeof buf62); + /* + buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array2D of array2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 0 ] 2 0 2 + [ 0 0 ] 3 0 3 + [ 0 1 ] 4 0 4 + [ 0 1 ] 5 0 5 + [ 0 1 ] 6 0 6 + [ 1 0 ] 7 0 7 + [ 1 0 ] 8 0 8 + [ 1 0 ] 9 0 9 + [ 1 1 ] 10 0 10 + [ 1 1 ] 11 0 11 + [ 1 1 ] 12 0 12 + [ 2 0 ] 13 0 13 + [ 2 0 ] 14 0 14 + [ 2 0 ] 15 0 15 + [ 2 1 ] 16 0 16 + [ 2 1 ] 17 0 17 + [ 2 1 ] 18 0 18 + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 2, dims2, "array2D", tid, buf62); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (make_diffs) { + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); + } + /* + Attribute: and + position integer2D of integer2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + 6 differences found + Attribute: and + position float2D of float2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + write_attr(loc_id, 2, dims2, "integer2D", H5T_NATIVE_INT, buf72); + write_attr(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); + + /*------------------------------------------------------------------------- + * 3D attributes + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + buf13[i][j][k][l] = 'z'; + + /* + buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; + + Attribute: and + position string3D of string3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] a z + [ 0 0 0 ] b z + [ 0 0 1 ] c z + [ 0 0 1 ] d z + [ 0 1 0 ] e z + [ 0 1 0 ] f z + [ 0 1 1 ] g z + [ 0 1 1 ] h z + [ 0 2 0 ] i z + [ 0 2 0 ] j z + [ 0 2 1 ] k z + [ 0 2 1 ] l z + [ 1 0 0 ] m z + [ 1 0 0 ] n z + [ 1 0 1 ] p z + [ 1 0 1 ] q z + [ 1 1 0 ] r z + [ 1 1 0 ] s z + [ 1 1 1 ] t z + [ 1 1 1 ] u z + [ 1 2 0 ] v z + [ 1 2 0 ] w z + [ 1 2 1 ] x z + [ 2 0 0 ] A z + [ 2 0 0 ] B z + [ 2 0 1 ] C z + [ 2 0 1 ] D z + [ 2 1 0 ] E z + [ 2 1 0 ] F z + [ 2 1 1 ] G z + [ 2 1 1 ] H z + [ 2 2 0 ] I z + [ 2 2 0 ] J z + [ 2 2 1 ] K z + [ 2 2 1 ] L z + [ 3 0 0 ] M z + [ 3 0 0 ] N z + [ 3 0 1 ] P z + [ 3 0 1 ] Q z + [ 3 1 0 ] R z + [ 3 1 0 ] S z + [ 3 1 1 ] T z + [ 3 1 1 ] U z + [ 3 2 0 ] V z + [ 3 2 0 ] W z + [ 3 2 1 ] X z + [ 3 2 1 ] Z z + */ + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + buf13a[i][j][k] = buf13[i][j][k]; + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 3, dims3, "string3D", tid, buf13a); + status = H5Tclose(tid); + + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 3, dims3, "VLstring3D", tid, buf13); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + if (make_diffs) + buf23[i][j][k] = 0; + else + buf23[i][j][k] = (char) n++; + + /* + position bitfield3D of bitfield3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + [ 1 2 0 ] 11 0 11 + [ 1 2 1 ] 12 0 12 + [ 2 0 0 ] 13 0 13 + [ 2 0 1 ] 14 0 14 + [ 2 1 0 ] 15 0 15 + [ 2 1 1 ] 16 0 16 + [ 2 2 0 ] 17 0 17 + [ 2 2 1 ] 18 0 18 + [ 3 0 0 ] 19 0 19 + [ 3 0 1 ] 20 0 20 + [ 3 1 0 ] 21 0 21 + [ 3 1 1 ] 22 0 22 + [ 3 2 0 ] 23 0 23 + [ 3 2 1 ] 24 0 24 + */ + + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id, 3, dims3, "bitfield3D", tid, buf23); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id, 3, dims3, "opaque3D", tid, buf23); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + if (make_diffs) { + buf33[i][j][k].a = 0; + buf33[i][j][k].b = 0.0F; + } else { + buf33[i][j][k].a = (char) n++; + buf33[i][j][k].b = n++; + } + /*position compound3D of compound3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 1 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 1 0 ] 5 0 5 + [ 0 1 0 ] 6 0 6 + [ 0 1 1 ] 7 0 7 + [ 0 1 1 ] 8 0 8 + [ 0 2 0 ] 9 0 9 + [ 0 2 0 ] 10 0 10 + [ 0 2 1 ] 11 0 11 + [ 0 2 1 ] 12 0 12 + [ 1 0 0 ] 13 0 13 + [ 1 0 0 ] 14 0 14 + [ 1 0 1 ] 15 0 15 + [ 1 0 1 ] 16 0 16 + [ 1 1 0 ] 17 0 17 + [ 1 1 0 ] 18 0 18 + [ 1 1 1 ] 19 0 19 + [ 1 1 1 ] 20 0 20 + [ 1 2 0 ] 21 0 21 + [ 1 2 0 ] 22 0 22 + [ 1 2 1 ] 23 0 23 + [ 1 2 1 ] 24 0 24 + [ 2 0 0 ] 25 0 25 + [ 2 0 0 ] 26 0 26 + [ 2 0 1 ] 27 0 27 + [ 2 0 1 ] 28 0 28 + [ 2 1 0 ] 29 0 29 + [ 2 1 0 ] 30 0 30 + [ 2 1 1 ] 31 0 31 + [ 2 1 1 ] 32 0 32 + [ 2 2 0 ] 33 0 33 + [ 2 2 0 ] 34 0 34 + [ 2 2 1 ] 35 0 35 + [ 2 2 1 ] 36 0 36 + [ 3 0 0 ] 37 0 37 + [ 3 0 0 ] 38 0 38 + [ 3 0 1 ] 39 0 39 + [ 3 0 1 ] 40 0 40 + [ 3 1 0 ] 41 0 41 + [ 3 1 0 ] 42 0 42 + [ 3 1 1 ] 43 0 43 + [ 3 1 1 ] 44 0 44 + [ 3 2 0 ] 45 0 45 + [ 3 2 0 ] 46 0 46 + [ 3 2 1 ] 47 0 47 + [ 3 2 1 ] 48 0 48 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id, 3, dims3, "compound3D", tid, buf33); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_REFERENCE (H5R_OBJECT object reference) + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + status = H5Rcreate(&buf43[i][j][k], fid, dset_name, + H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 3, dims3, "reference3D", H5T_STD_REF_OBJ, buf43); + } + + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + if (make_diffs) + buf453[i][j][k] = RED; + else + buf453[i][j][k] = GREEN; + + /* + position enum3D of enum3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] GREEN RED + [ 0 0 1 ] GREEN RED + [ 0 1 0 ] GREEN RED + [ 0 1 1 ] GREEN RED + [ 0 2 0 ] GREEN RED + [ 0 2 1 ] GREEN RED + [ 1 0 0 ] GREEN RED + [ 1 0 1 ] GREEN RED + [ 1 1 0 ] GREEN RED + [ 1 1 1 ] GREEN RED + [ 1 2 0 ] GREEN RED + [ 1 2 1 ] GREEN RED + [ 2 0 0 ] GREEN RED + [ 2 0 1 ] GREEN RED + [ 2 1 0 ] GREEN RED + [ 2 1 1 ] GREEN RED + [ 2 2 0 ] GREEN RED + [ 2 2 1 ] GREEN RED + [ 3 0 0 ] GREEN RED + [ 3 0 1 ] GREEN RED + [ 3 1 0 ] GREEN RED + [ 3 1 1 ] GREEN RED + [ 3 2 0 ] GREEN RED + [ 3 2 1 ] GREEN RED + */ + + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id, 3, dims3, "enum3D", tid, buf453); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n = 0; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) { + buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].len = (size_t)(i + 1); + for (l = 0; l < i + 1; l++) + if (make_diffs) + ((int *) buf53[i][j][k].p)[l] = 0; + else + ((int *) buf53[i][j][k].p)[l] = n++; + } + /* + position vlen3D of vlen3D of difference + ------------------------------------------------------------ + [ 0 0 1 ] 1 0 1 + [ 0 1 0 ] 2 0 2 + [ 0 1 1 ] 3 0 3 + [ 0 2 0 ] 4 0 4 + [ 0 2 1 ] 5 0 5 + [ 1 0 0 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 0 1 ] 9 0 9 + [ 1 1 0 ] 10 0 10 + etc + */ + sid = H5Screate_simple(3, dims3, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf53); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); + assert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + n = 1; + for (i = 0; i < 24; i++) { + for (j = 0; j < (int) dimarray[0]; j++) { + if (make_diffs) + buf63[i][j] = 0; + else + buf63[i][j] = n++; + } + } + /* + position array3D of array3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 0 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 0 1 ] 5 0 5 + [ 0 0 1 ] 6 0 6 + [ 0 1 0 ] 7 0 7 + etc + */ + + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 3, dims3, "array3D", tid, buf63); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + n = 1; + f = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf73[i][j][k] = 0; + buf83[i][j][k] = 0.0F; + } + else { + buf73[i][j][k] = n++; + buf83[i][j][k] = f++; + } + } + + /* + position integer3D of integer3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + etc + */ + write_attr(loc_id, 3, dims3, "integer3D", H5T_NATIVE_INT, buf73); + write_attr(loc_id, 3, dims3, "float3D", H5T_NATIVE_FLOAT, buf83); +} + +/*------------------------------------------------------------------------- + * Function: write_attr_in + * + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * + *------------------------------------------------------------------------- + */ +static +void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs /* flag to modify data buffers */) +{ + /* Compound datatype */ + typedef struct s_t { + char a; + double b; + } s_t; + + typedef enum { + RED, GREEN + } e_t; + + hid_t aid = -1; + hid_t sid = -1; + hid_t tid = -1; + herr_t status; + int val, i, j, k, l, n; + float f; + + /* create 1D attributes with dimension [2], 2 elements */ + hsize_t dims[1] = { 2 }; + char buf1[2][STR_SIZE] = { "ab", "de" }; /* string */ + char *buf1a[2]; /* VL string */ + char buf2[2] = { 1, 2 }; /* bitfield, opaque */ + s_t buf3[2] = { { 1, 2.0F }, { 3, 4.0F } }; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2] = { RED, RED }; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1] = { 3 }; /* array dimension */ + int buf6[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } }; /* array */ + int buf7[2] = { 1, 2 }; /* integer */ + float buf8[2] = { 1.0F, 2.0F }; /* float */ + + /* create 2D attributes with dimension [3][2], 6 elements */ + hsize_t dims2[2] = { 3, 2 }; + char buf12[3][2][STR_SIZE] = { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }; /* string */ + char *buf12a[3][2]; /* VL string */ + char buf22[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* bitfield, opaque */ + s_t buf32[6] = { { 1, 2.0F }, { 3, 4.0F }, { 5, 6.0F }, { 7, 8.0F }, { 9, 10.0F }, { 11, 12.0F } }; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + e_t buf452[3][2]; /* enum */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15 }, { 16, 17, 18 } }; /* array */ + int buf72[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* integer */ + float buf82[3][2] = { { 1.0F, 2.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /* float */ + + /* create 3D attributes with dimension [4][3][2], 24 elements */ + hsize_t dims3[3] = { 4, 3, 2 }; + char buf13[4][3][2][STR_SIZE] = { { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }, + { { "mn", "pq" }, { "rs", "tu" }, { "vw", "xz" } }, + { { "AB", "CD" }, { "EF", "GH" }, { "IJ", "KL" } }, + { { "MN", "PQ" }, { "RS", "TU" }, { "VW", "XZ" } } }; /* string */ + char *buf13a[4][3][2]; /* VL string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + e_t buf453[4][3][2]; /* enum */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ + + /*------------------------------------------------------------------------- + * 1D attributes + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + buf1[i][j] = 'z'; + /* + buf1[2][2]= {"ab","de"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position string of string of difference + ------------------------------------------------------------ + [ 0 ] a z + [ 0 ] b z + [ 1 ] d z + [ 1 ] e z + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 1, dims, "string", tid, buf1); + status = H5Tclose(tid); + + for (i = 0; i < 2; i++) + buf1a[i] = buf1[i]; + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 1, dims, "VLstring", tid, buf1a); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) + buf2[i] = buf2[1] = 0; + /* + buf2[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position bitfield of bitfield of difference + position opaque of opaque of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id, 1, dims, "bitfield", tid, buf2); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + + /* + buf2[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position opaque of opaque of difference + position opaque of opaque of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id, 1, dims, "opaque", tid, buf2); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + if (make_diffs) + for (i = 0; i < 2; i++) { + buf3[i].a = 0; + buf3[i].b = 0; + } + /* + buf3[2]= {{1,2},{3,4}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position compound of compound of difference + ------------------------------------------------------------ + [ 0 ] 1 5 4 + [ 0 ] 2 5 3 + [ 1 ] 3 5 2 + [ 1 ] 4 5 1 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id, 1, dims, "compound", tid, buf3); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_REFERENCE (H5R_OBJECT object reference) + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) { + status = H5Rcreate(&buf4[0], fid, dset_name, H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&buf4[1], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 1, dims, "reference", H5T_STD_REF_OBJ, buf4); + } + + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + if (make_diffs) + for (i = 0; i < 2; i++) + buf45[i] = GREEN; + /* + buf45[2]= {RED,RED}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position enum of enum of difference + ------------------------------------------------------------ + [ 0 ] RED GREEN + [ 1 ] RED GREEN + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id, 1, dims, "enum", tid, buf45); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + + buf5[0].len = 1; + buf5[0].p = HDmalloc(1 * sizeof(int)); + ((int *) buf5[0].p)[0] = 1; + buf5[1].len = 2; + buf5[1].p = HDmalloc(2 * sizeof(int)); + ((int *) buf5[1].p)[0] = 2; + ((int *) buf5[1].p)[1] = 3; + + if (make_diffs) { + ((int *) buf5[0].p)[0] = 0; + ((int *) buf5[1].p)[0] = 0; + ((int *) buf5[1].p)[1] = 0; + } + /* + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position vlen of vlen of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + [ 1 ] 3 0 3 + */ + + sid = H5Screate_simple(1, dims, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf5); + assert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); + assert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) { + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + buf6[i][j] = 0; + } + /* + buf6[2][3]= {{1,2,3},{4,5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array of array of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 0 ] 2 0 2 + [ 0 ] 3 0 3 + [ 1 ] 4 0 4 + [ 1 ] 5 0 5 + [ 1 ] 6 0 6 */ tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_attr(loc_id, 1, dims, "array", tid, buf6); @@ -5820,31 +6493,28 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<2; i++) - { - buf7[i]=0; - buf8[i]=0; + if (make_diffs) { + for (i = 0; i < 2; i++) { + buf7[i] = 0; + buf8[i] = 0; } } /* - buf7[2]= {1,2}; - buf8[2]= {1,2}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - position integer of integer of difference - ------------------------------------------------------------ - [ 0 ] 1 0 1 - [ 1 ] 2 0 2 - position float of float of difference - ------------------------------------------------------------ - [ 0 ] 1 0 1 - [ 1 ] 2 0 2 - */ - write_attr(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - write_attr(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); - + buf7[2]= {1,2}; + buf8[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position integer of integer of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + position float of float of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + write_attr(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_attr(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); /*------------------------------------------------------------------------- * 2D attributes @@ -5855,50 +6525,45 @@ void write_attr_in(hid_t loc_id, * H5T_STRING *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<3; i++) - for (j=0; j<2; j++) - for (k=0; k<2; k++) - buf12[i][j][k]='z'; + if (make_diffs) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + for (k = 0; k < 2; k++) + buf12[i][j][k] = 'z'; } /* - buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - position string2D of string2D of difference - ------------------------------------------------------------ - [ 0 0 ] a z - [ 0 0 ] b z - [ 0 1 ] c z - [ 0 1 ] d z - [ 1 0 ] e z - [ 1 0 ] f z - [ 1 1 ] g z - [ 1 1 ] h z - [ 2 0 ] i z - [ 2 0 ] j z - [ 2 1 ] k z - [ 2 1 ] l z + buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position string2D of string2D of difference + ------------------------------------------------------------ + [ 0 0 ] a z + [ 0 0 ] b z + [ 0 1 ] c z + [ 0 1 ] d z + [ 1 0 ] e z + [ 1 0 ] f z + [ 1 1 ] g z + [ 1 1 ] h z + [ 2 0 ] i z + [ 2 0 ] j z + [ 2 1 ] k z + [ 2 1 ] l z */ tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, (size_t)STR_SIZE); - write_attr(loc_id,2,dims2,"string2D",tid,buf12); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 2, dims2, "string2D", tid, buf12); status = H5Tclose(tid); - for (i=0; i<3; i++) - { - for (j=0; j<2; j++) - { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + buf12a[i][j] = buf12[i][j]; - buf12a[i][j]=buf12[i][j]; - } - } tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_attr(loc_id,2,dims2,"VLstring2D",tid,buf12a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 2, dims2, "VLstring2D", tid, buf12a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5907,27 +6572,23 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf22,0,sizeof buf22); - } - + memset(buf22, 0, sizeof buf22); /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - position bitfield2D of bitfield2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position bitfield2D of bitfield2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 */ - tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,2,dims2,"bitfield2D",tid,buf22); + write_attr(loc_id, 2, dims2, "bitfield2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5936,21 +6597,21 @@ void write_attr_in(hid_t loc_id, */ /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - position opaque2D of opaque2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,2,dims2,"opaque2D",tid,buf22); + write_attr(loc_id, 2, dims2, "opaque2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5958,29 +6619,25 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ if (make_diffs) - { - memset(buf32,0,sizeof buf32); - } - + memset(buf32, 0, sizeof buf32); /* - buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Attribute: and - position opaque2D of opaque2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - */ - - - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,2,dims2,"compound2D",tid,buf32); + write_attr(loc_id, 2, dims2, "compound2D", tid, buf32); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -5988,44 +6645,41 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + if (dset_name) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + status = H5Rcreate(&buf42[i][j], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 2, dims2, "reference2D", H5T_STD_REF_OBJ, buf42); } /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ - for (i=0; i<3; i++) - { - for (j=0; j<2; j++) - { - if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) { + if (make_diffs) + buf452[i][j] = GREEN; + else + buf452[i][j] = RED; } - } /* - Attribute: and - position enum2D of enum2D of difference - ------------------------------------------------------------ - [ 0 0 ] RED GREEN - [ 0 1 ] RED GREEN - [ 1 0 ] RED GREEN - [ 1 1 ] RED GREEN - [ 2 0 ] RED GREEN - [ 2 1 ] RED GREEN + Attribute: and + position enum2D of enum2D of difference + ------------------------------------------------------------ + [ 0 0 ] RED GREEN + [ 0 1 ] RED GREEN + [ 1 0 ] RED GREEN + [ 1 1 ] RED GREEN + [ 2 0 ] RED GREEN + [ 2 1 ] RED GREEN */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,2,dims2,"enum2D",tid,buf452); + write_attr(loc_id, 2, dims2, "enum2D", tid, buf452); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6034,33 +6688,33 @@ void write_attr_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) { + n = 0; + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); - for(l = 0; l < i + 1; l++) - if(make_diffs) - ((int *)buf52[i][j].p)[l] = 0; + for (l = 0; l < i + 1; l++) + if (make_diffs) + ((int *) buf52[i][j].p)[l] = 0; else - ((int *)buf52[i][j].p)[l] = n++; + ((int *) buf52[i][j].p)[l] = n++; } } /* - position vlen2D of vlen2D of difference - ------------------------------------------------------------ - [ 0 1 ] 1 0 1 - [ 1 0 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 1 1 ] 5 0 5 - [ 2 0 ] 6 0 6 - [ 2 0 ] 7 0 7 - [ 2 0 ] 8 0 8 - [ 2 1 ] 9 0 9 - [ 2 1 ] 10 0 10 - [ 2 1 ] 11 0 11 + position vlen2D of vlen2D of difference + ------------------------------------------------------------ + [ 0 1 ] 1 0 1 + [ 1 0 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 1 1 ] 5 0 5 + [ 2 0 ] 6 0 6 + [ 2 0 ] 7 0 7 + [ 2 0 ] 8 0 8 + [ 2 1 ] 9 0 9 + [ 2 1 ] 10 0 10 + [ 2 1 ] 11 0 11 */ sid = H5Screate_simple(2, dims2, NULL); @@ -6080,34 +6734,32 @@ void write_attr_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf62,0,sizeof buf62); - } + memset(buf62, 0, sizeof buf62); /* - buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; - $h5diff file7.h5 file6.h5 g1 g1 -v - Group: and - Attribute: and - position array2D of array2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 0 ] 2 0 2 - [ 0 0 ] 3 0 3 - [ 0 1 ] 4 0 4 - [ 0 1 ] 5 0 5 - [ 0 1 ] 6 0 6 - [ 1 0 ] 7 0 7 - [ 1 0 ] 8 0 8 - [ 1 0 ] 9 0 9 - [ 1 1 ] 10 0 10 - [ 1 1 ] 11 0 11 - [ 1 1 ] 12 0 12 - [ 2 0 ] 13 0 13 - [ 2 0 ] 14 0 14 - [ 2 0 ] 15 0 15 - [ 2 1 ] 16 0 16 - [ 2 1 ] 17 0 17 - [ 2 1 ] 18 0 18 + buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position array2D of array2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 0 ] 2 0 2 + [ 0 0 ] 3 0 3 + [ 0 1 ] 4 0 4 + [ 0 1 ] 5 0 5 + [ 0 1 ] 6 0 6 + [ 1 0 ] 7 0 7 + [ 1 0 ] 8 0 8 + [ 1 0 ] 9 0 9 + [ 1 1 ] 10 0 10 + [ 1 1 ] 11 0 11 + [ 1 1 ] 12 0 12 + [ 2 0 ] 13 0 13 + [ 2 0 ] 14 0 14 + [ 2 0 ] 15 0 15 + [ 2 1 ] 16 0 16 + [ 2 1 ] 17 0 17 + [ 2 1 ] 18 0 18 */ tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_attr(loc_id, 2, dims2, "array2D", tid, buf62); @@ -6118,36 +6770,34 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - memset(buf72,0,sizeof buf72); - memset(buf82,0,sizeof buf82); + if (make_diffs) { + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); } /* - Attribute: and - position integer2D of integer2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - 6 differences found - Attribute: and - position float2D of float2D of difference - ------------------------------------------------------------ - [ 0 0 ] 1 0 1 - [ 0 1 ] 2 0 2 - [ 1 0 ] 3 0 3 - [ 1 1 ] 4 0 4 - [ 2 0 ] 5 0 5 - [ 2 1 ] 6 0 6 - */ - - write_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); - write_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + Attribute: and + position integer2D of integer2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + 6 differences found + Attribute: and + position float2D of float2D of difference + ------------------------------------------------------------ + [ 0 0 ] 1 0 1 + [ 0 1 ] 2 0 2 + [ 1 0 ] 3 0 3 + [ 1 1 ] 4 0 4 + [ 2 0 ] 5 0 5 + [ 2 1 ] 6 0 6 + */ + + write_attr(loc_id, 2, dims2, "integer2D", H5T_NATIVE_INT, buf72); + write_attr(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); /*------------------------------------------------------------------------- * 3D attributes @@ -6159,90 +6809,83 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<4; i++) - for (j=0; j<3; j++) - for (k=0; k<2; k++) - for (l=0; l<2; l++) - buf13[i][j][k][l]='z'; + if (make_diffs) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + buf13[i][j][k][l] = 'z'; } /* - buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", - "rs","tu","vw","xz","AB","CD","EF","GH", - "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; - - Attribute: and - position string3D of string3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] a z - [ 0 0 0 ] b z - [ 0 0 1 ] c z - [ 0 0 1 ] d z - [ 0 1 0 ] e z - [ 0 1 0 ] f z - [ 0 1 1 ] g z - [ 0 1 1 ] h z - [ 0 2 0 ] i z - [ 0 2 0 ] j z - [ 0 2 1 ] k z - [ 0 2 1 ] l z - [ 1 0 0 ] m z - [ 1 0 0 ] n z - [ 1 0 1 ] p z - [ 1 0 1 ] q z - [ 1 1 0 ] r z - [ 1 1 0 ] s z - [ 1 1 1 ] t z - [ 1 1 1 ] u z - [ 1 2 0 ] v z - [ 1 2 0 ] w z - [ 1 2 1 ] x z - [ 2 0 0 ] A z - [ 2 0 0 ] B z - [ 2 0 1 ] C z - [ 2 0 1 ] D z - [ 2 1 0 ] E z - [ 2 1 0 ] F z - [ 2 1 1 ] G z - [ 2 1 1 ] H z - [ 2 2 0 ] I z - [ 2 2 0 ] J z - [ 2 2 1 ] K z - [ 2 2 1 ] L z - [ 3 0 0 ] M z - [ 3 0 0 ] N z - [ 3 0 1 ] P z - [ 3 0 1 ] Q z - [ 3 1 0 ] R z - [ 3 1 0 ] S z - [ 3 1 1 ] T z - [ 3 1 1 ] U z - [ 3 2 0 ] V z - [ 3 2 0 ] W z - [ 3 2 1 ] X z - [ 3 2 1 ] Z z + buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; + + Attribute: and + position string3D of string3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] a z + [ 0 0 0 ] b z + [ 0 0 1 ] c z + [ 0 0 1 ] d z + [ 0 1 0 ] e z + [ 0 1 0 ] f z + [ 0 1 1 ] g z + [ 0 1 1 ] h z + [ 0 2 0 ] i z + [ 0 2 0 ] j z + [ 0 2 1 ] k z + [ 0 2 1 ] l z + [ 1 0 0 ] m z + [ 1 0 0 ] n z + [ 1 0 1 ] p z + [ 1 0 1 ] q z + [ 1 1 0 ] r z + [ 1 1 0 ] s z + [ 1 1 1 ] t z + [ 1 1 1 ] u z + [ 1 2 0 ] v z + [ 1 2 0 ] w z + [ 1 2 1 ] x z + [ 2 0 0 ] A z + [ 2 0 0 ] B z + [ 2 0 1 ] C z + [ 2 0 1 ] D z + [ 2 1 0 ] E z + [ 2 1 0 ] F z + [ 2 1 1 ] G z + [ 2 1 1 ] H z + [ 2 2 0 ] I z + [ 2 2 0 ] J z + [ 2 2 1 ] K z + [ 2 2 1 ] L z + [ 3 0 0 ] M z + [ 3 0 0 ] N z + [ 3 0 1 ] P z + [ 3 0 1 ] Q z + [ 3 1 0 ] R z + [ 3 1 0 ] S z + [ 3 1 1 ] T z + [ 3 1 1 ] U z + [ 3 2 0 ] V z + [ 3 2 0 ] W z + [ 3 2 1 ] X z + [ 3 2 1 ] Z z */ tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, (size_t)STR_SIZE); - write_attr(loc_id,3,dims3,"string3D",tid,buf13); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_attr(loc_id, 3, dims3, "string3D", tid, buf13); status = H5Tclose(tid); - for (i=0; i<4; i++) - { - for (j=0; j<3; j++) - { - for (k=0; k<2; k++) - { - buf13a[i][j][k]=buf13[i][j][k]; - } - } - } + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + buf13a[i][j][k] = buf13[i][j][k]; tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_attr(loc_id,3,dims3,"VLstring3D",tid,buf13a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_attr(loc_id, 3, dims3, "VLstring3D", tid, buf13a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6250,58 +6893,55 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - if(make_diffs) + if (make_diffs) buf23[i][j][k] = 0; else - buf23[i][j][k] = (char)n++; + buf23[i][j][k] = (char) n++; } - } - } - /* - position bitfield3D of bitfield3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 1 ] 2 0 2 - [ 0 1 0 ] 3 0 3 - [ 0 1 1 ] 4 0 4 - [ 0 2 0 ] 5 0 5 - [ 0 2 1 ] 6 0 6 - [ 1 0 0 ] 7 0 7 - [ 1 0 1 ] 8 0 8 - [ 1 1 0 ] 9 0 9 - [ 1 1 1 ] 10 0 10 - [ 1 2 0 ] 11 0 11 - [ 1 2 1 ] 12 0 12 - [ 2 0 0 ] 13 0 13 - [ 2 0 1 ] 14 0 14 - [ 2 1 0 ] 15 0 15 - [ 2 1 1 ] 16 0 16 - [ 2 2 0 ] 17 0 17 - [ 2 2 1 ] 18 0 18 - [ 3 0 0 ] 19 0 19 - [ 3 0 1 ] 20 0 20 - [ 3 1 0 ] 21 0 21 - [ 3 1 1 ] 22 0 22 - [ 3 2 0 ] 23 0 23 - [ 3 2 1 ] 24 0 24 + position bitfield3D of bitfield3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + [ 1 2 0 ] 11 0 11 + [ 1 2 1 ] 12 0 12 + [ 2 0 0 ] 13 0 13 + [ 2 0 1 ] 14 0 14 + [ 2 1 0 ] 15 0 15 + [ 2 1 1 ] 16 0 16 + [ 2 2 0 ] 17 0 17 + [ 2 2 1 ] 18 0 18 + [ 3 0 0 ] 19 0 19 + [ 3 0 1 ] 20 0 20 + [ 3 1 0 ] 21 0 21 + [ 3 1 1 ] 22 0 22 + [ 3 2 0 ] 23 0 23 + [ 3 2 1 ] 24 0 24 */ tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,3,dims3,"bitfield3D",tid,buf23); + write_attr(loc_id, 3, dims3, "bitfield3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,3,dims3,"opaque3D",tid,buf23); + write_attr(loc_id, 3, dims3, "opaque3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6309,77 +6949,75 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { buf33[i][j][k].a = 0; buf33[i][j][k].b = 0.0F; } else { - buf33[i][j][k].a = (char)n++; + buf33[i][j][k].a = (char) n++; buf33[i][j][k].b = n++; } } - } - } /*position compound3D of compound3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 0 ] 2 0 2 - [ 0 0 1 ] 3 0 3 - [ 0 0 1 ] 4 0 4 - [ 0 1 0 ] 5 0 5 - [ 0 1 0 ] 6 0 6 - [ 0 1 1 ] 7 0 7 - [ 0 1 1 ] 8 0 8 - [ 0 2 0 ] 9 0 9 - [ 0 2 0 ] 10 0 10 - [ 0 2 1 ] 11 0 11 - [ 0 2 1 ] 12 0 12 - [ 1 0 0 ] 13 0 13 - [ 1 0 0 ] 14 0 14 - [ 1 0 1 ] 15 0 15 - [ 1 0 1 ] 16 0 16 - [ 1 1 0 ] 17 0 17 - [ 1 1 0 ] 18 0 18 - [ 1 1 1 ] 19 0 19 - [ 1 1 1 ] 20 0 20 - [ 1 2 0 ] 21 0 21 - [ 1 2 0 ] 22 0 22 - [ 1 2 1 ] 23 0 23 - [ 1 2 1 ] 24 0 24 - [ 2 0 0 ] 25 0 25 - [ 2 0 0 ] 26 0 26 - [ 2 0 1 ] 27 0 27 - [ 2 0 1 ] 28 0 28 - [ 2 1 0 ] 29 0 29 - [ 2 1 0 ] 30 0 30 - [ 2 1 1 ] 31 0 31 - [ 2 1 1 ] 32 0 32 - [ 2 2 0 ] 33 0 33 - [ 2 2 0 ] 34 0 34 - [ 2 2 1 ] 35 0 35 - [ 2 2 1 ] 36 0 36 - [ 3 0 0 ] 37 0 37 - [ 3 0 0 ] 38 0 38 - [ 3 0 1 ] 39 0 39 - [ 3 0 1 ] 40 0 40 - [ 3 1 0 ] 41 0 41 - [ 3 1 0 ] 42 0 42 - [ 3 1 1 ] 43 0 43 - [ 3 1 1 ] 44 0 44 - [ 3 2 0 ] 45 0 45 - [ 3 2 0 ] 46 0 46 - [ 3 2 1 ] 47 0 47 - [ 3 2 1 ] 48 0 48 - */ - - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 1 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 1 0 ] 5 0 5 + [ 0 1 0 ] 6 0 6 + [ 0 1 1 ] 7 0 7 + [ 0 1 1 ] 8 0 8 + [ 0 2 0 ] 9 0 9 + [ 0 2 0 ] 10 0 10 + [ 0 2 1 ] 11 0 11 + [ 0 2 1 ] 12 0 12 + [ 1 0 0 ] 13 0 13 + [ 1 0 0 ] 14 0 14 + [ 1 0 1 ] 15 0 15 + [ 1 0 1 ] 16 0 16 + [ 1 1 0 ] 17 0 17 + [ 1 1 0 ] 18 0 18 + [ 1 1 1 ] 19 0 19 + [ 1 1 1 ] 20 0 20 + [ 1 2 0 ] 21 0 21 + [ 1 2 0 ] 22 0 22 + [ 1 2 1 ] 23 0 23 + [ 1 2 1 ] 24 0 24 + [ 2 0 0 ] 25 0 25 + [ 2 0 0 ] 26 0 26 + [ 2 0 1 ] 27 0 27 + [ 2 0 1 ] 28 0 28 + [ 2 1 0 ] 29 0 29 + [ 2 1 0 ] 30 0 30 + [ 2 1 1 ] 31 0 31 + [ 2 1 1 ] 32 0 32 + [ 2 2 0 ] 33 0 33 + [ 2 2 0 ] 34 0 34 + [ 2 2 1 ] 35 0 35 + [ 2 2 1 ] 36 0 36 + [ 3 0 0 ] 37 0 37 + [ 3 0 0 ] 38 0 38 + [ 3 0 1 ] 39 0 39 + [ 3 0 1 ] 40 0 40 + [ 3 1 0 ] 41 0 41 + [ 3 1 0 ] 42 0 42 + [ 3 1 1 ] 43 0 43 + [ 3 1 1 ] 44 0 44 + [ 3 2 0 ] 45 0 45 + [ 3 2 0 ] 46 0 46 + [ 3 2 1 ] 47 0 47 + [ 3 2 1 ] 48 0 48 + */ + + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,3,dims3,"compound3D",tid,buf33); + write_attr(loc_id, 3, dims3, "compound3D", tid, buf33); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6387,15 +7025,13 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + if (dset_name) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + status = H5Rcreate(&buf43[i][j][k], fid, dset_name, + H5R_OBJECT, (hid_t) -1); + write_attr(loc_id, 3, dims3, "reference3D", H5T_STD_REF_OBJ, buf43); } /*------------------------------------------------------------------------- @@ -6403,48 +7039,47 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - if (make_diffs) buf453[i][j][k]=RED; else buf453[i][j][k]=GREEN; + if (make_diffs) + buf453[i][j][k] = RED; + else + buf453[i][j][k] = GREEN; } - } - } - /* - position enum3D of enum3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] GREEN RED - [ 0 0 1 ] GREEN RED - [ 0 1 0 ] GREEN RED - [ 0 1 1 ] GREEN RED - [ 0 2 0 ] GREEN RED - [ 0 2 1 ] GREEN RED - [ 1 0 0 ] GREEN RED - [ 1 0 1 ] GREEN RED - [ 1 1 0 ] GREEN RED - [ 1 1 1 ] GREEN RED - [ 1 2 0 ] GREEN RED - [ 1 2 1 ] GREEN RED - [ 2 0 0 ] GREEN RED - [ 2 0 1 ] GREEN RED - [ 2 1 0 ] GREEN RED - [ 2 1 1 ] GREEN RED - [ 2 2 0 ] GREEN RED - [ 2 2 1 ] GREEN RED - [ 3 0 0 ] GREEN RED - [ 3 0 1 ] GREEN RED - [ 3 1 0 ] GREEN RED - [ 3 1 1 ] GREEN RED - [ 3 2 0 ] GREEN RED - [ 3 2 1 ] GREEN RED + position enum3D of enum3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] GREEN RED + [ 0 0 1 ] GREEN RED + [ 0 1 0 ] GREEN RED + [ 0 1 1 ] GREEN RED + [ 0 2 0 ] GREEN RED + [ 0 2 1 ] GREEN RED + [ 1 0 0 ] GREEN RED + [ 1 0 1 ] GREEN RED + [ 1 1 0 ] GREEN RED + [ 1 1 1 ] GREEN RED + [ 1 2 0 ] GREEN RED + [ 1 2 1 ] GREEN RED + [ 2 0 0 ] GREEN RED + [ 2 0 1 ] GREEN RED + [ 2 1 0 ] GREEN RED + [ 2 1 1 ] GREEN RED + [ 2 2 0 ] GREEN RED + [ 2 2 1 ] GREEN RED + [ 3 0 0 ] GREEN RED + [ 3 0 1 ] GREEN RED + [ 3 1 0 ] GREEN RED + [ 3 1 1 ] GREEN RED + [ 3 2 0 ] GREEN RED + [ 3 2 1 ] GREEN RED */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,3,dims3,"enum3D",tid,buf453); + write_attr(loc_id, 3, dims3, "enum3D", tid, buf453); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6453,34 +7088,32 @@ void write_attr_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 0; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) - if(make_diffs) - ((int *)buf53[i][j][k].p)[l] = 0; + if (make_diffs) + ((int *) buf53[i][j][k].p)[l] = 0; else - ((int *)buf53[i][j][k].p)[l] = n++; + ((int *) buf53[i][j][k].p)[l] = n++; } - } - } /* - position vlen3D of vlen3D of difference - ------------------------------------------------------------ - [ 0 0 1 ] 1 0 1 - [ 0 1 0 ] 2 0 2 - [ 0 1 1 ] 3 0 3 - [ 0 2 0 ] 4 0 4 - [ 0 2 1 ] 5 0 5 - [ 1 0 0 ] 6 0 6 - [ 1 0 0 ] 7 0 7 - [ 1 0 1 ] 8 0 8 - [ 1 0 1 ] 9 0 9 - [ 1 1 0 ] 10 0 10 - etc + position vlen3D of vlen3D of difference + ------------------------------------------------------------ + [ 0 0 1 ] 1 0 1 + [ 0 1 0 ] 2 0 2 + [ 0 1 1 ] 3 0 3 + [ 0 2 0 ] 4 0 4 + [ 0 2 1 ] 5 0 5 + [ 1 0 0 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 0 1 ] 9 0 9 + [ 1 1 0 ] 10 0 10 + etc */ sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -6497,24 +7130,25 @@ void write_attr_in(hid_t loc_id, * H5T_ARRAY *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { - if (make_diffs) buf63[i][j]=0; - else buf63[i][j]=n++; + n = 1; + for (i = 0; i < 24; i++) + for (j = 0; j < (int) dimarray[0]; j++) { + if (make_diffs) + buf63[i][j] = 0; + else + buf63[i][j] = n++; } - } /* - position array3D of array3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 0 ] 2 0 2 - [ 0 0 0 ] 3 0 3 - [ 0 0 1 ] 4 0 4 - [ 0 0 1 ] 5 0 5 - [ 0 0 1 ] 6 0 6 - [ 0 1 0 ] 7 0 7 - etc + position array3D of array3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 0 ] 2 0 2 + [ 0 0 0 ] 3 0 3 + [ 0 0 1 ] 4 0 4 + [ 0 0 1 ] 5 0 5 + [ 0 0 1 ] 6 0 6 + [ 0 1 0 ] 7 0 7 + etc */ tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); @@ -6525,132 +7159,120 @@ void write_attr_in(hid_t loc_id, * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + f = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { - buf73[i][j][k]=0; - buf83[i][j][k]=0.0F; + buf73[i][j][k] = 0; + buf83[i][j][k] = 0.0F; } else { - buf73[i][j][k]=n++; - buf83[i][j][k]=f++; + buf73[i][j][k] = n++; + buf83[i][j][k] = f++; } } - } - } /* - position integer3D of integer3D of difference - ------------------------------------------------------------ - [ 0 0 0 ] 1 0 1 - [ 0 0 1 ] 2 0 2 - [ 0 1 0 ] 3 0 3 - [ 0 1 1 ] 4 0 4 - [ 0 2 0 ] 5 0 5 - [ 0 2 1 ] 6 0 6 - [ 1 0 0 ] 7 0 7 - [ 1 0 1 ] 8 0 8 - [ 1 1 0 ] 9 0 9 - [ 1 1 1 ] 10 0 10 - etc - */ - write_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - write_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); + position integer3D of integer3D of difference + ------------------------------------------------------------ + [ 0 0 0 ] 1 0 1 + [ 0 0 1 ] 2 0 2 + [ 0 1 0 ] 3 0 3 + [ 0 1 1 ] 4 0 4 + [ 0 2 0 ] 5 0 5 + [ 0 2 1 ] 6 0 6 + [ 1 0 0 ] 7 0 7 + [ 1 0 1 ] 8 0 8 + [ 1 1 0 ] 9 0 9 + [ 1 1 1 ] 10 0 10 + etc + */ + write_attr(loc_id, 3, dims3, "integer3D", H5T_NATIVE_INT, buf73); + write_attr(loc_id, 3, dims3, "float3D", H5T_NATIVE_FLOAT, buf83); } - - /*------------------------------------------------------------------------- -* Function: write_dset_in -* -* Purpose: write datasets in LOC_ID -* -*------------------------------------------------------------------------- -*/ + * Function: write_dset_in + * + * Purpose: write datasets in LOC_ID + * + *------------------------------------------------------------------------- + */ static -void write_dset_in(hid_t loc_id, - const char* dset_name, /* for saving reference to dataset*/ - hid_t fid, - int make_diffs /* flag to modify data buffers */) +void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t - { - char a; + typedef struct s_t { + char a; double b; } s_t; - typedef enum - { - RED, - GREEN + typedef enum { + RED, GREEN } e_t; - hid_t did; - hid_t sid; - hid_t tid; - hid_t dcpl; - herr_t status; - int val, i, j, k, l, n; - float f; - int fillvalue=2; - int scalar_data = 2; + hid_t did = -1; + hid_t sid = -1; + hid_t tid = -1; + hid_t dcpl = -1; + herr_t status; + int val, i, j, k, l, n; + float f; + int fillvalue = 2; + int scalar_data = 2; /* create 1D attributes with dimension [2], 2 elements */ - hsize_t dims[1]={2}; - char buf1[2][STR_SIZE]= {"ab","de"}; /* string */ - char *buf1a[2]; /* VL string */ - char buf2[2]= {1,2}; /* bitfield, opaque */ - s_t buf3[2]= {{1,2.0F},{3,4.0F}}; /* compound */ - hobj_ref_t buf4[2]; /* reference */ - e_t buf45[2]= {RED,GREEN}; /* enum */ - hvl_t buf5[2]; /* vlen */ - hsize_t dimarray[1]={3}; /* array dimension */ - int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int buf7[2]= {1,2}; /* integer */ - float buf8[2]= {1.0F,2.0F}; /* float */ + hsize_t dims[1] = { 2 }; + char buf1[2][STR_SIZE] = { "ab", "de" }; /* string */ + char *buf1a[2]; /* VL string */ + char buf2[2] = { 1, 2 }; /* bitfield, opaque */ + s_t buf3[2] = { { 1, 2.0F }, { 3, 4.0F } }; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2] = { RED, GREEN }; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1] = { 3 }; /* array dimension */ + int buf6[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } }; /* array */ + int buf7[2] = { 1, 2 }; /* integer */ + float buf8[2] = { 1.0F, 2.0F }; /* float */ /* create 2D attributes with dimension [3][2], 6 elements */ - hsize_t dims2[2]={3,2}; - char buf12[3][2][STR_SIZE]= {{"ab","cd"},{"ef","gh"},{"ij","kl"}}; /* string */ - char *buf12a[3][2]; /* VL string */ - char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ - s_t buf32[6]= {{1,2.0F},{3,4.0F},{5,6.0F},{7,8.0F},{9,10.0F},{11,12.0F}}; /* compound */ - hobj_ref_t buf42[3][2]; /* reference */ - hvl_t buf52[3][2]; /* vlen */ - int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ - int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ - float buf82[3][2]= {{1.0F,2.0F},{3.0F,4.0F},{5.0F,6.0F}}; /* float */ + hsize_t dims2[2] = { 3, 2 }; + char buf12[3][2][STR_SIZE] = { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }; /* string */ + char *buf12a[3][2]; /* VL string */ + char buf22[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* bitfield, opaque */ + s_t buf32[6] = { { 1, 2.0F }, { 3, 4.0F }, { 5, 6.0F }, { 7, 8.0F }, { 9, 10.0F }, { 11, 12.0F } }; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 }, { 13, 14, 15 }, { 16, 17, 18 } }; /* array */ + int buf72[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; /* integer */ + float buf82[3][2] = { { 1.0F, 2.0F }, { 3.0F, 4.0F }, { 5.0F, 6.0F } }; /* float */ /* create 3D attributes with dimension [4][3][2], 24 elements */ - hsize_t dims3[3]={4,3,2}; - char buf13[4][3][2][STR_SIZE]= {{{"ab","cd"},{"ef","gh"},{"ij","kl"}}, - {{"mn","pq"},{"rs","tu"},{"vw","xz"}}, - {{"AB","CD"},{"EF","GH"},{"IJ","KL"}}, - {{"MN","PQ"},{"RS","TU"},{"VW","XZ"}}}; /* string */ - char *buf13a[4][3][2]; /* VL string */ - char buf23[4][3][2]; /* bitfield, opaque */ - s_t buf33[4][3][2]; /* compound */ - hobj_ref_t buf43[4][3][2]; /* reference */ - hvl_t buf53[4][3][2]; /* vlen */ - int buf63[24][3]; /* array */ - int buf73[4][3][2]; /* integer */ - float buf83[4][3][2]; /* float */ - - if(make_diffs == 2) { + hsize_t dims3[3] = { 4, 3, 2 }; + char buf13[4][3][2][STR_SIZE] = { { { "ab", "cd" }, { "ef", "gh" }, { "ij", "kl" } }, + { { "mn", "pq" }, { "rs", "tu" }, { "vw", "xz" } }, + { { "AB", "CD" }, { "EF", "GH" }, { "IJ", "KL" } }, + { { "MN", "PQ" }, { "RS", "TU" }, { "VW", "XZ" } } }; /* string */ + char *buf13a[4][3][2]; /* VL string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ + + if (make_diffs == 2) dimarray[0] = 4; - } /*------------------------------------------------------------------------- * H5S_SCALAR *------------------------------------------------------------------------- */ - - - if(make_diffs) + if (make_diffs) scalar_data = 1; /* create a space */ @@ -6666,7 +7288,6 @@ void write_dset_in(hid_t loc_id, H5Dclose(did); H5Sclose(sid); - /*------------------------------------------------------------------------- * 1D *------------------------------------------------------------------------- @@ -6677,27 +7298,22 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<2; i++) - for (j=0; j<2; j++) - buf1[i][j]='z'; - } - + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + buf1[i][j] = 'z'; tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid,(size_t)STR_SIZE); - write_dset(loc_id,1,dims,"string",tid,buf1); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_dset(loc_id, 1, dims, "string", tid, buf1); status = H5Tclose(tid); - for (i=0; i<2; i++) - { - buf1a[i]=buf1[i]; - } + for (i = 0; i < 2; i++) + buf1a[i] = buf1[i]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_dset(loc_id,1,dims,"VLstring",tid,buf1a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_dset(loc_id, 1, dims, "VLstring", tid, buf1a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6706,13 +7322,11 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - buf2[i]=buf2[1]=0; - } + for (i = 0; i < 2; i++) + buf2[i] = buf2[1] = 0; tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,1,dims,"bitfield",tid,buf2); + write_dset(loc_id, 1, dims, "bitfield", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6721,16 +7335,14 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf3[i].a=0; buf3[i].b=0; + for (i = 0; i < 2; i++) { + buf3[i].a = 0; + buf3[i].b = 0; } - } - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,1,dims,"opaque",tid,buf2); + write_dset(loc_id, 1, dims, "opaque", tid, buf2); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6738,19 +7350,14 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<2; i++) - { - buf45[i]=GREEN; - } - } + for (i = 0; i < 2; i++) + buf45[i] = GREEN; - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,1,dims,"compound",tid,buf3); + write_dset(loc_id, 1, dims, "compound", tid, buf3); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6758,11 +7365,10 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); - write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + if (dset_name) { + status = H5Rcreate(&buf4[0], fid, dset_name, H5R_OBJECT, (hid_t) -1); + status = H5Rcreate(&buf4[1], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_dset(loc_id, 1, dims, "reference", H5T_STD_REF_OBJ, buf4); } /*------------------------------------------------------------------------- @@ -6770,16 +7376,16 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - gen_datareg(fid,make_diffs); + gen_datareg(fid, make_diffs); /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,1,dims,"enum",tid,buf45); + write_dset(loc_id, 1, dims, "enum", tid, buf45); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6790,22 +7396,23 @@ void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc( 1 * sizeof(int)); - ((int *)buf5[0].p)[0]=1; + buf5[0].p = HDmalloc(1 * sizeof(int)); + ((int *) buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc( 2 * sizeof(int)); - ((int *)buf5[1].p)[0]=2; - ((int *)buf5[1].p)[1]=3; + buf5[1].p = HDmalloc(2 * sizeof(int)); + ((int *) buf5[1].p)[0] = 2; + ((int *) buf5[1].p)[1] = 3; - if(make_diffs) { - ((int *)buf5[0].p)[0] = 0; - ((int *)buf5[1].p)[0] = 0; - ((int *)buf5[1].p)[1]=0; + if (make_diffs) { + ((int *) buf5[0].p)[0] = 0; + ((int *) buf5[1].p)[0] = 0; + ((int *) buf5[1].p)[1] = 0; } sid = H5Screate_simple(1, dims, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); @@ -6820,37 +7427,32 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - for (j=0; j<3; j++) - { - buf6[i][j]=0; - } - } + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + buf6[i][j] = 0; tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 1, dims, "array", tid, buf6); status = H5Tclose(tid); { - double *dbuf; /* information to write */ - hid_t ldid; /* dataset ID */ - hid_t lsid; /* dataspace ID */ - hid_t ltid; /* datatype ID */ - size_t size; - hsize_t sdims[] = {1}; - hsize_t tdims[] = {H5TOOLS_MALLOCSIZE / sizeof(double) + 1}; - size_t jj; + double *dbuf; /* information to write */ + hid_t ldid = -1; /* dataset ID */ + hid_t lsid = -1; /* dataspace ID */ + hid_t ltid = -1; /* datatype ID */ + size_t size; + hsize_t sdims[] = { 1 }; + hsize_t tdims[] = { H5TOOLS_MALLOCSIZE / sizeof(double) + 1 }; + size_t jj; /* allocate and initialize array data to write */ - size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); - dbuf = (double *)HDmalloc(size); + size = (H5TOOLS_MALLOCSIZE / sizeof(double) + 1) * sizeof(double); + dbuf = (double *) HDmalloc(size); - for(jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) - dbuf[jj] = (double)jj; + for (jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) + dbuf[jj] = (double) jj; - if (make_diffs) - { + if (make_diffs) { dbuf[5] = 0; dbuf[6] = 0; } @@ -6877,17 +7479,13 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - for (i=0; i<2; i++) - { - buf7[i]=0; - buf8[i]=0; + for (i = 0; i < 2; i++) { + buf7[i] = 0; + buf8[i] = 0; } - } - - write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); + write_dset(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_dset(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); /*------------------------------------------------------------------------- * 2D @@ -6899,30 +7497,25 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<3; i++) - for (j=0; j<2; j++) - for (k=0; k<2; k++) - buf12[i][j][k]='z'; + if (make_diffs) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + for (k = 0; k < 2; k++) + buf12[i][j][k] = 'z'; } - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid,(size_t)STR_SIZE); - write_dset(loc_id,2,dims2,"string2D",tid,buf12); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_dset(loc_id, 2, dims2, "string2D", tid, buf12); status = H5Tclose(tid); - for (i=0; i<3; i++) - { - for (j=0; j<2; j++) - { - buf12a[i][j]=buf12[i][j]; - } - } + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + buf12a[i][j] = buf12[i][j]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_dset(loc_id,2,dims2,"VLstring2D",tid,buf12a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_dset(loc_id, 2, dims2, "VLstring2D", tid, buf12a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6930,23 +7523,20 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - memset(buf22,0,sizeof buf22); - } + memset(buf22, 0, sizeof buf22); tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,2,dims2,"bitfield2D",tid,buf22); + write_dset(loc_id, 2, dims2, "bitfield2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,2,dims2,"opaque2D",tid,buf22); + write_dset(loc_id, 2, dims2, "opaque2D", tid, buf22); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6955,14 +7545,12 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf32,0,sizeof buf32); - } + memset(buf32, 0, sizeof buf32); - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,2,dims2,"compound2D",tid,buf32); + write_dset(loc_id, 2, dims2, "compound2D", tid, buf32); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6970,14 +7558,11 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + if (dset_name) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + status = H5Rcreate(&buf42[i][j], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_dset(loc_id, 2, dims2, "reference2D", H5T_STD_REF_OBJ, buf42); } /*------------------------------------------------------------------------- @@ -6986,9 +7571,9 @@ void write_dset_in(hid_t loc_id, */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,2,dims2,"enum2D",tid,0); + write_dset(loc_id, 2, dims2, "enum2D", tid, 0); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -6998,18 +7583,17 @@ void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n = 0; - for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) { buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); - for(l = 0; l < i + 1; l++) { - if(make_diffs) - ((int *)buf52[i][j].p)[l] = 0; + for (l = 0; l < i + 1; l++) { + if (make_diffs) + ((int *) buf52[i][j].p)[l] = 0; else - ((int *)buf52[i][j].p)[l] = n++; + ((int *) buf52[i][j].p)[l] = n++; } } - } sid = H5Screate_simple(2, dims2, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -7028,10 +7612,7 @@ void write_dset_in(hid_t loc_id, */ if (make_diffs) - { - memset(buf62,0,sizeof buf62); - } - + memset(buf62, 0, sizeof buf62); tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 2, dims2, "array2D", tid, buf62); @@ -7042,14 +7623,11 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - - if (make_diffs) - { + if (make_diffs) { memset(buf72, 0, sizeof buf72); memset(buf82, 0, sizeof buf82); } - dcpl = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue); sid = H5Screate_simple(2, dims2, NULL); @@ -7064,8 +7642,7 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + write_dset(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); /*------------------------------------------------------------------------- * 3D @@ -7077,33 +7654,27 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if (make_diffs) - { - for (i=0; i<4; i++) - for (j=0; j<3; j++) - for (k=0; k<2; k++) - for (l=0; l<2; l++) - buf13[i][j][k][l]='z'; + if (make_diffs) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + buf13[i][j][k][l] = 'z'; } tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid,(size_t)STR_SIZE); - write_dset(loc_id,3,dims3,"string3D",tid,buf13); + status = H5Tset_size(tid, (size_t) STR_SIZE); + write_dset(loc_id, 3, dims3, "string3D", tid, buf13); status = H5Tclose(tid); - for (i=0; i<4; i++) - { - for (j=0; j<3; j++) - { - for (k=0; k<2; k++) - { - buf13a[i][j][k]=buf13[i][j][k]; - } - } - } + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) + buf13a[i][j][k] = buf13[i][j][k]; + tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, H5T_VARIABLE); - write_dset(loc_id,3,dims3,"VLstring3D",tid,buf13a); + status = H5Tset_size(tid, H5T_VARIABLE); + write_dset(loc_id, 3, dims3, "VLstring3D", tid, buf13a); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7111,31 +7682,27 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - if(make_diffs) + if (make_diffs) buf23[i][j][k] = 0; else - buf23[i][j][k] = (char)n++; + buf23[i][j][k] = (char) n++; } - } - } - tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,3,dims3,"bitfield3D",tid,buf23); + write_dset(loc_id, 3, dims3, "bitfield3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ - tid = H5Tcreate(H5T_OPAQUE, (size_t)1); + tid = H5Tcreate(H5T_OPAQUE, (size_t) 1); status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,3,dims3,"opaque3D",tid,buf23); + write_dset(loc_id, 3, dims3, "opaque3D", tid, buf23); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7143,27 +7710,24 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - n=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { buf33[i][j][k].a = 0; buf33[i][j][k].b = 0.0F; } else { - buf33[i][j][k].a = (char)n++; + buf33[i][j][k].a = (char) n++; buf33[i][j][k].b = n++; } } - } - } - - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,3,dims3,"compound3D",tid,buf33); + write_dset(loc_id, 3, dims3, "compound3D", tid, buf33); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7171,15 +7735,12 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ /* Create references to dataset */ - if (dset_name) - { - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + if (dset_name) { + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); - } - } - write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + status = H5Rcreate(&buf43[i][j][k], fid, dset_name, H5R_OBJECT, (hid_t) -1); + write_dset(loc_id, 3, dims3, "reference3D", H5T_STD_REF_OBJ, buf43); } /*------------------------------------------------------------------------- @@ -7188,9 +7749,9 @@ void write_dset_in(hid_t loc_id, */ tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,3,dims3,"enum3D",tid,0); + write_dset(loc_id, 3, dims3, "enum3D", tid, 0); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -7199,21 +7760,19 @@ void write_dset_in(hid_t loc_id, */ /* Allocate and initialize VL dataset to write */ - n=0; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { + n = 0; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) { buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); - for(l = 0; l < i + 1; l++) { - if(make_diffs) - ((int *)buf53[i][j][k].p)[l] = 0; + for (l = 0; l < i + 1; l++) { + if (make_diffs) + ((int *) buf53[i][j][k].p)[l] = 0; else - ((int *)buf53[i][j][k].p)[l] = n++; + ((int *) buf53[i][j][k].p)[l] = n++; } } - } - } sid = H5Screate_simple(3, dims3, NULL); tid = H5Tvlen_create(H5T_NATIVE_INT); @@ -7231,14 +7790,14 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - - n=1; - for (i = 0; i < 24; i++) { + n = 1; + for (i = 0; i < 24; i++) for (j = 0; j < 3; j++) { - if (make_diffs) buf63[i][j]=0; - else buf63[i][j]=n++; + if (make_diffs) + buf63[i][j] = 0; + else + buf63[i][j] = n++; } - } tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 3, dims3, "array3D", tid, buf63); @@ -7248,82 +7807,86 @@ void write_dset_in(hid_t loc_id, * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - n=1; f=1; - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { + n = 1; + f = 1; + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { if (make_diffs) { - buf73[i][j][k]=0; - buf83[i][j][k]=0.0F; + buf73[i][j][k] = 0; + buf83[i][j][k] = 0.0F; } else { - buf73[i][j][k]=n++; - buf83[i][j][k]=f++; + buf73[i][j][k] = n++; + buf83[i][j][k] = f++; } } - } - } - write_dset(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); + + write_dset(loc_id, 3, dims3, "integer3D", H5T_NATIVE_INT, buf73); + write_dset(loc_id, 3, dims3, "float3D", H5T_NATIVE_FLOAT, buf83); } /*------------------------------------------------------------------------- -* Function: gen_datareg -* -* Purpose: generate a dataset region and its reference -* -* Date: April 19, 2006 -* -*------------------------------------------------------------------------- -*/ + * Function: gen_datareg + * + * Purpose: generate a dataset region and its reference + * + * Date: April 19, 2006 + * + *------------------------------------------------------------------------- + */ static -void gen_datareg(hid_t fid, - int make_diffs /* flag to modify data buffers */) +void gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) { /* data dataset */ - hid_t did1; /* dataset ID */ - hid_t sid1; /* dataspace ID */ - hsize_t dims1[2] = {10,10};/* dimensions */ - int *buf; /* dataset buffer */ + hid_t did1 = -1; /* dataset ID */ + hid_t sid1 = -1; /* dataspace ID */ + hsize_t dims1[2] = { 10, 10 };/* dimensions */ + int *buf; /* dataset buffer */ /* reference dataset */ - hid_t did2; /* dataset ID */ - hid_t sid2; /* dataspace ID */ - hsize_t dims2[] = {2}; /* 2 references */ - hdset_reg_ref_t *rbuf; /* buffer for write the references */ - hsize_t start[10]; /* starting location of hyperslab */ - hsize_t count[10]; /* element count of hyperslab */ - hsize_t coord[5][2]; /* coordinates for point selection */ - herr_t status; - int i; + hid_t did2 = -1; /* dataset ID */ + hid_t sid2 = -1; /* dataspace ID */ + hsize_t dims2[] = { 2 }; /* 2 references */ + hdset_reg_ref_t *rbuf; /* buffer for write the references */ + hsize_t start[10]; /* starting location of hyperslab */ + hsize_t count[10]; /* element count of hyperslab */ + hsize_t coord[5][2]; /* coordinates for point selection */ + herr_t status; + int i; /* allocate the buffer for write the references */ - rbuf = (hdset_reg_ref_t *)HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); + rbuf = (hdset_reg_ref_t *) HDcalloc((size_t )2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf = (int *)HDmalloc(10 * 10 * sizeof(int)); + buf = (int *) HDmalloc(10 * 10 * sizeof(int)); - for(i = 0; i < 10 * 10; i++) + for (i = 0; i < 10 * 10; i++) buf[i] = i; /* create the data dataset */ - sid1 = H5Screate_simple(2, dims1, NULL); - did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + sid1 = H5Screate_simple(2, dims1, NULL); + did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); HDassert(status >= 0); /* create the reference dataset */ - sid2 = H5Screate_simple(1, dims2, NULL); - did2 = H5Dcreate2(fid, "refreg", H5T_STD_REF_DSETREG, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + sid2 = H5Screate_simple(1, dims2, NULL); + did2 = H5Dcreate2(fid, "refreg", H5T_STD_REF_DSETREG, sid2, H5P_DEFAULT, + H5P_DEFAULT, H5P_DEFAULT); /* create the references */ /* select hyperslab for first reference */ - start[0] = 2; start[1] = 2; - count[0] = 6; count[1] = 6; - if(make_diffs) { - start[0] = 0; start[1] = 0; - count[0] = 3; count[1] = 3; + start[0] = 2; + start[1] = 2; + count[0] = 6; + count[1] = 6; + if (make_diffs) { + start[0] = 0; + start[1] = 0; + count[0] = 3; + count[1] = 3; } status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); @@ -7335,25 +7898,32 @@ void gen_datareg(hid_t fid, HDassert(status >= 0); /* select sequence of five points for second reference */ - coord[0][0]=6; coord[0][1]=9; - coord[1][0]=2; coord[1][1]=2; - coord[2][0]=8; coord[2][1]=4; - coord[3][0]=1; coord[3][1]=6; - coord[4][0]=2; coord[4][1]=8; - if (make_diffs) - { - coord[1][0]=3; coord[1][1]=3; - coord[3][0]=2; coord[3][1]=5; - coord[4][0]=1; coord[4][1]=7; - } - H5Sselect_elements(sid1,H5S_SELECT_SET,(size_t)5,(const hsize_t *)coord); + coord[0][0] = 6; + coord[0][1] = 9; + coord[1][0] = 2; + coord[1][1] = 2; + coord[2][0] = 8; + coord[2][1] = 4; + coord[3][0] = 1; + coord[3][1] = 6; + coord[4][0] = 2; + coord[4][1] = 8; + if (make_diffs) { + coord[1][0] = 3; + coord[1][1] = 3; + coord[3][0] = 2; + coord[3][1] = 5; + coord[4][0] = 1; + coord[4][1] = 7; + } + H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t) 5, (const hsize_t *) coord); H5Sget_select_npoints(sid1); /* store second dataset region */ - H5Rcreate(&rbuf[1],fid,"dsetref",H5R_DATASET_REGION,sid1); + H5Rcreate(&rbuf[1], fid, "dsetref", H5R_DATASET_REGION, sid1); /* write */ - status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf); + status = H5Dwrite(did2, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf); HDassert(status >= 0); /* close, free memory buffers */ @@ -7370,60 +7940,58 @@ void gen_datareg(hid_t fid, HDfree(buf); } - /*------------------------------------------------------------------------- -* Function: test_hyperslab -* -* Purpose: test diff by hyperslabs. create a dataset with 1GB dimensions -* by iterating trough 1KB hyperslabs -* -*------------------------------------------------------------------------- -*/ + * Function: test_hyperslab + * + * Purpose: test diff by hyperslabs. create a dataset with 1GB dimensions + * by iterating trough 1KB hyperslabs + * + *------------------------------------------------------------------------- + */ static -int test_hyperslab(const char *fname, - int make_diffs /* flag to modify data buffers */) +int test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers */) { - hid_t did=-1; - hid_t fid=-1; - hid_t f_sid=-1; - hid_t m_sid=-1; - hid_t tid=-1; - hid_t dcpl=-1; - hsize_t dims[1]={GBLL}; /* dataset dimensions */ - hsize_t hs_size[1]={GBLL/(1024*1024)}; /* hyperslab dimensions */ - hsize_t chunk_dims[1]={GBLL/1024}; /* chunk dimensions */ + hid_t did = -1; + hid_t fid = -1; + hid_t f_sid = -1; + hid_t m_sid = -1; + hid_t tid = -1; + hid_t dcpl = -1; + hsize_t dims[1] = { GBLL }; /* dataset dimensions */ + hsize_t hs_size[1] = { GBLL / (1024 * 1024) }; /* hyperslab dimensions */ + hsize_t chunk_dims[1] = { GBLL / 1024 }; /* chunk dimensions */ hsize_t hs_start[1]; - size_t size; - size_t nelmts=(size_t)GBLL/(1024*1024); /* elements in each hyperslab */ - char fillvalue=-1; - char *buf=NULL; - int i, j, s; - char c; + size_t size; + size_t nelmts = (size_t)GBLL / (1024 * 1024); /* elements in each hyperslab */ + char fillvalue = -1; + char *buf = NULL; + int i, j, s; + char c; /* create */ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if(H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0) + if (H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0) goto out; - if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0) + if (H5Pset_chunk(dcpl, 1, chunk_dims) < 0) goto out; - if((f_sid = H5Screate_simple(1, dims, NULL)) < 0) + if ((f_sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if((did = H5Dcreate2(fid, "big", H5T_NATIVE_CHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(fid, "big", H5T_NATIVE_CHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto out; - if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) + if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - if((tid = H5Dget_type(did)) < 0) + if ((tid = H5Dget_type(did)) < 0) goto out; - if((size = H5Tget_size(tid)) <= 0) + if ((size = H5Tget_size(tid)) <= 0) goto out; /* create a evenly divided buffer from 0 to 127 */ - buf = (char *)HDmalloc((size_t)(nelmts * size)); + buf = (char *) HDmalloc((size_t)(nelmts * size)); s = 1024 * 1024 / 127; - for(i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { - if(j == s) { + for (i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { + if (j == s) { c++; j = 0; } @@ -7432,32 +8000,30 @@ int test_hyperslab(const char *fname, HDmemset(buf, c, nelmts); /* make a different hyperslab at this position */ - if(make_diffs && i == 512 * 512) + if (make_diffs && i == 512 * 512) HDmemset(buf, 0, nelmts); - hs_start[0] = (unsigned long long)i * GBLL / (1024 * 1024); - if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0) + hs_start[0] = (unsigned long long) i * GBLL / (1024 * 1024); + if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0) goto out; /* write only one hyperslab */ - if ( i==512*512) - { - if (H5Dwrite (did,H5T_NATIVE_CHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0) + if (i == 512 * 512) { + if (H5Dwrite(did, H5T_NATIVE_CHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; } - } HDfree(buf); - buf=NULL; + buf = NULL; /* close */ - if(H5Sclose(f_sid) < 0) + if (H5Sclose(f_sid) < 0) goto out; - if(H5Sclose(m_sid) < 0) + if (H5Sclose(m_sid) < 0) goto out; - if(H5Pclose(dcpl) < 0) + if (H5Pclose(dcpl) < 0) goto out; - if(H5Dclose(did) < 0) + if (H5Dclose(did) < 0) goto out; H5Fclose(fid); @@ -7472,40 +8038,32 @@ out: H5Fclose(fid); } H5E_END_TRY; return -1; - } - /*------------------------------------------------------------------------- -* Function: write_attr -* -* Purpose: utility function to write an attribute in LOC_ID -* -*------------------------------------------------------------------------- -*/ + * Function: write_attr + * + * Purpose: utility function to write an attribute in LOC_ID + * + *------------------------------------------------------------------------- + */ static -int write_attr(hid_t loc_id, - int rank, - hsize_t *dims, - const char *name, - hid_t tid, - void *buf) +int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf) { - hid_t aid=-1; - hid_t sid=-1; + hid_t aid = -1; + hid_t sid = -1; /* create a space */ - if((sid = H5Screate_simple(rank, dims, NULL)) < 0) + if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto out; /* create the attribute */ - if((aid = H5Acreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((aid = H5Acreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write */ - if(buf) - { - if(H5Awrite(aid, tid, buf) < 0) + if (buf) { + if (H5Awrite(aid, tid, buf) < 0) goto out; } @@ -7523,35 +8081,29 @@ out: } /*------------------------------------------------------------------------- -* Function: write_dset -* -* Purpose: utility function to create and write a dataset in LOC_ID -* -*------------------------------------------------------------------------- -*/ + * Function: write_dset + * + * Purpose: utility function to create and write a dataset in LOC_ID + * + *------------------------------------------------------------------------- + */ static -int write_dset( hid_t loc_id, - int rank, - hsize_t *dims, - const char *name, - hid_t tid, - void *buf ) +int write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf) { - hid_t did=-1; - hid_t sid=-1; + hid_t did = -1; + hid_t sid = -1; /* create a space */ - if((sid = H5Screate_simple(rank, dims, NULL)) < 0) + if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto out; /* create the dataset */ - if((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write */ - if(buf) - { - if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if (buf) { + if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto out; } diff --git a/tools/test/h5diff/testfiles/h5diff_8639.txt b/tools/test/h5diff/testfiles/h5diff_8639.txt new file mode 100644 index 0000000..4022e06 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_8639.txt @@ -0,0 +1,72 @@ + +group1 group2 +--------------------------------------- + x x + +group : and +0 differences found +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +Warning: different storage datatype +Not comparable: or is of mixed string type +attribute: > and > +0 differences found +attribute: > and > +0 differences found +attribute: > and > +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. +EXIT CODE: 0 diff --git a/tools/test/h5diff/testfiles/h5diff_attr1.h5 b/tools/test/h5diff/testfiles/h5diff_attr1.h5 index c44066b..4cea743 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_attr1.h5 and b/tools/test/h5diff/testfiles/h5diff_attr1.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_attr2.h5 b/tools/test/h5diff/testfiles/h5diff_attr2.h5 index 5de3303..3ea3302 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_attr2.h5 and b/tools/test/h5diff/testfiles/h5diff_attr2.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_attr3.h5 b/tools/test/h5diff/testfiles/h5diff_attr3.h5 new file mode 100644 index 0000000..631845d Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_attr3.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_tmp2.txt b/tools/test/h5diff/testfiles/h5diff_tmp2.txt deleted file mode 100644 index a2d6da6..0000000 --- a/tools/test/h5diff/testfiles/h5diff_tmp2.txt +++ /dev/null @@ -1,13 +0,0 @@ -dataset: and -1599 differences found -dataset: and -8 differences found -dataset: and -1845 differences found -dataset: and -10 differences found --------------------------------- -Some objects are not comparable --------------------------------- -Use -c for a list of objects. -EXIT CODE: 1 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index d9cb857..c464f94 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -82,6 +82,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_types.h5 $SRC_H5DIFF_TESTFILES/h5diff_dtypes.h5 $SRC_H5DIFF_TESTFILES/h5diff_attr1.h5 $SRC_H5DIFF_TESTFILES/h5diff_attr2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_attr3.h5 $SRC_H5DIFF_TESTFILES/h5diff_dset1.h5 $SRC_H5DIFF_TESTFILES/h5diff_dset2.h5 $SRC_H5DIFF_TESTFILES/h5diff_hyper1.h5 @@ -118,8 +119,6 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 $SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 -$SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.reference.h5 -$SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.output.h5 $SRC_H5DIFF_TESTFILES/diff_strings1.h5 $SRC_H5DIFF_TESTFILES/diff_strings2.h5 $SRC_TOOLS_TESTFILES/tvlstr.h5 @@ -336,7 +335,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_710.txt $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_8625.txt -$SRC_H5DIFF_TESTFILES/h5diff_tmp2.txt +$SRC_H5DIFF_TESTFILES/h5diff_8639.txt $SRC_H5DIFF_TESTFILES/h5diff_v1.txt $SRC_H5DIFF_TESTFILES/h5diff_v2.txt $SRC_H5DIFF_TESTFILES/h5diff_v3.txt @@ -818,8 +817,6 @@ TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # 7. attributes # ############################################################################## TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 -# temporary test to verify HDFFV-8639 -TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5 # ################################################## # attrs with verbose option level @@ -1143,6 +1140,8 @@ TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5 TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy # test to verify HDFFV-8625 TOOLTEST h5diff_8625.txt -v --enable-error-stack h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group/Compound_dset1 /group_copy/Compound_dset3 +# test to verify HDFFV-8639 +TOOLTEST h5diff_8639.txt -v h5diff_attr3.h5 h5diff_attr2.h5 /g1 TOOLTEST h5diff_vlstr.txt -v tvlstr.h5 tvlstr2.h5 # ############################################################################## -- cgit v0.12 From db1add7e22be9ec8e44aba29b3988e6c1826fe25 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Jan 2018 10:19:21 -0600 Subject: HDFFV-8745 update release note --- release_docs/RELEASE.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3882c4c..17ec3ac 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -268,6 +268,21 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5diff + + h5diff seg faulted if comparing VL strings against fixed strigs. + + Reworked solution for HDFFV-8625 and 8639. Implemented the check + for string objects of same type in the diff_can_type function by + adding an if(tclass1 == H5T_STRING) block. This if block moves the + same check that was added for attributes to this function, which is + used by all object types. This function also handles complex type + structures. + Also added a new test file in h5diffgenttest for testing this issue + and removed the temporary files used in the test scripts. + + (ADB - 2018/01/04, HDFFV-8745) + - h5repack h5repack failed to copy a dataset with existing filter. -- cgit v0.12 From db918c06b549ef8dc8d106d69da277bcf8d0aa11 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Jan 2018 10:44:02 -0600 Subject: HDFFV-8745 fix typos --- release_docs/RELEASE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 17ec3ac..b52a46f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -270,9 +270,9 @@ Bug Fixes since HDF5-1.10.1 release ----- - h5diff - h5diff seg faulted if comparing VL strings against fixed strigs. + h5diff seg faulted if comparing VL strings against fixed strings. - Reworked solution for HDFFV-8625 and 8639. Implemented the check + Reworked solution for HDFFV-8625 and HDFFV-8639. Implemented the check for string objects of same type in the diff_can_type function by adding an if(tclass1 == H5T_STRING) block. This if block moves the same check that was added for attributes to this function, which is -- cgit v0.12 From d01ad2a94ae5643090e9443dfb0ee69657d894c2 Mon Sep 17 00:00:00 2001 From: hdftest Date: Fri, 5 Jan 2018 08:50:10 -0600 Subject: Snapshot version 1.11 release 1 --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- java/src/hdf/hdf5lib/H5.java | 4 ++-- java/test/TestH5.java | 4 ++-- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- .../testfiles/h5repack_layout.h5-plugin_version_test.ddl | 14 +++++++------- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.txt b/README.txt index 6820267..e9985c2 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.0 currently under development +HDF5 version 1.11.1 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index ae5dd90..c4725c3 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.11.0" +PROJECT_NUMBER = "1.11.1" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index e7b73b3..011ee7b 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set (CTEST_SOURCE_VERSION "1.11.0") +set (CTEST_SOURCE_VERSION "1.11.1") set (CTEST_SOURCE_VERSEXT "") ############################################################################## diff --git a/configure.ac b/configure.ac index 5562d5c..7a8ccbf 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.11.0], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.11.1], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 78ebbe2..5285ac5 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -214,7 +214,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * exception handlers to print out the HDF-5 error stack. *
* - * @version HDF5 1.11.0
+ * @version HDF5 1.11.1
* See also: hdf.hdf5lib.HDFArray
* hdf.hdf5lib.HDF5Constants
* hdf.hdf5lib.HDF5CDataTypes
@@ -237,7 +237,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { 1, 11, 0 }; + public final static int LIB_VERSION[] = { 1, 11, 1 }; public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 413e58d..a45984e 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -162,7 +162,7 @@ public class TestH5 { */ @Test public void testH5get_libversion() { - int libversion[] = { 1, 11, 0 }; + int libversion[] = { 1, 11, 1 }; try { H5.H5get_libversion(libversion); @@ -184,7 +184,7 @@ public class TestH5 { */ @Test public void testH5check_version() { - int majnum = 1, minnum = 11, relnum = 0; + int majnum = 1, minnum = 11, relnum = 1; try { H5.H5check_version(majnum, minnum, relnum); diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3882c4c..d022526 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.0 currently under development +HDF5 version 1.11.1 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 58d0cd1..d08e6b0 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,10 +93,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 11 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 1 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.11.0" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.11.1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 283b44c..0821257 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -11,7 +11,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -33,7 +33,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -55,7 +55,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -77,7 +77,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -99,7 +99,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -121,7 +121,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { @@ -143,7 +143,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 0 } + PARAMS { 9 1 11 1 } } } FILLVALUE { -- cgit v0.12 From bee148a99501e9aa582e93bfb880648a905f4301 Mon Sep 17 00:00:00 2001 From: hdftest Date: Fri, 5 Jan 2018 10:09:10 -0600 Subject: Snapshot version 1.11 release 2 --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 4 ++-- java/src/hdf/hdf5lib/H5.java | 4 ++-- java/test/TestH5.java | 4 ++-- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- .../testfiles/h5repack_layout.h5-plugin_version_test.ddl | 14 +++++++------- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.txt b/README.txt index e9985c2..759e412 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.1 currently under development +HDF5 version 1.11.2 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index c4725c3..56ea1e6 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.11.1" +PROJECT_NUMBER = "1.11.2" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 011ee7b..d32a6bdb 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set (CTEST_SOURCE_VERSION "1.11.1") +set (CTEST_SOURCE_VERSION "1.11.2") set (CTEST_SOURCE_VERSEXT "") ############################################################################## diff --git a/configure.ac b/configure.ac index 7a8ccbf..6bd650f 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.11.1], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.11.2], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) @@ -48,7 +48,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where a ## ## By default, it is enabled. Users can configure with ## --disable-maintainer-mode to prevent running the autotools. -AM_MAINTAINER_MODE([enable]) +AM_MAINTAINER_MODE([disable]) ## ---------------------------------------------------------------------- ## Set prefix default (install directory) to a directory in the build area. diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 5285ac5..20aa634 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -214,7 +214,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * exception handlers to print out the HDF-5 error stack. *
* - * @version HDF5 1.11.1
+ * @version HDF5 1.11.2
* See also: hdf.hdf5lib.HDFArray
* hdf.hdf5lib.HDF5Constants
* hdf.hdf5lib.HDF5CDataTypes
@@ -237,7 +237,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { 1, 11, 1 }; + public final static int LIB_VERSION[] = { 1, 11, 2 }; public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; diff --git a/java/test/TestH5.java b/java/test/TestH5.java index a45984e..b922583 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -162,7 +162,7 @@ public class TestH5 { */ @Test public void testH5get_libversion() { - int libversion[] = { 1, 11, 1 }; + int libversion[] = { 1, 11, 2 }; try { H5.H5get_libversion(libversion); @@ -184,7 +184,7 @@ public class TestH5 { */ @Test public void testH5check_version() { - int majnum = 1, minnum = 11, relnum = 1; + int majnum = 1, minnum = 11, relnum = 2; try { H5.H5check_version(majnum, minnum, relnum); diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d022526..dac5876 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.11.1 currently under development +HDF5 version 1.11.2 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index d08e6b0..9157366 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,10 +93,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 11 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 1 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 2 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.11.1" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.11.2" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 0821257..5a1ebe7 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -11,7 +11,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -33,7 +33,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -55,7 +55,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -77,7 +77,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -99,7 +99,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -121,7 +121,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { @@ -143,7 +143,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 11 1 } + PARAMS { 9 1 11 2 } } } FILLVALUE { -- cgit v0.12 From 2a1a2c59937657cf318232e6bfde456cbd297ef1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 Jan 2018 11:45:44 -0600 Subject: HDDFV-10361 combine duplicated prefix utility functions --- src/H5Dvirtual.c | 319 +++------------------------ src/H5Fint.c | 331 +++++++++++++++++++++++++--- src/H5Fprivate.h | 6 + src/H5Lexternal.c | 306 ++++--------------------- tools/test/h5dump/errfiles/tall-1.err | 5 +- tools/test/h5dump/errfiles/tall-2A.err | 5 +- tools/test/h5dump/errfiles/tall-2A0.err | 5 +- tools/test/h5dump/errfiles/tall-2B.err | 5 +- tools/test/h5dump/errfiles/textlink.err | 10 +- tools/test/h5dump/errfiles/torderlinks1.err | 5 +- tools/test/h5dump/errfiles/torderlinks2.err | 5 +- 11 files changed, 415 insertions(+), 587 deletions(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 306fe62..9e1ebe8 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -147,7 +147,7 @@ H5FL_DEFINE(H5O_storage_virtual_name_seg_t); H5FL_DEFINE_STATIC(H5D_virtual_held_file_t); - + /*------------------------------------------------------------------------- * Function: H5D_virtual_check_mapping_pre * @@ -217,7 +217,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_check_mapping_pre() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_check_mapping_post * @@ -285,7 +285,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_check_mapping_post() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_update_min_dims * @@ -344,7 +344,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_update_min_dims() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_check_min_dims * @@ -389,7 +389,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_check_min_dims() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_copy_layout * @@ -553,7 +553,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy_layout() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_reset_layout * @@ -637,7 +637,7 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_reset_layout() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_copy * @@ -683,7 +683,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_delete * @@ -733,255 +733,6 @@ done: } /* end H5D__virtual_delete */ -/*-------------------------------------------------------------------------- - * Function: H5D__virtual_build_name - * - * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME - * - * Return: Non-negative on success/Negative on failure - *--------------------------------------------------------------------------*/ -static herr_t -H5D__virtual_build_name(char *prefix, char *file_name, char **full_name/*out*/) -{ - size_t prefix_len; /* length of prefix */ - size_t fname_len; /* Length of external link file name */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - prefix_len = HDstrlen(prefix); - fname_len = HDstrlen(file_name); - - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - - /* Compose the full file name */ - HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, - (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_build_name() */ - - -/*-------------------------------------------------------------------------- - * Function: H5D_getenv_prefix_name -- - * - * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, - * which is separated by the environment delimiter. - * env_prefix is modified to point to the remaining pathnames - * in the list. - * - * Return: A pointer to a pathname ---------------------------------------------------------------------------*/ -static char * -H5D_getenv_prefix_name(char **env_prefix/*in,out*/) -{ - char *retptr=NULL; - char *strret=NULL; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { - retptr = *env_prefix; - *env_prefix = strret; - } else { - retptr = *env_prefix; - *env_prefix = strret + 1; - *strret = '\0'; - } - - FUNC_LEAVE_NOAPI(retptr) -} /* end H5D_getenv_prefix_name() */ - -/*------------------------------------------------------------------------- - * Function: H5D__virtual_open_file - * - * Purpose: Attempts to open a source dataset file. - * - * Return: Non-negative on success/Negative on failure - *------------------------------------------------------------------------- - */ -static H5F_t * -H5D__virtual_open_file(hid_t plist_id, const H5F_t *vdset_file, - const char *file_name, - hid_t fapl_id, hid_t dxpl_id) -{ - H5F_t *src_file = NULL; /* Source file */ - H5F_t *ret_value = NULL; /* Actual return value */ - char *full_name = NULL; /* File name with prefix */ - char *my_prefix = NULL; /* Library's copy of the prefix */ - unsigned intent; /* File access permissions */ - char *actual_file_name = NULL; /* Virtual file's actual name */ - char *temp_file_name = NULL; /* Temporary pointer to file name */ - size_t temp_file_name_len; /* Length of temporary file name */ - - FUNC_ENTER_STATIC - - /* Simplify intent flags for open calls */ - intent = H5F_INTENT(vdset_file); - intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); - - /* Copy the file name to use */ - if(NULL == (temp_file_name = H5MM_strdup(file_name))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - temp_file_name_len = HDstrlen(temp_file_name); - - /* target file_name is an absolute pathname: see RM for detailed description */ - if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - char *ptr; - - H5E_clear_stack(NULL); - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(file_name, ptr) - HDassert(ptr); - - /* Increment past delimiter */ - ptr++; - - /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - else if(H5_CHECK_ABS_DRIVE(file_name)) { - /* Try opening file */ - if(NULL == (src_file = H5F_open(file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - - H5E_clear_stack(NULL); - - /* strip ":" */ - HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - - /* try searching from paths set in the environment variable */ - if(src_file == NULL) { - char *env_prefix; - - if(NULL != (env_prefix = HDgetenv("HDF5_VDS_PREFIX"))) { - char *tmp_env_prefix, *saved_env; - - if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - while((tmp_env_prefix) && (*tmp_env_prefix)) { - char *out_prefix_name; - - out_prefix_name = H5D_getenv_prefix_name(&tmp_env_prefix/*in,out*/); - if(out_prefix_name && (*out_prefix_name)) { - if(H5D__virtual_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { - saved_env = (char *)H5MM_xfree(saved_env); - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - } /* end if */ - - src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); - full_name = (char *)H5MM_xfree(full_name); - if(src_file != NULL) - break; - H5E_clear_stack(NULL); - } /* end if */ - } /* end while */ - saved_env = (char *)H5MM_xfree(saved_env); - } /* end if */ - } /* end if */ - - /* try searching from property list */ - if(src_file == NULL) { - size_t size = 0; - H5E_BEGIN_TRY { - size = H5Pget_virtual_prefix(plist_id, NULL, 0); - } H5E_END_TRY; - if(size <= 0) - my_prefix = NULL; - else { - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (my_prefix = (char *)H5MM_malloc(size + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer") - if(H5Pget_virtual_prefix(plist_id, my_prefix, size+1) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vds prefix") - if(my_prefix) { - if(H5D__virtual_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - my_prefix = (char *)H5MM_xfree(my_prefix); - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } - } /* end if */ - } /* end if */ - - /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ - if(src_file == NULL) { - char *vdspath; - - if(NULL != (vdspath = H5F_EXTPATH(vdset_file))) { - if(H5D__virtual_build_name(vdspath, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try the relative file_name stored in temp_file_name */ - if(src_file == NULL) { - if(NULL == (src_file = H5F_open(temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - } /* end if */ - - /* try the 'resolved' name for the virtual file */ - if(src_file == NULL) { - char *ptr = NULL; - - /* Copy resolved file name */ - if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(vdset_file)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(actual_file_name, ptr) - if(!ptr) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - - /* Truncate filename portion from actual file name path */ - *ptr = '\0'; - - /* Build new file name for the external file */ - if(H5D__virtual_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't prepend prefix to filename") - actual_file_name = (char *)H5MM_xfree(actual_file_name); - - /* Try opening with the resolved name */ - if(NULL == (src_file = H5F_open(full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENFILE, NULL, "unable to open vds file, vds file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - - /* Success */ - ret_value = src_file; -done: - if((NULL == ret_value) && src_file) - if(H5F_try_close(src_file, NULL) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, NULL, "can't close source file") - if(my_prefix) - my_prefix = (char *)H5MM_xfree(my_prefix); - if(full_name) - full_name = (char *)H5MM_xfree(full_name); - if(temp_file_name) - temp_file_name = (char *)H5MM_xfree(temp_file_name); - if(actual_file_name) - actual_file_name = (char *)H5MM_xfree(actual_file_name); - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__virtual_open_file() */ - - /*------------------------------------------------------------------------- * Function: H5D__virtual_open_source_dset * @@ -1000,13 +751,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) { H5F_t *src_file = NULL; /* Source file */ - char *vds_prefix = NULL; /* Source file vds_prefix */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ H5G_loc_t src_root_loc; /* Object location of source file root group */ herr_t ret_value = SUCCEED; /* Return value */ - char *full_name = NULL; /* File name with prefix */ - unsigned intent; /* File access permissions */ hid_t plist_id = -1; /* Property list pointer */ + unsigned intent; /* File access permissions */ FUNC_ENTER_STATIC @@ -1019,9 +768,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { - if((plist_id = H5D_get_access_plist(vdset)) < 0) + if((plist_id = H5D_get_access_plist((H5D_t *)vdset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist") - if(NULL == (src_file = H5D__virtual_open_file(plist_id, vdset->oloc.file, source_dset->file_name, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + intent = H5F_INTENT(vdset->oloc.file); + if(NULL == (src_file = H5F_prefix_open_file(plist_id, vdset->oloc.file, H5D_ACS_VDS_PREFIX_NAME, source_dset->file_name, intent, + vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -1062,13 +813,13 @@ done: H5Pclose(plist_id); /* Close source file */ if(src_file_open) - if(H5F_try_close(src_file, NULL) < 0) + if(H5F_efc_close(vdset->oloc.file, src_file) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_open_source_dset() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_reset_source_dset * @@ -1155,7 +906,7 @@ H5D__virtual_reset_source_dset(H5O_storage_virtual_ent_t *virtual_ent, FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_reset_source_dset() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_str_append * @@ -1231,7 +982,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5D__virtual_str_append() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_parse_source_name * @@ -1347,7 +1098,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_parse_source_name() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_copy_parsed_name * @@ -1404,7 +1155,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy_parsed_name() */ - + /*------------------------------------------------------------------------- * Function: H5D_virtual_free_parsed_name * @@ -1437,7 +1188,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_virtual_free_parsed_name() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_build_source_name * @@ -1539,7 +1290,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_build_source_name() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_set_extent_unlim * @@ -1967,7 +1718,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_set_extent_unlim() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_init_all * @@ -2191,7 +1942,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_init_all() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_init * @@ -2286,7 +2037,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_init() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_is_space_alloc * @@ -2318,7 +2069,7 @@ H5D__virtual_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_is_space_alloc() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_pre_io * @@ -2559,7 +2310,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_pre_io() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_post_io * @@ -2609,7 +2360,7 @@ H5D__virtual_post_io(H5O_storage_virtual_t *storage) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_post_io() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_read_one * @@ -2666,7 +2417,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_read_one() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_read * @@ -2799,7 +2550,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_read() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_write_one * @@ -2858,7 +2609,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_write_one() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_write * @@ -2935,7 +2686,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_write() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_flush * @@ -2983,7 +2734,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_flush() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_hold_source_dset_files * @@ -3061,7 +2812,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_hold_source_dset_files() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_refresh_source_dset * @@ -3101,7 +2852,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_refresh_source_dsets() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_refresh_source_dsets * @@ -3154,7 +2905,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_refresh_source_dsets() */ - + /*------------------------------------------------------------------------- * Function: H5D__virtual_release_source_dset_files * diff --git a/src/H5Fint.c b/src/H5Fint.c index 8212eb5..b135ce1 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -30,6 +30,7 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ @@ -98,7 +99,7 @@ H5FL_DEFINE(H5F_t); /* Declare a free list to manage the H5F_file_t struct */ H5FL_DEFINE(H5F_file_t); - + /*------------------------------------------------------------------------- * Function: H5F_get_access_plist * @@ -213,7 +214,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_access_plist() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_obj_count * @@ -241,7 +242,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_obj_count() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_obj_ids * @@ -268,7 +269,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_obj_ids() */ - + /*--------------------------------------------------------------------------- * Function: H5F_get_objects * @@ -370,7 +371,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_objects() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_objects_cb * @@ -479,7 +480,265 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_objects_cb() */ - +/*-------------------------------------------------------------------------- + * Function: H5F_build_name + * + * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME + * + * Return: Non-negative on success/Negative on failure + *--------------------------------------------------------------------------*/ +herr_t +H5F_build_name(char *prefix, char *file_name, char **full_name/*out*/) +{ + size_t prefix_len; /* length of prefix */ + size_t fname_len; /* Length of external link file name */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + prefix_len = HDstrlen(prefix); + fname_len = HDstrlen(file_name); + + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") + + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F_build_name() */ + + +/*-------------------------------------------------------------------------- + * Function: H5F_getenv_prefix_name -- + * + * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, + * which is separated by the environment delimiter. + * env_prefix is modified to point to the remaining pathnames + * in the list. + * + * Return: A pointer to a pathname +--------------------------------------------------------------------------*/ +char * +H5F_getenv_prefix_name(char **env_prefix/*in,out*/) +{ + char *retptr=NULL; + char *strret=NULL; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); + if (strret == NULL) { + retptr = *env_prefix; + *env_prefix = strret; + } else { + retptr = *env_prefix; + *env_prefix = strret + 1; + *strret = '\0'; + } + + FUNC_LEAVE_NOAPI(retptr) +} /* end H5F_getenv_prefix_name() */ + +/*------------------------------------------------------------------------- + * Function: H5F_prefix_open_file + * + * Purpose: Attempts to open a dataset file. + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +H5F_t * +H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, + const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id) +{ + H5F_t *src_file = NULL; /* Source file */ + H5F_t *ret_value = NULL; /* Actual return value */ + char *full_name = NULL; /* File name with prefix */ + char *my_prefix = NULL; /* Library's copy of the prefix */ + char *actual_file_name = NULL; /* File's actual name */ + char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ + + FUNC_ENTER_STATIC + + /* Simplify intent flags for open calls */ + file_intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); + + /* Copy the file name to use */ + if(NULL == (temp_file_name = H5MM_strdup(file_name))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); + + /* target file_name is an absolute pathname: see RM for detailed description */ + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + char *ptr; + + H5E_clear_stack(NULL); + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(file_name, ptr) + HDassert(ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ + if(NULL == (src_file = H5F_efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + + H5E_clear_stack(NULL); + + /* strip ":" */ + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; + } /* end if */ + } /* end if */ + + /* try searching from paths set in the environment variable */ + if(src_file == NULL) { + char *env_prefix; + + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + env_prefix = HDgetenv("HDF5_VDS_PREFIX"); + else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0) + env_prefix = HDgetenv("HDF5_EXT_PREFIX"); + else + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "prefix name is not sensible") + if(NULL != env_prefix) { + char *tmp_env_prefix, *saved_env; + + if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + while((tmp_env_prefix) && (*tmp_env_prefix)) { + char *out_prefix_name; + + out_prefix_name = H5F_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + if(out_prefix_name && (*out_prefix_name)) { + if(H5F_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + saved_env = (char *)H5MM_xfree(saved_env); + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + } /* end if */ + + src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + full_name = (char *)H5MM_xfree(full_name); + if(src_file != NULL) + break; + H5E_clear_stack(NULL); + } /* end if */ + } /* end while */ + saved_env = (char *)H5MM_xfree(saved_env); + } /* end if */ + } /* end if */ + + /* try searching from property list */ + if(src_file == NULL) { + ssize_t size = 0; + H5E_BEGIN_TRY { + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + size = H5Pget_virtual_prefix(plist_id, NULL, 0); + else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0) + size = H5Pget_elink_prefix(plist_id, NULL, 0); + } H5E_END_TRY; + if(size <= 0) + my_prefix = NULL; + else { + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (my_prefix = (char *)H5MM_malloc((size_t)size + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer") + if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0) + size = H5Pget_virtual_prefix(plist_id, my_prefix, (size_t)size+1); + else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0) + size = H5Pget_elink_prefix(plist_id, my_prefix, (size_t)size+1); + if(size < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file prefix") + if(my_prefix) { + if(H5F_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + my_prefix = (char *)H5MM_xfree(my_prefix); + if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } + } + } + + /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ + if(src_file == NULL) { + char *dspath; + + if(NULL != (dspath = H5F_EXTPATH(primary_file))) { + if(H5F_build_name(dspath, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + } /* end if */ + + /* try the relative file_name stored in temp_file_name */ + if(src_file == NULL) { + if(NULL == (src_file = H5F_efc_open(primary_file, temp_file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + H5E_clear_stack(NULL); + } /* end if */ + + /* try the 'resolved' name for the virtual file */ + if(src_file == NULL) { + char *ptr = NULL; + + /* Copy resolved file name */ + if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(primary_file)))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "can't duplicate resolved file name string") + + /* get last component of file_name */ + H5_GET_LAST_DELIMITER(actual_file_name, ptr) + if(!ptr) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file, file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + + /* Truncate filename portion from actual file name path */ + *ptr = '\0'; + + /* Build new file name for the external file */ + if(H5F_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + /* Try opening with the resolved name */ + if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file, file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) + full_name = (char *)H5MM_xfree(full_name); + } /* end if */ + + /* Success */ + ret_value = src_file; +done: + if((NULL == ret_value) && src_file) + if(H5F_efc_close(primary_file, src_file) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "can't close source file") + if(my_prefix) + my_prefix = (char *)H5MM_xfree(my_prefix); + if(full_name) + full_name = (char *)H5MM_xfree(full_name); + if(temp_file_name) + temp_file_name = (char *)H5MM_xfree(temp_file_name); + if(actual_file_name) + actual_file_name = (char *)H5MM_xfree(actual_file_name); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F_prefix_open_file() */ + + /*------------------------------------------------------------------------- * Function: H5F__is_hdf5 * @@ -528,7 +787,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__is_hdf5() */ - + /*------------------------------------------------------------------------- * Function: H5F_new * @@ -792,7 +1051,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_new() */ - + /*------------------------------------------------------------------------- * Function: H5F__dest * @@ -1051,7 +1310,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_dest() */ - + /*------------------------------------------------------------------------- * Function: H5F_open * @@ -1469,7 +1728,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_open() */ - + /*------------------------------------------------------------------------- * Function: H5F_flush_phase1 * @@ -1506,7 +1765,7 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush_phase1() */ - + /*------------------------------------------------------------------------- * Function: H5F__flush_phase2 * @@ -1568,7 +1827,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush_phase2() */ - + /*------------------------------------------------------------------------- * Function: H5F__flush * @@ -1600,7 +1859,7 @@ H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush() */ - + /*------------------------------------------------------------------------- * Function: H5F_close * @@ -1661,7 +1920,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_close() */ - + /*------------------------------------------------------------------------- * Function: H5F_try_close * @@ -1834,7 +2093,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_try_close() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_id * @@ -1870,7 +2129,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_id() */ - + /*------------------------------------------------------------------------- * Function: H5F_incr_nopen_objs * @@ -1891,7 +2150,7 @@ H5F_incr_nopen_objs(H5F_t *f) FUNC_LEAVE_NOAPI(++f->nopen_objs) } /* end H5F_incr_nopen_objs() */ - + /*------------------------------------------------------------------------- * Function: H5F_decr_nopen_objs * @@ -1912,7 +2171,7 @@ H5F_decr_nopen_objs(H5F_t *f) FUNC_LEAVE_NOAPI(--f->nopen_objs) } /* end H5F_decr_nopen_objs() */ - + /*------------------------------------------------------------------------- * Function: H5F_build_actual_name * @@ -2034,7 +2293,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_build_actual_name() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_encode_len * @@ -2071,7 +2330,7 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp/*in,out*/, haddr_t addr) FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_encode_len() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_encode * @@ -2095,7 +2354,7 @@ H5F_addr_encode(const H5F_t *f, uint8_t **pp/*in,out*/, haddr_t addr) FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_encode() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_decode_len * @@ -2159,7 +2418,7 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_decode_len() */ - + /*------------------------------------------------------------------------- * Function: H5F_addr_decode * @@ -2186,7 +2445,7 @@ H5F_addr_decode(const H5F_t *f, const uint8_t **pp/*in,out*/, haddr_t *addr_p/*o FUNC_LEAVE_NOAPI_VOID } /* end H5F_addr_decode() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_grp_btree_shared * @@ -2212,7 +2471,7 @@ H5F_set_grp_btree_shared(H5F_t *f, H5UC_t *rc) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_grp_btree_shared() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_sohm_addr * @@ -2237,7 +2496,7 @@ H5F_set_sohm_addr(H5F_t *f, haddr_t addr) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_sohm_addr() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_sohm_vers * @@ -2262,7 +2521,7 @@ H5F_set_sohm_vers(H5F_t *f, unsigned vers) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_sohm_vers() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_sohm_nindexes * @@ -2287,7 +2546,7 @@ H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_sohm_nindexes() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_store_msg_crt_idx * @@ -2312,7 +2571,7 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_store_msg_crt_idx() */ - + /*------------------------------------------------------------------------- * Function: H5F_get_file_image * @@ -2428,7 +2687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_get_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5F_track_metadata_read_retries * @@ -2476,7 +2735,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_track_metadata_read_retries() */ - + /*------------------------------------------------------------------------- * Function: H5F_set_retries * @@ -2512,7 +2771,7 @@ H5F_set_retries(H5F_t *f) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_retries() */ - + /*------------------------------------------------------------------------- * Function: H5F_object_flush_cb * @@ -2542,7 +2801,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_object_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5F__set_base_addr * @@ -2569,7 +2828,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__set_base_addr() */ - + /*------------------------------------------------------------------------- * Function: H5F__set_eoa * @@ -2596,7 +2855,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__set_eoa() */ - + /*------------------------------------------------------------------------- * Function: H5F__set_paged_aggr * @@ -2625,7 +2884,7 @@ done: } /* end H5F__set_paged_aggr() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5F_set_coll_md_read * @@ -2650,7 +2909,7 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr) } /* H5F_set_coll_md_read() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5F_set_latest_flags * diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 96b8e36..ba94069 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -863,6 +863,12 @@ H5_DLL H5F_t *H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file); +/* File prefix routines */ +H5_DLL herr_t H5F_build_name(char *prefix, char *file_name, char **full_name); +H5_DLL char * H5F_getenv_prefix_name(char **env_prefix); +H5F_t *H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, + const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id); + /* Global heap CWFS routines */ H5_DLL herr_t H5F_cwfs_add(H5F_t *f, struct H5HG_heap_t *heap); H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr); diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index b4a173f..bf0a044 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -15,7 +15,7 @@ /* Module Setup */ /****************/ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5Lmodule.h" /* This source code file is part of the H5L module */ @@ -25,8 +25,9 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ #include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ +#include "H5Iprivate.h" /* IDs */ #include "H5Lpkg.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opublic.h" /* File objects */ @@ -79,7 +80,7 @@ static ssize_t H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const voi /* Default External Link link class */ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - H5L_TYPE_EXTERNAL, /* Link type id number */ + H5L_TYPE_EXTERNAL, /* Link type id number */ "external", /* Link name for debugging */ NULL, /* Creation callback */ NULL, /* Move callback */ @@ -89,82 +90,10 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ H5L_extern_query /* Query callback */ }}; - - -/*-------------------------------------------------------------------------- - * Function: H5L_getenv_prefix_name -- - * - * Purpose: Get the first pathname in the list of pathnames stored in ENV_PREFIX, - * which is separated by the environment delimiter. - * ENV_PREFIX is modified to point to the remaining pathnames - * in the list. - * - * Return: A pointer to a pathname - * - * Programmer: Vailin Choi, April 2, 2008 - * ---------------------------------------------------------------------------*/ -static char * -H5L_getenv_prefix_name(char **env_prefix/*in,out*/) -{ - char *retptr=NULL; - char *strret=NULL; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { - retptr = *env_prefix; - *env_prefix = strret; - } else { - retptr = *env_prefix; - *env_prefix = strret + 1; - *strret = '\0'; - } - - FUNC_LEAVE_NOAPI(retptr) -} /* end H5L_getenv_prefix_name() */ - - -/*-------------------------------------------------------------------------- - * Function: H5L_build_name - * - * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi, April 2, 2008 - * ---------------------------------------------------------------------------*/ -static herr_t -H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) -{ - size_t prefix_len; /* length of prefix */ - size_t fname_len; /* Length of external link file name */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - prefix_len = HDstrlen(prefix); - fname_len = HDstrlen(file_name); - - /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - - /* Compose the full file name */ - HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, - (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_build_name() */ - - /*------------------------------------------------------------------------- - * Function: H5L_extern_traverse + * Function: H5L_extern_traverse * - * Purpose: Default traversal function for external links. This can + * Purpose: Default traversal function for external links. This can * be overridden using H5Lregister(). * * Given a filename and path packed into the link udata, @@ -173,25 +102,25 @@ done: * link access property list, appends that prefix to the * filename being opened. * - * Return: ID of the opened object on success/Negative on failure + * Return: ID of the opened object on success/Negative on failure * - * Programmer: James Laird + * Programmer: James Laird * Monday, July 10, 2006 * Modifications: - * Vailin Choi, April 2, 2008 - * Add handling to search for the target file - * See description in RM: H5Lcreate_external + * Vailin Choi, April 2, 2008 + * Add handling to search for the target file + * See description in RM: H5Lcreate_external * - * Vailin Choi; Sept. 12th, 2008; bug #1247 - * Retrieve the file access property list identifer that is set - * for link access property via H5Pget_elink_fapl(). - * If the return value is H5P_DEFAULT, the parent's file access - * property is used to H5F_open() the target file; - * Otherwise, the file access property retrieved from H5Pget_elink_fapl() - * is used to H5F_open() the target file. + * Vailin Choi; Sept. 12th, 2008; bug #1247 + * Retrieve the file access property list identifer that is set + * for link access property via H5Pget_elink_fapl(). + * If the return value is H5P_DEFAULT, the parent's file access + * property is used to H5F_open() the target file; + * Otherwise, the file access property retrieved from H5Pget_elink_fapl() + * is used to H5F_open() the target file. * - * Vailin Choi; Nov 2010 - * Free memory pointed to by tmp_env_prefix for HDF5_EXT_PREFIX case. + * Vailin Choi; Nov 2010 + * Free memory pointed to by tmp_env_prefix for HDF5_EXT_PREFIX case. * *------------------------------------------------------------------------- */ @@ -200,13 +129,11 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const void *_udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) { H5P_genplist_t *plist; /* Property list pointer */ - char *my_prefix; /* Library's copy of the prefix */ H5G_loc_t root_loc; /* Location of root group in external file */ H5G_loc_t loc; /* Location of object */ - H5F_t *ext_file = NULL; /* File struct for external file */ + H5F_t *ext_file = NULL; /* File struct for external file */ const uint8_t *p = (const uint8_t *)_udata; /* Pointer into external link buffer */ const char *file_name; /* Name of file containing external link's object */ - char *full_name = NULL; /* File name with prefix */ const char *obj_name; /* Name external link's object */ size_t fname_len; /* Length of external link file name */ unsigned intent; /* File access permissions */ @@ -215,11 +142,8 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, hid_t ext_obj = -1; /* ID for external link's object */ char *parent_group_name = NULL;/* Temporary pointer to group name */ char local_group_name[H5L_EXT_TRAVERSE_BUF_SIZE]; /* Local buffer to hold group name */ - char *temp_file_name = NULL; /* Temporary pointer to file name */ - size_t temp_file_name_len; /* Length of temporary file name */ - char *actual_file_name = NULL; /* Parent file's actual name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ - H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ + H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -266,7 +190,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, intent = H5F_INTENT(loc.oloc->file); if((fapl_id == H5P_DEFAULT) && ((fapl_id = H5F_get_access_plist(loc.oloc->file, FALSE)) < 0)) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get parent's file access property list") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get parent's file access property list") /* Get callback_info */ if(H5P_get(plist, H5L_ACS_ELINK_CB_NAME, &cb_info) < 0) @@ -274,7 +198,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Get file access property list */ if(NULL == (fa_plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Make callback if it exists */ if(cb_info.func) { @@ -314,143 +238,11 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Set file close degree for new file to "weak" */ if(H5P_set(fa_plist, H5F_ACS_CLOSE_DEGREE_NAME, &fc_degree) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") - - /* - * Start searching for the target file - */ - - /* Simplify intent flags for open calls */ - intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); - - /* Copy the file name to use */ - if(NULL == (temp_file_name = H5MM_strdup(file_name))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - temp_file_name_len = HDstrlen(temp_file_name); - - /* target file_name is an absolute pathname: see RM for detailed description */ - if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { - /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - char *ptr; - - H5E_clear_stack(NULL); - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(file_name, ptr) - HDassert(ptr); - - /* Increment past delimiter */ - ptr++; - - /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - else if(H5_CHECK_ABS_DRIVE(file_name)) { - /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { - - H5E_clear_stack(NULL); - - /* strip ":" */ - HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); - temp_file_name[temp_file_name_len - 1] = '\0'; - } /* end if */ - } /* end if */ - - /* try searching from paths set in the environment variable */ - if(ext_file == NULL) { - char *env_prefix; - - if(NULL != (env_prefix = HDgetenv("HDF5_EXT_PREFIX"))) { - char *tmp_env_prefix, *saved_env; - - if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix))) - HGOTO_ERROR(H5E_LINK, H5E_NOSPACE, FAIL, "memory allocation failed") - - while((tmp_env_prefix) && (*tmp_env_prefix)) { - char *out_prefix_name; - - out_prefix_name = H5L_getenv_prefix_name(&tmp_env_prefix/*in,out*/); - if(out_prefix_name && (*out_prefix_name)) { - if(H5L_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { - saved_env = (char *)H5MM_xfree(saved_env); - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - } /* end if */ - - ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); - full_name = (char *)H5MM_xfree(full_name); - if(ext_file != NULL) - break; - H5E_clear_stack(NULL); - } /* end if */ - } /* end while */ - saved_env = (char *)H5MM_xfree(saved_env); - } /* end if */ - } /* end if */ - - /* try searching from property list */ - if(ext_file == NULL) { - if(H5P_peek(plist, H5L_ACS_ELINK_PREFIX_NAME, &my_prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix") - if(my_prefix) { - if(H5L_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */ - if(ext_file == NULL) { - char *extpath; - - if(NULL != (extpath = H5F_EXTPATH(loc.oloc->file))) { - if(H5L_build_name(extpath, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ - } /* end if */ - - /* try the relative file_name stored in temp_file_name */ - if(ext_file == NULL) { - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - H5E_clear_stack(NULL); - } /* end if */ - - /* try the 'resolved' name for the parent file (i.e. the name after symlinks - * were resolved) - */ - if(ext_file == NULL) { - char *ptr = NULL; - - /* Copy resolved file name */ - if(NULL == (actual_file_name = H5MM_strdup(H5F_ACTUAL_NAME(loc.oloc->file)))) - HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't duplicate resolved file name string") - - /* get last component of file_name */ - H5_GET_LAST_DELIMITER(actual_file_name, ptr) - if(!ptr) - HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - - /* Truncate filename portion from actual file name path */ - *ptr = '\0'; - - /* Build new file name for the external file */ - if(H5L_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - - /* Try opening with the resolved name */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) - full_name = (char *)H5MM_xfree(full_name); - } /* end if */ + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") + /* Search for the target file */ + if(NULL == (ext_file = H5F_prefix_open_file(lapl_id, loc.oloc->file, H5L_ACS_ELINK_PREFIX_NAME, file_name, intent, fapl_id, dxpl_id))) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s'", file_name) /* Retrieve the "group location" for the file's root group */ if(H5G_root_loc(ext_file, &root_loc) < 0) @@ -471,10 +263,6 @@ done: HDONE_ERROR(H5E_LINK, H5E_CANTCLOSEFILE, FAIL, "problem closing external file") if(parent_group_name && parent_group_name != local_group_name) parent_group_name = (char *)H5MM_xfree(parent_group_name); - full_name = (char *)H5MM_xfree(full_name); - temp_file_name = (char *)H5MM_xfree(temp_file_name); - actual_file_name = (char *)H5MM_xfree(actual_file_name); - if(ret_value < 0) { /* Close object if it's open and something failed */ if(ext_obj >= 0 && H5I_dec_ref(ext_obj) < 0) @@ -484,20 +272,20 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5L_extern_traverse() */ - + /*------------------------------------------------------------------------- - * Function: H5L_extern_query + * Function: H5L_extern_query * - * Purpose: Default query function for external links. This can + * Purpose: Default query function for external links. This can * be overridden using H5Lregister(). * * Returns the size of the link's user data. If a buffer of * is provided, copies at most buf_size bytes of the udata * into it. * - * Return: Size of buffer on success/Negative on failure + * Return: Size of buffer on success/Negative on failure * - * Programmer: James Laird + * Programmer: James Laird * Monday, July 10, 2006 * *------------------------------------------------------------------------- @@ -534,23 +322,23 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5L_extern_query() */ - + /*------------------------------------------------------------------------- - * Function: H5Lcreate_external + * Function: H5Lcreate_external * - * Purpose: Creates an external link from LINK_NAME to OBJ_NAME. + * Purpose: Creates an external link from LINK_NAME to OBJ_NAME. * * External links are links to objects in other HDF5 files. They * are allowed to "dangle" like soft links internal to a file. * FILE_NAME is the name of the file that OBJ_NAME is is contained * within. If OBJ_NAME is given as a relative path name, the * path will be relative to the root group of FILE_NAME. - * LINK_NAME is interpreted relative to LINK_LOC_ID, which is + * LINK_NAME is interpreted relative to LINK_LOC_ID, which is * either a file ID or a group ID. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 18, 2005 * *------------------------------------------------------------------------- @@ -559,14 +347,14 @@ herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id) { - H5G_loc_t link_loc; /* Group location to create link */ - char *norm_obj_name = NULL; /* Pointer to normalized current name */ + H5G_loc_t link_loc; /* Group location to create link */ + char *norm_obj_name = NULL; /* Pointer to normalized current name */ void *ext_link_buf = NULL; /* Buffer to contain external link */ size_t buf_size; /* Size of buffer to hold external link */ size_t file_name_len; /* Length of file name string */ size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ + hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -575,13 +363,13 @@ H5Lcreate_external(const char *file_name, const char *obj_name, /* Check arguments */ if(!file_name || !*file_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no file name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no file name specified") if(!obj_name || !*obj_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name specified") if(H5G_loc(link_loc_id, &link_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!link_name || !*link_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified") /* Get normalized copy of the link target */ if(NULL == (norm_obj_name = H5G_normalize(obj_name))) @@ -616,7 +404,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_external() */ - + /*------------------------------------------------------------------------- * Function: H5L_register_external * @@ -645,7 +433,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5L_register_external() */ - + /*------------------------------------------------------------------------- * Function: H5Lunpack_elink_val * diff --git a/tools/test/h5dump/errfiles/tall-1.err b/tools/test/h5dump/errfiles/tall-1.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-1.err +++ b/tools/test/h5dump/errfiles/tall-1.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A.err b/tools/test/h5dump/errfiles/tall-2A.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-2A.err +++ b/tools/test/h5dump/errfiles/tall-2A.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A0.err b/tools/test/h5dump/errfiles/tall-2A0.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-2A0.err +++ b/tools/test/h5dump/errfiles/tall-2A0.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2B.err b/tools/test/h5dump/errfiles/tall-2B.err index ab9dbe3..5bfb451 100644 --- a/tools/test/h5dump/errfiles/tall-2B.err +++ b/tools/test/h5dump/errfiles/tall-2B.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/textlink.err b/tools/test/h5dump/errfiles/textlink.err index 95556db..fbbfb12 100644 --- a/tools/test/h5dump/errfiles/textlink.err +++ b/tools/test/h5dump/errfiles/textlink.err @@ -20,9 +20,12 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'filename', temp_file_name = 'filename' + major: File accessibilty + minor: Unable to open file HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header @@ -45,6 +48,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'anotherfile', temp_file_name = 'anotherfile' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/torderlinks1.err b/tools/test/h5dump/errfiles/torderlinks1.err index e665f03..b72872d 100644 --- a/tools/test/h5dump/errfiles/torderlinks1.err +++ b/tools/test/h5dump/errfiles/torderlinks1.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'fname', temp_file_name = 'fname' + major: File accessibilty + minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/torderlinks2.err b/tools/test/h5dump/errfiles/torderlinks2.err index e665f03..b72872d 100644 --- a/tools/test/h5dump/errfiles/torderlinks2.err +++ b/tools/test/h5dump/errfiles/torderlinks2.err @@ -20,6 +20,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname' major: Links minor: Unable to open file + #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'fname', temp_file_name = 'fname' + major: File accessibilty + minor: Unable to open file -- cgit v0.12 From 804d89f596869635318fbcc20723034bd737619c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 Jan 2018 13:58:23 -0600 Subject: HDFFV-10361 Update release note for vds prefix --- release_docs/RELEASE.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b52a46f..a7e56f7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -65,13 +65,15 @@ New Features on the virtual file, using a data access property list (DAPL), allows the source files to located at an absolute or relative path to the virtual file. + Private utility functions in H5D and H5L packages merged into single + function in H5F package. New public APIs: herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char* prefix); ssize_t H5Pget_virtual_prefix(hid_t dapl_id, char* prefix /*out*/, size_t size); The prefix can also be set with an environment variable, HDF5_VDS_PREFIX. - (ADB - 2017/12/12, HDFFV-9724) + (ADB - 2017/12/12, HDFFV-9724, HDFFV-10361) Parallel Library: -- cgit v0.12 From be42e047913c332f148db3b8a9180e6a2eb5c23a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 09:56:28 -0600 Subject: HDFFV-10385 refactor CMAKE_BUILD_TYPE usage --- CMakeLists.txt | 6 +++-- config/cmake/HDFCompilerFlags.cmake | 6 ++--- config/cmake/libhdf5.settings.cmake.in | 6 ++--- config/cmake_ext_mod/HDFMacros.cmake | 39 +++++++++++++++++++++++++++---- config/cmake_ext_mod/HDFUseFortran.cmake | 8 +++++++ fortran/src/CMakeLists.txt | 14 ++++------- fortran/test/CMakeLists.txt | 14 ++++------- hl/fortran/src/CMakeLists.txt | 14 ++++------- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- release_docs/RELEASE.txt | 25 ++++++++++++++++---- test/CMakeTests.cmake | 2 +- testpar/CMakeLists.txt | 4 ++-- tools/src/h5copy/CMakeLists.txt | 7 +++--- tools/src/h5diff/CMakeLists.txt | 7 +++--- tools/src/h5dump/CMakeLists.txt | 7 +++--- tools/src/h5format_convert/CMakeLists.txt | 6 +++-- tools/src/h5import/CMakeLists.txt | 6 +++-- tools/src/h5jam/CMakeLists.txt | 6 +++-- tools/src/h5ls/CMakeLists.txt | 7 +++--- tools/src/h5repack/CMakeLists.txt | 7 +++--- tools/src/h5stat/CMakeLists.txt | 7 +++--- tools/src/misc/CMakeLists.txt | 8 +++---- 27 files changed, 129 insertions(+), 89 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4e6300..5be2f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -409,6 +409,8 @@ include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake) include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) +SET_HDF5_BUILD_TYPE() + #----------------------------------------------------------------------------- # Setup output Directories #----------------------------------------------------------------------------- @@ -426,7 +428,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." ) if (WIN32) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}) set (CMAKE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." ) @@ -582,7 +584,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (CMAKE_BUILD_TYPE MATCHES Debug) +if (HDF5_BUILD_TYPE MATCHES Debug) add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 5f71f33..eeb4b97 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,12 +13,12 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () - else (CMAKE_BUILD_TYPE MATCHES Debug) + else (HDF5_BUILD_TYPE MATCHES Debug) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 8348af0..28fb876 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -1,5 +1,5 @@ - SUMMARY OF THE HDF5 CONFIGURATION - ================================= + SUMMARY OF THE HDF5 CONFIGURATION + ================================= General Information: ------------------- @@ -13,7 +13,7 @@ General Information: Compiling Options: ------------------ - Build Mode: @CMAKE_BUILD_TYPE@ + Build Mode: @HDF5_BUILD_TYPE@ Debugging Symbols: @SYMBOLS@ Asserts: @ASSERTS@ Profiling: @PROFILING@ diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 192a5c8..dd7e262 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -9,6 +9,37 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # + +#------------------------------------------------------------------------------- +macro (SET_HDF5_BUILD_TYPE) + get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(_isMultiConfig) + set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + else() + if(CMAKE_BUILD_TYPE) + set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + else() + set(HDF5_BUILD_TYPE) + endif() + endif() +endmacro () + +#------------------------------------------------------------------------------- +macro (CREATE_CONFIG_DIR path) + get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(_isMultiConfig) + foreach(c ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) + file(MAKE_DIRECTORY "${path}/${c}") + endforeach() + else() + if(CMAKE_BUILD_TYPE) + file(MAKE_DIRECTORY "${path}/${CMAKE_BUILD_TYPE}") + else() + file(MAKE_DIRECTORY "${path}") + endif() + endif() +endmacro () + #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) @@ -145,7 +176,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${HDF5_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -160,8 +191,8 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) ) else () set_target_properties (${libtarget} PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) endif () else () @@ -181,7 +212,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) else () if (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) else () diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 7bf4d81..5be2c49 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -15,6 +15,14 @@ #------------------------------------------------------------------------------- ENABLE_LANGUAGE (Fortran) +#------------------------------------------------------------------------------- +# Fix Fortran flags if we are compiling staticly on Windows using +# Windows_MT.cmake from config/cmake/UserMacros +#------------------------------------------------------------------------------- +if (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +endif () + #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 18d6d80..692509b 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,17 +66,11 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - if (WIN32) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () -if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) endif () +CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 3c3eb8f..f536bf2 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,17 +34,11 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - if (WIN32) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () -if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) endif () +CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 3fc66c4..90ee19b 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,17 +38,11 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - if (WIN32) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () -if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) endif () +CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 3972ec8..dd007f5 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 8569b8b..fac8158 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index b912208..7f2801a 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,7 +61,7 @@ endforeach () add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list}) MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 9dc4dd7..a21d369 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,7 +63,7 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 10d1b6d..90343b2 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -57,7 +57,7 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) if (WIN32) get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (HDF5_BUILD_TYPE MATCHES Debug) set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}_D") endif () # message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}") diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 8912b3f..fadc1ea 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,7 +88,7 @@ endforeach () set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") set (testfilter "OK (598 tests)") -if (CMAKE_BUILD_TYPE MATCHES Debug) +if (HDF5_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7f2f8b4..1dc5bd1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -54,7 +54,15 @@ New Features Configuration: ------------- - - + - CMake + + Refactor use of CMAKE_BUILD_TYPE for new variable, which understands + the type of generator in use. + + Added new configuration macros to use new HDF5_BUILD_TYPE variable. This + variable is set correctly for the type of generator being used for the build. + + (ADB - 2018/01/08, HDFFV-10385, HDFFV-10296) Library: -------- @@ -224,7 +232,16 @@ Bug Fixes since HDF5-1.10.1 release Configuration ------------- - - cmake + - CMake + + Add replacement of fortran flags if using static CRT. + + Added TARGET_STATIC_CRT_FLAGS call to HDFUseFortran.cmake file in + config/cmake_ext_mod folder. + + (ADB - 2018/01/08, HDFFV-10334) + + - CMake The hdf5 library used shared szip and zlib, which needlessly required applications to link with the same szip and zlib libraries. @@ -236,7 +253,7 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/11/14, HDFFV-10329) - - cmake MPI + - CMake MPI CMake implementation for MPI was problematic and would create incorrect MPI library references in the hdf5 libraries. @@ -247,7 +264,7 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/11/02, HDFFV-10321) - - cmake + - CMake Too many commands for POST_BUILD step caused command line to be too big on windows. diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fca2f27..a304485 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) macro (CHECK_VFD_TEST vfdtest vfdname resultcode) if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") - if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) + if (NOT BUILD_SHARED_LIBS AND NOT HDF5_BUILD_TYPE MATCHES Debug) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 997d1a1..db61d35 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -30,7 +30,7 @@ set (testphdf5_SOURCES add_executable (testphdf5 ${testphdf5_SOURCES}) TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") -target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) +target_link_libraries (testphdf5 PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) target_link_libraries (testphdf5 PRIVATE ${MPI_C_LIBRARIES}) endif () @@ -40,7 +40,7 @@ MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) + target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${file} PRIVATE ${MPI_C_LIBRARIES}) endif () diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index d1f5f50..23c8fae 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -39,10 +39,9 @@ endif () # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5copy-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 00d93de..b0cf66e 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -57,10 +57,9 @@ endif () # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5diff-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 65a7cdd..c58b20c 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -47,10 +47,9 @@ endif () # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5dump-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index fa3abc0..1e3e62f 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -28,11 +28,13 @@ set (H5_DEP_EXECUTABLES h5format_convert) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5format_convert ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5format_convert + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index 9a61beb..bebc6d8 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -29,11 +29,13 @@ set (H5_DEP_EXECUTABLES h5import) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5import + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 3cca771..1075180 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -38,11 +38,13 @@ set (H5_DEP_EXECUTABLES # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5jam h5unjam + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 2e23634..0e3d57f 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -39,10 +39,9 @@ endif () # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5ls-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 81e6275..abf4c24 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -50,10 +50,9 @@ endif () # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5repack-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 9762dbb..60d3f7c 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -39,10 +39,9 @@ endif () # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5stat-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 1292628..20c9171 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -62,13 +62,13 @@ set (H5_DEP_EXECUTABLES # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) + foreach (exec ${H5_DEP_EXECUTABLES}) + INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endforeach () install ( TARGETS - h5debug h5repart h5mkgrp + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -- cgit v0.12 From 9c2a9cec1f708039dbc625bcc6827ab64282e065 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 14:35:59 -0600 Subject: HDFFV-10361 Correct signatures --- src/H5Fint.c | 32 ++++++++++++++++---------------- src/H5Fprivate.h | 4 +--- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index b135ce1..e528cab 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -481,20 +481,20 @@ done: } /* end H5F_get_objects_cb() */ /*-------------------------------------------------------------------------- - * Function: H5F_build_name + * Function: H5F__build_name * * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME * * Return: Non-negative on success/Negative on failure *--------------------------------------------------------------------------*/ -herr_t -H5F_build_name(char *prefix, char *file_name, char **full_name/*out*/) +static herr_t +H5F__build_name(char *prefix, char *file_name, char **full_name/*out*/) { size_t prefix_len; /* length of prefix */ size_t fname_len; /* Length of external link file name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC prefix_len = HDstrlen(prefix); fname_len = HDstrlen(file_name); @@ -509,11 +509,11 @@ H5F_build_name(char *prefix, char *file_name, char **full_name/*out*/) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_build_name() */ +} /* H5F__build_name() */ /*-------------------------------------------------------------------------- - * Function: H5F_getenv_prefix_name -- + * Function: H5F__getenv_prefix_name -- * * Purpose: Get the first pathname in the list of pathnames stored in env_prefix, * which is separated by the environment delimiter. @@ -522,13 +522,13 @@ done: * * Return: A pointer to a pathname --------------------------------------------------------------------------*/ -char * -H5F_getenv_prefix_name(char **env_prefix/*in,out*/) +static char * +H5F__getenv_prefix_name(char **env_prefix/*in,out*/) { char *retptr=NULL; char *strret=NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC strret = HDstrchr(*env_prefix, H5_COLON_SEPC); if (strret == NULL) { @@ -541,7 +541,7 @@ H5F_getenv_prefix_name(char **env_prefix/*in,out*/) } FUNC_LEAVE_NOAPI(retptr) -} /* end H5F_getenv_prefix_name() */ +} /* end H5F__getenv_prefix_name() */ /*------------------------------------------------------------------------- * Function: H5F_prefix_open_file @@ -563,7 +563,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ char *temp_file_name = NULL; /* Temporary pointer to file name */ size_t temp_file_name_len; /* Length of temporary file name */ - FUNC_ENTER_STATIC + FUNC_ENTER_NOAPI_NOINIT /* Simplify intent flags for open calls */ file_intent &= (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ); @@ -624,9 +624,9 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ while((tmp_env_prefix) && (*tmp_env_prefix)) { char *out_prefix_name; - out_prefix_name = H5F_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + out_prefix_name = H5F__getenv_prefix_name(&tmp_env_prefix/*in,out*/); if(out_prefix_name && (*out_prefix_name)) { - if(H5F_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + if(H5F__build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { saved_env = (char *)H5MM_xfree(saved_env); HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") } /* end if */ @@ -664,7 +664,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ if(size < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file prefix") if(my_prefix) { - if(H5F_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + if(H5F__build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") my_prefix = (char *)H5MM_xfree(my_prefix); if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) @@ -679,7 +679,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ char *dspath; if(NULL != (dspath = H5F_EXTPATH(primary_file))) { - if(H5F_build_name(dspath, temp_file_name, &full_name/*out*/) < 0) + if(H5F__build_name(dspath, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) H5E_clear_stack(NULL); @@ -710,7 +710,7 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ *ptr = '\0'; /* Build new file name for the external file */ - if(H5F_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + if(H5F__build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename") actual_file_name = (char *)H5MM_xfree(actual_file_name); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index ba94069..49c5098 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -864,9 +864,7 @@ H5_DLL H5F_t *H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file); /* File prefix routines */ -H5_DLL herr_t H5F_build_name(char *prefix, char *file_name, char **full_name); -H5_DLL char * H5F_getenv_prefix_name(char **env_prefix); -H5F_t *H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, +H5_DLL H5F_t *H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type, const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id); /* Global heap CWFS routines */ -- cgit v0.12 From 3e0c6530dc3a6008f800b25eb55c1422d853cc67 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 16:26:12 -0600 Subject: HDFFV-10385 fix platform errors --- CMakeLists.txt | 4 ++-- config/cmake/hdf5-config.cmake.in | 6 ----- config/cmake_ext_mod/HDFMacros.cmake | 21 ++++-------------- fortran/src/CMakeLists.txt | 43 ++++++++++++++++++++---------------- fortran/test/CMakeLists.txt | 21 +++++++++--------- hl/fortran/src/CMakeLists.txt | 23 +++++++++---------- 6 files changed, 52 insertions(+), 66 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5be2f03..f40fc2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,12 +428,12 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." ) if (WIN32) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) set (CMAKE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." ) else () - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) endif () else () # if we are externally configured, but the project uses old cmake scripts diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 01c27df..421f693 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -105,12 +105,6 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- if (NOT TARGET "@HDF5_PACKAGE@") - if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") - include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) - endif () - if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") - include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) - endif () include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) endif () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index dd7e262..218c882 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -15,27 +15,14 @@ macro (SET_HDF5_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() if(CMAKE_BUILD_TYPE) set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + set(HDF5_CFG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() - set(HDF5_BUILD_TYPE) - endif() - endif() -endmacro () - -#------------------------------------------------------------------------------- -macro (CREATE_CONFIG_DIR path) - get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) - if(_isMultiConfig) - foreach(c ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) - file(MAKE_DIRECTORY "${path}/${c}") - endforeach() - else() - if(CMAKE_BUILD_TYPE) - file(MAKE_DIRECTORY "${path}/${CMAKE_BUILD_TYPE}") - else() - file(MAKE_DIRECTORY "${path}") + set(HDF5_BUILD_TYPE "Release") + set(HDF5_CFG_BUILD_TYPE "Release") endif() endif() endmacro () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 692509b..c377d62 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,11 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) +file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) @@ -81,14 +80,14 @@ add_executable (H5match_types ) set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS H5match_types ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( @@ -127,10 +126,15 @@ set_source_files_properties (${f90CStub_C_SOURCES} PROPERTIES LANGUAGE C) set (f90CStub_C_HDRS # generated files - ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h +) +set (f90CStub_C_SHHDRS + # generated files + ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) +target_include_directories(${HDF5_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") @@ -143,7 +147,8 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) - add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) + add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) + target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") @@ -168,16 +173,16 @@ set (f90_F_GEN_SOURCES ) set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS ${f90_F_GEN_SOURCES} COMMENT "Generating the H5_gen.F90 file" ) add_custom_target (H5gen ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + DEPENDS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) @@ -216,12 +221,12 @@ set (f90_F_BASE_SOURCES set (f90_F_SOURCES # generated file - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 ${f90_F_BASE_SOURCES} # generated file - ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 @@ -309,8 +314,8 @@ install ( ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h - ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index f536bf2..c47618e 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -33,12 +33,11 @@ set_target_properties (H5_test_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) + file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) +file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) @@ -47,6 +46,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) set_source_files_properties (t.c PROPERTIES LANGUAGE C) +target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} @@ -60,6 +60,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) +target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} @@ -77,16 +78,16 @@ endif () set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + OUTPUT ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 file" ) add_custom_target (H5testgen ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + DEPENDS ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) @@ -105,7 +106,7 @@ endif () set (HDF5_F90_TF_SOURCES # generated files - ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 # normal distribution tf.F90 diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 90ee19b..47e8236 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -37,12 +37,9 @@ set_target_properties (H5HL_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -CREATE_CONFIG_DIR(${CMAKE_Fortran_MODULE_DIRECTORY}/static) -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories @@ -70,6 +67,7 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) +target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -83,6 +81,7 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) + target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") @@ -109,18 +108,18 @@ set (HDF5_HL_F90_F_BASE_SOURCES set (CMD $) add_custom_command ( - OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/static DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files" ) add_custom_target (H5HLgen ALL - DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 ) set_source_files_properties ( - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) if (BUILD_SHARED_LIBS) @@ -146,8 +145,8 @@ set (HDF5_HL_F90_F_SOURCES ${HDF5_HL_F90_F_BASE_SOURCES} # generated files - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) -- cgit v0.12 From a5789f6c9ab1f9308b5cc4dc64b156e9be077459 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 16:26:25 -0600 Subject: HDFFV-8745 fix minor defects --- tools/lib/h5diff_attr.c | 2 -- tools/lib/h5diff_dset.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 4e4b40d..7f08cc7 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -325,8 +325,6 @@ hsize_t diff_attr(hid_t loc1_id, hid_t space2_id = -1; /* space ID */ hid_t ftype1_id = -1; /* file data type ID */ hid_t ftype2_id = -1; /* file data type ID */ - int vstrtype1 = 0; /* ftype1 is a variable string */ - int vstrtype2 = 0; /* ftype2 is a variable string */ hid_t mtype1_id = -1; /* memory data type ID */ hid_t mtype2_id = -1; /* memory data type ID */ size_t msize1; /* memory size of memory type */ diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 86aa543..ff542db 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -773,8 +773,8 @@ int diff_can_type(hid_t f_tid1, /* file data type */ } if(tclass1 == H5T_STRING) { - hid_t vstrtype1 = -1; - hid_t vstrtype2 = -1; + htri_t vstrtype1 = -1; + htri_t vstrtype2 = -1; h5difftrace("diff_can_type end - H5T_STRING\n"); vstrtype1 = H5Tis_variable_str(f_tid1); @@ -782,7 +782,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ /* no compare if either one but not both are variable string type */ if (vstrtype1 != vstrtype2) { - if((opts->m_verbose || opts->m_list_not_cmp)) + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n", obj1_name, obj2_name); opts->not_cmp = 1; -- cgit v0.12 From 16e0a6b85868ddc30fffe2c92063f71caa5c71c2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jan 2018 16:55:29 -0600 Subject: Correct folder typo --- CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f40fc2a..2288be5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,7 @@ if (NOT HDF5_INSTALL_DATA_DIR) set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (HDF5_INSTALL_DATA_DIR share) - set (HDF5_INSTALL_CMAKE_DIR share/cmake) + set (HDF5_INSTALL_CMAKE_DIR share/cmake/hdf5) else () set (HDF5_INSTALL_DATA_DIR ".") set (HDF5_INSTALL_CMAKE_DIR cmake) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index c47618e..0af4df9 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -33,10 +33,10 @@ set_target_properties (H5_test_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") + file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") +file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) -- cgit v0.12 From 6bf125c7b38887a26b95d3eac4be08e5e44bb1af Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 08:31:44 -0600 Subject: HDFFV-10385 fix fortran references --- fortran/examples/h5_crtatt.f90 | 4 ++++ hl/fortran/src/CMakeLists.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/fortran/examples/h5_crtatt.f90 b/fortran/examples/h5_crtatt.f90 index 7e287c6..d3df380 100644 --- a/fortran/examples/h5_crtatt.f90 +++ b/fortran/examples/h5_crtatt.f90 @@ -84,6 +84,10 @@ PROGRAM H5_CRTATT ! CALL h5aclose_f(attr_id, error) ! + ! Close the attribute datatype. + ! + CALL h5tclose_f(atype_id, error) + ! ! Terminate access to the data space. ! CALL h5sclose_f(aspace_id, error) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 47e8236..dc2629a 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -37,8 +37,10 @@ set_target_properties (H5HL_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) + file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () +file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- -- cgit v0.12 From 850ec7a30a3e7cb9fb5727f1819a182dcebbe25d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 08:39:50 -0600 Subject: HDFFV-10385 - add release note --- release_docs/RELEASE.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1dc5bd1..2cacc30 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -234,6 +234,19 @@ Bug Fixes since HDF5-1.10.1 release ------------- - CMake + Correct usuage of CMAKE_BUILD_TYPE variable. + + The use of the CMAKE_BUILD_TYPE is incorrect for multi-config + generators (Visual Studio and XCode) and is optional for single + config generators. Created a new macro to check + GLOBAL PROPERTY -> GENERATOR_IS_MULTI_CONFIG + Created two new HDF variable, HDF5_BUILD_TYPE and HDF5_CFG_BUILD_TYPE. + Defaults for these variables is "Release". + + (ADB - 2018/01/10, HDFFV-10385) + + - CMake + Add replacement of fortran flags if using static CRT. Added TARGET_STATIC_CRT_FLAGS call to HDFUseFortran.cmake file in -- cgit v0.12 From 82709178aa25d726224d91df2b9e51b626137922 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 09:52:06 -0600 Subject: HDFFV-10385 includes cleanup --- fortran/test/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 0af4df9..7842359 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -39,8 +39,6 @@ endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) - #----------------------------------------------------------------------------- # Add Test Lib #----------------------------------------------------------------------------- -- cgit v0.12 From bdde53eb3ec3341bbe0b28617c0784dcd1f31b50 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 11:49:09 -0600 Subject: HDFFV-8745 remove obsolete files --- .../test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 | Bin 124440 -> 0 bytes .../h5diff/testfiles/tmpSingleSiteBethe.reference.h5 | Bin 119464 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 delete mode 100644 tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 diff --git a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 b/tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 deleted file mode 100644 index bbcfb63..0000000 Binary files a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 b/tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 deleted file mode 100644 index 6b19ed7..0000000 Binary files a/tools/test/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 and /dev/null differ -- cgit v0.12 From 5b4b4658328b63181899834c1981555bc6144f98 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 13:04:06 -0600 Subject: Fix typo --- config/cmake/UseJava.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 52b37a9..c70f52e 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -285,7 +285,7 @@ # # Example: # create_javadoc(my_example_doc -# PACKAGES com.exmaple.foo com.example.bar +# PACKAGES com.example.foo com.example.bar # SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}" # CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} # WINDOWTITLE "My example" -- cgit v0.12 From 681047269b27d0f1be33827362ff823f919c593b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 13:31:47 -0600 Subject: HDFFV-10385 fix packaging --- fortran/src/CMakeLists.txt | 4 ++-- fortran/test/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c377d62..030cb37 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,10 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 7842359..31d0f59 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,10 +34,10 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) #----------------------------------------------------------------------------- # Add Test Lib diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index dc2629a..22738b90 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,10 +38,10 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif () file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12 From 9956b151e005fa98e28926cbbb3565afb85b1d06 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 14:35:00 -0600 Subject: HDFFV-10385 multi-config builders need folder set --- config/cmake_ext_mod/HDFMacros.cmake | 3 +-- fortran/src/CMakeLists.txt | 4 ++-- fortran/test/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 218c882..76e0612 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -17,12 +17,11 @@ macro (SET_HDF5_BUILD_TYPE) set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() + set(HDF5_CFG_BUILD_TYPE ".") if(CMAKE_BUILD_TYPE) set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - set(HDF5_CFG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() set(HDF5_BUILD_TYPE "Release") - set(HDF5_CFG_BUILD_TYPE "Release") endif() endif() endmacro () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 030cb37..c377d62 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,10 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 31d0f59..7842359 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,10 +34,10 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Add Test Lib diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 22738b90..dc2629a 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,10 +38,10 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12 From c7e8a0788c68c2fe05b6b70591a499ad277c8fa5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jan 2018 14:36:25 -0600 Subject: Correct whitespace --- fortran/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 7842359..9946aa0 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -58,7 +58,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) -target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} -- cgit v0.12 From a2f2e1f4cf44f305a12c674a37c120d26ce3362b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 11 Jan 2018 10:48:14 -0600 Subject: Fix fortran cmake variable usage --- fortran/src/CMakeLists.txt | 6 +++--- fortran/test/CMakeLists.txt | 30 +++++++++++++++--------------- hl/fortran/src/CMakeLists.txt | 5 +++-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c377d62..7ed5fef 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -71,7 +71,7 @@ endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) +INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) #----------------------------------------------------------------------------- add_executable (H5match_types @@ -134,7 +134,7 @@ set (f90CStub_C_SHHDRS ) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) -target_include_directories(${HDF5_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") @@ -148,7 +148,7 @@ set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) - target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 9946aa0..9f2d593 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_FORTRAN_TESTS_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -33,10 +33,10 @@ set_target_properties (H5_test_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") + file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) endif () -file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") +file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- @@ -44,7 +44,7 @@ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYP #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) set_source_files_properties (t.c PROPERTIES LANGUAGE C) -target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} @@ -58,7 +58,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) - target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} @@ -76,35 +76,35 @@ endif () set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 + OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 COMMAND ${CMD} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static + WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 file" ) add_custom_target (H5testgen ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 + DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 + OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 COMMAND ${CMDSH} - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared + WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 shared file" ) add_custom_target (H5testgenSH ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 + DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 ) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) + set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) endif () set (HDF5_F90_TF_SOURCES # generated files - ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 + ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 # normal distribution tf.F90 @@ -113,7 +113,7 @@ set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran) if (BUILD_SHARED_LIBS) set (HDF5_F90_TF_SOURCES_SHARED # generated file - ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 + ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 # normal distribution tf.F90 diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index dc2629a..9190354 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -49,6 +49,7 @@ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYP INCLUDE_DIRECTORIES ( ${HDF5_HL_SRC_DIR}/src ${HDF5_F90_SRC_DIR}/src + ${HDF5_HL_F90_SRC_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR} @@ -69,7 +70,7 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) -target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -83,7 +84,7 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) - target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") -- cgit v0.12 From 19c18e44ed113af84896604d7cedcc892f8338dc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 12 Jan 2018 14:17:04 -0600 Subject: Revert CMAKE_BUILD_TYPE for matches - need to redesign --- CMakeLists.txt | 2 +- config/cmake/HDFCompilerFlags.cmake | 6 +++--- config/cmake_ext_mod/HDFMacros.cmake | 5 ++++- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- test/CMakeTests.cmake | 2 +- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2288be5..cb01cd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -584,7 +584,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (HDF5_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index eeb4b97..72d320c 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,12 +13,12 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () - else (HDF5_BUILD_TYPE MATCHES Debug) + else () set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 76e0612..8a6b74d 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -24,6 +24,9 @@ macro (SET_HDF5_BUILD_TYPE) set(HDF5_BUILD_TYPE "Release") endif() endif() + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") + endif() endmacro () #------------------------------------------------------------------------------- @@ -162,7 +165,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${HDF5_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index dd007f5..3972ec8 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index fac8158..8569b8b 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,7 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 7f2801a..b912208 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,7 +61,7 @@ endforeach () add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list}) MACRO (ADD_H5_TEST resultfile resultcode) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index a21d369..9dc4dd7 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,7 +63,7 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 90343b2..10d1b6d 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -57,7 +57,7 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) if (WIN32) get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE) - if (HDF5_BUILD_TYPE MATCHES Debug) + if (CMAKE_BUILD_TYPE MATCHES Debug) set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}_D") endif () # message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}") diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index fadc1ea..8912b3f 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,7 +88,7 @@ endforeach () set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") set (testfilter "OK (598 tests)") -if (HDF5_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") else () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index a304485..fca2f27 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) macro (CHECK_VFD_TEST vfdtest vfdname resultcode) if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") - if (NOT BUILD_SHARED_LIBS AND NOT HDF5_BUILD_TYPE MATCHES Debug) + if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -- cgit v0.12 From 37318f109a294bb47e5040be5888963967c1badc Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 12 Jan 2018 14:36:03 -0600 Subject: Changes made based on code reviews. --- src/H5Aint.c | 17 +- src/H5Dint.c | 25 +- src/H5Dlayout.c | 19 +- src/H5F.c | 18 +- src/H5Fdeprec.c | 62 ++ src/H5Fint.c | 36 +- src/H5Fprivate.h | 1 + src/H5Fpublic.h | 3 +- src/H5Fquery.c | 11 +- src/H5Fsuper.c | 87 ++- src/H5Gobj.c | 12 +- src/H5Oattr.c | 2 + src/H5Ocopy.c | 6 + src/H5Odtype.c | 2 + src/H5Ofill.c | 22 +- src/H5Oint.c | 22 +- src/H5Olayout.c | 5 +- src/H5Opkg.h | 8 +- src/H5Opline.c | 19 +- src/H5Oprivate.h | 6 +- src/H5Osdspace.c | 2 + src/H5S.c | 15 +- src/H5T.c | 5 +- src/H5trace.c | 3 +- test/genall5.c | 8 +- test/mf.c | 10 +- test/tfile.c | 2236 +++++++++++++++++++++++++++++------------------------- 27 files changed, 1534 insertions(+), 1128 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index 5c32e86..666f11d 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -1863,6 +1863,7 @@ herr_t H5A_set_version(const H5F_t *f, H5A_t *attr) { hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ + uint8_t version; /* Message version */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1884,18 +1885,22 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) /* Check which version to encode attribute with */ if(attr->shared->encoding != H5T_CSET_ASCII) - attr->shared->version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */ + version = H5O_ATTR_VERSION_3; /* Write version which includes the character encoding */ else if(type_shared || space_shared) - attr->shared->version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */ + version = H5O_ATTR_VERSION_2; /* Write out version with flag for indicating shared datatype or dataspace */ else - attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */ + version = H5O_ATTR_VERSION_1; /* Write out basic version */ /* Upgrade to the version indicated by the file's low bound if higher */ - attr->shared->version = MAX(attr->shared->version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(attr->shared->version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_ATTR, H5E_BADRANGE, FAIL, "attribute version out of bounds") + + /* Set the message version */ + attr->shared->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_set_version() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index c1a66ca..89dff1e 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -623,10 +623,10 @@ done: static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) { - htri_t relocatable; /* Flag whether the type is relocatable */ - htri_t immutable; /* Flag whether the type is immutable */ - hbool_t use_v18_latest_format; /* Flag indicating the 'latest datatype version support' is enabled */ - herr_t ret_value = SUCCEED; /* Return value */ + htri_t relocatable; /* Flag whether the type is relocatable */ + htri_t immutable; /* Flag whether the type is immutable */ + hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -643,10 +643,11 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if((immutable = H5T_is_immutable(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't check datatype?") - use_v18_latest_format = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); + /* To use at least v18 format versions or not */ + use_at_least_v18 = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); /* Copy the datatype if it's a custom datatype or if it'll change when it's location is changed */ - if(!immutable || relocatable || use_v18_latest_format) { + if(!immutable || relocatable || use_at_least_v18) { /* Copy datatype for dataset */ if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype") @@ -786,6 +787,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) H5D_fill_value_t fill_status; /* Fill value status */ hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */ hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ + hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -800,6 +802,9 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) type = dset->shared->type; fill_prop = &dset->shared->dcpl_cache.fill; + /* To use at least v18 format versions or not */ + use_at_least_v18 = (H5F_LOW_BOUND(file) >= H5F_LIBVER_V18); + /* Retrieve "defined" status of fill value */ if(H5P_is_fill_value_defined(fill_prop, &fill_status) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined") @@ -878,8 +883,8 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update new fill value header message") /* If there is valid information for the old fill value struct, add it */ - /* (only if we aren't trying to write the 'latest fill message version support') */ - if(fill_prop->buf && (H5F_LOW_BOUND(file) < H5F_LIBVER_V18)) { + /* (only if we aren't using v18 format versions and above */ + if(fill_prop->buf && !use_at_least_v18) { H5O_fill_t old_fill_prop; /* Copy of fill value property, for writing as "old" fill value */ /* Shallow copy the fill value property */ @@ -931,10 +936,10 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) #endif /* H5O_ENABLE_BOGUS */ /* Add a modification time message, if using older format. */ - /* (If using the latest 'no modification time message' version support, the modification time is part of the object + /* (If using v18 format versions and above, the the modification time is part of the object * header and doesn't use a separate message -QAK) */ - if(H5F_LOW_BOUND(file) < H5F_LIBVER_V18) + if(!use_at_least_v18) if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 5a4d537..980b810 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -46,9 +46,10 @@ /* Package Variables */ /*********************/ +/* Format version bounds for layout */ const unsigned H5O_layout_ver_bounds[] = { H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ - H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ /* H5O_LAYOUT_VERSION_DEFAULT */ H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -289,16 +290,15 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, January 15, 2009 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) { - unsigned vers; - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -307,12 +307,15 @@ H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) HDassert(f); /* Upgrade to the version indicated by the file's low bound if higher */ - layout->version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(layout->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "layout version out of bounds") + /* Set the message version */ + layout->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_set_version() */ diff --git a/src/H5F.c b/src/H5F.c index c670e17..8e5f65a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1478,6 +1478,8 @@ H5Fstart_swmr_write(hid_t file_id) if(file->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file superblock version should be at least 3") + HDassert((file->shared->low_bound == H5F_LIBVER_V110) && (file->shared->high_bound == H5F_LIBVER_V110)); + /* Should not be marked for SWMR writing mode already */ if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file already in SWMR writing mode") @@ -1739,9 +1741,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fset_libver_bounds (Internal library use) + * Function: H5Fset_libver_bounds * - * Purpose: Set .... the "latest format" flag while a file is open. + * Purpose: Set to a different low and high bounds while a file is open. + * This public routine is introduced in place of + * H5Fset_latest_format() starting release 1.10.2. + * See explanation for H5Fset_latest_format() in H5Fdeprec.c. * * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- @@ -1759,12 +1764,9 @@ H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high) if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") - /* Call the flush routine, for this file */ - if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") - - f->shared->low_bound = low; - f->shared->high_bound = high; + /* Call private set_libver_bounds function */ + if(H5F_set_libver_bounds(f, low, high) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 03f5df8..a9ffa43 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -143,5 +143,67 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Fget_info1() */ + +/*------------------------------------------------------------------------- + * Function: H5Fset_latest_format + * + * Purpose: Enable switching between latest or non-latest format while + * a file is open. + * This is deprecated starting release 1.10.2 and is modified + * to call the private H5F_set_libver_bounds() to set the + * bounds. + * + * Before release 1.10.2, the library supports only two + * combinations of low/high bounds: + * (earliest, latest) + * (latest, latest) + * Thus, this public routine does the job in switching + * between the two combinations listed above. + * + * Starting release 1.10.2, we add v18 to the enumerated + * define H5F_libver_t and the library supports five combinations + * as below: + * (earliest, v18) + * (earliest, v10) + * (v18, v18) + * (v18, v10) + * (v10, v10) + * So we introduce the new public routine H5Fset_libver_bounds() + * in place of H5Fset_latest_format(). + * See also RFC: Setting Bounds for Object Creation in HDF5 1.10.0. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; December 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fset_latest_format(hid_t file_id, hbool_t latest_format) +{ + H5F_t *f; /* File */ + H5F_libver_t low = H5F_LIBVER_LATEST; /* Low bound */ + H5F_libver_t high = H5F_LIBVER_LATEST; /* High bound */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ib", file_id, latest_format); + + /* Check args */ + if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") + + /* 'low' and 'high' are both initialized to LATEST. + If latest format is not expected, set 'low' to EARLIEST */ + if(!latest_format) + low = H5F_LIBVER_EARLIEST; + + /* Call private set_libver_bounds function to set the bounds */ + if(H5F_set_libver_bounds(f, low, high) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Fset_latest_format() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Fint.c b/src/H5Fint.c index f223195..79f0d06 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -671,9 +671,9 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial metadata cache resize config") - /* File format version high bound does not allow the generation of metadata cache image */ + /* Format version high bound does not allow the generation of metadata cache image */ if(f->shared->mdc_initCacheImageCfg.generate_image && f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "file format version out of bound for cache image") + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "format version out of bound for cache image") /* Get the VFD values to cache */ f->shared->maxaddr = H5FD_get_maxaddr(lf); @@ -2313,6 +2313,38 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_store_msg_crt_idx() */ +/*------------------------------------------------------------------------- + * Function: H5F_set_libver_bounds() + * + * Purpose: Set the file's low and high bound to the input parameters + * 'low' and 'high' respectively. + * This is done only if the existing setting is different + * from the inputs. + * + * Return: SUCCEED on success, and FAIL on failure. + * + * Programmer: Vailin Choi; December 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + + /* Set the bounds only if the existing setting is different from the inputs */ + if(f->shared->low_bound != low || f->shared->high_bound != high) { + f->shared->low_bound = low; + f->shared->high_bound = high; + } + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_libver_bounds() */ + /*------------------------------------------------------------------------- * Function: H5F_get_file_image diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 50325bb..ec98468 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -769,6 +769,7 @@ H5_DLL unsigned H5F_gc_ref(const H5F_t *f); H5_DLL unsigned H5F_use_latest_flags(const H5F_t *f, unsigned fl); H5_DLL hbool_t H5F_store_msg_crt_idx(const H5F_t *f); H5_DLL herr_t H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag); +H5_DLL herr_t H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high); H5_DLL struct H5UC_t *H5F_grp_btree_shared(const H5F_t *f); H5_DLL herr_t H5F_set_grp_btree_shared(H5F_t *f, struct H5UC_t *rc); H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 9364ee2..d333fa7 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -173,7 +173,7 @@ typedef struct H5F_sect_info_t { hsize_t size; /* Size of free space section */ } H5F_sect_info_t; -/* Library's file format versions */ +/* Library's format versions */ typedef enum H5F_libver_t { H5F_LIBVER_ERROR = -1, H5F_LIBVER_EARLIEST = 0, /* Use the earliest possible format for storing objects */ @@ -300,6 +300,7 @@ typedef struct H5F_info1_t { /* Function prototypes */ H5_DLL herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo); +H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 6b641f1..5d7de9d 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -716,9 +716,14 @@ H5F_sieve_buf_size(const H5F_t *f) * Purpose: Replaced a macro to retrieve the "garbage collect * references flag" now that the generic properties are being used * to store the values. - e - * is returned. - * Failure: (should not happen) + * + * Return: Success: The "garbage collect references flag" is returned. + * Failure: (should not happen) + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jul 8 2005 + * *------------------------------------------------------------------------- */ unsigned diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4c12cb9..d30434d 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -457,23 +457,46 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") - /* Upgrade low bound to at least V18 when encountering version 2 superblock */ + /* + * When opening a file with SWMR-write access, the library will first + * check to ensure that superblock version 3 is used. Otherwise fail + * file open. + * + * Then the library will upgrade the file's low_bound depending on + * superblock version as follows: + * --version 0 or 1: no change to low_bound + * --version 2: upgrade low_bound to at least V18 + * --version 3: upgrade low_bound to at least V110 + * + * Upgrading low_bound will give the best format versions available for + * that superblock version. Due to the possible upgrade, the fapl returned + * from H5Fget_access_plist() might indicate a low_bound higher than what + * the user originally set. + * + * After upgrading low_bound, the library will check to ensure that the + * superblock version does not exceed the version allowed by high_bound. + * Otherise fail file open. + * + * For details, please see RFC:Setting Bounds for Object Creation in HDF5 1.10.0. + */ + + /* Check to ensure that superblock version 3 is used for SWMR-write access */ + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { + if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version for SWMR is less than 3") + } + + /* Upgrade low_bound to at least V18 when encountering version 2 superblock */ if(sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2) f->shared->low_bound = MAX(H5F_LIBVER_V18, f->shared->low_bound); - /* Upgrade low bound to at least V110 when encountering version 3 superblock or SWMR_WRITE */ - if((sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) || (H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + /* Upgrade low_bound to at least V110 when encountering version 3 superblock */ + if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); - /* File bound check */ + /* Version bounds check */ if(sblock->super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (high bound)") - - /* SWMR requires at least superblock version 3 */ - if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { - if(sblock->super_vers < HDF5_superblock_ver_bounds[f->shared->low_bound]) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds (low bound)") - } + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version exceeds high bound") /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) @@ -833,9 +856,9 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); H5O_mdci_t mdci_msg; - /* Message exists but file format version high bound does not allow it */ + /* Message exists but version high bound does not allow it */ if(f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file format version out of bound for metadata cache image") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "format version out of bound for metadata cache image") /* if the metadata cache image superblock extension message exists, * read its contents and pass the data on to the metadata cache. @@ -1037,6 +1060,36 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) non_default_fs_settings = TRUE; + /* + * When creating a file with write access, the library will: + * -- set superblock version to 0, 1 or 2 based on feature enabled + * -- no change to low_bound + * When creating a file with SWMR-write access, the library will: + * (See explanation (#) below.) + * -- set superblock version to 3 + * -- upgrade low_bound to at least V110 + * + * Then the library will finalize superblock version to that allowed by + * low_bound if that is higher. + * Lastly, the library will check to ensure the superblock version does not + * exceed the version allowed by high_bound. Otherwise fail file open. + * + * For details, please see RFC:Setting Bounds for Object Creation in HDF5 1.10.0. + * + * (#) + * Version 3 superblock is introduced in 1.10 for SWMR due to the problem of + * the status_flags field in the superblock. The problem is discussed in + * jira issue SWMR-79 and also in the RFC: File Format Changes in HDF5 1.10.0. + * The file's low_bound is upgraded for SWMR so that the library will + * use the best format versions available in 1.10. + * Due to the possible upgrade, the fapl returned from H5Fget_access_plist() + * might indicate a low_bound higher than what the user originally set. + */ + + /* + * Creating a file with SWMR-write access will + * upgrade superblock version and low_bound + */ if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) { super_vers = HDF5_SUPERBLOCK_VERSION_3; f->shared->low_bound = MAX(H5F_LIBVER_V110, f->shared->low_bound); @@ -1060,10 +1113,10 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) else if(sblock->btree_k[H5B_CHUNK_ID] != HDF5_BTREE_CHUNK_IK_DEF) super_vers = HDF5_SUPERBLOCK_VERSION_1; - /* Upgrade to the version indicated by the file's low bound if higher */ + /* Finalize superblock version to that allowed by the file's low bound if higher */ super_vers = MAX(super_vers, HDF5_superblock_ver_bounds[f->shared->low_bound]); - /* File bound check */ + /* Version bounds check */ if(super_vers > HDF5_superblock_ver_bounds[f->shared->high_bound]) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "superblock version out of bounds") @@ -1091,8 +1144,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Sanity check the userblock size vs. the file's allocation alignment */ if(userblock_size > 0) { - /* Set up the alignment to use for page or aggr fs */ - hsize_t alignment = H5F_PAGED_AGGR(f) ? f->shared->fs_page_size : f->shared->alignment; + /* Set up the alignment to use for page or aggr fs */ + hsize_t alignment = H5F_PAGED_AGGR(f) ? f->shared->fs_page_size : f->shared->alignment; if(userblock_size < alignment) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "userblock size must be > file object alignment") diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 832c9a7..5f9bdc8 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -185,7 +185,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { size_t hdr_size; /* Size of object header to request */ - hbool_t use_v18_latest_format; /* Flag indicating the new group format should be used */ + hbool_t use_at_least_v18; /* Flag indicating the new group format should be used */ hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -204,12 +204,12 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") - /* Check for using the latest version of the group format */ + /* Check for using the latest version of the group format which is introduced in v18 */ /* (add more checks for creating "new format" groups when needed) */ if((H5F_LOW_BOUND(f) >= H5F_LIBVER_V18) || linfo->track_corder || (pline && pline->nused)) - use_v18_latest_format = TRUE; + use_at_least_v18 = TRUE; else - use_v18_latest_format = FALSE; + use_at_least_v18 = FALSE; /* Make certain that the creation order is being tracked if an index is * going to be built on it. @@ -218,7 +218,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it") /* Check if we should be using the latest version of the group format */ - if(use_v18_latest_format) { + if(use_at_least_v18) { H5O_link_t lnk; /* Temporary link message info for computing message size */ char null_char = '\0'; /* Character for creating null string */ size_t ginfo_size; /* Size of the group info message */ @@ -264,7 +264,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ - if(use_v18_latest_format) { + if(use_at_least_v18) { /* Insert link info message */ /* (Casting away const OK - QAK) */ if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 5c45e82..773a16b 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -635,6 +635,8 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(attr_src->shared->version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "attribute message version out of bounds") diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index aa26f05..74c02f4 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -416,6 +416,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Initialize header information */ oh_dst->version = oh_src->version; + /* Version bounds check for destination object header */ if(oh_dst->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(oloc_dst->file)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "destination object header version out of bounds") @@ -494,7 +495,12 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Decode the message if necessary. */ H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) + /* Save destination file pointer in cpy_info so that it can be used + in the pre_copy_file callback to obtain the destination file's + high bound. The high bound is used to index into the corresponding + message's array of versions for doing version bounds check. */ cpy_info->file_dst = oloc_dst->file; + /* Perform "pre copy" operation on message */ if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native, &(deleted[mesgno]), cpy_info, cpy_udata) < 0) diff --git a/src/H5Odtype.c b/src/H5Odtype.c index f6331df..c51e31d 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -1531,6 +1531,8 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version as indicated by the destination file's high bound */ if(dt_src->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "datatype message version out of bounds") diff --git a/src/H5Ofill.c b/src/H5Ofill.c index cf64594..6dc3064 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -156,7 +156,7 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ /* Format version bounds for fill value */ const unsigned H5O_fill_ver_bounds[] = { H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ - H5O_FILL_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_FILL_VERSION_2, /* H5F_LIBVER_V18 */ H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -809,8 +809,7 @@ H5O_fill_free(void *fill) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Friday, March 9, 2007 + * Programmer: Vailin Choi; Dec 2017 * *------------------------------------------------------------------------- */ @@ -827,6 +826,8 @@ H5O_fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(fill_src->version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "fill value message version out of bounds") @@ -1047,15 +1048,15 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, July 24, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1064,12 +1065,15 @@ H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill) HDassert(fill); /* Upgrade to the version indicated by the file's low bound if higher */ - fill->version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(fill->version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_fill_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") + /* Set the message version */ + fill->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_set_version() */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 0df7467..08eb28d 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -216,18 +216,17 @@ H5O__init_package(void) * Chooses the oldest version possible, unless the file's * low bound indicates otherwise. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 17 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ static herr_t H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) { + uint8_t version; /* Message version */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -238,17 +237,20 @@ H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx /* Set the correct version to encode object header with */ if(store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) - oh->version = H5O_VERSION_2; + version = H5O_VERSION_LATEST; else - oh->version = H5O_VERSION_1; + version = H5O_VERSION_1; /* Upgrade to the version indicated by the file's low bound if higher */ - oh->version = MAX(oh->version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(oh->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "object header version out of bounds") + /* Set the message version */ + oh->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_set_version() */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 3745f6d..85d7791 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -1055,8 +1055,7 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Friday, March 9, 2007 + * Programmer: Vailin Choi; Dec 2017 * *------------------------------------------------------------------------- */ @@ -1073,6 +1072,8 @@ H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(layout_src->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "layout message version out of bounds") diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 13e0e3e..498938a 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -63,8 +63,8 @@ ) #define H5O_ALIGN_OH(O, X) \ H5O_ALIGN_VERS((O)->version, X) -#define H5O_ALIGN_F(F, X) \ - H5O_ALIGN_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) ? H5O_VERSION_LATEST : H5O_VERSION_1), X) +#define H5O_ALIGN_F(F, X) \ + H5O_ALIGN_VERS(MAX(H5O_VERSION_1, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(F)]), X) /* Size of checksum (on disk) */ #define H5O_SIZEOF_CHKSUM 4 @@ -136,7 +136,7 @@ #define H5O_SIZEOF_MSGHDR_OH(O) \ H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) #define H5O_SIZEOF_MSGHDR_F(F, C) \ - H5O_SIZEOF_MSGHDR_VERS(((H5F_LOW_BOUND(F) >= H5F_LIBVER_V18) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C)) + H5O_SIZEOF_MSGHDR_VERS(MAX((H5F_STORE_MSG_CRT_IDX(F) ? H5O_VERSION_LATEST : H5O_VERSION_1), (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(F)]), (C)) /* * Size of chunk "header" for each chunk @@ -641,6 +641,8 @@ H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs); +/* Arrays of versions for: + Object header, Layout/Attribute/Datatype/Fill value/Filter pipeline/Dataspace messages */ H5_DLLVAR const unsigned H5O_obj_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_attr_ver_bounds[H5F_LIBVER_NBOUNDS]; diff --git a/src/H5Opline.c b/src/H5Opline.c index ea913da..e817f9a 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -576,7 +576,7 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, { const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */ H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -585,6 +585,8 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(pline_src->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "pline message version out of bounds") @@ -681,15 +683,15 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, July 24, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -698,12 +700,15 @@ H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline) HDassert(pline); /* Upgrade to the version indicated by the file's low bound if higher */ - pline->version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(pline->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_PLINE, H5E_BADRANGE, FAIL, "Filter pipeline version out of bounds") + /* Set the message version */ + pline->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_pline_set_version() */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 5cf9dce..2253bb2 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -178,7 +178,11 @@ typedef struct H5O_copy_t { hbool_t dst_dt_list_complete; /* Whether the destination datatype list is complete (i.e. not only populated with "suggestions" from H5Padd_merge_committed_dtype_path) */ H5O_t *oh_dst; /* The destination object header */ H5F_t *file_dst; /* The destination file pointer */ - void *shared_fo; /* The shared pointer for the object */ + /* This is used in the pre_copy_file callback to obtain + the destination file's high bound. The high bound + is used to index into the corresponding message's + array of versions for doing version bounds check. */ + void *shared_fo; /* The shared pointer for the src object */ H5O_mcdt_search_cb_t mcdt_cb; /* The callback to invoke before searching the global list of committed datatypes at destination */ void *mcdt_ud; /* User data passed to callback */ } H5O_copy_t; diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 9a9d020..12a9bb6 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -455,6 +455,8 @@ H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HDassert(cpy_info); HDassert(cpy_info->file_dst); + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ if(src_space_extent->version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "dataspace message version out of bounds") diff --git a/src/H5S.c b/src/H5S.c index 8046357..8f3e132 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -2180,15 +2180,15 @@ H5S_extent_nelem(const H5S_extent_t *ext) * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, July 24, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5S_set_version(H5F_t *f, H5S_t *ds) { - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2197,12 +2197,15 @@ H5S_set_version(H5F_t *f, H5S_t *ds) HDassert(ds); /* Upgrade to the version indicated by the file's low bound if higher */ - ds->extent.version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(ds->extent.version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "Dataspace version out of bounds") + /* Set the message version */ + ds->extent.version = version; + done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5T.c b/src/H5T.c index aa61358..eca0132 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5418,8 +5418,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, July 19, 2007 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ @@ -5442,7 +5441,7 @@ H5T_set_version(H5F_t *f, H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding") } - /* File bound check */ + /* Version bounds check */ if(dt->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "Datatype version out of bounds") diff --git a/src/H5trace.c b/src/H5trace.c index 5f8ccd1..b1f05ba 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1021,7 +1021,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5F_LIBVER_V18"); break; - case H5F_LIBVER_LATEST: + case H5F_LIBVER_V110: + HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); fprintf(out, "H5F_LIBVER_LATEST"); break; diff --git a/test/genall5.c b/test/genall5.c index 0ac1515..e3a9c96 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -1264,7 +1264,7 @@ os_grp_0(hid_t fid, const char *group_name) HDassert(fapl > 0); } - if ( pass ) { /* get libver_bounds from fapl */ + if ( pass ) { /* get low and high bounds from fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); if ( ret < 0 ) { @@ -1312,7 +1312,7 @@ os_grp_0(hid_t fid, const char *group_name) HDassert(ret >= 0); } - if ( pass ) { /* restore libver_bounds */ + if ( pass ) { /* restore low and high bounds */ if(low >= H5F_LIBVER_V18) { ret = H5Fset_libver_bounds(fid, low, high); @@ -1504,7 +1504,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) HDassert(fapl > 0); } - if ( pass ) { /* get libver_bounds from fapl */ + if ( pass ) { /* get low and high bounds from fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); if ( ret < 0 ) { @@ -1590,7 +1590,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) assert(ret >= 0); } - if ( pass ) { /* restore libver_bounds */ + if ( pass ) { /* restore low and high bounds */ if(low >= H5F_LIBVER_V18) { ret = H5Fset_libver_bounds(fid, low, high); diff --git a/test/mf.c b/test/mf.c index 289f04a..35dfab3 100644 --- a/test/mf.c +++ b/test/mf.c @@ -6920,6 +6920,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) H5FD_mem_t type; /* File allocation type */ H5FS_stat_t fs_stat; /* Information for free-space manager */ haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */ + haddr_t addrx; H5FD_mem_t fs_type; hbool_t contig_addr_vfd; hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE; @@ -7054,6 +7055,12 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) FAIL_STACK_ERROR + if(!new_format) { + /* Need to take up this space so that the free-space manager will go away */ + if(HADDR_UNDEF == (addrx = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)103))) + FAIL_STACK_ERROR + } + /* The H5FD_MEM_SUPER free-space manager will go away at H5MF_close() */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -7065,7 +7072,6 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ if(H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR @@ -8936,9 +8942,7 @@ main(void) /* Temporary: modify to skip testing for multi/split driver: fail file create when persisting free-space or using paged aggregation strategy */ -#ifdef OUT /* Will take a close look at this later */ nerrors += test_mf_fs_gone(env_h5_drvr, fapl, FALSE); -#endif nerrors += test_mf_fs_gone(env_h5_drvr, fapl, TRUE); /* Temporary: modify to skip testing multi/split driver: diff --git a/test/tfile.c b/test/tfile.c index 653fd12..03a5233 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -44,8 +44,11 @@ #define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" /* Datatype */ -#define H5A_FRIEND /*suppress error about including H5Apkg */ -#include "H5Apkg.h" /* Attributes */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Apkg.h" /* Attributes */ + +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Opkg.h" /* Object headers */ #define BAD_USERBLOCK_SIZE1 (hsize_t)1 #define BAD_USERBLOCK_SIZE2 (hsize_t)2 @@ -164,73 +167,19 @@ const char *FILESPACE_NAME[] = { NULL }; -/* - * Declarations for test_libver_bounds_low_high() and its associated functions: - * test_libver_bounds_super(), test_libver_bounds_super_create(), test_libver_bounds_super_open(), - * test_libver_bounds_obj(), - * test_libver_bounds_dataset(), - * test_libver_bounds_dataspace(), - * test_libver_bounds_datatype_check(), test_libver_bounds_datatype() - * test_libver_bounds_attributes() - */ -#define FILE8 "tfile8.h5" /* Test file */ - -/* See HDF5_SUPERBLOCK* versions in H5Fprivate.h */ -#define SUPERBLOCK_VERSION_3 3 - -/* See H5O* versions in H5Opkg.h */ -#define OBJ_VERSION_1 1 -#define OBJ_VERSION_2 2 -#define OBJ_VERSION_LATEST OBJ_VERSION_2 - -/* These should be in sync with H5O_obj_ver_bounds[] in H5O.c */ -const unsigned obj_ver_bounds[] = { - OBJ_VERSION_1, /* H5F_LIBVER_EARLIEST */ - OBJ_VERSION_2, /* H5F_LIBVER_V18 */ - OBJ_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_LAYOUT* versions in H5Oprivate.h */ -/* The library defines LAYOUT_VERSION_3 as the default--see H5Pdcpl.c */ -#define LAYOUT_VERSION_1 1 -#define LAYOUT_VERSION_3 3 -#define LAYOUT_VERSION_4 4 -#define LAYOUT_VERSION_DEFAULT LAYOUT_VERSION_3 -#define LAYOUT_VERSION_LATEST LAYOUT_VERSION_4 - -/* These should be in sync with H5O_layout_ver_bounds[] in H5Dlayout.c */ -const unsigned layout_ver_bounds[] = { - LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ - LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ - LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_PLINE* versions in H5Oprivate.h */ -#define PLINE_VERSION_1 1 -#define PLINE_VERSION_2 2 -#define PLINE_VERSION_LATEST H5O_PLINE_VERSION_2 - -/* These should be in sync with H5O_pline_ver_bounds[] in H5Opline.c */ -const unsigned pline_ver_bounds[] = { - PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */ - PLINE_VERSION_2, /* H5F_LIBVER_V18 */ - PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; +/* Local test function declarations for version bounds */ +static void test_libver_bounds_low_high(void); +static void test_libver_bounds_super(hid_t fapl); +static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr); +static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr); +static void test_libver_bounds_obj(hid_t fapl); +static void test_libver_bounds_dataset(hid_t fapl); +static void test_libver_bounds_dataspace(hid_t fapl); +static void test_libver_bounds_datatype(hid_t fapl); +static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid); +static void test_libver_bounds_attributes(hid_t fapl); -/* See H5O_FILL* versions in H5Oprivate.h */ -/* FILL_VERSION_2 is the default--see H5Pdcpl.c */ -#define FILL_VERSION_1 1 -#define FILL_VERSION_2 2 -#define FILL_VERSION_3 3 -#define FILL_VERSION_DEFAULT FILL_VERSION_2 -#define FILL_VERSION_LATEST H5O_FILL_VERSION_3 - -/* These should be in sync with H5O_fill_ver_bounds[] in H5Ofill.c */ -const unsigned fill_ver_bounds[] = { - FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ - FILL_VERSION_3, /* H5F_LIBVER_V18 */ - FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; +#define FILE8 "tfile8.h5" /* Test file */ #define DSET_NULL "DSET_NULL" #define DSET "DSET" @@ -238,44 +187,6 @@ const unsigned fill_ver_bounds[] = { #define DSETB "DSETB" #define DSETC "DSETC" -/* See H5O_SDSPACE* versions in H5Spkg.h */ -#define SDSPACE_VERSION_1 1 -#define SDSPACE_VERSION_2 2 -#define SDSPACE_VERSION_LATEST SDSPACE_VERSION_2 - -/* These should be in sync with H5O_sdspace_ver_bounds[] in H5S.c */ -const unsigned sdspace_ver_bounds[] = { - SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */ - SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */ - SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_DTYPE* versions in H5Tpkg.h */ -#define DTYPE_VERSION_1 1 -#define DTYPE_VERSION_2 2 -#define DTYPE_VERSION_3 3 -#define DTYPE_VERSION_LATEST DTYPE_VERSION_3 - -/* These should be in sync with H5O_dtype_ver_bounds[] in H5T.c */ -const unsigned dtype_ver_bounds[] = { - DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */ - DTYPE_VERSION_3, /* H5F_LIBVER_V18 */ - DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - -/* See H5O_ATTR* versions in H5Apkg.h */ -#define ATTR_VERSION_1 1 -#define ATTR_VERSION_2 2 -#define ATTR_VERSION_3 3 -#define ATTR_VERSION_LATEST ATTR_VERSION_3 - -/* These should be in sync with H5O_attr_ver_bounds[] in H5Aint.c */ -const unsigned attr_ver_bounds[] = { - ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ - ATTR_VERSION_3, /* H5F_LIBVER_V18 */ - ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */ -}; - static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *); static void @@ -2259,7 +2170,7 @@ test_file_double_file_dataset_open(hbool_t new_format) /* Create a chunked dataset with fixed array indexing */ sid1 = H5Screate_simple(1, dims, max_dims0); - CHECK(sid1, FAIL, "H5Screate"); + CHECK(sid1, FAIL, "H5Screate_simple"); tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); ret = H5Tset_size(tid1, H5T_VARIABLE); @@ -2285,7 +2196,7 @@ test_file_double_file_dataset_open(hbool_t new_format) /* Create a chunked dataset with extensible array indexing */ sid1 = H5Screate_simple(1, dims, max_dims1); - CHECK(sid1, FAIL, "H5Screate"); + CHECK(sid1, FAIL, "H5Screate_simple"); tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); ret = H5Tset_size(tid1, H5T_VARIABLE); @@ -2314,7 +2225,7 @@ test_file_double_file_dataset_open(hbool_t new_format) /* Create a chunked dataset with v2 btree indexing */ sid2 = H5Screate_simple(2, dims2, max_dims2); - CHECK(sid2, FAIL, "H5Screate"); + CHECK(sid2, FAIL, "H5Screate_simple"); dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); @@ -5008,8 +4919,8 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, CHECK(group, FAIL, "H5Gcreate"); ret = H5Oget_info(group, &oinfo); - CHECK(ret, FAIL, "H5Oget_info_by_name"); - VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info_by_name"); + CHECK(ret, FAIL, "H5Oget_info"); + VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info"); ret = H5Gclose(group); CHECK(ret, FAIL, "H5Gclose"); @@ -5061,252 +4972,472 @@ test_libver_bounds(void) test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2); } /* end test_libver_bounds() */ -/**************************************************************** +/************************************************************************************** ** -** test_libver_bounds_attributes(): -** Verify the attribute versions. +** test_libver_bounds_low_high(): +** Tests to verify that format versions are correct with the following five +** pairs of low/high version bounds set in fapl via H5Pset_libver_bounds(): +** (1) (earliest, v18) +** (2) (earliest, v110) +** (3) (v18, v18) +** (4) (v18, v110) +** (5) (v110, v110) ** -****************************************************************/ +** For each pair of setting in fapl, verify format versions with the following +** six tests: +** (1) test_libver_bounds_super(fapl): superblock versions +** (2) test_libver_bounds_obj(fapl): object header versions +** (3) test_libver_bounds_dataset(fapl): message versions associated with dataset +** (4) test_libver_bounds_dataspace(fapl): dataspace message versions +** (5) test_libver_bounds_datatype(fapl): datatype message versions +** (6) test_libver_bounds_attributes(fapl): attribute message versions +** +**************************************************************************************/ static void -test_libver_bounds_attributes(hid_t fapl) +test_libver_bounds_low_high(void) { - hid_t fid; /* File ID */ - hid_t fcpl; /* File creation property list */ - hid_t new_fapl; /* File access property list */ - hid_t did; /* Dataset ID */ - hid_t tid; /* Datatype ID */ - hid_t gid; /* Group ID */ - hid_t sid; /* Dataspace ID */ - hid_t aid; /* Attribute ID */ - hid_t attr_cpl; /* Attribute creation property list */ - H5A_t *attr; /* Internal attribute pointer */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - herr_t ret; /* Return value */ - - /* Retrieve the library format bounds */ - ret = H5Pget_libver_bounds(fapl, &low, &high); - CHECK(ret, FAIL, "H5Pget_libver_bounds"); - - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Integer datatpye */ - tid = H5Tcopy(H5T_NATIVE_INT); - CHECK(tid, FAIL, "H5Tcopy"); - - /* Create a committed datatype */ - ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Tcommit2"); + hid_t fapl = -1; /* File access property list */ + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* The return value */ - /* Create dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); - - /* Create a group */ - gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Gcreate2"); + /* Output message about test being performed */ + MESSAGE(5, ("Testing setting (low, high) format version bounds\n")); - /* Create an attribute to the group with the committed datatype */ - aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* Create a file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Loop through all the combinations of low/high version bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + H5E_BEGIN_TRY { + /* Set the low/high version bounds */ + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; - /* Verify the attribute version */ - if(low == H5F_LIBVER_EARLIEST) - VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); - else - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + /* Should fail: invalid combinations */ + if(high == H5F_LIBVER_EARLIEST) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + /* Should fail: invalid combinations */ + if(high < low) { + VERIFY(ret, FAIL, "H5Pset_libver_bounds"); + continue; + } - /* Create an attribute to the group with integer type */ - aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* All other combinations are valid and should succeed */ + VERIFY(ret, SUCCEED, "H5Pset_libver_bounds"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Tests to verify version bounds */ + test_libver_bounds_super(fapl); + test_libver_bounds_obj(fapl); + test_libver_bounds_dataset(fapl); + test_libver_bounds_dataspace(fapl); + test_libver_bounds_datatype(fapl); + test_libver_bounds_attributes(fapl); + } - /* Verify attribute version */ - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); +} /* end test_libver_bounds_low_high() */ - /* Enable character encoding in attribute creation property list */ - attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE); - CHECK(attr_cpl, FAIL, "H5Pcreate"); - ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8); - CHECK(ret, FAIL, "H5Pset_char_encoding"); - /* Create an attribute to the group with character encoding set */ - aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); +/*********************************************************************** +** +** test_libver_bounds_super(): +** Verify superblock version with the following two tests: +** (1) test_libver_bounds_super_create(): +** --when creating a file with the input fapl and the fcpl +** that has the following feature enabled: +** (A) default fcpl +** (B) fcpl with v1-btee K value enabled +** (C) fcpl with shared messages enabled +** (D) fcpl with persistent free-space manager enabled +** +** (2) test_libver_bounds_super_open(): +** --when opening a file which is created with the input fapl +** and the fcpl setting as #A to #D above. +** +** These two tests are run with or without SWMR file access. +** +*************************************************************************/ +static void +test_libver_bounds_super(hid_t fapl) +{ + hid_t fcpl = -1; /* File creation property list */ + herr_t ret; /* The return value */ - /* Get internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Create a default fcpl: #A */ + /* This will result in superblock version 0 */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); - /* Verify attribute version */ - if(low == H5F_LIBVER_EARLIEST) - VERIFY(attr->shared->version, ATTR_VERSION_3, "attr_ver_bounds"); - else - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + /* Verify superblock version when creating a file with input fapl, + fcpl #A and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #A and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Close the attribute creation property list */ - ret = H5Pclose(attr_cpl); + /* Close the fcpl */ + ret = H5Pclose(fcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); + /* Create a fcpl with v1-btree K value enabled: #B */ + /* This will result in superblock version 1 */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_istore_k(fcpl, 64); + CHECK(ret, FAIL, "H5Pset_istore_k"); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); + /* Verify superblock version when creating a file with input fapl, + fcpl #B and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Close the datatype */ - ret = H5Tclose(tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #B and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the fcpl */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Create a copy of the file creation property list */ + /* Create a fcpl with shared messages enabled: #C */ + /* This will result in superblock version 2 */ fcpl = H5Pcreate(H5P_FILE_CREATE); CHECK(fcpl, FAIL, "H5Pcreate"); - - /* Enable shared datatype message */ ret = H5Pset_shared_mesg_nindexes(fcpl, 1); CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); - ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create the file with shared datatype message enabled */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Integer datatye */ - tid = H5Tcopy(H5T_NATIVE_INT); - CHECK(tid, FAIL, "H5Tcopy"); + /* Verify superblock version when creating a file with input fapl, + fcpl #C and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Create dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #C and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Create a group */ - gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Gcreate2"); + /* Close the fcpl */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Create an attribute to the group with integer datatype */ - aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* Create a fcpl with persistent free-space manager enabled: #D */ + /* This will result in superblock version 2 */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); + CHECK(ret, FAIL, "H5Pset_file_space"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Verify superblock version when creating a file with input fapl, + fcpl #D and with/without SWMR access */ + test_libver_bounds_super_create(fapl, fcpl, TRUE); + test_libver_bounds_super_create(fapl, fcpl, FALSE); - /* Verify the attribute version */ - if(low == H5F_LIBVER_EARLIEST) - VERIFY(attr->shared->version, ATTR_VERSION_2, "attr_ver_bounds"); - else - VERIFY(attr->shared->version, attr_ver_bounds[low], "attr_ver_bounds"); + /* Verify superblock version when opening a file which is created + with input fapl, fcpl #D and with/without SWMR access */ + test_libver_bounds_super_open(fapl, fcpl, TRUE); + test_libver_bounds_super_open(fapl, fcpl, FALSE); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + /* Close the fcpl */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); +} /* end test_libver_bounds_super() */ - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); - /* Close the datatype */ - ret = H5Tclose(tid); - CHECK(ret, FAIL, "H5Tclose"); +/************************************************************************************************** +** +** test_libver_bounds_super_create(): +** Verify the following when the file is created with the input fapl, fcpl, and +** with/without SWMR access: +** (a) the superblock version # +** (b) the file's low bound setting +** (c) fail or succeed in creating the file +** +** For file creation, the bounds setting in fapl, the feature enabled in fcpl, +** and with/without SWMR file access will determine the results for #a to #c. +** +** The first row for the following two tables is the 5 pairs of low/high bounds setting +** in the input fapl. The next three rows list the expected results for #a to #c. +** "-->" indicates "upgrade to" +** +** Creating a file with write access +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** Superblock version | vers 0, 1, 2 | vers 0, 1, 2 | vers 2 | vers 2 | vers 3 | +** |------------------------------------------------------------------------------| +** File's low bound | no change | +** |------------------------------------------------------------------------------| +** File creation | succeed | +** |______________________________________________________________________________| +** +** Creating a file with SWMR-write access +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** Superblock version | -- | vers 3 | -- | vers 3 | vers 3 | +** |------------------------------------------------------------------------------| +** File's low bound | -- | ->v110 | -- | ->v110 | no change | +** |------------------------------------------------------------------------------| +** File creation | fail | succeed | fail | succeed | succed | +** |______________________________________________________________________________| +** +******************************************************************************************************/ +static void +test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* The return value */ - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Try to create the file */ + H5E_BEGIN_TRY { + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl); + } H5E_END_TRY; - /* Create a copy of the file access property list */ - new_fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(new_fapl, FAIL, "H5Pcreate"); + /* Get the internal file pointer if the create succeeds */ + if((ok = fid >= 0)) { + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + } - /* Create the dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); + /* Retrieve the low/high bounds */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file and group and attach an attribute to the group */ - /* Verify the attribute version */ - for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { - for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - H5E_BEGIN_TRY { - ret = H5Pset_libver_bounds(new_fapl, low, high); - } H5E_END_TRY; + if(is_swmr) { /* SWMR is enabled */ - if(ret < 0) /* Invalid low/high combinations */ - continue; + if(high == H5F_LIBVER_LATEST) { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(HDF5_SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "HDF5_superblock_ver_bounds"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds"); - /* Open the file */ + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fcreate"); + + } else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds"); + + switch(low) { + case H5F_LIBVER_EARLIEST: + ok = (f->shared->sblock->super_vers == 0 || + f->shared->sblock->super_vers == 1 || + f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); + break; + + case H5F_LIBVER_V18: + ok = (f->shared->sblock->super_vers == 2); + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); + break; + + case H5F_LIBVER_V110: + ok = (f->shared->sblock->super_vers == 3); + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); + break; + + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: + default: + ERROR("H5Pget_libver_bounds"); + + } /* end switch */ + } + + if(ok) { /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + +} /* end test_libver_bounds_super_create() */ + +/************************************************************************************************** +** +** test_libver_bounds_super_open(): +** Verify the following when opening a file which is created with the input fapl, fcpl, +** and with/without SWMR access: +** (a) the file's low bound setting +** (b) fail or succeed in opening the file +** +** (1) Create a file with the input fapl, fcpl and with/without SWMR access +** (2) Close the file +** (3) Reopen the file with a new fapl that is set to the 5 pairs of low/high bounds +** in a for loop. For each pair of setting in the new fapl: +** --Verify the expected results for #a and #b above. +** --Close the file. +** +** For file open, the file's superblock version, the low/high bounds setting in fapl, +** and with/without SWMR file access will determine the results for #a and #b. +** +** The first row for the following tables is the 5 pairs of low/high bounds setting +** in the input fapl. The next two rows list the expected results for #a and #b. +** "-->" indicates "upgrade to" +** +** Opening a file with write access +** +** Superblock version 0, 1 +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** File's low bound | no change | +** |------------------------------------------------------------------------------| +** File open | succeed | +** |______________________________________________________________________________| +** +** +** Superblock version 2 +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** File's low bound | -->v18 | no change | +** |------------------------------------------------------------------------------| +** File open | succeed | +** |______________________________________________________________________________| +** +** Superblock version 3 +** -------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) | +** |______________________________________________________________________________| +** File's low bound | -- | -->v110 | -- | -->v110 | no change | +** |------------------------------------------------------------------------------| +** File open | fail | succeed | fail | succeed | succeed | +** |______________________________________________________________________________| +** +** +** +** Opening a file with SWMR-write access +** +** Superblock version 0, 1, 2 +** ------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) | +** |_____________________________________________________________________________| +** File's low bound | ---- +** |-----------------------------------------------------------------------------| +** File open | fail +** |_____________________________________________________________________________| +** +** +** Superblock version 3 +** ------------------------------------------------------------------------------- +** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) | +** |_____________________________________________________________________________| +** File's low bound | -- | -->v110 | -- | -->v110 | no change | +** |-----------------------------------------------------------------------------| +** File open | fail | succeed | fail | succeed | succeed | +** |_____________________________________________________________________________| +** +** +******************************************************************************************************/ +static void +test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) +{ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ + hid_t new_fapl = -1; /* File access property list */ + unsigned super_vers; /* Superblock version */ + H5F_libver_t low, high; /* Low and high bounds */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* Return value */ + + /* Create the file with the input fcpl and fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + + /* The file's superblock version */ + super_vers = f->shared->sblock->super_vers; + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Create a default file access property list */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high bounds in new_fapl */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { - fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + ret = H5Pset_libver_bounds(new_fapl, low, high); } H5E_END_TRY; - if(fid >=0 ) { /* The file open succeeds */ - - /* Get the internal file pointer */ - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); + /* Invalid combinations */ + if (ret < 0) + continue; - /* Open the group */ - gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Dcreate2"); + /* Open the file with or without SWMR access */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); + } H5E_END_TRY; + ok = fid >= 0; - /* Create an attribute to the group */ - aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); - CHECK(aid, FAIL, "H5Acreate2"); + /* Verify the file open succeeds or fails */ + switch(super_vers) { + case 3: + if(high == H5F_LIBVER_LATEST) { + /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds"); - /* Get the internal attribute pointer */ - attr = (H5A_t *)H5I_object(aid); - CHECK(attr, NULL, "H5I_object"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } else /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + break; - VERIFY(attr->shared->version, attr_ver_bounds[f->shared->low_bound], "attr_ver_bounds"); + case 2: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); - /* Close the attribute */ - ret = H5Aclose(aid); - CHECK(ret, FAIL, "H5Aclose"); + ok = f->shared->low_bound >= H5F_LIBVER_V18; + VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); - /* Delete the attribute */ - ret = H5Adelete(gid, "attr1"); - CHECK(ret, FAIL, "H5Ldelete"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); + case 1: + case 0: + if(is_swmr) /* Should fail */ + VERIFY(ok, FALSE, "H5Fopen"); + else { /* Should succeed */ + VERIFY(ok, TRUE, "H5Fopen"); + VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + break; - } /* end if */ + default: + break; + } /* end switch */ } /* end for */ } /* end for */ @@ -5314,126 +5445,111 @@ test_libver_bounds_attributes(hid_t fapl) ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); - -} /* end test_libver_bounds_attributes() */ +} /* end test_libver_bounds_super_open() */ /**************************************************************** ** -** test_libver_bounds_datatype(): -** Verify the datatype message versions for parameter "tid". +** test_libver_bounds_obj(): +** Verify object header versions: +** +** (a) Create a file with: +** --the input fapl +** --a fcpl that has shared message enabled +** Verify the root group's object header version. +** Close the file. +** +** (b) Create another file with: +** --the input fapl +** --a default fcpl +** Verify the root group's object header version. +** Close the file. +** +** (c) Reopen the same file in (b) with a new fapl. +** The new fapl is set to the 5 pairs of low/high +** bounds in a "for" loop. For each setting in fapl: +** --Create a group in the file +** --Verify the group's object header version +** --Close and delete the group +** --Close the file ** ****************************************************************/ static void -test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) +test_libver_bounds_obj(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t new_fapl; /* File acess property list */ - hid_t dcpl; /* Dataset creation property list */ - hid_t dtid; /* Datatype ID for the dataset */ - hid_t str_tid; /* String datatype ID */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hsize_t dims[1] = {1}; /* Dimension sizes */ - hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ - hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */ - H5T_t *dtype; /* Internal datatype pointer */ - H5T_t *str_dtype; /* Internal datatype pointer for the string datatype */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - herr_t ret; /* Return value */ - - /* Retrieve the library format bounds */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t new_fapl = -1; /* File access property list */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + H5O_info_t oinfo; /* Object info */ + H5G_info_t ginfo; /* Group info */ + herr_t ret; /* Return value */ + + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Create a committed datatype of string */ - str_tid = H5Tcopy(H5T_C_S1); - CHECK(str_tid, FAIL, "H5Tcopy"); - ret = H5Tset_size(str_tid, (size_t)10); - CHECK(ret, FAIL, "H5Tset_size"); - ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Tcommit2"); - ret = H5Tclose(str_tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Create a default file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); - /* Create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - CHECK(sid, FAIL, "H5Screate"); + /* Enable shared message in the fcpl */ + /* This will result in a version 2 object header */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create a dataset */ - did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate2"); + /* Create the file with the fcpl and the input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); - /* Get the dataset's datatype */ - dtid = H5Dget_type(did); - CHECK(dtid, FAIL, "H5Dget_type"); + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); - /* Get the internal datatype pointer */ - dtype = (H5T_t *)H5I_object(dtid); - CHECK(dtype, NULL, "H5I_object"); + /* Verify object header version is 2 because shared message is enabled */ + VERIFY(oinfo.hdr.version, H5O_VERSION_2, "H5O_obj_ver_bounds"); - /* Verify the datatype versions */ - /* Datatype version is upgraded only for H5T_COMPOUND, H5T_ENUM, H5T_ARRAY */ - /* H5T_VLEN: the version is upgraded if the parent datatype version is greater */ - /* Remaining datatypes use basic version: - H5T_INTEGER H5T_FLOAT H5T_TIME H5T_STRING H5T_BITFIELD H5T_OPAQUE H5T_REFERENCE */ + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || - dtype->shared->type == H5T_ARRAY) { - if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) - VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); - else - VERIFY(dtype->shared->version, dtype_ver_bounds[low], "dtype_ver_bounds"); - } else - VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + /* Close the file creation property list */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); + /* Create a file with the default fcpl and input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Dclose"); + /* Get root group's object info */ + ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); - /* Close the datatype */ - ret = H5Tclose(dtid); - CHECK(ret, FAIL, "H5Fclose"); + /* Verify object header version is as indicated by low_bound */ + VERIFY(oinfo.hdr.version, H5O_obj_ver_bounds[low], "H5O_obj_ver_bounds"); /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Create a copy of file access property list */ + /* Create a new default file access property list which + is used to open the file in the "for" loop */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Prepare to create a chunked dataset with 2 unlimited dimensions */ - sid = H5Screate_simple(2, dims2, max_dims2); - CHECK(sid, FAIL, "H5Screate"); - dcpl = H5Pcreate(H5P_DATASET_CREATE); - CHECK(dcpl, FAIL, "H5Pcreate"); - ret = H5Pset_chunk(dcpl, 2, chunks); - CHECK(ret, FAIL, "H5Pset_chunk"); - - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file and create the chunked dataset */ - /* Verify the dataset's datatype versions */ + /* Loop through all the combinations of low/high bounds in new_fapl */ + /* Open the file with the fapl; create a group and verify the + object header version, then delete the group and close the file.*/ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); } H5E_END_TRY; - if (ret < 0) /* Invalid low/high combinations */ + if (ret < 0) /* Invalid combinations */ continue; /* Open the file */ @@ -5441,59 +5557,41 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); } H5E_END_TRY; - if(fid >= 0 ) { /* The file open succeeds */ + if(fid >=0 ) { /* The file open succeeds */ /* Get the internal file pointer */ f = (H5F_t *)H5I_object(fid); CHECK(f, NULL, "H5I_object"); - /* Verify the committed datatype's version */ - str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT); - CHECK(str_tid, FAIL, "H5Topen2"); - str_dtype = (H5T_t *)H5I_object(str_tid); - CHECK(str_dtype, NULL, "H5I_object"); + /* Create a group in the file */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); - VERIFY(str_dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); + /* Get group information */ + ret = H5Gget_info(gid, &ginfo); + CHECK(ret, FAIL, "H5Gget_info"); - ret = H5Tclose(str_tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Verify group storage type */ + if(f->shared->low_bound >= H5F_LIBVER_V18) + /* Links in group are stored in object header */ + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info"); + else + /* Links in group are stored with a "symbol table" */ + VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info"); + /* Get object header information */ + ret = H5Oget_info_by_name(gid, GRP_NAME, &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); - /* Create the chunked dataset */ - did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate2"); + /* Verify object header version as indicated by low_bound */ + VERIFY(oinfo.hdr.version, H5O_obj_ver_bounds[f->shared->low_bound], "H5O_obj_ver_bounds"); - /* Get the dataset's datatype */ - dtid = H5Dget_type(did); - CHECK(dtid, FAIL, "H5Dget_type"); - - /* Get the internal datatype pointer */ - dtype = (H5T_t *)H5I_object(dtid); - CHECK(dtype, NULL, "H5I_object"); - - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || - dtype->shared->type == H5T_ARRAY) { - - if(dtype->shared->type == H5T_ARRAY && - f->shared->low_bound == H5F_LIBVER_EARLIEST) - VERIFY(dtype->shared->version, DTYPE_VERSION_2, "dtype_ver_bounds"); - else - VERIFY(dtype->shared->version, dtype_ver_bounds[f->shared->low_bound], "dtype_ver_bounds"); - - } else /* not compound/enum/array */ - VERIFY(dtype->shared->version, dtype_ver_bounds[H5F_LIBVER_EARLIEST], "dtype_ver_bounds"); - - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); - - /* Close the dataset's datatype */ - ret = H5Tclose(dtid); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); - /* Delete the dataset */ - ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); + /* Delete the group */ + ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); /* Close the file */ @@ -5508,118 +5606,282 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); +} /* end test_libver_bounds_obj() */ + +/**************************************************************** +** +** test_libver_bounds_dataset(): +** Verify message versions associated with datasets: +** +** (a) Create a file with default fcpl and the input fapl. +** Create the following two datasets: +** --A contiguous dataset +** --A chunked dataset with "no filter edge chunks" +** For both datasets, verify the versions for the layout, +** fill value and filter pipeline messages. +** Close the file. +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in the +** new fapl: +** --Open the same file in (a) with the fapl +** --Create a chunked dataset with 2 unlimited +** dimensions +** --Verify the versions for the layout, fill value +** and filter pipeline messages +** --Close and delete the dataset +** --Close the file +** +****************************************************************/ +static void +test_libver_bounds_dataset(hid_t fapl) +{ + hid_t fid = -1; /* File ID */ + hid_t new_fapl = -1; /* File access property list */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + H5D_t *dset = NULL; /* Internal dataset pointer */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* Return value */ + hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */ + hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */ + hsize_t dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + + /* Retrieve the low/high bounds from the input fapl */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file with the input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create the dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a contiguous dataset */ + did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); + + /* Get the internal dataset pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify version for layout and fill value messages */ + if(low == H5F_LIBVER_EARLIEST) { + /* For layout message: the earliest version the library will set is 3 */ + /* For fill value message: the earliest version the library will set is 2 */ + VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[low], "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[low], "H5O_fill_ver_bounds"); + } + + /* Verify filter pipleline message version */ + VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[low], "H5O_pline_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + /* Close the dataspace */ ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); - /* Close the dataset creation property list */ + /* Set up dataspace and dcpl for creating a chunked dataset + with "no filter edge chunks" enabled. + This will result in a version 4 layout message */ + sid = H5Screate_simple(2, fix_dims2, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, fix_chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); + ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + CHECK(ret, FAIL, "H5Pset_chunk_opts"); + + /* Create the chunked dataset */ + H5E_BEGIN_TRY { + did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } H5E_END_TRY; + + if(did >= 0) { + + /* Get the internal dataset pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); + + /* Verify layout message version and chunk indexing type */ + VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_4, "H5O_layout_ver_bounds"); + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + } + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datset creation property list */ ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_datatype_check() */ + /* Create a default file access property list which is used + to open the file in the 'for' loop */ + new_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(new_fapl, FAIL, "H5Pcreate"); -/**************************************************************** -** -** test_libver_bounds_datatype(): -** Verify the datatype versions for various datatypes. -** -****************************************************************/ -static void -test_libver_bounds_datatype(hid_t fapl) -{ - hid_t tid, tid_enum, tid_array, tid_compound, tid_vlen; /* Datatype IDs */ - int enum_value; /* Value for enum datatype */ - typedef struct s1 { /* Data structure for compound datatype */ - char c; - int i; - } s1; - hsize_t dims[1] = {1}; /* Dimension sizes */ - herr_t ret; /* Return value */ + /* Set up dataspace and dcpl for creating a chunked dataset with + 2 unlimited dimensions in the 'for' loop */ + sid = H5Screate_simple(2, dims2, max_dims2); + CHECK(sid, FAIL, "H5Screate_simple"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, chunks2); + CHECK(ret, FAIL, "H5Pset_chunk"); - /* Create integer datatype */ - tid = H5Tcopy(H5T_NATIVE_INT); + /* Loop through all the combinations of low/high bounds in new_fapl */ + /* Open the file with the fapl and create the chunked dataset */ + /* Verify the dataset's layout, fill value and filter pipleline message versions */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid); + if (ret < 0) /* Invalid low/high combinations */ + continue; - /* Create enum datatype */ - tid_enum = H5Tenum_create(tid); - enum_value = 0; - H5Tenum_insert(tid_enum, "val1", &enum_value); - enum_value = 1; - H5Tenum_insert(tid_enum, "val2", &enum_value); + /* Open the file */ + H5E_BEGIN_TRY { + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); + } H5E_END_TRY; - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_enum); + if(fid >=0 ) { /* The file open succeeds */ - /* Create array datatype */ - tid_array = H5Tarray_create2(tid, 1, dims); + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_array); + /* Create the chunked dataset */ + did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); - /* Create compound datatype */ - tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1)); - H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE); - H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + /* Get the internal file pointer */ + dset = (H5D_t *)H5I_object(did); + CHECK(dset, NULL, "H5I_object"); - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_compound); + /* Verify the dataset's layout, fill value and filter pipeline message versions */ + /* Also verify the chunk indexing type */ + if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { + /* For layout message: the earliest version the library will set is 3 */ + /* For fill value message: the earliest version the library will set is 2 */ + VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); + } else { + VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound], "H5O_layout_ver_bounds"); + VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[f->shared->low_bound], "H5O_fill_ver_bounds"); + } - /* Create vlen datatype */ - tid_vlen = H5Tvlen_create(tid); + /* Verify the filter pipeline message version */ + VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound], "H5O_pline_ver_bounds"); - /* Verify datatype versions */ - test_libver_bounds_datatype_check(fapl, tid_vlen); + /* Verify the dataset's chunk indexing type */ + if(dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST) + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type"); + else + VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type"); - /* Close datatypes */ - ret = H5Tclose(tid); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); - ret = H5Tclose(tid_enum); - CHECK(ret, FAIL, "H5Tclose"); + /* Delete the dataset */ + ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); - ret = H5Tclose(tid_array); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); - ret = H5Tclose(tid_compound); - CHECK(ret, FAIL, "H5Tclose"); + } /* end if */ + } /* end for */ + } /* end for */ - ret = H5Tclose(tid_vlen); - CHECK(ret, FAIL, "H5Tclose"); + /* Close the file access property list */ + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_datatype() */ + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_libver_bounds_dataset() */ /**************************************************************** ** ** test_libver_bounds_dataspace(): -** Verify the dataspace message versions. +** Verify dataspace message versions: +** +** (a) Create a file with default fcpl and the input fapl. +** Create the following two datasets: +** --A dataset with scalar dataspace +** --A dataset with null dataspace +** For both datasets, verify the dataspace message versions. +** Close the file. +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in the +** new fapl: +** --Open the same file in (a) with the fapl +** --Create a chunked dataset, a compact dataset and +** a contigous dataset +** --Verify the dataspace message version for these +** three datasets +** --Delete the three datasets and the dataspaces +** --Close the file ** ****************************************************************/ static void test_libver_bounds_dataspace(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t new_fapl; /* File access property list */ - hid_t did, did_null, did_compact, did_contig; /* Dataset IDs */ - hid_t sid, sid_null, sid_compact, sid_contig; /* Dataspace IDs */ - hid_t dcpl, dcpl_compact, dcpl_contig; /* Dataset creation property lists */ - H5S_t *space, *space_null; /* Internal dataspace pointers */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - hsize_t dims[1] = {1}; /* Dimension sizes */ - hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ - hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunks[1] = {4}; /* Chunk dimension sizes */ - herr_t ret; /* Return value */ - - /* Create null dataspace, scalar dataspace */ - - /* Retrieve the library format bounds */ + hid_t fid = -1; /* File ID */ + hid_t new_fapl = -1; /* File access property list */ + hid_t did = -1, did_null = -1; /* Dataset IDs */ + hid_t did_compact = -1, did_contig = -1; /* Dataset IDs */ + hid_t sid = -1, sid_null = -1; /* Dataspace IDs */ + hid_t sid_compact = -1, sid_contig = -1; /* Dataspace IDs */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dcpl_compact = -1, dcpl_contig = -1; /* Dataset creation property lists */ + H5S_t *space = NULL, *space_null = NULL; /* Internal dataspace pointers */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[1] = {4}; /* Chunk dimension sizes */ + herr_t ret; /* Return value */ + + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Create the file */ + /* Create the file with the input fapl */ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); @@ -5627,7 +5889,7 @@ test_libver_bounds_dataspace(hid_t fapl) sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); - /* Create the dataset with scalar dataspace */ + /* Create a dataset with the scalar dataspace */ did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate"); @@ -5638,13 +5900,13 @@ test_libver_bounds_dataspace(hid_t fapl) CHECK(space, NULL, "H5I_object"); /* Verify the dataspace version */ - VERIFY(space->extent.version, sdspace_ver_bounds[low], "sdspace_ver_bounds"); + VERIFY(space->extent.version, H5O_sdspace_ver_bounds[low], "H5O_sdspace_ver_bounds"); /* Create null dataspace */ sid_null = H5Screate(H5S_NULL); CHECK(sid_null, FAIL, "H5Screate"); - /* Create the dataset with null dataspace */ + /* Create a dataset with the null dataspace */ did_null = H5Dcreate2(fid, DSET_NULL, H5T_NATIVE_INT, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(did_null, FAIL, "H5Dcreate"); @@ -5655,7 +5917,7 @@ test_libver_bounds_dataspace(hid_t fapl) CHECK(space_null, NULL, "H5I_object"); /* Verify the dataspace version */ - VERIFY(space_null->extent.version, SDSPACE_VERSION_2, "sdspace_ver_bounds"); + VERIFY(space_null->extent.version, H5O_SDSPACE_VERSION_2, "H5O_sdspace_ver_bounds"); /* Close the datasets */ ret = H5Dclose(did); @@ -5673,38 +5935,38 @@ test_libver_bounds_dataspace(hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - - /* Create a copy of file access property list */ + /* Create a default file access property list which is used + to open the file in the 'for' loop */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Prepare to create a chunked dataset with 1 unlimited dimension */ + /* Set up dataspace and dcpl for creating a chunked dataset */ sid = H5Screate_simple(1, dims, max_dims); - CHECK(sid, FAIL, "H5Screate"); + CHECK(sid, FAIL, "H5Screate_simple"); dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); ret = H5Pset_chunk(dcpl, 1, chunks); CHECK(ret, FAIL, "H5Pset_chunk"); - /* Prepare to create a compact dataset */ + /* Set up dataspace and dcpl for creating a compact dataset */ sid_compact = H5Screate_simple(1, dims, NULL); - CHECK(sid_compact, FAIL, "H5Screate"); + CHECK(sid_compact, FAIL, "H5Screate_simple"); dcpl_compact = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl_compact, FAIL, "H5Pcreate"); ret = H5Pset_layout(dcpl_compact, H5D_COMPACT); CHECK(ret, FAIL, "H5Pset_layout"); - /* Prepare to create a contiguous dataset */ + /* Set up dataspace and dcpl for creating a contiguous dataset */ sid_contig = H5Screate_simple(2, dims2, NULL); - CHECK(sid_contig, FAIL, "H5Screate"); + CHECK(sid_contig, FAIL, "H5Screate_simple"); dcpl_contig = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl_contig, FAIL, "H5Pcreate"); ret = H5Pset_layout(dcpl_contig, H5D_CONTIGUOUS); CHECK(ret, FAIL, "H5Pset_layout"); - /* Loop through all the combinations of low/high library format bounds */ + /* Loop through all the combinations of low/high bounds in new_fapl */ /* Open the file and create the chunked/compact/contiguous datasets */ - /* Verify the dataspace version for the three datasets */ + /* Verify the dataspace message version for the three datasets */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { hid_t tmp_sid, tmp_sid_compact, tmp_sid_contig; /* Dataspace IDs */ @@ -5758,9 +6020,10 @@ test_libver_bounds_dataspace(hid_t fapl) tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig); CHECK(tmp_space_contig, NULL, "H5I_object"); - VERIFY(tmp_space->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); - VERIFY(tmp_space_compact->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); - VERIFY(tmp_space_contig->extent.version, sdspace_ver_bounds[f->shared->low_bound], "sdspace_ver_bounds"); + /* Verify versions for the three dataspaces */ + VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds"); + VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds"); + VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds"); /* Close the three datasets */ ret = H5Dclose(did); @@ -5770,6 +6033,7 @@ test_libver_bounds_dataspace(hid_t fapl) ret = H5Dclose(did_contig); CHECK(ret, FAIL, "H5Dclose"); + /* Close the three dataspaces */ ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); ret = H5Sclose(tmp_sid_compact); @@ -5815,127 +6079,218 @@ test_libver_bounds_dataspace(hid_t fapl) } /* end test_libver_bounds_dataspace() */ + /**************************************************************** ** -** test_libver_bounds_dataset(): -** Verify the dataset's layout, fill, and pline message versions -** with the low/high library format bounds setting in the fapl. -** For chunked dataset, also verify the chunked indexing type. +** test_libver_bounds_datatype(): +** Verify the datatype message version: +** +** (a) Create the following datatypes: +** 1) integer +** 2) enum +** 3) array +** 4) compound +** 5) vlen +** (b) Call test_libver_bounds_datatype_check() for each +** datatype in (a) to verify the datatype message version. ** ****************************************************************/ static void -test_libver_bounds_dataset(hid_t fapl) +test_libver_bounds_datatype(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t new_fapl; /* File access property list */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t dcpl; /* Dataset creation property list */ - H5D_t *dset; /* Internal dataset pointer */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - herr_t ret; /* Return value */ - hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */ - hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */ - hsize_t dims2[2] = {1, 4}; /* Dimension sizes */ - hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + hid_t tid = -1, tid_enum = -1, tid_array = -1; /* Datatype IDs */ + hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ + int enum_value; /* Value for enum datatype */ + typedef struct s1 { /* Data structure for compound datatype */ + char c; + int i; + } s1; + hsize_t dims[1] = {1}; /* Dimension sizes */ + herr_t ret; /* Return value */ - /* Retrieve the library format bounds */ - ret = H5Pget_libver_bounds(fapl, &low, &high); - CHECK(ret, FAIL, "H5Pget_libver_bounds"); + /* Create integer datatype */ + tid = H5Tcopy(H5T_NATIVE_INT); - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid); - /* Create the dataspace */ - sid = H5Screate(H5S_SCALAR); - CHECK(sid, FAIL, "H5Screate"); + /* Create enum datatype */ + tid_enum = H5Tenum_create(tid); + enum_value = 0; + H5Tenum_insert(tid_enum, "val1", &enum_value); + enum_value = 1; + H5Tenum_insert(tid_enum, "val2", &enum_value); - /* Create a contiguous dataset */ - did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_enum); - /* Get the internal dataset pointer */ - dset = (H5D_t *)H5I_object(did); - CHECK(dset, NULL, "H5I_object"); + /* Create array datatype */ + tid_array = H5Tarray_create2(tid, 1, dims); - /* Verify layout and fill messages version */ - if(low == H5F_LIBVER_EARLIEST) { - VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); - } else { - VERIFY(dset->shared->layout.version, layout_ver_bounds[low], "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[low], "fill_ver_bounds"); - } + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_array); - /* Verify pline message version */ - VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[low], "pline_ver_bounds"); + /* Create compound datatype */ + tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1)); + H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE); + H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_compound); - /* Close the dataspace */ - ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); + /* Create vlen datatype */ + tid_vlen = H5Tvlen_create(tid); - /* Create a chunked dataset with "no filter edge chunks" enabled */ - sid = H5Screate_simple(2, fix_dims2, NULL); - CHECK(sid, FAIL, "H5Screate"); - dcpl = H5Pcreate(H5P_DATASET_CREATE); - CHECK(dcpl, FAIL, "H5Pcreate"); - ret = H5Pset_chunk(dcpl, 2, fix_chunks2); - CHECK(ret, FAIL, "H5Pset_chunk"); - ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); - CHECK(ret, FAIL, "H5Pset_chunk_opts"); + /* Verify datatype message version */ + test_libver_bounds_datatype_check(fapl, tid_vlen); - H5E_BEGIN_TRY { - did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - } H5E_END_TRY; + /* Close the datatypes */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); - if(did >= 0) { + ret = H5Tclose(tid_enum); + CHECK(ret, FAIL, "H5Tclose"); - /* Get the internal dataset pointer */ - dset = (H5D_t *)H5I_object(did); - CHECK(dset, NULL, "H5I_object"); + ret = H5Tclose(tid_array); + CHECK(ret, FAIL, "H5Tclose"); - VERIFY(dset->shared->layout.version, LAYOUT_VERSION_4, "layout_ver_bounds"); - VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type"); + ret = H5Tclose(tid_compound); + CHECK(ret, FAIL, "H5Tclose"); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); - } + ret = H5Tclose(tid_vlen); + CHECK(ret, FAIL, "H5Tclose"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); +} /* end test_libver_bounds_datatype() */ + +/**************************************************************** +** +** test_libver_bounds_datatype_check(): +** Helper routine called by test_libver_bounds_datatype() +** to verify the datatype message version for the input tid: +** +** (a) Create a file with default fcpl and the input fapl. +** Create a contiguous dataset with the input tid. +** Verify the datatype message version. +** Create a committed datatype of string to be +** used later. +** Close the file. +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in +** the new fapl: +** --Open the same file in (a) with the fapl +** --Verify the message version for the committed +** datatype created earlier +** --Create a chunked dataset with the input tid +** --Verify the datatype message version +** --Close and delete the dataset +** --Close the file +** +****************************************************************/ +static void +test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) +{ + hid_t fid = -1; /* File ID */ + hid_t new_fapl = -1; /* File acess property list */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t dtid = -1; /* Datatype ID for the dataset */ + hid_t str_tid = -1; /* String datatype ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hsize_t dims[1] = {1}; /* Dimension sizes */ + hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */ + H5T_t *dtype = NULL; /* Internal datatype pointer */ + H5T_t *str_dtype = NULL; /* Internal datatype pointer for the string datatype */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* Return value */ + + /* Retrieve the low/high version bounds from the input fapl */ + ret = H5Pget_libver_bounds(fapl, &low, &high); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + + /* Create the file with the input fapl */ + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create a committed datatype of string which will be used + later inside the 'for' loop */ + str_tid = H5Tcopy(H5T_C_S1); + CHECK(str_tid, FAIL, "H5Tcopy"); + ret = H5Tset_size(str_tid, (size_t)10); + CHECK(ret, FAIL, "H5Tset_size"); + ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Create a dataset with the input tid */ + did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); + + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); + + /* Verify the datatype message version */ + /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 + * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: + * --the library will only use basic version + */ + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[low], "H5O_dtype_ver_bounds"); + } else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds"); + + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); /* Close the dataspace */ ret = H5Sclose(sid); - CHECK(ret, FAIL, "H5Sclose"); + CHECK(ret, FAIL, "H5Dclose"); - /* Close the datset creation property list */ - ret = H5Pclose(dcpl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); - /* Create a copy of file access property list */ + /* Create a default file access property list */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Prepare to create a chunked dataset with 2 unlimited dimensions */ + /* Set up dataspace and dcpl for creating a chunked dataset */ sid = H5Screate_simple(2, dims2, max_dims2); - CHECK(sid, FAIL, "H5Screate"); + CHECK(sid, FAIL, "H5Screate_simple"); dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); - ret = H5Pset_chunk(dcpl, 2, chunks2); + ret = H5Pset_chunk(dcpl, 2, chunks); CHECK(ret, FAIL, "H5Pset_chunk"); - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file and create the chunked dataset */ - /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ + /* Loop through all the combinations of low/high bounds */ + /* Open the file and create the chunked dataset with the input tid */ + /* Verify the dataset's datatype message version */ + /* Also verify the committed atatype message version */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { @@ -5950,41 +6305,66 @@ test_libver_bounds_dataset(hid_t fapl) fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); } H5E_END_TRY; - if(fid >=0 ) { /* The file open succeeds */ + if(fid >= 0 ) { /* The file open succeeds */ /* Get the internal file pointer */ f = (H5F_t *)H5I_object(fid); CHECK(f, NULL, "H5I_object"); + /* Open the committed datatype */ + str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT); + CHECK(str_tid, FAIL, "H5Topen2"); + str_dtype = (H5T_t *)H5I_object(str_tid); + CHECK(str_dtype, NULL, "H5I_object"); + + /* Verify the committed datatype message version */ + VERIFY(str_dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds"); + + /* Close the committed datatype */ + ret = H5Tclose(str_tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Create the chunked dataset */ - did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate2"); - /* Get the internal file pointer */ - dset = (H5D_t *)H5I_object(did); - CHECK(dset, NULL, "H5I_object"); + /* Get the dataset's datatype */ + dtid = H5Dget_type(did); + CHECK(dtid, FAIL, "H5Dget_type"); - /* Verify the dataset's layout, fill, pline message versions and chunked indexing type */ - if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { - VERIFY(dset->shared->layout.version, LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, FILL_VERSION_DEFAULT, "fill_ver_bounds"); - } else { - VERIFY(dset->shared->layout.version, layout_ver_bounds[f->shared->low_bound], "layout_ver_bounds"); - VERIFY(dset->shared->dcpl_cache.fill.version, fill_ver_bounds[f->shared->low_bound], "fill_ver_bounds"); - } + /* Get the internal datatype pointer */ + dtype = (H5T_t *)H5I_object(dtid); + CHECK(dtype, NULL, "H5I_object"); - VERIFY(dset->shared->dcpl_cache.pline.version, pline_ver_bounds[f->shared->low_bound], "pline_ver_bounds"); - if(dset->shared->layout.version == LAYOUT_VERSION_LATEST) - VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type"); - else - VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type"); + /* Verify the dataset's datatype message version */ + /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 + * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: + * --the library will only use basic version + */ + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || + dtype->shared->type == H5T_ARRAY) { + if(dtype->shared->type == H5T_ARRAY && + f->shared->low_bound == H5F_LIBVER_EARLIEST) + VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); + else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound], "H5O_dtype_ver_bounds"); + } else + VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds"); /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); + /* Close the dataset's datatype */ + ret = H5Tclose(dtid); + CHECK(ret, FAIL, "H5Tclose"); + /* Delete the dataset */ - ret = H5Ldelete(fid, DSETC, H5P_DEFAULT); + ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); /* Close the file */ @@ -6007,242 +6387,283 @@ test_libver_bounds_dataset(hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_dataset() */ +} /* end test_libver_bounds_datatype_check() */ /**************************************************************** ** -** test_libver_bounds_obj(): -** Verify object header version with the low/high library -** format bounds setting in the fapl. +** test_libver_bounds_attributes(): +** Verify the attribute message versions: +** +** (a) Create a file with default fcpl and the input fapl. +** Create a group and attach the following three attributes +** to the group: +** (1) Attribute with a committed datatype +** (2) Attribute with integer type +** (3) Attribute with character encoding set +** Verify the three attributes' message versions. +** Close the file. +** +** (b) Create a fcpl that has shared datatype message enabled. +** Create a file with the fcpl and the input fapl. +** Create a group and attach an attribute with shared +** integer type to the group. +** Verify the attribute message version. +** Close the file +** +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in +** the new fapl: +** --Open the same file in (b) with the fapl +** --Open the group and attach an attribute with integer +** type to the group +** --Verify the attribute message version +** --Delete the attribute +** --Close the group and the file ** ****************************************************************/ static void -test_libver_bounds_obj(hid_t fapl) +test_libver_bounds_attributes(hid_t fapl) { - hid_t fid; /* File ID */ - hid_t gid; /* Group ID */ - hid_t fcpl; /* File creation property list */ - hid_t new_fapl; /* File access property list */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - H5O_info_t oinfo; /* Object info */ - H5G_info_t ginfo; /* Group info */ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t new_fapl = -1; /* File access property list */ + hid_t tid = -1; /* Datatype ID */ + hid_t gid = -1; /* Group ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t attr_cpl = -1; /* Attribute creation property list */ + H5A_t *attr = NULL; /* Internal attribute pointer */ + H5F_t *f = NULL; /* Internal file pointer */ + H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the format bounds */ + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); - /* Get a copy of file creation property list */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - - /* Enable shared message */ - ret = H5Pset_shared_mesg_nindexes(fcpl, 1); - CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); - ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); - CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create the file */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); - /* Get root group's object info */ - ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Oget_info"); + /* Integer datatpye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); - /* Verify object header version is 2 when shared message is enabled */ - VERIFY(oinfo.hdr.version, OBJ_VERSION_2, "H5Oget_info"); + /* Create a committed datatype */ + ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); - /* Close the file creation property list */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Fclose"); + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); - /* Create a file with default fcpl */ - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); + /* Attach an attribute to the group with the committed datatype */ + aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - /* Get root group's object info */ - ret = H5Oget_info_by_name(fid, "/", &oinfo, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Oget_info"); + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - /* Verify object header version */ - VERIFY(oinfo.hdr.version, obj_ver_bounds[low], "obj_ver_bounds"); + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + /* The earliest version the library can set for an attribute with committed datatype is 2 */ + VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds"); + else + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - /* Create a copy of file access property list */ - new_fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(new_fapl, FAIL, "H5Pcreate"); + /* Create an attribute to the group with integer type */ + aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - /* Loop through all the combinations of low/high library format bounds */ - /* Open the file to verify object header version */ - for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { - for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - H5E_BEGIN_TRY { - ret = H5Pset_libver_bounds(new_fapl, low, high); - } H5E_END_TRY; + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - if (ret < 0) /* Invalid combinations */ - continue; + /* Verify attribute version */ + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); - /* Open the file */ - H5E_BEGIN_TRY { - fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); - } H5E_END_TRY; + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - if(fid >=0 ) { /* The file open succeeds */ + /* Enable character encoding in attribute creation property list */ + attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE); + CHECK(attr_cpl, FAIL, "H5Pcreate"); + ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8); + CHECK(ret, FAIL, "H5Pset_char_encoding"); - /* Get the internal file pointer */ - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); - - /* Create a group in the file */ - gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Gcreate2"); - - /* Get group information */ - ret = H5Gget_info(gid, &ginfo); - CHECK(ret, FAIL, "H5Gget_info"); + /* Attach an attribute to the group with character encoding set */ + aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - /* Verify group storage type */ - if(f->shared->low_bound >= H5F_LIBVER_V18) - VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info"); - else - VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info"); + /* Get internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - /* Get object header information */ - ret = H5Oget_info_by_name(gid, GRP_NAME, &oinfo, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Oget_info"); + /* Verify attribute version */ + if(low == H5F_LIBVER_EARLIEST) + /* The earliest version the library can set for an attribute with character encoding is 3 */ + VERIFY(attr->shared->version, H5O_ATTR_VERSION_3, "H5O_attr_ver_bounds"); + else + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); - /* Verify object header version */ - VERIFY(oinfo.hdr.version, obj_ver_bounds[f->shared->low_bound], "obj_ver_bounds"); + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - /* Close the group */ - ret = H5Gclose(gid); - CHECK(ret, FAIL, "H5Gclose"); + /* Close the attribute creation property list */ + ret = H5Pclose(attr_cpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Delete the group */ - ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Gclose"); + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); - } /* end if */ - } /* end for */ - } /* end for */ + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); - /* Close the file access property list */ - ret = H5Pclose(new_fapl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); -} /* end test_libver_bounds_obj() */ + /* Create a copy of the file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); -/**************************************************************** -** -** test_libver_bounds_super(): -** Verify open of a file with 0, 1, 2 and 3 superblock versions. -** -****************************************************************/ -static void -test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) -{ - hid_t fid; /* File ID */ - H5F_t *f; /* Internal file pointer */ - hid_t new_fapl; /* File access property list */ - unsigned super_vers; /* Superblock version */ - H5F_libver_t low, high; /* File format bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* Return value */ + /* Enable shared datatype message */ + ret = H5Pset_shared_mesg_nindexes(fcpl, 1); + CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); + ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2); + CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Create the file */ + /* Create the file with shared datatype message enabled */ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); - /* Get the internal file pointer */ - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); + /* Create an integer datatye */ + tid = H5Tcopy(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tcopy"); - /* The file's superblock version */ - super_vers = f->shared->sblock->super_vers; + /* Create dataspace */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create a group */ + gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Attach an attribute to the group with shared integer datatype */ + aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); + + /* Verify the attribute version */ + if(low == H5F_LIBVER_EARLIEST) + /* The earliest version the library can set for an attribute with shared datatype is 2 */ + VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds"); + else + VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); + + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close the datatype */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Create a file access property list */ + /* Create a default file access property list */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Loop through all the combinations of low/high library format bounds */ + /* Create a scalar dataspace to be used later for the attribute */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Loop through all the combinations of low/high bounds */ + /* Open the file and group and attach an attribute to the group */ + /* Verify the attribute version */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); } H5E_END_TRY; - /* Invalid combinations */ - if (ret < 0) + if(ret < 0) /* Invalid low/high combinations */ continue; - /* Open the file with or without SWMR */ + /* Open the file */ H5E_BEGIN_TRY { - fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); + fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); } H5E_END_TRY; - ok = fid >= 0; - /* Verify the file open succeeds or fails */ - switch(super_vers) { - case 3: - if(high == H5F_LIBVER_LATEST) { - /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); - VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); + if(fid >=0 ) { /* The file open succeeds */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } else /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); - break; + /* Get the internal file pointer */ + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); - case 2: - if(is_swmr) /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); - else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); + /* Open the group */ + gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); - ok = f->shared->low_bound >= H5F_LIBVER_V18; - VERIFY(ok, TRUE, "superblock_ver_bounds"); + /* Attach an attribute to the group */ + aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } - break; + /* Get the internal attribute pointer */ + attr = (H5A_t *)H5I_object(aid); + CHECK(attr, NULL, "H5I_object"); - case 1: - case 0: - if(is_swmr) /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); - else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); + /* Verify the attribute message version */ + VERIFY(attr->shared->version, H5O_attr_ver_bounds[f->shared->low_bound], "H5O_attr_ver_bounds"); - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } - break; + /* Close the attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); - default: - break; - } /* end switch */ + /* Delete the attribute */ + ret = H5Adelete(gid, "attr1"); + CHECK(ret, FAIL, "H5Adelete"); + + /* Close the group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + } /* end if */ } /* end for */ } /* end for */ @@ -6250,232 +6671,11 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); -} /* end test_libver_bounds_super_open() */ - -/**************************************************************** -** -** test_libver_bounds_super_create(): -** Verify the superblock version with the low/high library -** version bounds setting in the fapl. -** -****************************************************************/ -static void -test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) -{ - hid_t fid; /* File ID */ - H5F_t *f; /* Internal file pointer */ - H5F_libver_t low, high; /* File format bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* The return value */ - - /* Try to create the file */ - H5E_BEGIN_TRY { - fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl); - } H5E_END_TRY; - - /* Get the internal file pointer if the create succeeds */ - if((ok = fid >= 0)) { - f = (H5F_t *)H5I_object(fid); - CHECK(f, NULL, "H5I_object"); - } - - /* Retrieve the format bounds */ - ret = H5Pget_libver_bounds(fapl, &low, &high); - CHECK(ret, FAIL, "H5Pget_libver_bounds"); - - if(is_swmr) { /* SWMR is enabled */ - - if(high == H5F_LIBVER_LATEST) { /* Superblock version is 3 */ - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "superblock_ver_bounds"); - VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "superblock_ver_bounds"); - - } else /* Should fail */ - VERIFY(ok, FALSE, "H5Fcreate"); - - } else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fcreate"); - - switch(low) { - case H5F_LIBVER_EARLIEST: - ok = (f->shared->sblock->super_vers == 0 || - f->shared->sblock->super_vers == 1 || - f->shared->sblock->super_vers == 2); - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); - break; - - case H5F_LIBVER_V18: - ok = (f->shared->sblock->super_vers == 2); - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); - break; - - case H5F_LIBVER_V110: - ok = (f->shared->sblock->super_vers == 3); - VERIFY(ok, TRUE, "H5Fcreate"); - VERIFY(low, f->shared->low_bound, "superblock_ver_bounds"); - break; - - case H5F_LIBVER_ERROR: - case H5F_LIBVER_NBOUNDS: - default: - ERROR("H5Pget_libver_bounds"); - - } /* end switch */ - } - - if(ok) { /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - } - -} /* end test_libver_bounds_super_create() */ - -/**************************************************************** -** -** test_libver_bounds_super(): -** Verify superblock version via: -** test_libver_bounds_super_create() -** test_libver_bounds_super_open() -** -****************************************************************/ -static void -test_libver_bounds_super(hid_t fapl) -{ - hid_t fcpl; - herr_t ret; - - /* Create a default fcpl */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - - /* Verify superblock version is 0 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 0 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - - /* Create fcpl with non-default v1-btree K value enabled */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - - ret = H5Pset_istore_k(fcpl, 64); - CHECK(ret, FAIL, "H5Pset_istore_k"); - - /* Verify superblock version is 1 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 1 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - - /* Create fcpl with shared messages enabled */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - ret = H5Pset_shared_mesg_nindexes(fcpl, 1); - CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes"); - ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); - CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - - /* Verify superblock version is 2 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 2 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - - /* Create fcpl with persistent free-space enabled */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); - ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); - CHECK(ret, FAIL, "H5Pset_file_space"); - - /* Verify superblock version is 2 when creating a file with or without SWMR */ - test_libver_bounds_super_create(fapl, fcpl, TRUE); - test_libver_bounds_super_create(fapl, fcpl, FALSE); - - /* Verify opening a file with or without SWMR when superblock version is 2 */ - test_libver_bounds_super_open(fapl, fcpl, TRUE); - test_libver_bounds_super_open(fapl, fcpl, FALSE); - - /* Close fcpl */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); - -} /* end test_libver_bounds_super() */ - -/**************************************************************** -** -** test_libver_bounds_low_high(): -** Tests to verify that format versions are correct with the five -** pairs of (low, high) combinations via H5Pset_libver_bounds(). -** -****************************************************************/ -static void -test_libver_bounds_low_high(void) -{ - hid_t fapl; - H5F_libver_t low, high; - herr_t ret; - - /* Output message about test being performed */ - MESSAGE(5, ("Testing setting library version bounds for (low, high) bounds\n")); - - fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(fapl, FAIL, "H5Pcreate"); - - /* Loop through all the combinations of low/high library format bounds */ - for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) - for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - H5E_BEGIN_TRY { - ret = H5Pset_libver_bounds(fapl, low, high); - } H5E_END_TRY; - - /* Should fail: invalid combinations */ - if(high == H5F_LIBVER_EARLIEST) { - VERIFY(ret, FAIL, "H5Pset_libver_bounds"); - continue; - } - - /* Should fail: invalid combinations */ - if(high < low) { - VERIFY(ret, FAIL, "H5Pset_libver_bounds"); - continue; - } - - /* All other combinations are valid and should succeed */ - VERIFY(ret, SUCCEED, "H5Pset_libver_bounds"); - - /* Tests to verify format versions */ - test_libver_bounds_super(fapl); - test_libver_bounds_obj(fapl); - test_libver_bounds_dataset(fapl); - test_libver_bounds_dataspace(fapl); - test_libver_bounds_datatype(fapl); - test_libver_bounds_attributes(fapl); - } - - ret = H5Pclose(fapl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); -} /* end test_libver_bounds_low_high() */ +} /* end test_libver_bounds_attributes() */ /**************************************************************** ** -- cgit v0.12 From 0291c0907502b8d1b2f0328a97c2f19ca16c7370 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 Jan 2018 16:08:52 -0600 Subject: HDFFV-10385 Use OUTPUT_NAME property instead of CMAKE_BUILD_TYPE --- java/examples/datasets/CMakeLists.txt | 9 ++------- java/examples/datatypes/CMakeLists.txt | 9 ++------- java/examples/groups/CMakeLists.txt | 9 ++------- java/examples/intro/CMakeLists.txt | 9 ++------- java/test/CMakeLists.txt | 10 ++-------- 5 files changed, 10 insertions(+), 36 deletions(-) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 3972ec8..b95ede7 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,13 +62,8 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) - if (WIN32) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_datasets-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 8569b8b..9c6e29f 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,13 +62,8 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) - if (WIN32) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_datatypes-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index b912208..5bf5040 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,13 +61,8 @@ endforeach () add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list}) MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) - if (WIN32) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_groups-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 9dc4dd7..0e5ae79 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,13 +63,8 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - if (CMAKE_BUILD_TYPE MATCHES Debug) - if (WIN32) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JAVA_intro-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 8912b3f..5c8fa8d 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,14 +88,8 @@ endforeach () set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") set (testfilter "OK (598 tests)") -if (CMAKE_BUILD_TYPE MATCHES Debug) - if (WIN32) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () -endif () - +string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) +set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") add_test ( NAME JUnit-interface-clearall-objects COMMAND ${CMAKE_COMMAND} -- cgit v0.12 From d202b3cfa14baf3a32fdf03b1e59759fe2a67c6b Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 16 Jan 2018 17:35:29 -0600 Subject: Modify h5repack usage so that it is more descriptive. --- tools/src/h5repack/h5repack_main.c | 21 ++++++++++++++++----- tools/test/h5repack/testfiles/h5repack-help.txt | 19 +++++++++++++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 037aa4a..9a24057 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -83,10 +83,13 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n"); + PRINTVALSTREAM(rawoutstream, " -E --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n"); - PRINTVALSTREAM(rawoutstream, " -j, --low The low bound as in H5Pset_libver_bounds()\n"); - PRINTVALSTREAM(rawoutstream, " -k, --high The high bound as in H5Pset_libver_bounds()\n"); + PRINTVALSTREAM(rawoutstream, " -j BOUND, --low=BOUND The low bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file\n"); + PRINTVALSTREAM(rawoutstream, " -k BOUND, --high=BOUND The high bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n"); @@ -119,8 +122,11 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " F - is the shared object header message type, any of . If F is not specified, S applies to all messages\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - PRINTVALSTREAM(rawoutstream, " occur.\n"); + PRINTVALSTREAM(rawoutstream, " BOUND is an integer indicating the library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file (see H5Pset_libver_bounds()):\n"); + PRINTVALSTREAM(rawoutstream, " 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct\n"); + PRINTVALSTREAM(rawoutstream, " 1: This is H5F_LIBVER_V18 in H5F_libver_t struct\n"); + PRINTVALSTREAM(rawoutstream, " 2: This is H5F_LIBVER_V110 in H5F_libver_t struct\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " FS_STRATEGY is a string indicating the file space strategy used:\n"); PRINTVALSTREAM(rawoutstream, " FSM_AGGR:\n"); @@ -210,6 +216,11 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " Using latest file format with maximum compact group size of 10 and\n"); PRINTVALSTREAM(rawoutstream, " and minimum shared datatype size of 20\n"); PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, "5) h5repack -j 0 -k 1 file1 file2\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when\n"); + PRINTVALSTREAM(rawoutstream, " creating the repacked file: file2\n"); + PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n"); @@ -655,7 +666,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'E': - enable_error_stack = TRUE; + enable_error_stack = TRUE; break; default: diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 77e2178..da75e9f 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -6,10 +6,13 @@ usage: h5repack [OPTIONS] file1 file2 -v, --verbose Verbose mode, print object information -V, --version Print version number and exit -n, --native Use a native HDF5 type when repacking + -E --enable-error-stack Prints messages from the HDF5 error stack as they occur -L, --latest Use latest version of file format This option will take precedence over the -j and -k options - -j, --low The low bound as in H5Pset_libver_bounds() - -k, --high The high bound as in H5Pset_libver_bounds() + -j BOUND, --low=BOUND The low bound for library release versions to use when creating + objects in the file + -k BOUND, --high=BOUND The high bound for library release versions to use when creating + objects in the file -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size @@ -42,8 +45,11 @@ usage: h5repack [OPTIONS] file1 file2 F - is the shared object header message type, any of . If F is not specified, S applies to all messages - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + BOUND is an integer indicating the library release versions to use when creating + objects in the file (see H5Pset_libver_bounds()): + 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct + 1: This is H5F_LIBVER_V18 in H5F_libver_t struct + 2: This is H5F_LIBVER_V110 in H5F_libver_t struct FS_STRATEGY is a string indicating the file space strategy used: FSM_AGGR: @@ -133,6 +139,11 @@ Examples of use: Using latest file format with maximum compact group size of 10 and and minimum shared datatype size of 20 +5) h5repack -j 0 -k 1 file1 file2 + + Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when + creating the repacked file: file2 + 5) h5repack -f SHUF -f GZIP=1 file1 file2 Add both filters SHUF and GZIP in this order to all datasets -- cgit v0.12 From 6ca95c512a116340b6e483882a4a3737d9d1c67c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 Jan 2018 10:27:00 -0600 Subject: HDFFV-10385 rework java names --- c++/examples/CMakeLists.txt | 2 -- c++/test/CMakeLists.txt | 1 - config/cmake_ext_mod/HDFMacros.cmake | 32 +++++++++++++++++++----------- examples/CMakeLists.txt | 4 ---- fortran/examples/CMakeLists.txt | 6 ------ fortran/test/CMakeLists.txt | 10 ---------- fortran/testpar/CMakeLists.txt | 1 - hl/c++/examples/CMakeLists.txt | 1 - hl/c++/test/CMakeLists.txt | 1 - hl/examples/CMakeLists.txt | 1 - hl/fortran/examples/CMakeLists.txt | 1 - hl/fortran/test/CMakeLists.txt | 8 -------- hl/test/CMakeLists.txt | 5 ----- hl/tools/gif2h5/CMakeLists.txt | 3 --- hl/tools/h5watch/CMakeLists.txt | 4 ---- java/examples/datasets/CMakeLists.txt | 3 +-- java/examples/datatypes/CMakeLists.txt | 3 +-- java/examples/groups/CMakeLists.txt | 3 +-- java/examples/intro/CMakeLists.txt | 3 +-- java/src/jni/CMakeLists.txt | 4 +--- java/test/CMakeLists.txt | 3 +-- release_docs/USING_HDF5_CMake.txt | 9 ++++----- test/CMakeLists.txt | 19 ------------------ test/CMakeTests.cmake | 1 - testpar/CMakeLists.txt | 2 -- tools/src/h5copy/CMakeLists.txt | 2 -- tools/src/h5diff/CMakeLists.txt | 3 --- tools/src/h5dump/CMakeLists.txt | 2 -- tools/src/h5format_convert/CMakeLists.txt | 1 - tools/src/h5import/CMakeLists.txt | 1 - tools/src/h5jam/CMakeLists.txt | 2 -- tools/src/h5ls/CMakeLists.txt | 2 -- tools/src/h5repack/CMakeLists.txt | 2 -- tools/src/h5stat/CMakeLists.txt | 2 -- tools/src/misc/CMakeLists.txt | 4 ---- tools/test/h5copy/CMakeLists.txt | 1 - tools/test/h5diff/CMakeLists.txt | 1 - tools/test/h5dump/CMakeLists.txt | 1 - tools/test/h5format_convert/CMakeLists.txt | 2 -- tools/test/h5import/CMakeLists.txt | 1 - tools/test/h5jam/CMakeLists.txt | 3 --- tools/test/h5repack/CMakeLists.txt | 2 -- tools/test/h5stat/CMakeLists.txt | 1 - tools/test/misc/CMakeLists.txt | 4 ---- tools/test/misc/vds/CMakeLists.txt | 1 - tools/test/perform/CMakeLists.txt | 9 --------- 46 files changed, 30 insertions(+), 147 deletions(-) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index e5b0b4a..300f6bc 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -34,7 +34,6 @@ set (tutr_examples foreach (example ${examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - TARGET_NAMING (cpp_ex_${example} STATIC) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) @@ -42,7 +41,6 @@ endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - TARGET_NAMING (cpp_ex_${example} STATIC) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 65815f9..4930626 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -37,7 +37,6 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) -TARGET_NAMING (cpp_testhdf5 STATIC) TARGET_C_PROPERTIES (cpp_testhdf5 STATIC " " " ") target_link_libraries (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 8a6b74d..2813de6 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -14,13 +14,16 @@ macro (SET_HDF5_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) + set(HDF5_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() set(HDF5_CFG_BUILD_TYPE ".") if(CMAKE_BUILD_TYPE) + set(HDF5_CFG_NAME ${CMAKE_BUILD_TYPE}) set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() + set(HDF5_CFG_NAME "Release") set(HDF5_BUILD_TYPE "Release") endif() endif() @@ -65,13 +68,6 @@ macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) endmacro () #------------------------------------------------------------------------------- -macro (TARGET_NAMING libtarget libtype) - if (${libtype} MATCHES "SHARED") - set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}${ARGN}") - endif () -endmacro () - -#------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (WIN32 AND MSVC) get_target_property (target_type ${libtarget} TYPE) @@ -108,6 +104,12 @@ endmacro () #------------------------------------------------------------------------------- macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) + set (LIB_DEBUG_PREFIX "") + if (WIN32) + set (LIB_DEBUG_SUFFIX "_D") + else () + set (LIB_DEBUG_SUFFIX "_debug") + endif () if (${libtype} MATCHES "SHARED") if (WIN32) set (LIB_RELEASE_NAME "${libname}") @@ -118,6 +120,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) endif () else () if (WIN32) + set (LIB_DEBUG_PREFIX "lib") set (LIB_RELEASE_NAME "lib${libname}") set (LIB_DEBUG_NAME "lib${libname}_D") else () @@ -128,11 +131,16 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES - OUTPUT_NAME ${LIB_RELEASE_NAME} - OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} - OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} - OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} - OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} +# OUTPUT_NAME +# ${LIB_DEBUG_PREFIX}${libname}$<$:${LIB_DEBUG_SUFFIX}> + OUTPUT_NAME_DEBUG + ${LIB_DEBUG_NAME} + OUTPUT_NAME_RELEASE + ${LIB_RELEASE_NAME} + OUTPUT_NAME_MINSIZEREL + ${LIB_RELEASE_NAME} + OUTPUT_NAME_RELWITHDEBINFO + ${LIB_RELEASE_NAME} ) if (${libtype} MATCHES "STATIC") if (WIN32) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 04a99ce..43c6d63 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -46,13 +46,11 @@ set (examples foreach (example ${examples}) add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - TARGET_NAMING (${example} STATIC) TARGET_C_PROPERTIES (${example} STATIC " " " ") target_link_libraries (${example} ${HDF5_LIB_TARGET}) set_target_properties (${example} PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - TARGET_NAMING (${example}-shared SHARED) TARGET_C_PROPERTIES (${example}-shared SHARED " " " ") target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET}) set_target_properties (${example}-shared PROPERTIES FOLDER examples) @@ -61,13 +59,11 @@ endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - TARGET_NAMING (ph5example STATIC) TARGET_C_PROPERTIES (ph5example STATIC " " " ") target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - TARGET_NAMING (ph5example-shared SHARED) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index a05f296..a48b3bd 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -40,7 +40,6 @@ set (F2003_examples foreach (example ${examples}) add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f90_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (f90_ex_${example} STATIC " " " ") target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} @@ -54,7 +53,6 @@ foreach (example ${examples}) ) if (BUILD_SHARED_LIBS) add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f90_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_${example}-shared SHARED " " " ") target_link_libraries (f90_ex_${example}-shared ${HDF5_F90_LIBSH_TARGET} @@ -71,7 +69,6 @@ endforeach () foreach (example ${F2003_examples}) add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (f03_ex_${example} STATIC " " " ") target_link_libraries (f03_ex_${example} ${HDF5_F90_LIB_TARGET} @@ -85,7 +82,6 @@ foreach (example ${F2003_examples}) ) if (BUILD_SHARED_LIBS) add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") target_link_libraries (f03_ex_${example}-shared ${HDF5_F90_LIBSH_TARGET} @@ -102,7 +98,6 @@ endforeach () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - TARGET_NAMING (f90_ex_ph5example STATIC) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example STATIC " " " ") target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} @@ -116,7 +111,6 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ) if (BUILD_SHARED_LIBS) add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - TARGET_NAMING (f90_ex_ph5example-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example-shared SHARED " " " ") target_link_libraries (f90_ex_ph5example-shared ${HDF5_F90_LIBSH_TARGET} diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 9f2d593..e9eed90 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -195,7 +195,6 @@ add_executable (testhdf5_fortran tH5Z.F90 tHDF5.F90 ) -TARGET_NAMING (testhdf5_fortran STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran STATIC " " " ") target_link_libraries (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} @@ -231,7 +230,6 @@ if (BUILD_SHARED_LIBS) tH5Z.F90 tHDF5.F90 ) - TARGET_NAMING (testhdf5_fortran-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran-shared SHARED " " " ") target_link_libraries (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET} @@ -259,7 +257,6 @@ add_executable (testhdf5_fortran_1_8 tH5MISC_1_8.F90 tHDF5_1_8.F90 ) -TARGET_NAMING (testhdf5_fortran_1_8 STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 STATIC " " " ") target_link_libraries (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} @@ -286,7 +283,6 @@ if (BUILD_SHARED_LIBS) tH5MISC_1_8.F90 tHDF5_1_8.F90 ) - TARGET_NAMING (testhdf5_fortran_1_8-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8-shared SHARED " " " ") target_link_libraries (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET} @@ -316,7 +312,6 @@ add_executable (fortranlib_test_F03 tH5T_F03.F90 tHDF5_F03.F90 ) -TARGET_NAMING (fortranlib_test_F03 STATIC) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 STATIC " " " ") target_link_libraries (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} @@ -345,7 +340,6 @@ if (BUILD_SHARED_LIBS) tH5T_F03.F90 tHDF5_F03.F90 ) - TARGET_NAMING (fortranlib_test_F03-shared SHARED) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03-shared SHARED " " " ") target_link_libraries (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET} @@ -367,7 +361,6 @@ endif () #-- Adding test for fflush1 add_executable (fflush1 fflush1.F90) -TARGET_NAMING (fflush1 STATIC) TARGET_FORTRAN_PROPERTIES (fflush1 STATIC " " " ") target_link_libraries (fflush1 ${HDF5_F90_LIB_TARGET} @@ -387,7 +380,6 @@ add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_executable (fflush1-shared fflush1.F90) - TARGET_NAMING (fflush1-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush1-shared SHARED " " " ") target_link_libraries (fflush1-shared ${HDF5_F90_LIBSH_TARGET} @@ -408,7 +400,6 @@ endif () #-- Adding test for fflush2 add_executable (fflush2 fflush2.F90) -TARGET_NAMING (fflush2 STATIC) TARGET_FORTRAN_PROPERTIES (fflush2 STATIC " " " ") target_link_libraries (fflush2 ${HDF5_F90_TEST_LIB_TARGET} @@ -428,7 +419,6 @@ add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_executable (fflush2-shared fflush2.F90) - TARGET_NAMING (fflush2-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush2-shared SHARED " " " ") target_link_libraries (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET} diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 4aa7f43..ed9d28c 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -16,7 +16,6 @@ add_executable (parallel_test hyper.f90 mdset.f90 ) -TARGET_NAMING (parallel_test STATIC) TARGET_FORTRAN_PROPERTIES (parallel_test STATIC " " " ") target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 33ad1e5..8c48795 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) -TARGET_NAMING (ptExampleFL STATIC) TARGET_C_PROPERTIES (ptExampleFL STATIC " " " ") target_link_libraries ( ptExampleFL diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index a2f9429..54afd7c 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -17,7 +17,6 @@ INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) TARGET_C_PROPERTIES (hl_ptableTest STATIC " " " ") -TARGET_NAMING (hl_ptableTest STATIC) target_link_libraries ( hl_ptableTest ${HDF5_LIB_TARGET} diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 1144e0f..68f0128 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -28,7 +28,6 @@ set (examples foreach (example ${examples}) add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) - TARGET_NAMING (hl_ex_${example} STATIC) TARGET_C_PROPERTIES (hl_ex_${example} STATIC " " " ") target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index dfe6102..d920d64 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -16,7 +16,6 @@ set (examples foreach (example ${examples}) add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (hl_f90_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} STATIC " " " ") target_link_libraries (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index fbd31c5..b264d5f 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -8,7 +8,6 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #-- Adding test for hl_f90_tstds add_executable (hl_f90_tstds tstds.F90) -TARGET_NAMING (hl_f90_tstds STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds STATIC " " " ") target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -16,7 +15,6 @@ set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstds-shared tstds.F90) - TARGET_NAMING (hl_f90_tstds-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") target_link_libraries (hl_f90_tstds-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstds-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) @@ -29,7 +27,6 @@ endif () #-- Adding test for hl_f90_tstlite add_executable (hl_f90_tstlite tstlite.F90) -TARGET_NAMING (hl_f90_tstlite STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite STATIC " " " ") target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -37,7 +34,6 @@ set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstlite-shared tstlite.F90) - TARGET_NAMING (hl_f90_tstlite-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") target_link_libraries (hl_f90_tstlite-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tstlite-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) @@ -50,7 +46,6 @@ endif () #-- Adding test for hl_f90_tstimage add_executable (hl_f90_tstimage tstimage.F90) -TARGET_NAMING (hl_f90_tstimage STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage STATIC " " " ") target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -58,7 +53,6 @@ set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstimage-shared tstimage.F90) - TARGET_NAMING (hl_f90_tstimage-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") target_link_libraries (hl_f90_tstimage-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstimage-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) @@ -71,7 +65,6 @@ endif () #-- Adding test for hl_f90_tsttable add_executable (hl_f90_tsttable tsttable.F90) -TARGET_NAMING (hl_f90_tsttable STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable STATIC " " " ") target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) @@ -79,7 +72,6 @@ set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) add_executable (hl_f90_tsttable-shared tsttable.F90) - TARGET_NAMING (hl_f90_tsttable-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") target_link_libraries (hl_f90_tsttable-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tsttable-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 8845505..82a3c1b 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -22,7 +22,6 @@ include_directories (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- MACRO (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) - TARGET_NAMING (hl_${hl_name} STATIC) TARGET_C_PROPERTIES (hl_${hl_name} STATIC " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} @@ -34,7 +33,6 @@ ENDMACRO () MACRO (HL_ADD_SHEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) - TARGET_NAMING (hl_${hl_name} SHARED) TARGET_C_PROPERTIES (hl_${hl_name} SHARED " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIBSH_TARGET} @@ -55,7 +53,6 @@ HL_ADD_EXE (test_dset_append) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) -TARGET_NAMING (hl_test_packet STATIC) TARGET_C_PROPERTIES (hl_test_packet STATIC " " " ") target_link_libraries (hl_test_packet ${HDF5_HL_LIB_TARGET} @@ -70,7 +67,6 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_gen_test_ds gen_test_ds.c) - TARGET_NAMING (hl_gen_test_ds STATIC) TARGET_C_PROPERTIES (hl_gen_test_ds STATIC " " " ") target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} @@ -80,7 +76,6 @@ if (HDF5_BUILD_GENERATORS) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) add_executable (hl_gen_test_ld gen_test_ld.c) - TARGET_NAMING (hl_gen_test_ld STATIC) TARGET_C_PROPERTIES (hl_gen_test_ld STATIC " " " ") target_link_libraries (hl_gen_test_ld ${HDF5_HL_LIB_TARGET} diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 9d7a406..34d7074 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -18,7 +18,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}) add_executable (gif2h5 ${GIF2H5_SOURCES}) -TARGET_NAMING (gif2h5 STATIC) TARGET_C_PROPERTIES (gif2h5 STATIC " " " ") target_link_libraries (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) @@ -30,7 +29,6 @@ set (hdf2gif_SOURCES ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdfgifwr.c ) add_executable (h52gif ${hdf2gif_SOURCES}) -TARGET_NAMING (h52gif STATIC) TARGET_C_PROPERTIES (h52gif STATIC " " " ") target_link_libraries (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h52gif PROPERTIES FOLDER tools/hl) @@ -44,7 +42,6 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c) - TARGET_NAMING (hl_h52gifgentest STATIC) TARGET_C_PROPERTIES (hl_h52gifgentest STATIC " " " ") target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 6b8d5f2..d0764c9 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -14,7 +14,6 @@ include_directories (${HDF5_HL_TOOLS_DIR}/src) include_directories (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}) add_executable (h5watch ${H5WATCH_SOURCES}) -TARGET_NAMING (h5watch STATIC) TARGET_C_PROPERTIES (h5watch STATIC " " " ") target_link_libraries (h5watch ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5watch PROPERTIES FOLDER tools/hl) @@ -27,7 +26,6 @@ if (BUILD_TESTING) ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c ) add_executable (hl_swmr_check_compat_vfd ${hl_swmr_check_compat_vfd_SOURCES}) - TARGET_NAMING (hl_swmr_check_compat_vfd STATIC) TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC " " " ") target_link_libraries (hl_swmr_check_compat_vfd ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl) @@ -37,13 +35,11 @@ if (BUILD_TESTING) ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c ) add_executable (extend_dset ${extend_dset_SOURCES}) - TARGET_NAMING (extend_dset STATIC) TARGET_C_PROPERTIES (extend_dset STATIC " " " ") target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (extend_dset PROPERTIES FOLDER tools/hl) add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) - TARGET_NAMING (h5watchgentest STATIC) TARGET_C_PROPERTIES (h5watchgentest STATIC " " " ") target_link_libraries (h5watchgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index b95ede7..3e8bc8b 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -62,8 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_datasets-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 9c6e29f..b79ba64 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -62,8 +62,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_datatypes-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 5bf5040..56c92fe 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -61,8 +61,7 @@ endforeach () add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list}) MACRO (ADD_H5_TEST resultfile resultcode) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_groups-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 0e5ae79..495ec5e 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -63,8 +63,7 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) endforeach () MACRO (ADD_H5_TEST resultfile resultcode) - string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JAVA_intro-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 10d1b6d..ea9665b 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -57,9 +57,7 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION}) if (WIN32) get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE) - if (CMAKE_BUILD_TYPE MATCHES Debug) - set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}_D") - endif () + set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}$<$:_D>") # message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}") if (BUILD_TESTING) add_custom_target (HDF5_JAVA_JNI-Test-Copy ALL diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 5c8fa8d..49cda32 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -88,8 +88,7 @@ endforeach () set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") set (testfilter "OK (598 tests)") -string(TOUPPER ${HDF5_BUILD_TYPE} CMD_BUILD_TYPE) -set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$;") + set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$:_DEBUG>>;") add_test ( NAME JUnit-interface-clearall-objects COMMAND ${CMAKE_COMMAND} diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index ecf972d..5993a0f 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -37,7 +37,7 @@ I. Preconditions 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.10.x product requires a minimum CMake version - of 3.2.2. + of 3.10.1. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -101,10 +101,10 @@ These steps are described in more detail below. * Unix Makefiles * Visual Studio 12 2013 * Visual Studio 12 2013 Win64 - * Visual Studio 11 2012 - * Visual Studio 11 2012 Win64 * Visual Studio 14 2015 * Visual Studio 14 2015 Win64 + * Visual Studio 15 2017 + * Visual Studio 15 2017 Win64 is: * BUILD_TESTING:BOOL=ON @@ -180,7 +180,7 @@ Given the preconditions in section I, create a CMakeLists.txt file at the source root. Include the following text in the file: ########################################################## -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.10.1) project (HDF5MyApp C CXX) set (LIB_TYPE STATIC) # or SHARED @@ -194,7 +194,6 @@ set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_${LIB_TYPE}_LIBRARY}) set (example hdf_example) add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c) -TARGET_NAMING (${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (${example} ${LIB_TYPE} " " " ") target_link_libraries (${example} ${LINK_LIBS}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 713f2bd..5e0c990 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -172,13 +172,11 @@ set (testhdf5_SOURCES #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SOURCES}) -TARGET_NAMING (testhdf5 STATIC) TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (testhdf5-shared ${testhdf5_SOURCES}) - TARGET_NAMING (testhdf5-shared SHARED) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) @@ -186,13 +184,11 @@ endif () MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_NAMING (${file}-shared SHARED) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) @@ -299,7 +295,6 @@ add_executable (cache_image ${HDF5_TEST_SOURCE_DIR}/cache_image.c ${HDF5_TEST_SOURCE_DIR}/genall5.c ) -TARGET_NAMING (cache_image STATIC) TARGET_C_PROPERTIES (cache_image STATIC " " " ") target_link_libraries (cache_image ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache_image PROPERTIES FOLDER test) @@ -308,7 +303,6 @@ if (BUILD_SHARED_LIBS) ${HDF5_TEST_SOURCE_DIR}/cache_image.c ${HDF5_TEST_SOURCE_DIR}/genall5.c ) - TARGET_NAMING (cache_image-shared SHARED) TARGET_C_PROPERTIES (cache_image-shared SHARED " " " ") target_link_libraries (cache_image-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (cache_image-shared PROPERTIES FOLDER test) @@ -316,13 +310,11 @@ endif () #-- Adding test for hyperslab add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) -TARGET_NAMING (hyperslab STATIC) TARGET_C_PROPERTIES (hyperslab STATIC " " " ") target_link_libraries (hyperslab ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (hyperslab PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (hyperslab-shared ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) - TARGET_NAMING (hyperslab-shared SHARED) TARGET_C_PROPERTIES (hyperslab-shared SHARED " " " ") target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (hyperslab-shared PROPERTIES FOLDER test) @@ -342,7 +334,6 @@ add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) -TARGET_NAMING (ttsafe STATIC) TARGET_C_PROPERTIES (ttsafe STATIC " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) @@ -354,7 +345,6 @@ if (BUILD_SHARED_LIBS) ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) - TARGET_NAMING (ttsafe-shared SHARED) TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) @@ -386,7 +376,6 @@ endforeach () # This has to be copied to the test directory for execve() to find it # and it can't be renamed (i.e., no -shared). add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c) -TARGET_NAMING (accum_swmr_reader STATIC) TARGET_C_PROPERTIES (accum_swmr_reader STATIC " " " ") target_link_libraries (accum_swmr_reader ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) @@ -414,13 +403,11 @@ endif () ############################################################################## if (BUILD_SHARED_LIBS) add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) - TARGET_NAMING (filter_plugin SHARED) TARGET_C_PROPERTIES (filter_plugin SHARED " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) else () add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) - TARGET_NAMING (filter_plugin STATIC) TARGET_C_PROPERTIES (filter_plugin STATIC " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) @@ -431,13 +418,11 @@ endif () ############################################################################## set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) add_executable (use_append_chunk ${use_append_chunk_SOURCES}) -TARGET_NAMING (use_append_chunk STATIC) TARGET_C_PROPERTIES (use_append_chunk STATIC " " " ") target_link_libraries (use_append_chunk ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (use_append_chunk PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES}) - TARGET_NAMING (use_append_chunk-shared SHARED) TARGET_C_PROPERTIES (use_append_chunk-shared SHARED " " " ") target_link_libraries (use_append_chunk-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test) @@ -445,13 +430,11 @@ endif () set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) -TARGET_NAMING (use_append_mchunks STATIC) TARGET_C_PROPERTIES (use_append_mchunks STATIC " " " ") target_link_libraries (use_append_mchunks ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (use_append_mchunks PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES}) - TARGET_NAMING (use_append_mchunks-shared SHARED) TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED " " " ") target_link_libraries (use_append_mchunks-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test) @@ -459,13 +442,11 @@ endif () set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) -TARGET_NAMING (use_disable_mdc_flushes STATIC) TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC " " " ") target_link_libraries (use_disable_mdc_flushes ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES}) - TARGET_NAMING (use_disable_mdc_flushes-shared SHARED) TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED " " " ") target_link_libraries (use_disable_mdc_flushes-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fca2f27..165b6d8 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1345,7 +1345,6 @@ endif () if (HDF5_BUILD_GENERATORS) macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) - TARGET_NAMING (${genfile} STATIC) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index db61d35..d0b74b0 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -28,7 +28,6 @@ set (testphdf5_SOURCES #-- Adding test for testhdf5 add_executable (testphdf5 ${testphdf5_SOURCES}) -TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") target_link_libraries (testphdf5 PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) @@ -38,7 +37,6 @@ set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) - TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 23c8fae..1d9c11e 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5copy and test executables # -------------------------------------------------------------------- add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) -TARGET_NAMING (h5copy STATIC) TARGET_C_PROPERTIES (h5copy STATIC " " " ") target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5copy PROPERTIES FOLDER tools) @@ -20,7 +19,6 @@ set (H5_DEP_EXECUTABLES h5copy) if (BUILD_SHARED_LIBS) add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) - TARGET_NAMING (h5copy-shared SHARED) TARGET_C_PROPERTIES (h5copy-shared SHARED " " " ") target_link_libraries (h5copy-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5copy-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index b0cf66e..a485de7 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -13,7 +13,6 @@ add_executable (h5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) -TARGET_NAMING (h5diff STATIC) TARGET_C_PROPERTIES (h5diff STATIC " " " ") target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5diff PROPERTIES FOLDER tools) @@ -26,7 +25,6 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) - TARGET_NAMING (h5diff-shared SHARED) TARGET_C_PROPERTIES (h5diff-shared SHARED " " " ") target_link_libraries (h5diff-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5diff-shared PROPERTIES FOLDER tools) @@ -40,7 +38,6 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) - TARGET_NAMING (ph5diff STATIC) TARGET_C_PROPERTIES (ph5diff STATIC " " " ") target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index c58b20c..bcfa89c 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -14,7 +14,6 @@ add_executable (h5dump ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) -TARGET_NAMING (h5dump STATIC) TARGET_C_PROPERTIES (h5dump STATIC " " " ") target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dump PROPERTIES FOLDER tools) @@ -28,7 +27,6 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) - TARGET_NAMING (h5dump-shared SHARED) TARGET_C_PROPERTIES (h5dump-shared SHARED " " " ") target_link_libraries (h5dump-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5dump-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 1e3e62f..0f6d8d9 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5format_convert executables # -------------------------------------------------------------------- add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c) -TARGET_NAMING (h5format_convert STATIC) TARGET_C_PROPERTIES (h5format_convert STATIC " " " ") target_link_libraries (h5format_convert ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5format_convert PROPERTIES FOLDER tools) diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index bebc6d8..4aa8938 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) -TARGET_NAMING (h5import STATIC) TARGET_C_PROPERTIES (h5import STATIC " " " ") target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) #set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 1075180..fbd4250 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -10,14 +10,12 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5jam executables # -------------------------------------------------------------------- add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c) -TARGET_NAMING (h5jam STATIC) TARGET_C_PROPERTIES (h5jam STATIC " " " ") target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5jam PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam") add_executable (h5unjam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c) -TARGET_NAMING (h5unjam STATIC) TARGET_C_PROPERTIES (h5unjam STATIC " " " ") target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5unjam PROPERTIES FOLDER tools) diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 0e3d57f..703e55e 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5ls executable #----------------------------------------------------------------------------- add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) -TARGET_NAMING (h5ls STATIC) TARGET_C_PROPERTIES (h5ls STATIC " " " ") target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) @@ -20,7 +19,6 @@ set (H5_DEP_EXECUTABLES h5ls) if (BUILD_SHARED_LIBS) add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) - TARGET_NAMING (h5ls-shared SHARED) TARGET_C_PROPERTIES (h5ls-shared SHARED " " " ") target_link_libraries (h5ls-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5ls-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index abf4c24..a646819 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -21,7 +21,6 @@ set (REPACK_COMMON_SOURCES ) add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) -TARGET_NAMING (h5repack STATIC) TARGET_C_PROPERTIES (h5repack STATIC " " " ") target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repack PROPERTIES FOLDER tools) @@ -31,7 +30,6 @@ set (H5_DEP_EXECUTABLES h5repack) if (BUILD_SHARED_LIBS) add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) - TARGET_NAMING (h5repack-shared SHARED) TARGET_C_PROPERTIES (h5repack-shared SHARED " " " ") target_link_libraries (h5repack-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5repack-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 60d3f7c..cde81ee 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5stat executables # -------------------------------------------------------------------- add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) -TARGET_NAMING (h5stat STATIC) TARGET_C_PROPERTIES (h5stat STATIC " " " ") target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5stat PROPERTIES FOLDER tools) @@ -20,7 +19,6 @@ set (H5_DEP_EXECUTABLES h5stat) if (BUILD_SHARED_LIBS) add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) - TARGET_NAMING (h5stat-shared SHARED) TARGET_C_PROPERTIES (h5stat-shared SHARED " " " ") target_link_libraries (h5stat-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5stat-shared PROPERTIES FOLDER tools) diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 20c9171..313760f 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -11,28 +11,24 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- #-- Misc Executables add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c) -TARGET_NAMING (h5debug STATIC) TARGET_C_PROPERTIES (h5debug STATIC " " " ") target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5debug PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug") add_executable (h5repart ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c) -TARGET_NAMING (h5repart STATIC) TARGET_C_PROPERTIES (h5repart STATIC " " " ") target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart") add_executable (h5mkgrp ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c) -TARGET_NAMING (h5mkgrp STATIC) TARGET_C_PROPERTIES (h5mkgrp STATIC " " " ") target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5mkgrp PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp") add_executable (h5clear ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c) -TARGET_NAMING (h5clear STATIC) TARGET_C_PROPERTIES (h5clear STATIC " " " ") target_link_libraries (h5clear ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5clear PROPERTIES FOLDER tools) diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index c57cd5e..35aee35 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -12,7 +12,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) if (HDF5_BUILD_GENERATORS) add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c) - TARGET_NAMING (h5copygentest STATIC) TARGET_C_PROPERTIES (h5copygentest STATIC " " " ") target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index 9a41fb3..def2e6d 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) - TARGET_NAMING (h5diffgentest STATIC) TARGET_C_PROPERTIES (h5diffgentest STATIC " " " ") target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 89c7534..c4f2b95 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -39,7 +39,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - TARGET_NAMING (h5dumpgentest STATIC) TARGET_C_PROPERTIES (h5dumpgentest STATIC " " " ") target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 7e47b13..497f463 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -10,14 +10,12 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5format_convert test executables # -------------------------------------------------------------------- add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c) - TARGET_NAMING (h5fc_chk_idx STATIC) TARGET_C_PROPERTIES (h5fc_chk_idx STATIC " " " ") target_link_libraries (h5fc_chk_idx ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) if (HDF5_BUILD_GENERATORS) add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) - TARGET_NAMING (h5fc_gentest STATIC) TARGET_C_PROPERTIES (h5fc_gentest STATIC " " " ") target_link_libraries (h5fc_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 0d23e5d..36bfbdc 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -10,7 +10,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c) - TARGET_NAMING (h5importtest STATIC) TARGET_C_PROPERTIES (h5importtest STATIC " " " ") target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5importtest PROPERTIES FOLDER tools) diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 562b4f3..dbac14b 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c) - TARGET_NAMING (h5jamgentest STATIC) TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) @@ -20,13 +19,11 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) endif () add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) -TARGET_NAMING (getub STATIC) TARGET_C_PROPERTIES (getub STATIC " " " ") target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (getub PROPERTIES FOLDER tools) add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c) -TARGET_NAMING (tellub STATIC) TARGET_C_PROPERTIES (tellub STATIC " " " ") target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (tellub PROPERTIES FOLDER tools) diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 9d67ec3..5996fff 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -12,7 +12,6 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # Add h5Repack test executables # -------------------------------------------------------------------- add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) -TARGET_NAMING (testh5repack_detect_szip STATIC) TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC " " " ") target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) @@ -27,7 +26,6 @@ set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c ) add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c) -TARGET_NAMING (h5repacktest STATIC) TARGET_C_PROPERTIES (h5repacktest STATIC " " " ") target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5repacktest PROPERTIES FOLDER tools) diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 10ac5e0..d2a1de2 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c) - TARGET_NAMING (h5stat_gentest STATIC) TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ") target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 5e3c0a2..48bc8ab 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -11,14 +11,12 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c) - TARGET_NAMING (h5repart_gentest STATIC) TARGET_C_PROPERTIES (h5repart_gentest STATIC " " " ") target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5repart_gentest COMMAND $) add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) - TARGET_NAMING (h5clear_gentest STATIC) TARGET_C_PROPERTIES (h5clear_gentest STATIC " " " ") target_link_libraries (h5clear_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) @@ -29,13 +27,11 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) endif () add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) - TARGET_NAMING (h5repart_test STATIC) TARGET_C_PROPERTIES (h5repart_test STATIC " " " ") target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_test PROPERTIES FOLDER tools) add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) - TARGET_NAMING (clear_open_chk STATIC) TARGET_C_PROPERTIES (clear_open_chk STATIC " " " ") target_link_libraries (clear_open_chk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (clear_open_chk PROPERTIES FOLDER tools) diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index ec672e5..9092079 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -8,7 +8,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c) - TARGET_NAMING (${genfile} STATIC) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 20250c6..581a85e 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -21,7 +21,6 @@ set (h5perf_serial_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial ${h5perf_serial_SOURCES}) -TARGET_NAMING (h5perf_serial STATIC) TARGET_C_PROPERTIES (h5perf_serial STATIC " " " ") target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial PROPERTIES FOLDER perform) @@ -33,7 +32,6 @@ if (HDF5_BUILD_PERFORM_STANDALONE) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES}) - TARGET_NAMING (h5perf_serial_alone STATIC) TARGET_C_PROPERTIES (h5perf_serial_alone STATIC " " " ") target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) @@ -47,7 +45,6 @@ set (chunk_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SOURCES}) -TARGET_NAMING (chunk STATIC) TARGET_C_PROPERTIES (chunk STATIC " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (chunk PROPERTIES FOLDER perform) @@ -57,7 +54,6 @@ set (iopipe_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c ) add_executable (iopipe ${iopipe_SOURCES}) -TARGET_NAMING (iopipe STATIC) TARGET_C_PROPERTIES (iopipe STATIC " " " ") target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (iopipe PROPERTIES FOLDER perform) @@ -67,7 +63,6 @@ set (overhead_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c ) add_executable (overhead ${overhead_SOURCES}) -TARGET_NAMING (overhead STATIC) TARGET_C_PROPERTIES (overhead STATIC " " " ") target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (overhead PROPERTIES FOLDER perform) @@ -77,7 +72,6 @@ set_target_properties (overhead PROPERTIES FOLDER perform) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c ) add_executable (perf_meta ${perf_meta_SOURCES}) - TARGET_NAMING (perf_meta STATIC) TARGET_C_PROPERTIES (perf_meta STATIC " " " ") target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (perf_meta PROPERTIES FOLDER perform) @@ -87,7 +81,6 @@ set (zip_perf_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c ) add_executable (zip_perf ${zip_perf_SOURCES}) -TARGET_NAMING (zip_perf STATIC) TARGET_C_PROPERTIES (zip_perf STATIC " " " ") target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (zip_perf PROPERTIES FOLDER perform) @@ -99,7 +92,6 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf ${h5perf_SOURCES}) - TARGET_NAMING (h5perf STATIC) TARGET_C_PROPERTIES (h5perf STATIC " " " ") target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf PROPERTIES FOLDER perform) @@ -111,7 +103,6 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf_alone ${h5perf_alone_SOURCES}) - TARGET_NAMING (h5perf_alone STATIC) TARGET_C_PROPERTIES (h5perf_alone STATIC " " " ") target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf_alone PROPERTIES FOLDER perform) -- cgit v0.12 From 601ae0ebbc2b766ebf2662315b3143b0f903d76b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 Jan 2018 11:56:42 -0600 Subject: HDFFV-10392 change size of local array to 16 chars --- tools/src/h5repack/h5repack_parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 05af197..03fcf0e 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -45,9 +45,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, int f, k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; - char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - char stype[6] = {0, 0, 0, 0, 0, 0}; - char smask[3] = {0, 0, 0}; + char scomp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + char stype[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + char smask[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; obj_list_t* obj_list = NULL; unsigned pixels_per_block; @@ -116,7 +116,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, if (c == '=' || i == len - 1) { if (c == '=') { /*one more parameter */ scomp[k] = '\0'; /*cut space */ - /*------------------------------------------------------------------------- * H5Z_FILTER_SZIP * szip has the format SZIP= @@ -236,8 +235,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, filt->cd_nelmts = HDstrtoull(stype, NULL, 0); p = 0; } - else + else { filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0); + } q = 0; u++; /* skip ',' */ } @@ -462,7 +462,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, return obj_list; } - + /*------------------------------------------------------------------------- * Function: parse_layout * -- cgit v0.12 From 3374818d14c11e9177370fe940c966240de34052 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 Jan 2018 14:21:41 -0600 Subject: HDFFV-10393 fix incorrect search for name in h5repack object table --- release_docs/RELEASE.txt | 26 ++++++++++++++++++++++++++ tools/src/h5repack/h5repack_filters.c | 12 +++++++----- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 04f2ce0..790313f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -300,6 +300,32 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5repack + + h5repack incorrectly searched internal object table for name. + + h5repack would search the table of objects for a name, if the + name did not match it tried to determine if the name without a + leading slash would match. The logic was flawed! The table + stored names(paths) without a leading slash and did a strstr + of the table path to the name. + The assumption was that if there was a difference of one then + it was a match, however "pressure" would match "/pressure" as + well as "/pressure1", "/pressure2", etc. Changed logic to remove + any leading slash and then do a full compare of the name. + + (ADB - 2018/01/18, HDFFV-10393) + + - h5repack + + h5repack failed to handle more then 9 chars for int conversion. + + User defined filter parameter conversions would fail for integers + larger then 9 characters. Increased local variable array for storing + the current command line parameter to prevent buffer overflows. + + (ADB - 2018/01/17, HDFFV-10392) + - h5diff h5diff seg faulted if comparing VL strings against fixed strings. diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 067ebad..ae0bfd5 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -84,7 +84,8 @@ static int aux_find_obj(const char* name, /* object name from traverse list */ pack_opt_t *options, /* repack options */ pack_info_t *obj /*OUT*/) /* info about object to filter */ { - char *pdest; + char *pdest = NULL; + char *pname = NULL; int result; unsigned int i; @@ -94,11 +95,12 @@ static int aux_find_obj(const char* name, /* object name from traverse list */ return (int) i; } - pdest = HDstrstr(name, options->op_tbl->objs[i].path); - result = (int) (pdest - name); + pdest = options->op_tbl->objs[i].path; + if (pdest[0] == '/') pdest++; + pname = name; + if (pname[0] == '/') pname++; - /* found at position 1, meaning without '/' */ - if (pdest != NULL && result == 1) { + if (HDstrcmp(pdest, pname) == 0) { *obj = options->op_tbl->objs[i]; return (int) i; } -- cgit v0.12 From f122d6f27f85245f2f559c85064eabf91a631b27 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 18 Jan 2018 14:26:13 -0600 Subject: Modify usage description for -j and -k options so that it is more informative. --- tools/src/h5repack/h5repack_main.c | 5 +++-- tools/test/h5repack/testfiles/h5repack-help.txt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 9a24057..6121f81 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -87,9 +87,9 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n"); PRINTVALSTREAM(rawoutstream, " -j BOUND, --low=BOUND The low bound for library release versions to use when creating\n"); - PRINTVALSTREAM(rawoutstream, " objects in the file\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_EARLIEST)\n"); PRINTVALSTREAM(rawoutstream, " -k BOUND, --high=BOUND The high bound for library release versions to use when creating\n"); - PRINTVALSTREAM(rawoutstream, " objects in the file\n"); + PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_LATEST)\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n"); @@ -127,6 +127,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct\n"); PRINTVALSTREAM(rawoutstream, " 1: This is H5F_LIBVER_V18 in H5F_libver_t struct\n"); PRINTVALSTREAM(rawoutstream, " 2: This is H5F_LIBVER_V110 in H5F_libver_t struct\n"); + PRINTVALSTREAM(rawoutstream, " (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " FS_STRATEGY is a string indicating the file space strategy used:\n"); PRINTVALSTREAM(rawoutstream, " FSM_AGGR:\n"); diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index da75e9f..723711d 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -10,9 +10,9 @@ usage: h5repack [OPTIONS] file1 file2 -L, --latest Use latest version of file format This option will take precedence over the -j and -k options -j BOUND, --low=BOUND The low bound for library release versions to use when creating - objects in the file + objects in the file (default is H5F_LIBVER_EARLIEST) -k BOUND, --high=BOUND The high bound for library release versions to use when creating - objects in the file + objects in the file (default is H5F_LIBVER_LATEST) -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size @@ -50,6 +50,7 @@ usage: h5repack [OPTIONS] file1 file2 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct 1: This is H5F_LIBVER_V18 in H5F_libver_t struct 2: This is H5F_LIBVER_V110 in H5F_libver_t struct + (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release FS_STRATEGY is a string indicating the file space strategy used: FSM_AGGR: -- cgit v0.12 From 0f5ada2e0819bc107b2da0fc7d9a93bc4cd5b200 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 Jan 2018 16:54:55 -0600 Subject: HDFFV-10385 Refactor out CMAKE_BUILD_TYPE usage --- CMakeLists.txt | 2 +- config/cmake/HDFCompilerFlags.cmake | 4 ++-- config/cmake_ext_mod/HDFMacros.cmake | 19 ++++++------------- test/CMakeTests.cmake | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb01cd4..1663df4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -584,7 +584,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (CMAKE_BUILD_TYPE MATCHES Debug) +if (${HDF5_CFG_NAME} MATCHES "Debug") add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 72d320c..c126b24 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,7 +13,7 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (${HDF5_CFG_NAME} MATCHES "Debug") set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_BUILD_TYPE MATCHES Debug) + if (${HDF5_CFG_NAME} MATCHES "Debug") set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 2813de6..d7d256f 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -104,35 +104,28 @@ endmacro () #------------------------------------------------------------------------------- macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) - set (LIB_DEBUG_PREFIX "") if (WIN32) set (LIB_DEBUG_SUFFIX "_D") else () set (LIB_DEBUG_SUFFIX "_debug") endif () if (${libtype} MATCHES "SHARED") - if (WIN32) - set (LIB_RELEASE_NAME "${libname}") - set (LIB_DEBUG_NAME "${libname}_D") - else () - set (LIB_RELEASE_NAME "${libname}") - set (LIB_DEBUG_NAME "${libname}_debug") - endif () + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}") else () if (WIN32) - set (LIB_DEBUG_PREFIX "lib") set (LIB_RELEASE_NAME "lib${libname}") - set (LIB_DEBUG_NAME "lib${libname}_D") + set (LIB_DEBUG_NAME "lib${libname}${LIB_DEBUG_SUFFIX}") else () set (LIB_RELEASE_NAME "${libname}") - set (LIB_DEBUG_NAME "${libname}_debug") + set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}") endif () endif () set_target_properties (${libtarget} PROPERTIES # OUTPUT_NAME -# ${LIB_DEBUG_PREFIX}${libname}$<$:${LIB_DEBUG_SUFFIX}> +# ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE @@ -173,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${HDF5_CFG_NAME} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 165b6d8..dd92065 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) macro (CHECK_VFD_TEST vfdtest vfdname resultcode) if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") - if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) + if (NOT BUILD_SHARED_LIBS AND NOT ${HDF5_CFG_NAME} MATCHES "Debug") add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -- cgit v0.12 From 608a71200d4f70708c141790ec33f88e2e1a9993 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 19 Jan 2018 10:49:17 -0600 Subject: HDFFV-10385 rename vars and macros --- CMakeLists.txt | 12 +++++------- config/cmake/HDFCompilerFlags.cmake | 4 ++-- config/cmake_ext_mod/HDFMacros.cmake | 26 +++++++++++++------------- fortran/src/CMakeLists.txt | 4 ++-- fortran/test/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 4 ++-- release_docs/RELEASE.txt | 4 ++-- test/CMakeTests.cmake | 2 +- 8 files changed, 29 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1663df4..ce0aadf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -409,7 +409,7 @@ include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake) include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) -SET_HDF5_BUILD_TYPE() +SET_HDF_BUILD_TYPE() #----------------------------------------------------------------------------- # Setup output Directories @@ -553,11 +553,9 @@ endif () set (EXE_EXT "") if (WIN32) set (EXE_EXT ".exe") - if (NOT CYGWIN) - add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) - add_definitions (-D_CRT_SECURE_NO_WARNINGS) - add_definitions (-D_CONSOLE) - endif () + add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + add_definitions (-D_CONSOLE) endif () if (MSVC) @@ -584,7 +582,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) #----------------------------------------------------------------------------- option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) mark_as_advanced (HDF5_ENABLE_TRACE) -if (${HDF5_CFG_NAME} MATCHES "Debug") +if (${HDF_CFG_NAME} MATCHES "Debug") add_definitions (-DDEBUG) # Enable tracing of the API if (HDF5_ENABLE_TRACE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index c126b24..a414cea 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,7 +13,7 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) - if (${HDF5_CFG_NAME} MATCHES "Debug") + if (${HDF_CFG_NAME} MATCHES "Debug") set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") @@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC) endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - if (${HDF5_CFG_NAME} MATCHES "Debug") + if (${HDF_CFG_NAME} MATCHES "Debug") set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index d7d256f..870ff5a 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -11,20 +11,20 @@ # #------------------------------------------------------------------------------- -macro (SET_HDF5_BUILD_TYPE) +macro (SET_HDF_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set(HDF5_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) - set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) - set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) + set(HDF_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) + set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() - set(HDF5_CFG_BUILD_TYPE ".") + set(HDF_CFG_BUILD_TYPE ".") if(CMAKE_BUILD_TYPE) - set(HDF5_CFG_NAME ${CMAKE_BUILD_TYPE}) - set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) + set(HDF_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else() - set(HDF5_CFG_NAME "Release") - set(HDF5_BUILD_TYPE "Release") + set(HDF_CFG_NAME "Release") + set(HDF_BUILD_TYPE "Release") endif() endif() if(NOT CMAKE_BUILD_TYPE) @@ -166,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${HDF5_CFG_NAME} MATCHES "Debug") + if (${HDF_CFG_NAME} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -181,8 +181,8 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) ) else () set_target_properties (${libtarget} PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) endif () else () @@ -202,7 +202,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) else () if (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) else () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 7ed5fef..b664c50 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -66,10 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index e9eed90..2990bcc 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -34,10 +34,10 @@ set_target_properties (H5_test_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Add Test Lib diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 9190354..b1a639a 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -38,10 +38,10 @@ set_target_properties (H5HL_buildiface PROPERTIES if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") - set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") -set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE}) +set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- # Setup include Directories diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 790313f..3f0ea92 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -59,7 +59,7 @@ New Features Refactor use of CMAKE_BUILD_TYPE for new variable, which understands the type of generator in use. - Added new configuration macros to use new HDF5_BUILD_TYPE variable. This + Added new configuration macros to use new HDF_BUILD_TYPE variable. This variable is set correctly for the type of generator being used for the build. (ADB - 2018/01/08, HDFFV-10385, HDFFV-10296) @@ -242,7 +242,7 @@ Bug Fixes since HDF5-1.10.1 release generators (Visual Studio and XCode) and is optional for single config generators. Created a new macro to check GLOBAL PROPERTY -> GENERATOR_IS_MULTI_CONFIG - Created two new HDF variable, HDF5_BUILD_TYPE and HDF5_CFG_BUILD_TYPE. + Created two new HDF variable, HDF_BUILD_TYPE and HDF_CFG_BUILD_TYPE. Defaults for these variables is "Release". (ADB - 2018/01/10, HDFFV-10385) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index dd92065..e6b364c 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD) macro (CHECK_VFD_TEST vfdtest vfdname resultcode) if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") - if (NOT BUILD_SHARED_LIBS AND NOT ${HDF5_CFG_NAME} MATCHES "Debug") + if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug") add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -- cgit v0.12 From a87cf25f2d42f4822b2b62aa15dc1334b3de552c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jan 2018 07:59:12 -0600 Subject: HDFFV-10385 Correct name of var --- config/cmake/libhdf5.settings.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 28fb876..7bb426f 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -13,7 +13,7 @@ General Information: Compiling Options: ------------------ - Build Mode: @HDF5_BUILD_TYPE@ + Build Mode: @HDF_BUILD_TYPE@ Debugging Symbols: @SYMBOLS@ Asserts: @ASSERTS@ Profiling: @PROFILING@ -- cgit v0.12 From 7e33ee85b8bd4f9770d9ece1cc2187434e6b4ef9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jan 2018 08:55:30 -0600 Subject: HDFFV-10385 test OUTPUT_NAME var for mac --- config/cmake_ext_mod/HDFMacros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 870ff5a..8584737 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -124,8 +124,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES -# OUTPUT_NAME -# ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> + OUTPUT_NAME + ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE -- cgit v0.12 From f22d8726707e26b97df38962b404754119e8abd7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jan 2018 11:09:58 -0600 Subject: HDFFV-10385 some platforms need this var --- config/cmake_ext_mod/HDFMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 8584737..1326420 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -125,7 +125,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME - ${LIB_RELEASE_NAME}$<$:${LIB_DEBUG_SUFFIX}> + ${LIB_RELEASE_NAME} OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE -- cgit v0.12 From 8427eefafe7af83dbc133975c3ac2368cf1b08d6 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 22 Jan 2018 17:40:44 -0600 Subject: Fix bounds check for the generation of cache image. --- src/H5Cimage.c | 5 ++++- src/H5Fint.c | 4 ---- src/H5Fsuper.c | 4 ---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 53d1712..be2560f 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -1382,9 +1382,12 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * Note that under some error conditions, the superblock will be * undefined in this case as well -- if so, assume that the * superblock does not support superblock extension messages. + * Also verify that the file's high_bound is at least release + * 1.10.x, otherwise cancel the request for a cache image */ if((NULL == f->shared->sblock) || - (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2)) { + (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) || + (f->shared->high_bound < H5F_LIBVER_V110)) { H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL; cache_ptr->image_ctl = default_image_ctl; diff --git a/src/H5Fint.c b/src/H5Fint.c index 9d79481..86627ea 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -930,10 +930,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial metadata cache resize config") - /* Format version high bound does not allow the generation of metadata cache image */ - if(f->shared->mdc_initCacheImageCfg.generate_image && f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "format version out of bound for cache image") - /* Get the VFD values to cache */ f->shared->maxaddr = H5FD_get_maxaddr(lf); if(!H5F_addr_defined(f->shared->maxaddr)) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index d30434d..4250ff0 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -856,10 +856,6 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); H5O_mdci_t mdci_msg; - /* Message exists but version high bound does not allow it */ - if(f->shared->high_bound < H5F_LIBVER_V110) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "format version out of bound for metadata cache image") - /* if the metadata cache image superblock extension message exists, * read its contents and pass the data on to the metadata cache. * Given this data, the cache will load and decode the metadata -- cgit v0.12 From f0b0c35afb32fd7bb9370acdd01de0e1b3902fb6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 09:58:16 -0600 Subject: HDFFV-10396 Eliminate overuse of h5tools_simple_prefix function --- tools/lib/h5tools_dump.c | 65 --------------- tools/src/h5dump/h5dump_ddl.c | 22 +---- tools/src/h5dump/h5dump_xml.c | 190 ------------------------------------------ 3 files changed, 3 insertions(+), 274 deletions(-) diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index ed7d38a..38ace81 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2080,7 +2080,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2091,7 +2090,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2131,7 +2129,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2170,7 +2167,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); @@ -2245,7 +2241,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); if(H5Tclose(str_type) < 0) @@ -2288,7 +2283,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed"); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); @@ -2299,7 +2293,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); @@ -2318,7 +2311,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ mname = H5Tget_member_name(type, i); if((mtype = H5Tget_member_type(type, i)) >= 0) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_print_datatype(stream, buffer, info, ctx, mtype, TRUE); @@ -2335,7 +2327,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); @@ -2360,7 +2351,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); @@ -2376,7 +2366,6 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->enumblockend); @@ -2792,7 +2781,6 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END); @@ -2820,7 +2808,6 @@ h5tools_print_virtual_selection(hid_t vspace, switch(H5Sget_select_type(vspace)) { case H5S_SEL_NONE: /* Nothing selected */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", VDS_NONE); @@ -2833,7 +2820,6 @@ h5tools_print_virtual_selection(hid_t vspace, break; case H5S_SEL_HYPERSLABS: /* "New-style" hyperslab selection defined */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); if (H5Sis_regular_hyperslab(vspace)) { @@ -2856,14 +2842,12 @@ h5tools_print_virtual_selection(hid_t vspace, } h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->virtualselectionblockend); break; case H5S_SEL_ALL: /* Entire extent selected */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, *curr_pos, 0); h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", VDS_ALL); @@ -2956,7 +2940,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); @@ -2967,7 +2950,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_CHUNKED: ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", CHUNKED); @@ -2980,7 +2962,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); @@ -3036,14 +3017,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_COMPACT: ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", COMPACT); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); @@ -3063,14 +3042,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; if (next) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", CONTIGUOUS); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); @@ -3081,7 +3058,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size); @@ -3091,7 +3067,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3101,21 +3076,18 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, haddr_t ioffset; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", CONTIGUOUS); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); ioffset = H5Dget_offset(obj_id); @@ -3143,7 +3115,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, hid_t virtual_srcspace = H5Pget_virtual_srcspace(dcpl_id, next); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %ld %s ", VDS_MAPPING, next, BEGIN); @@ -3152,7 +3123,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_VIRTUAL, BEGIN); @@ -3165,14 +3135,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SOURCE, BEGIN); @@ -3190,7 +3158,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, H5Pget_virtual_dsetname(dcpl_id, next, dsetname, sizeof(dsetname)); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SRC_FILE, h5tools_dump_header_format->virtualfilenamebegin); @@ -3199,7 +3166,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", VDS_SRC_DATASET, h5tools_dump_header_format->virtualdatasetnamebegin); @@ -3212,7 +3178,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3221,7 +3186,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3241,7 +3205,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, }/*switch*/ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3253,7 +3216,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ if (H5D_VIRTUAL != stl) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN); @@ -3271,7 +3233,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, continue; /* nothing to print for invalid filter */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); switch(filtn) { @@ -3297,14 +3258,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_CHIP_OPTION_MASK) @@ -3314,7 +3273,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_EC_OPTION_MASK) @@ -3324,7 +3282,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_LSB_OPTION_MASK) @@ -3335,7 +3292,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "HEADER %s", "RAW"); @@ -3345,7 +3301,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3366,7 +3321,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILTER_ID %d", filtn); @@ -3374,7 +3328,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if(f_name[0] != '\0') { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT %s", f_name); @@ -3382,7 +3335,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, } if (cd_nelmts) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ","PARAMS", BEGIN); @@ -3394,7 +3346,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); @@ -3406,7 +3357,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, else { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NONE"); @@ -3415,7 +3365,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); @@ -3427,7 +3376,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILLVALUE, BEGIN); @@ -3436,7 +3384,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILL_TIME "); @@ -3460,7 +3407,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", "VALUE "); @@ -3486,7 +3432,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3498,7 +3443,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ if (H5D_VIRTUAL != stl) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "ALLOCATION_TIME %s", BEGIN); @@ -3507,7 +3451,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); H5Pget_alloc_time(dcpl_id, &at); @@ -3532,7 +3475,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level--; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); @@ -3626,7 +3568,6 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", @@ -3663,7 +3604,6 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, } ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); @@ -3782,7 +3722,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->subsettingbegin, h5tools_dump_header_format->subsettingblockbegin); @@ -3791,7 +3730,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->startbegin, h5tools_dump_header_format->startblockbegin); @@ -3800,7 +3738,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->stridebegin, h5tools_dump_header_format->strideblockbegin); @@ -3809,7 +3746,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->countbegin, h5tools_dump_header_format->countblockbegin); @@ -3823,7 +3759,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->blockbegin, h5tools_dump_header_format->blockblockbegin); diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index eecd113..6646626 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -155,7 +155,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * return ret; } - + /*------------------------------------------------------------------------- * Function: dump_all_cb * @@ -291,7 +291,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -303,7 +302,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -327,7 +325,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } else if(found_obj->displayed) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -348,7 +345,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -436,7 +432,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR /* print the value of a soft link */ /* Standard DDL: no modification */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -447,7 +442,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -472,7 +466,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -501,7 +494,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -509,7 +501,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -522,7 +513,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } /* end else */ } /* end else */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -544,7 +534,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR case H5L_TYPE_HARD: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -556,7 +545,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "LINKCLASS %d", linfo->type); @@ -565,7 +553,6 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); if(HDstrlen(h5tools_dump_header_format->udlinkblockend)) { @@ -926,7 +913,6 @@ dump_group(hid_t gid, const char *name) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1169,7 +1155,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char); } - + /*------------------------------------------------------------------------- * Function: dump_fcpl * @@ -1614,7 +1600,6 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H HDmemset(&buffer, 0, sizeof(h5tools_str_t)); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1626,7 +1611,6 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H error_msg("unable to open object \"%s\"\n", obj_name); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); if(HDstrlen(h5tools_dump_header_format->attributeblockend)) { @@ -2081,7 +2065,7 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED * data, int pe } } - + /*------------------------------------------------------------------------- * Function: dump_extlink * diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index a83ec08..4e13df3 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -231,7 +231,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -243,7 +242,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -278,7 +276,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -298,7 +295,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -310,7 +306,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -405,7 +400,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ if (res == 0) { /* target obj found */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -427,7 +421,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ else { /* dangling link -- omit from xml attributes */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -492,7 +485,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -539,7 +531,6 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -905,7 +896,6 @@ xml_print_datatype(hid_t type, unsigned in_group) as it's name. */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -918,7 +908,6 @@ xml_print_datatype(hid_t type, unsigned in_group) char *t_objname = xml_escape_the_name(found_obj->objname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -931,7 +920,6 @@ xml_print_datatype(hid_t type, unsigned in_group) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -944,7 +932,6 @@ xml_print_datatype(hid_t type, unsigned in_group) switch (H5Tget_class(type)) { case H5T_INTEGER: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -957,7 +944,6 @@ xml_print_datatype(hid_t type, unsigned in_group) sgn = H5Tget_sign(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1002,7 +988,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1018,7 +1003,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ord = H5Tget_order(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1027,7 +1011,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1061,7 +1044,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1071,7 +1053,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_TIME: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1080,7 +1061,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1090,7 +1070,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1106,7 +1085,6 @@ xml_print_datatype(hid_t type, unsigned in_group) is_vlstr = H5Tis_variable_str(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1116,7 +1094,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1144,7 +1121,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1157,7 +1133,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ord = H5Tget_order(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1166,7 +1141,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1193,7 +1167,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1205,7 +1178,6 @@ xml_print_datatype(hid_t type, unsigned in_group) /* */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1215,7 +1187,6 @@ xml_print_datatype(hid_t type, unsigned in_group) mname = H5Tget_tag(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1227,7 +1198,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1242,7 +1212,6 @@ xml_print_datatype(hid_t type, unsigned in_group) nmembers = (unsigned)H5Tget_nmembers(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1262,7 +1231,6 @@ xml_print_datatype(hid_t type, unsigned in_group) t_fname = xml_escape_the_name(mname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1275,7 +1243,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1288,7 +1255,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1298,7 +1264,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1309,7 +1274,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1319,7 +1283,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1329,7 +1292,6 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Only Object references supported at this time */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1338,7 +1300,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1347,7 +1308,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1356,7 +1316,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1369,7 +1328,6 @@ xml_print_datatype(hid_t type, unsigned in_group) nmembs = H5Tget_nmembers(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1379,7 +1337,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1388,7 +1345,6 @@ xml_print_datatype(hid_t type, unsigned in_group) xml_print_enum(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1398,7 +1354,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1408,7 +1363,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1419,7 +1373,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1432,7 +1385,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1442,7 +1394,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1458,7 +1409,6 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Print lead-in */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1474,7 +1424,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; for (i = 0; i < ndims; i++) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1487,7 +1436,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1500,7 +1448,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1510,7 +1457,6 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1524,7 +1470,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_NCLASSES: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1606,7 +1551,6 @@ xml_dump_datatype(hid_t type) */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1619,7 +1563,6 @@ xml_dump_datatype(hid_t type) char *t_objname = xml_escape_the_name(found_obj->objname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1632,7 +1575,6 @@ xml_dump_datatype(hid_t type) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1642,7 +1584,6 @@ xml_dump_datatype(hid_t type) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1655,7 +1596,6 @@ xml_dump_datatype(hid_t type) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1720,7 +1660,6 @@ xml_dump_dataspace(hid_t space) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1733,7 +1672,6 @@ xml_dump_dataspace(hid_t space) /* scalar dataspace (just a tag, no XML attrs. defined */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1746,7 +1684,6 @@ xml_dump_dataspace(hid_t space) /* */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1758,7 +1695,6 @@ xml_dump_dataspace(hid_t space) for (i = 0; i < ndims; i++) { if (maxsize[i] == H5S_UNLIMITED) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1768,7 +1704,6 @@ xml_dump_dataspace(hid_t space) } else if (maxsize[i] == (hsize_t) 0) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1778,7 +1713,6 @@ xml_dump_dataspace(hid_t space) } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1790,7 +1724,6 @@ xml_dump_dataspace(hid_t space) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1805,7 +1738,6 @@ xml_dump_dataspace(hid_t space) ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNullDataspace />",xmlnsprefix); @@ -1817,7 +1749,6 @@ xml_dump_dataspace(hid_t space) case H5S_NO_CLASS: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1828,7 +1759,6 @@ xml_dump_dataspace(hid_t space) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1899,7 +1829,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, outputformat = &string_dataformat; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1909,7 +1838,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2005,7 +1933,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2031,7 +1958,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2092,7 +2018,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED outputformat = &string_dataformat; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2128,7 +2053,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2136,7 +2060,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2144,7 +2067,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2152,7 +2074,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2160,7 +2081,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2173,7 +2093,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2184,7 +2103,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2192,7 +2110,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); if (!H5Tequal(type, H5T_STD_REF_OBJ)) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2200,7 +2117,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2209,7 +2125,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2219,7 +2134,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED xml_print_refs(attr_id, ATTRIBUTE_DATA); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2228,7 +2142,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2238,7 +2151,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2251,7 +2163,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_NCLASSES: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2259,7 +2170,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2267,7 +2177,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2275,7 +2184,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2288,7 +2196,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED /* The case of an attribute never yet written ?? * Or dataspace is H5S_NULL. */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2298,7 +2205,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2308,7 +2214,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2323,7 +2228,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED H5Aclose(attr_id); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2338,7 +2242,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2348,7 +2251,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2435,7 +2337,6 @@ xml_dump_named_datatype(hid_t type, const char *name) */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2450,7 +2351,6 @@ xml_dump_named_datatype(hid_t type, const char *name) H5O_info_t oinfo; /* Object info */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2487,7 +2387,6 @@ xml_dump_named_datatype(hid_t type, const char *name) xml_name_to_XID(found_obj->objname, pointerxid, (int)sizeof(pointerxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2497,7 +2396,6 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2515,7 +2413,6 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2529,7 +2426,6 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2540,7 +2436,6 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2680,7 +2575,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID("/", grpxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2695,7 +2589,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2715,7 +2608,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2739,7 +2631,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID("/", grpxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2755,7 +2646,6 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2825,7 +2715,6 @@ xml_dump_group(hid_t gid, const char *name) char *parentxid = (char *)HDmalloc((size_t)100); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2898,7 +2787,6 @@ xml_dump_group(hid_t gid, const char *name) } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3025,7 +2913,6 @@ xml_print_refs(hid_t did, int source) if (!path) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3036,7 +2923,6 @@ xml_print_refs(hid_t did, int source) char *t_path = xml_escape_the_string(path, -1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3182,7 +3068,6 @@ xml_print_strs(hid_t did, int source) if (!onestring) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3290,7 +3175,6 @@ check_filters(hid_t dcpl) if (filter == H5Z_FILTER_DEFLATE) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3309,7 +3193,6 @@ check_filters(hid_t dcpl) else if (filter == H5Z_FILTER_FLETCHER32) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3320,7 +3203,6 @@ check_filters(hid_t dcpl) else if (filter == H5Z_FILTER_SHUFFLE) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3332,7 +3214,6 @@ check_filters(hid_t dcpl) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3426,7 +3307,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3444,7 +3324,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) const char * path = lookup_ref_path(*(hobj_ref_t *) buf); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3452,7 +3331,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); if (!path) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3463,7 +3341,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) char *t_path = xml_escape_the_string(path, -1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3473,7 +3350,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3483,7 +3359,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) else if (H5Tget_class(type) == H5T_STRING) { /* ????? */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3491,7 +3366,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3503,7 +3377,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) switch (H5Tget_class(type)) { case H5T_INTEGER: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3519,7 +3392,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3528,7 +3400,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_FLOAT: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3544,7 +3415,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3554,7 +3424,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) case H5T_BITFIELD: case H5T_OPAQUE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3576,7 +3445,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3585,7 +3453,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_ENUM: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3603,7 +3470,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) if(name) H5free_memory(name); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3612,7 +3478,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_ARRAY: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3620,7 +3485,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3629,7 +3493,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_TIME: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3637,7 +3500,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3646,7 +3508,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3654,7 +3515,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3663,7 +3523,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3671,7 +3530,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3684,7 +3542,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) case H5T_REFERENCE: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3692,7 +3549,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3706,7 +3562,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3793,7 +3648,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s xml_name_to_XID(prefix, pstr, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3828,7 +3682,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3838,7 +3691,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3853,7 +3705,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s for (i = 0; i < ndims; i++) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3862,7 +3713,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3876,7 +3726,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3887,7 +3736,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3897,7 +3745,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3912,7 +3759,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3921,7 +3767,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3930,7 +3775,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3942,7 +3786,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3951,7 +3794,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3960,7 +3802,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3976,7 +3817,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4025,7 +3865,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4037,7 +3876,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4050,7 +3888,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4061,7 +3898,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4114,7 +3950,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4122,7 +3957,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4130,7 +3964,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4138,7 +3971,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4150,7 +3982,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4166,7 +3997,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4174,7 +4004,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); if (!H5Tequal(type, H5T_STD_REF_OBJ)) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4182,7 +4011,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4191,7 +4019,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4201,7 +4028,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s xml_print_refs(did, DATASET_DATA); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4210,7 +4036,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s } ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4222,7 +4047,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4241,7 +4065,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s case H5T_NCLASSES: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4249,7 +4072,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4257,7 +4079,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4265,7 +4086,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4279,7 +4099,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4288,7 +4107,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4297,7 +4115,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4311,7 +4128,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s H5Pclose(dcpl); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4377,7 +4193,6 @@ xml_print_enum(hid_t type) super = H5Tget_super(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4387,7 +4202,6 @@ xml_print_enum(hid_t type) xml_print_datatype(super,0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4438,7 +4252,6 @@ xml_print_enum(hid_t type) char *t_name = xml_escape_the_name(name[i]); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4456,7 +4269,6 @@ xml_print_enum(hid_t type) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4464,7 +4276,6 @@ xml_print_enum(hid_t type) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4494,7 +4305,6 @@ xml_print_enum(hid_t type) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); -- cgit v0.12 From ad4514ebee259eb8906cecd2c1fd2e20695fd6ea Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 10:32:23 -0600 Subject: HDFFV-10396 Add note --- release_docs/RELEASE.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3f0ea92..bdf9b9a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -300,6 +300,16 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5dump + + h5dump would output an indented blank line in the filters section. + + h5dump over used the h5tools_simple_prefix function, which is a + function intended to account for the data index (x,y,z) option. + Removed the function call for header information. + + (ADB - 2018/01/25, HDFFV-10396) + - h5repack h5repack incorrectly searched internal object table for name. -- cgit v0.12 From fbcaec3555b6fce1a6be92b019972f51b6a51439 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 11:16:04 -0600 Subject: HDFFV-10396 typo fix --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index bdf9b9a..74b73a4 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -304,7 +304,7 @@ Bug Fixes since HDF5-1.10.1 release h5dump would output an indented blank line in the filters section. - h5dump over used the h5tools_simple_prefix function, which is a + h5dump overused the h5tools_simple_prefix function, which is a function intended to account for the data index (x,y,z) option. Removed the function call for header information. -- cgit v0.12 From 3ab1a073688453991b78df300067009cd0c5f610 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 Jan 2018 16:54:28 -0600 Subject: Fix missing ext libs references --- CMakeInstallation.cmake | 10 +++++----- CMakeLists.txt | 2 +- config/cmake/hdf5-config.cmake.in | 8 +++++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 8804964..0bfb2cc 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -41,7 +41,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) if (HDF5_EXPORTED_TARGETS) install ( EXPORT ${HDF5_EXPORTED_TARGETS} - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5 FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake NAMESPACE ${HDF5_PACKAGE}:: COMPONENT configinstall @@ -84,7 +84,7 @@ set (CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}/hdf5" PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}" ) @@ -98,14 +98,14 @@ set (CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in "${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" - INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" + INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}/hdf5" PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR ) if (NOT HDF5_EXTERNALLY_CONFIGURED) install ( FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5 COMPONENT configinstall ) endif () @@ -120,7 +120,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ) install ( FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5 COMPONENT configinstall ) endif () diff --git a/CMakeLists.txt b/CMakeLists.txt index ce0aadf..922ada8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,7 @@ if (NOT HDF5_INSTALL_DATA_DIR) set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (HDF5_INSTALL_DATA_DIR share) - set (HDF5_INSTALL_CMAKE_DIR share/cmake/hdf5) + set (HDF5_INSTALL_CMAKE_DIR share/cmake) else () set (HDF5_INSTALL_DATA_DIR ".") set (HDF5_INSTALL_CMAKE_DIR cmake) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 421f693..574f541 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -105,7 +105,13 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- if (NOT TARGET "@HDF5_PACKAGE@") - include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + endif () + if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") + include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + endif () + include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) endif () # Handle default component(static) : -- cgit v0.12 From 707de0b92eb1abeea27350e5630990ff2a33f806 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 Jan 2018 15:41:13 -0600 Subject: Fix case of command --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 922ada8..fb1df12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,13 +756,13 @@ add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) + add_dependencies (${HDF5_LIB_TARGET} ZLIB) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} ZLIB) endif () endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) - ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) + add_dependencies (${HDF5_LIB_TARGET} SZIP) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} SZIP) endif () -- cgit v0.12 From 468fbc36f1b02087d6567da7b905b80019cda3bc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 29 Jan 2018 10:27:32 -0600 Subject: Fix windows compile errors abstract out common settings --- CMakeLists.txt | 84 ++-------------------------------- config/cmake/libhdf5.settings.cmake.in | 2 +- config/cmake_ext_mod/HDFMacros.cmake | 84 +++++++++++++++++++++++++++++++++- 3 files changed, 88 insertions(+), 82 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb1df12..3579f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,51 +199,6 @@ set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-1.7.5.j set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-1.7.5.jar) set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-1.7.5.jar) -if (APPLE) - option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) -endif () - -if (NOT HDF5_INSTALL_BIN_DIR) - set (HDF5_INSTALL_BIN_DIR bin) -endif () -if (NOT HDF5_INSTALL_LIB_DIR) - if (APPLE) - if (HDF5_BUILD_FRAMEWORKS) - set (HDF5_INSTALL_JAR_DIR ../Java) - else () - set (HDF5_INSTALL_JAR_DIR lib) - endif () - set (HDF5_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - else () - set (HDF5_INSTALL_JAR_DIR lib) - endif () - set (HDF5_INSTALL_LIB_DIR lib) -endif () -if (NOT HDF5_INSTALL_INCLUDE_DIR) - set (HDF5_INSTALL_INCLUDE_DIR include) -endif () -if (NOT HDF5_INSTALL_DATA_DIR) - if (NOT WIN32) - if (APPLE) - if (HDF5_BUILD_FRAMEWORKS) - set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport) - else () - set (HDF5_INSTALL_EXTRA_DIR share) - endif () - set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif () - set (HDF5_INSTALL_DATA_DIR share) - set (HDF5_INSTALL_CMAKE_DIR share/cmake) - else () - set (HDF5_INSTALL_DATA_DIR ".") - set (HDF5_INSTALL_CMAKE_DIR cmake) - endif () -endif () - -if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") - set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) -endif () - #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO #----------------------------------------------------------------------------- @@ -406,46 +361,15 @@ set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") # Include some macros for reusable code #----------------------------------------------------------------------------- include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake) -include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) -include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) -SET_HDF_BUILD_TYPE() +HDF_DIR_PATHS(${HDF5_PACKAGE_NAME}) -#----------------------------------------------------------------------------- -# Setup output Directories -#----------------------------------------------------------------------------- -if (NOT HDF5_EXTERNALLY_CONFIGURED) - set (CMAKE_RUNTIME_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." - ) - set (CMAKE_LIBRARY_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" - ) - set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." - ) - set (CMAKE_Fortran_MODULE_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." - ) - if (WIN32) - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) - set (CMAKE_PDB_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." - ) - else () - set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) - endif () -else () - # if we are externally configured, but the project uses old cmake scripts - # this may not be set and utilities like H5detect will fail - if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) - endif () -endif () +include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) +include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use -# by other projects using FindHDF5. +# by other projects. #----------------------------------------------------------------------------- if (NOT HDF5_EXPORTED_TARGETS) set (HDF5_EXPORTED_TARGETS "hdf5-targets") diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 7bb426f..891e3a7 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -13,7 +13,7 @@ General Information: Compiling Options: ------------------ - Build Mode: @HDF_BUILD_TYPE@ + Build Mode: @CMAKE_BUILD_TYPE@ Debugging Symbols: @SYMBOLS@ Asserts: @ASSERTS@ Profiling: @PROFILING@ diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 1326420..4097ca9 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -166,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${HDF_CFG_NAME} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -331,3 +331,85 @@ macro (HDFTEST_COPY_FILE src dest target) ) list (APPEND ${target}_list "${dest}") endmacro () + +macro (HDF_DIR_PATHS package_prefix) + if (APPLE) + option (${package_prefix}_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) + endif () + + if (NOT ${package_prefix}_INSTALL_BIN_DIR) + set (${package_prefix}_INSTALL_BIN_DIR bin) + endif () + if (NOT ${package_prefix}_INSTALL_LIB_DIR) + if (APPLE) + if (${package_prefix}_BUILD_FRAMEWORKS) + set (${package_prefix}_INSTALL_JAR_DIR ../Java) + else () + set (${package_prefix}_INSTALL_JAR_DIR lib) + endif () + set (${package_prefix}_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + else () + set (${package_prefix}_INSTALL_JAR_DIR lib) + endif () + set (${package_prefix}_INSTALL_LIB_DIR lib) + endif () + if (NOT ${package_prefix}_INSTALL_INCLUDE_DIR) + set (${package_prefix}_INSTALL_INCLUDE_DIR include) + endif () + if (NOT ${package_prefix}_INSTALL_DATA_DIR) + if (NOT WIN32) + if (APPLE) + if (${package_prefix}_BUILD_FRAMEWORKS) + set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport) + else () + set (${package_prefix}_INSTALL_EXTRA_DIR share) + endif () + set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + endif () + set (${package_prefix}_INSTALL_DATA_DIR share) + set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) + else () + set (${package_prefix}_INSTALL_DATA_DIR ".") + set (${package_prefix}_INSTALL_CMAKE_DIR cmake) + endif () + endif () + + if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") + set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) + endif () + + SET_HDF_BUILD_TYPE() + +#----------------------------------------------------------------------------- +# Setup output Directories +#----------------------------------------------------------------------------- + if (NOT ${package_prefix}_EXTERNALLY_CONFIGURED) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." + ) + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" + ) + set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." + ) + set (CMAKE_Fortran_MODULE_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules." + ) + if (WIN32) + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) + set (CMAKE_PDB_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." + ) + else () + set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE}) + endif () + else () + # if we are externally configured, but the project uses old cmake scripts + # this may not be set and utilities like H5detect will fail + if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) + endif () + endif () +endmacro () + -- cgit v0.12 From f837afc8758c7c0394e2f40d636a8e6319b6b668 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 29 Jan 2018 12:40:52 -0600 Subject: Update reference files for CMake options --- COPYING | 2 +- config/cmake/CTestScript.cmake | 7 - config/cmake/scripts/CTestScript.cmake | 7 - config/cmake/scripts/HDF5config.cmake | 52 +------- config/cmake/scripts/HDF5options.cmake | 26 ++++ release_docs/INSTALL_CMake.txt | 8 -- release_docs/USING_HDF5_CMake.txt | 225 +++++++++++++++++++-------------- 7 files changed, 158 insertions(+), 169 deletions(-) diff --git a/COPYING b/COPYING index 51cb4e6..c668565 100644 --- a/COPYING +++ b/COPYING @@ -99,7 +99,7 @@ and/or accompanying materials: HDF5 is available with the SZIP compression library but SZIP is not part of HDF5 and has separate copyright and license terms. See “Szip Compression -in HDF Products” (www.hdfgroup.org/doc_resource/SZIP/) for further details. +in HDF Products” (https://support.hdfgroup.org/doc_resource/SZIP/) for further details. ----------------------------------------------------------------------------- diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index c59b10c..a8b7bbc 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -63,13 +63,6 @@ if (APPLE) set (ENV{CC} "${XCODE_CC}") set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") endif () diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 3cb9a5e..f826e31 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -64,13 +64,6 @@ if (APPLE) set (ENV{CC} "${XCODE_CC}") set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") endif () diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index d32a6bdb..33d7868 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -32,10 +32,6 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATIC_ONLY - Build/use static libraries -# FORTRAN_LIBRARIES - Build/use fortran libraries -# JAVA_LIBRARIES - Build/use java libraries -# NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## set (CTEST_SOURCE_VERSION "1.11.2") @@ -47,10 +43,6 @@ set (CTEST_SOURCE_VERSEXT "") #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 -#STATIC_ONLY - Default is YES -#FORTRAN_LIBRARIES - Default is NO -#JAVA_LIBRARIES - Default is NO -#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 @@ -70,6 +62,7 @@ endif () ################################################################### ### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +### (default use command line -C value) set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") ################################################################### @@ -86,21 +79,6 @@ endif () if (NOT DEFINED CTEST_SOURCE_NAME) set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") endif () -if (NOT DEFINED STATIC_ONLY) - set (STATICONLYLIBRARIES "YES") -else () - set (STATICONLYLIBRARIES "NO") -endif () -if (NOT DEFINED FORTRAN_LIBRARIES) - set (FORTRANLIBRARIES "NO") -else () - set(FORTRANLIBRARIES "YES") -endif () -if (NOT DEFINED JAVA_LIBRARIES) - set (JAVALIBRARIES "NO") -else () - set (JAVALIBRARIES "YES") -endif () set (CTEST_BINARY_NAME "build") set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") @@ -212,34 +190,6 @@ set (REPOSITORY_BRANCH "develop") #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### -################################################################### -if (${STATICONLYLIBRARIES}) - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - ######### Following describes computer ############ - ## following is optional to describe build ## - set (SITE_BUILDNAME_SUFFIX "STATIC") -endif () -################################################################### -#### fortran #### -if (${FORTRANLIBRARIES}) - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -else () - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") -endif () -#### java #### -if (${JAVALIBRARIES}) - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") -else () - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") -endif () - -### change install prefix -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") ################################################################### diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index b090434..82ab04a 100755 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -21,6 +21,32 @@ #set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") ############################################################################################# +#### Only build static libraries #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +#### Add PICC option on linux/mac #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + +############################################################################################# +#### fortran enabled #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") +#### fortran disabled #### +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") + +############################################################################################# +#### java enabled #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") +#### java disabled #### +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + +############################################################################################# +### change install prefix (default use INSTALLDIR value) +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") + +############################################################################################# #### ext libraries #### ### ext libs from tgz diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index f20ca43..8c72685 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -664,10 +664,6 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATIC_ONLY - Build/use static libraries -# FORTRAN_LIBRARIES - Build/use fortran libraries -# JAVA_LIBRARIES - Build/use java libraries -# NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## set (CTEST_SOURCE_VERSION "1.11.0") @@ -679,10 +675,6 @@ set (CTEST_SOURCE_VERSEXT "") #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 -#STATIC_ONLY - Default is YES -#FORTRAN_LIBRARIES - Default is NO -#JAVA_LIBRARIES - Default is NO -#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 5993a0f..fc62b75 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -219,129 +219,113 @@ NOTE: this file is available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html HDF5_Examples.cmake + HDF5_Examples_options.cmake Also available at the HDF web site is a CMake application framework template. You can quickly add files to the framework and execute the script to compile your application with an installed HDF5 binary. ======================================================================== -ctest +ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake ======================================================================== cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: -# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log +# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log ############################################################################################################### -set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +if("@CMAKE_GENERATOR_TOOLSET@") + set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") +endif() +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. #INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_ONLY - Default is YES -#FORTRAN_LIBRARIES - Default is NO -#JAVA_LIBRARIES - Default is NO -##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) -if (DEFINED CTEST_SCRIPT_ARG) - # transform ctest script arguments of the form - # script.ctest,var1=value1,var2=value2 - # to variables with the respective names set to the respective values - string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach (current_var ${script_args}) - if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () -if (NOT DEFINED INSTALLDIR) - set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif () -if (NOT DEFINED CTEST_CONFIGURATION_TYPE) - set (CTEST_CONFIGURATION_TYPE "Release") -endif () -if (NOT DEFINED CTEST_SOURCE_NAME) - set (CTEST_SOURCE_NAME "HDF5Examples") -endif () -if (NOT DEFINED STATIC_ONLY) - set (STATICONLYLIBRARIES "YES") -else () - set (STATICONLYLIBRARIES "NO") -endif () -if (NOT DEFINED FORTRAN_LIBRARIES) - set (FORTRANLIBRARIES "NO") -else () - set (FORTRANLIBRARIES "YES") -endif () -if (NOT DEFINED JAVA_LIBRARIES) - set (JAVALIBRARIES "NO") -else () - set (JAVALIBRARIES "YES") -endif () +#CTEST_SOURCE_NAME - name of source folder; HDF5Examples +if(DEFINED CTEST_SCRIPT_ARG) + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) + if("${current_var}" MATCHES "^([^=]+)=(.+)$") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() + +################################################################### +### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE "Release") +endif() +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}") +################################################################## + +if(NOT DEFINED INSTALLDIR) + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif() + +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "HDF5Examples") +endif() + +if(NOT DEFINED HDF_LOCAL) + set(CDASH_LOCAL "NO") +else() + set(CDASH_LOCAL "YES") +endif() +if(NOT DEFINED CTEST_SITE) + set(CTEST_SITE "local") +endif() +if(NOT DEFINED CTEST_BUILD_NAME) + set(CTEST_BUILD_NAME "examples") +endif() +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile -#if (NOT DEFINED TAR_SOURCE) -# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") -#endif () +#if(NOT DEFINED TAR_SOURCE) +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source") +#endif() ############################################################################################################### -# Adjust the following SET Commands as needed -############################################################################################################### -if (WIN32) - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif () - set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else (WIN32) - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif () - set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif(WIN32) -if (${FORTRANLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif () -if (${JAVALIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") -endif () -set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") +if(WIN32) + set(SITE_OS_NAME "Windows") + set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else() + set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif() +if(${CDASH_LOCAL}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") +endif() +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org # ############################################################################################################### -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if (APPLE) - # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format for file: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# +if(WIN32) + include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) +else() + include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) +endif() #----------------------------------------------------------------------------- set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") @@ -415,6 +399,57 @@ endif () #----------------------------------------------------------------------------- ############################################################################################################## +############################################################################################################## +#### HDF5_Examples_options.cmake ### +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +############################################################################################################## +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +#### DEFAULT: ### +#### BUILD_SHARED_LIBS:BOOL=OFF ### +#### HDF_BUILD_C:BOOL=ON ### +#### HDF_BUILD_CXX:BOOL=OFF ### +#### HDF_BUILD_FORTRAN:BOOL=OFF ### +#### HDF_BUILD_JAVA:BOOL=OFF ### +#### BUILD_TESTING:BOOL=OFF ### +#### HDF_ENABLE_PARALLEL:BOOL=OFF ### +#### HDF_ENABLE_THREADSAFE:BOOL=OFF ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options +### build with shared libraries +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") + +############################################################################################# +#### languages #### +### disable C builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_C:BOOL=OFF") + +### enable C++ builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_CXX:BOOL=ON") + +### enable Fortran builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") + +### enable JAVA builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") + +############################################################################################# +### enable parallel program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON") + +############################################################################################# +### enable threadsafe program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON") + +############################################################################################# +### enable test program builds, requires reference files in testfiles subdirectory +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON") + +############################################################################################# + ======================================================================== -- cgit v0.12 From 6cc86417d5357e4fd018346cc332210ad410b203 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 30 Jan 2018 09:56:21 -0600 Subject: Increase maximum number of retries to 30 for h5watch tests. --- hl/tools/h5watch/testh5watch.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 7514281..3f8f5ae 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -44,7 +44,7 @@ GEN_TEST=h5watchgentest # Generate HDF5 file with various datasets GEN_TEST_BIN=`pwd`/$GEN_TEST # Path of the binary GEN_TEST WATCHFILE=`pwd`/WATCH.h5 # The HDF5 file generated to test h5watch TESTFILE=TEST.h5 # The temporary file (a copy of WATCH.h5) used by tests -TRY_MAX=20 # Try running the test again +TRY_MAX=30 # Try running the test again # # These 3 defines should be the same as the defines in ./extend_dset.c WRITER_MESSAGE=writer_message # The message file created by the "extend" process -- cgit v0.12 From bd7bc909ed2c950e75772c3876f9a236799565c5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:05:22 -0600 Subject: HDFFV-10398 Honor CMAKE_MODULE_PATH when including check modules --- config/cmake_ext_mod/CheckTypeSize.cmake | 61 ------------------------------ config/cmake_ext_mod/ConfigureChecks.cmake | 22 +++++------ 2 files changed, 11 insertions(+), 72 deletions(-) delete mode 100644 config/cmake_ext_mod/CheckTypeSize.cmake diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake deleted file mode 100644 index c14c2f2..0000000 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# 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. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# -# Check if the type exists and determine size of type. if the type -# exists, the size will be stored to the variable. -# -# CHECK_TYPE_SIZE - macro which checks the size of type -# VARIABLE - variable to store size if the type exists. -# HAVE_${VARIABLE} - does the variable exists or not -# - -macro (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) - set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) - if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - set (MACRO_CHECK_TYPE_SIZE_FLAGS - "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" - ) - foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) - if ("${def}") - set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") - endif () - endforeach () - - message (STATUS "Check size of ${TYPE}") - if (CMAKE_REQUIRED_LIBRARIES) - set (CHECK_TYPE_SIZE_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" - ) - endif () - try_run (${VARIABLE} HAVE_${VARIABLE} - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_EXT_DIR}/CheckTypeSize.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS} - "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" - OUTPUT_VARIABLE OUTPUT - ) - if (HAVE_${VARIABLE}) - message (STATUS "Check size of ${TYPE} - done") - file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log - "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" - ) - else () - message (STATUS "Check size of ${TYPE} - failed") - file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" - ) - endif () - endif () - set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) -endmacro () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 56d45f9..e1b8853 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -12,18 +12,18 @@ #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- -include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) -include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) -include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) -include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) -include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) -include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) -include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +include (CheckFunctionExists) +include (CheckIncludeFile) +include (CheckIncludeFileCXX) +include (CheckIncludeFiles) +include (CheckLibraryExists) +include (CheckSymbolExists) +include (CheckTypeSize) +include (CheckVariableExists) +include (CheckFortranFunctionExists) +include (TestBigEndian) if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) - include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) + include (TestForSTDNamespace) endif () #----------------------------------------------------------------------------- -- cgit v0.12 From 2f18da435e537118e1405f7f9fef3f3e29a346f2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:21:01 -0600 Subject: HDFFV-10398 use the simpler add_subdirectory signature --- CMakeLists.txt | 24 ++++++++++++------------ MANIFEST | 1 - c++/CMakeLists.txt | 6 +++--- fortran/CMakeLists.txt | 8 ++++---- hl/CMakeLists.txt | 8 ++++---- hl/c++/CMakeLists.txt | 6 +++--- hl/fortran/CMakeLists.txt | 6 +++--- hl/tools/CMakeLists.txt | 4 ++-- java/CMakeLists.txt | 6 +++--- java/examples/CMakeLists.txt | 8 ++++---- java/src/CMakeLists.txt | 4 ++-- java/src/hdf/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 6 +++--- tools/src/CMakeLists.txt | 20 ++++++++++---------- tools/test/CMakeLists.txt | 22 +++++++++++----------- tools/test/misc/CMakeLists.txt | 2 +- 16 files changed, 66 insertions(+), 67 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3579f6c..ee5fc2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -676,7 +676,7 @@ endif () #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) +add_subdirectory (src) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) @@ -721,12 +721,12 @@ if (BUILD_TESTING) if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) - add_subdirectory (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) + add_subdirectory (tools/lib) + add_subdirectory (test) endif () if (H5_HAVE_PARALLEL) if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") - add_subdirectory (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) + add_subdirectory (testpar) endif () endif () endif () @@ -738,7 +738,7 @@ endif () if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON) if (HDF5_BUILD_TOOLS) - add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) + add_subdirectory (tools) endif () endif () @@ -748,7 +748,7 @@ endif () if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON) if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) + add_subdirectory (examples) endif () endif () @@ -759,7 +759,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON) if (HDF5_BUILD_HL_LIB) set (H5_INCLUDE_HL 1) - add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) + add_subdirectory (hl) endif () endif () @@ -808,11 +808,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for # # set (FCFLAGS "${Fortran_DEFINES}") - add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) + add_subdirectory (fortran) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes - add_subdirectory (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) + add_subdirectory (hl/fortran) endif () endif () endif () @@ -835,11 +835,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) endif () - add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) + add_subdirectory (c++) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") #-- Build the High Level Fortran source codes - add_subdirectory (${HDF5_SOURCE_DIR}/hl/c++ ${PROJECT_BINARY_DIR}/hl/c++) + add_subdirectory (hl/c++) endif () endif () endif () @@ -861,7 +861,7 @@ endif () if (EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java") option (HDF5_BUILD_JAVA "Build Java HDF5 Library" OFF) if (HDF5_BUILD_JAVA) - add_subdirectory (${HDF5_SOURCE_DIR}/java ${PROJECT_BINARY_DIR}/java) + add_subdirectory (java) endif () endif () diff --git a/MANIFEST b/MANIFEST index 2db6d6b..a2a78c8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3093,7 +3093,6 @@ ./config/cmake/userblockTest.cmake ./config/cmake/vfdTest.cmake -./config/cmake_ext_mod/CheckTypeSize.cmake ./config/cmake_ext_mod/ConfigureChecks.cmake ./config/cmake_ext_mod/CTestCustom.cmake ./config/cmake_ext_mod/FindMPI.cmake diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index c9c4815..adbf1a4 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -27,18 +27,18 @@ if (H5_HAVE_PARALLEL) add_definitions ("-DMPICH_IGNORE_CXX_SEEK") endif () -add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the CPP Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) + add_subdirectory (test) endif () diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 075e1da..a0f92d3 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -10,21 +10,21 @@ endif () #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the Fortran Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) + add_subdirectory (test) if (MPI_Fortran_FOUND) - add_subdirectory (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) + add_subdirectory (testpar) endif () endif () diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index a47e023..d80b4f9 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -12,21 +12,21 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) -add_subdirectory (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) +add_subdirectory (src) #-- Build the High level Tools if (HDF5_BUILD_TOOLS) - add_subdirectory (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) + add_subdirectory (tools) endif () #-- Add High Level Examples if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #-- Build the Unit testing if requested if (NOT HDF5_EXTERNALLY_CONFIGURED) if (BUILD_TESTING) - add_subdirectory (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) + add_subdirectory (test) endif () endif () diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 91bfa14..9a1d059 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -4,13 +4,13 @@ PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- # Main HL lib is in /src #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) +add_subdirectory (src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) + add_subdirectory (examples) endif () # -------------------------------------------------------------------- @@ -18,5 +18,5 @@ endif () # -------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) + add_subdirectory (test) endif () diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index c651ce9..00d7517 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -4,18 +4,18 @@ PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the HL Fortran Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) + add_subdirectory (test) endif () diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 9536517..43229e8 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TOOLS C CXX) -add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5 ${HDF5_HL_TOOLS_BINARY_DIR}/gif2h5) +add_subdirectory (gif2h5) -add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/h5watch ${HDF5_HL_TOOLS_BINARY_DIR}/h5watch) +add_subdirectory (h5watch) diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 68860be..9a5692f 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -36,20 +36,20 @@ set (CMAKE_JAVA_INCLUDE_PATH "") #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/src ${HDF5_JAVA_BINARY_DIR}/src) +add_subdirectory (src) #----------------------------------------------------------------------------- # Build the Java Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/examples ${HDF5_JAVA_BINARY_DIR}/examples) + add_subdirectory (examples) endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/test ${HDF5_JAVA_BINARY_DIR}/test) + add_subdirectory (test) endif () #----------------------------------------------------------------------------- diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index a1a7483..3073918 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDFJAVA_EXAMPLES) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datasets datasets) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datatypes datatypes) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/groups groups) -add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/intro intro) +add_subdirectory (datasets) +add_subdirectory (datatypes) +add_subdirectory (groups) +add_subdirectory (intro) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 3f93f39..9bdab4b 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -4,5 +4,5 @@ PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- -add_subdirectory (${HDF5_JAVA_SRC_SOURCE_DIR}/jni ${HDF5_JAVA_SRC_BINARY_DIR}/jni) -add_subdirectory (${HDF5_JAVA_SRC_SOURCE_DIR}/hdf ${HDF5_JAVA_SRC_BINARY_DIR}/hdf) +add_subdirectory (jni) +add_subdirectory (hdf) diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index 84bda53..649f7d0 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_JAVA_HDF) -add_subdirectory (${HDF5_JAVA_HDF_SOURCE_DIR}/hdf5lib hdf5lib) +add_subdirectory (hdf5lib) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4b3b3d5..8d442e0 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -10,7 +10,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- if (NOT BUILD_TESTING) - add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib) + add_subdirectory (lib) endif () #----------------------------------------------------------------------------- @@ -19,9 +19,9 @@ endif () INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) #-- Add the test sources -add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/src) +add_subdirectory (src) #-- Add the tests if (BUILD_TESTING) - add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/test) + add_subdirectory (test) endif () diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 37680dd..24e682a 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -7,31 +7,31 @@ PROJECT (HDF5_TOOLS_SRC) add_definitions (${HDF_EXTRA_C_FLAGS}) #-- Add the h5diff and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5diff) +add_subdirectory (h5diff) #-- Add the h5ls executable -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5ls) +add_subdirectory (h5ls) #-- Misc Executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/misc) +add_subdirectory (misc) #-- Add the h5import and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5import) +add_subdirectory (h5import) #-- h5Repack executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5repack) +add_subdirectory (h5repack) #-- Add the h5dump and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5jam) +add_subdirectory (h5jam) #-- Add the h5copy and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5copy) +add_subdirectory (h5copy) #-- Add the h5stat and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5stat) +add_subdirectory (h5stat) #-- Add the h5dump and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5dump) +add_subdirectory (h5dump) #-- Add the h5format_convert and test executables -add_subdirectory (${HDF5_TOOLS_SRC_SOURCE_DIR}/h5format_convert) +add_subdirectory (h5format_convert) diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index a7dd11f..6877bfc 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -7,34 +7,34 @@ PROJECT (HDF5_TOOLS_TEST) add_definitions (${HDF_EXTRA_C_FLAGS}) #-- Add the h5diff tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5diff) +add_subdirectory (h5diff) #-- Add the h5ls tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5ls) +add_subdirectory (h5ls) #-- Misc tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/misc) +add_subdirectory (misc) #-- Add the h5import tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5import) +add_subdirectory (h5import) #-- h5Repack tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5repack) +add_subdirectory (h5repack) #-- Add the h5jam tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5jam) +add_subdirectory (h5jam) #-- Add the h5copy tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5copy) +add_subdirectory (h5copy) #-- Add the h5stat tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5stat) +add_subdirectory (h5stat) #-- Add the h5dump tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5dump) +add_subdirectory (h5dump) #-- Add the h5format_convert and test executables -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/h5format_convert) +add_subdirectory (h5format_convert) #-- Add the perform tests -add_subdirectory (${HDF5_TOOLS_TEST_SOURCE_DIR}/perform) +add_subdirectory (perform) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 48bc8ab..c014fad 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $) - add_subdirectory (${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/vds) + add_subdirectory (vds) endif () -- cgit v0.12 From 0866bc0bb855fcfdde4608cc437c29d668634a67 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:29:51 -0600 Subject: HDFFV-10398 use the target name for custom commands --- fortran/src/CMakeLists.txt | 12 ++++-------- fortran/test/CMakeLists.txt | 6 ++---- hl/fortran/src/CMakeLists.txt | 6 ++---- src/CMakeLists.txt | 12 ++++-------- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index b664c50..5446616 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -78,22 +78,20 @@ add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -set (CMD $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS H5match_types ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 - COMMAND ${CMDSH} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared DEPENDS H5match_types ) @@ -171,10 +169,9 @@ set (f90_F_GEN_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90 ) -set (CMD $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static DEPENDS ${f90_F_GEN_SOURCES} COMMENT "Generating the H5_gen.F90 file" @@ -185,10 +182,9 @@ add_custom_target (H5gen ALL set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 - COMMAND ${CMDSH} + COMMAND $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared DEPENDS ${f90_F_GEN_SOURCES} COMMENT "Generating the H5_gen.F90 shared file" diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 2990bcc..86f7a12 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -74,10 +74,9 @@ if (BUILD_SHARED_LIBS) ) endif () -set (CMD $) add_custom_command ( OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 file" @@ -88,10 +87,9 @@ add_custom_target (H5testgen ALL set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 - COMMAND ${CMDSH} + COMMAND $ WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 shared file" diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index b1a639a..5ad441c 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -109,10 +109,9 @@ set (HDF5_HL_F90_F_BASE_SOURCES ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90 ) -set (CMD $) add_custom_command ( OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/static DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files" @@ -126,10 +125,9 @@ set_source_files_properties ( PROPERTIES GENERATED TRUE ) if (BUILD_SHARED_LIBS) - set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 - COMMAND ${CMD} + COMMAND $ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/shared DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0552244..0cc68ac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -853,10 +853,9 @@ if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () -set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c DEPENDS H5detect ) @@ -867,10 +866,9 @@ if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () -set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c DEPENDS H5make_libsettings WORKING_DIRECTORY ${HDF5_BINARY_DIR} @@ -905,18 +903,16 @@ set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared") - set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/shared/H5Tinit.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/shared/H5Tinit.c DEPENDS H5detect WORKING_DIRECTORY ${HDF5_BINARY_DIR}/shared ) - set (CMD $) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c - COMMAND ${CMD} + COMMAND $ ARGS > ${HDF5_BINARY_DIR}/shared/H5lib_settings.c DEPENDS H5make_libsettings WORKING_DIRECTORY ${HDF5_BINARY_DIR} -- cgit v0.12 From 98f8fd9603e085cf110df56192d657bc0dec164c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:43:01 -0600 Subject: HDFFV-10398 Suppress VS 2015 assertion failure popup during try_run --- config/cmake_ext_mod/HDFTests.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 60ac744..320fd5b 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -222,12 +222,26 @@ SIMPLE_TEST(struct stat sb; sb.st_blocks=0); #include #include +#if defined(_MSC_VER) && defined(_DEBUG) +# include +int DebugReport(int reportType, char* message, int* returnValue) +{ + (void)reportType; + (void)message; + (void)returnValue; + return 1; /* no further handling required */ +} +#endif + int main(void) { char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL }; char *s = malloc(128); char **currentArg = NULL; LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; + #if defined(_MSC_VER) && defined(_DEBUG) + _CrtSetReportHook(DebugReport); + #endif for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++) { char formatString[64]; -- cgit v0.12 From 6aee1578c39a58c073333bc62b2eb90f3aa4891e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 12:46:23 -0600 Subject: HDFFV-10398 msvc: use /W0 rather than /w --- config/cmake/HDFCompilerFlags.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index a414cea..56277fa 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -49,9 +49,9 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) if (MSVC) set (HDF5_WARNINGS_BLOCKED 1) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) -- cgit v0.12 From dc384f474d65116dc1b70db1aea9a671076a89b2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 14:47:43 -0600 Subject: HDFFV-10398 - avoid ubsan crashes --- config/cmake/ConversionTests.c | 167 ++++++++++++++++++++++------------------- 1 file changed, 89 insertions(+), 78 deletions(-) diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 082dbd4..002bc88 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -9,12 +9,23 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ ++ +#if defined(__has_attribute) +#if __has_attribute(no_sanitize) +#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined"))) +#else +#define HDF_NO_UBSAN +#endif +#else +#define HDF_NO_UBSAN +#endif + #ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld = 20041683600089727.779961L; long ll; @@ -24,44 +35,44 @@ int main(void) int ret = 1; if(sizeof(long double) == 16 && sizeof(long) == 8) { - /*make sure the long double type has 16 bytes in size and - * 11 bits of exponent. If it is, - *the bit sequence should be like below. It's not - *a decent way to check but this info isn't available. */ - memcpy(s, &ld, 16); - if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && - s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && - s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) { - - /* Assign the hexadecimal value of long double type. */ - s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; - s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; - s[8]=0xbf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; - s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; - - memcpy(&ld, s, 16); - - ll = (long)ld; - memcpy(s2, &ll, 8); - - /* The library's algorithm converts it to 0x 00 47 33 ce 17 af 22 82 - * and gets wrong value 20041683600089730 on the IBM Power6 Linux. - * But the IBM Power6 Linux converts it to 0x00 47 33 ce 17 af 22 7f - * and gets the correct value 20041683600089727. It uses some special - * algorithm. We're going to define the macro and skip the test until - * we can figure out how they do it. */ - if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && - s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) - ret = 0; - - ull = (unsigned long)ld; - memcpy(s2, &ull, 8); - - /* The unsigned long is the same as signed long. */ - if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && - s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) - ret = 0; - } + /*make sure the long double type has 16 bytes in size and + * 11 bits of exponent. If it is, + *the bit sequence should be like below. It's not + *a decent way to check but this info isn't available. */ + memcpy(s, &ld, 16); + if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && + s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && + s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) { + + /* Assign the hexadecimal value of long double type. */ + s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; + s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; + s[8]=0xbf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; + s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; + + memcpy(&ld, s, 16); + + ll = (long)ld; + memcpy(s2, &ll, 8); + + /* The library's algorithm converts it to 0x 00 47 33 ce 17 af 22 82 + * and gets wrong value 20041683600089730 on the IBM Power6 Linux. + * But the IBM Power6 Linux converts it to 0x00 47 33 ce 17 af 22 7f + * and gets the correct value 20041683600089727. It uses some special + * algorithm. We're going to define the macro and skip the test until + * we can figure out how they do it. */ + if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && + s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) + ret = 0; + + ull = (unsigned long)ld; + memcpy(s2, &ull, 8); + + /* The unsigned long is the same as signed long. */ + if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && + s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) + ret = 0; + } } done: @@ -75,7 +86,7 @@ done: #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld; long ll; @@ -86,46 +97,46 @@ int main(void) /*Determine if long double has 16 byte in size, 11 bit exponent, and *the bias is 0x3ff */ if(sizeof(long double) == 16) { - ld = 1.0L; - memcpy(s, &ld, 16); - if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) - flag = 1; + ld = 1.0L; + memcpy(s, &ld, 16); + if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) + flag = 1; } if(flag==1 && sizeof(long)==8) { - ll = 0x003fffffffffffffL; - ld = (long double)ll; - memcpy(s, &ld, 16); - /* The library converts the value to 0x434fffffffffffff8000000000000000. - * In decimal it is 18014398509481982.000000, one value short of the original. - * The IBM Power6 Linux converts it to 0x4350000000000000bff0000000000000. - * The value is correct in decimal. It uses some special - * algorithm. We're going to define the macro and skip the test until - * we can figure out how they do it. */ - if(s[0]==0x43 && s[1]==0x50 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && - s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && - s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) - ret = 0; + ll = 0x003fffffffffffffL; + ld = (long double)ll; + memcpy(s, &ld, 16); + /* The library converts the value to 0x434fffffffffffff8000000000000000. + * In decimal it is 18014398509481982.000000, one value short of the original. + * The IBM Power6 Linux converts it to 0x4350000000000000bff0000000000000. + * The value is correct in decimal. It uses some special + * algorithm. We're going to define the macro and skip the test until + * we can figure out how they do it. */ + if(s[0]==0x43 && s[1]==0x50 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && + s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && + s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) + ret = 0; } if(flag==1 && sizeof(unsigned long)==8) { - ull = 0xffffffffffffffffUL; - ld = (long double)ull; - memcpy(s, &ld, 16); - /* Use a different value from signed long to test. The problem is the same - * for both long and unsigned long. The value is 18446744073709551615. - * The library converts the value to 0x43effffffffffffffe000000000000000. - * In decimal it's 18446744073709548544.000000, very different from the original. - * The IBM Power6 Linux converts it to 0x43f0000000000000bff0000000000000. - * The value is correct in decimal. It uses some special - * algorithm. We're going to define the macro and skip the test until - * we can figure out how they do it. */ - if(s[0]==0x43 && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && - s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && - s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) - ret = 0; + ull = 0xffffffffffffffffUL; + ld = (long double)ull; + memcpy(s, &ld, 16); + /* Use a different value from signed long to test. The problem is the same + * for both long and unsigned long. The value is 18446744073709551615. + * The library converts the value to 0x43effffffffffffffe000000000000000. + * In decimal it's 18446744073709548544.000000, very different from the original. + * The IBM Power6 Linux converts it to 0x43f0000000000000bff0000000000000. + * The value is correct in decimal. It uses some special + * algorithm. We're going to define the macro and skip the test until + * we can figure out how they do it. */ + if(s[0]==0x43 && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && + s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && + s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) + ret = 0; } done: exit(ret); @@ -138,7 +149,7 @@ done: #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld = 20041683600089727.779961L; long long ll; @@ -181,7 +192,7 @@ done: #include #include -int main(void) +int main(void) HDF_NO_UBSAN { long double ld; long long ll; @@ -243,7 +254,7 @@ int FC_DUMMY_MAIN() #endif #endif int -main () +main () HDF_NO_UBSAN { char *chp = "beefs"; -- cgit v0.12 From 1711c3727e11d41268da1c6d4ae0204e081c5e1d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 15:21:07 -0600 Subject: HDFFV-10398 avoid sanitizer failures --- src/H5detect.c | 1038 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 527 insertions(+), 511 deletions(-) diff --git a/src/H5detect.c b/src/H5detect.c index 75a1dba..2cc8366 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -27,23 +27,23 @@ static const char *FileHeader = "\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"; /* * - * Created: H5detect.c - * 10 Aug 1997 - * Robb Matzke + * Created: H5detect.c + * 10 Aug 1997 + * Robb Matzke * - * Purpose: This code was borrowed heavily from the `detect.c' - * program in the AIO distribution from Lawrence - * Livermore National Laboratory. + * Purpose: This code was borrowed heavily from the `detect.c' + * program in the AIO distribution from Lawrence + * Livermore National Laboratory. * - * Detects machine byte order and floating point - * format and generates a C source file (H5Tinit.c) - * to describe those paramters. + * Detects machine byte order and floating point + * format and generates a C source file (H5Tinit.c) + * to describe those paramters. * * Assumptions: We have an ANSI compiler. We're on a Unix like - * system or configure has detected those Unix - * features which aren't available. We're not - * running on a Vax or other machine with mixed - * endianess. + * system or configure has detected those Unix + * features which aren't available. We're not + * running on a Vax or other machine with mixed + * endianess. * * Modifications: * @@ -54,9 +54,19 @@ static const char *FileHeader = "\n\ #include "H5Tpublic.h" #include "H5Rpublic.h" +#if defined(__has_attribute) +#if __has_attribute(no_sanitize) +#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined"))) +#else +#define HDF_NO_UBSAN +#endif +#else +#define HDF_NO_UBSAN +#endif + #define MAXDETECT 64 -/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals. +/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals. * We use setjmp/longjmp in the signal handlers for recovery. But setjmp/longjmp * do not necessary restore the signal blocking status while sigsetjmp/siglongjmp * do. If sigsetjmp/siglongjmp are not supported, need to use sigprocmask to @@ -66,19 +76,19 @@ static const char *FileHeader = "\n\ /* supported. */ #if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP) /* Always save blocked signals to be restore by siglongjmp. */ -#define H5JMP_BUF sigjmp_buf -#define H5SETJMP(buf) HDsigsetjmp(buf, 1) -#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) -#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */ +#define H5JMP_BUF sigjmp_buf +#define H5SETJMP(buf) HDsigsetjmp(buf, 1) +#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) +#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */ #elif defined(H5_HAVE_LONGJMP) -#define H5JMP_BUF jmp_buf -#define H5SETJMP(buf) HDsetjmp(buf) -#define H5LONGJMP(buf, val) HDlongjmp(buf, val) +#define H5JMP_BUF jmp_buf +#define H5SETJMP(buf) HDsetjmp(buf) +#define H5LONGJMP(buf, val) HDlongjmp(buf, val) #endif /* ALIGNMENT and signal-handling status codes */ -#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */ -#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */ +#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */ +#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */ /* @@ -133,11 +143,11 @@ static void detect_C99_integers32(void); static void detect_C99_integers64(void); static void detect_alignments(void); static unsigned int align_g[] = {1, 2, 4, 8, 16}; -static int align_status_g = 0; /* ALIGNMENT Signal Status */ -static int sigbus_handler_called_g = 0; /* how many times called */ +static int align_status_g = 0; /* ALIGNMENT Signal Status */ +static int sigbus_handler_called_g = 0; /* how many times called */ static int sigsegv_handler_called_g = 0;/* how many times called */ -static int sigill_handler_called_g = 0; /* how many times called */ -static int signal_handler_tested_g = 0; /* how many times tested */ +static int sigill_handler_called_g = 0; /* how many times called */ +static int signal_handler_tested_g = 0; /* how many times tested */ #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) static int verify_signal_handlers(int signum, void (*handler)(int)); #endif @@ -145,16 +155,16 @@ static int verify_signal_handlers(int signum, void (*handler)(int)); static H5JMP_BUF jbuf_g; #endif - + /*------------------------------------------------------------------------- - * Function: precision + * Function: precision * - * Purpose: Determine the precision and offset. + * Purpose: Determine the precision and offset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Thursday, June 18, 1998 + * Programmer: Robb Matzke + * Thursday, June 18, 1998 * * Modifications: * @@ -167,7 +177,7 @@ precision (detected_t *d) if (0 == d->msize) { /* - * An integer. The permutation can have negative values at the + * An integer. The permutation can have negative values at the * beginning or end which represent padding of bytes. We must adjust * the precision and offset accordingly. */ @@ -201,36 +211,36 @@ precision (detected_t *d) } } - + /*------------------------------------------------------------------------- - * Function: DETECT_I/DETECT_BYTE + * Function: DETECT_I/DETECT_BYTE * - * Purpose: These macro takes a type like `int' and a base name like - * `nati' and detects the byte order. The VAR is used to - * construct the names of the C variables defined. + * Purpose: These macro takes a type like `int' and a base name like + * `nati' and detects the byte order. The VAR is used to + * construct the names of the C variables defined. * * DETECT_I is used for types that are larger than one byte, * DETECT_BYTE is used for types that are exactly one byte. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * * Modifications: * - * Robb Matzke, 4 Nov 1996 - * The INFO.perm now contains `-1' for bytes that aren't used and - * are always zero. This happens on the Cray for `short' where - * sizeof(short) is 8, but only the low-order 4 bytes are ever used. + * Robb Matzke, 4 Nov 1996 + * The INFO.perm now contains `-1' for bytes that aren't used and + * are always zero. This happens on the Cray for `short' where + * sizeof(short) is 8, but only the low-order 4 bytes are ever used. * - * Robb Matzke, 4 Nov 1996 - * Added a `padding' field to indicate how many zero bytes appear to - * the left (N) or right (-N) of the value. + * Robb Matzke, 4 Nov 1996 + * Added a `padding' field to indicate how many zero bytes appear to + * the left (N) or right (-N) of the value. * - * Robb Matzke, 5 Nov 1996 - * Removed HFILE and CFILE arguments. + * Robb Matzke, 5 Nov 1996 + * Removed HFILE and CFILE arguments. * * Neil Fortner, 6 Sep 2013 * Split macro into DETECT_I and DETECT_BYTE macros, extracted @@ -273,27 +283,27 @@ precision (detected_t *d) DETECT_I_BYTE_CORE(TYPE,VAR,INFO,int) \ } -#define DETECT_I(TYPE,VAR,INFO) { \ +#define DETECT_I(TYPE,VAR,INFO) { \ HDcompile_assert(sizeof(TYPE) > 1); \ \ DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \ } - + /*------------------------------------------------------------------------- - * Function: DETECT_F + * Function: DETECT_F * - * Purpose: This macro takes a floating point type like `double' and - * a base name like `natd' and detects byte order, mantissa - * location, exponent location, sign bit location, presence or - * absence of implicit mantissa bit, and exponent bias and - * initializes a detected_t structure with those properties. + * Purpose: This macro takes a floating point type like `double' and + * a base name like `natd' and detects byte order, mantissa + * location, exponent location, sign bit location, presence or + * absence of implicit mantissa bit, and exponent bias and + * initializes a detected_t structure with those properties. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * *------------------------------------------------------------------------- */ @@ -383,31 +393,31 @@ precision (detected_t *d) } \ } - + /*------------------------------------------------------------------------- - * Function: DETECT_M + * Function: DETECT_M * - * Purpose: This macro takes only miscellaneous structures or pointer + * Purpose: This macro takes only miscellaneous structures or pointer * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It - * constructs the names and decides the alignment in structure. + * constructs the names and decides the alignment in structure. * - * Return: void + * Return: void * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu - * Dec 9, 2002 + * Programmer: Raymond Lu + * slu@ncsa.uiuc.edu + * Dec 9, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -#define DETECT_M(TYPE,VAR,INFO) { \ - INFO.name = #VAR; \ - COMP_ALIGNMENT(TYPE, INFO.comp_align); \ +#define DETECT_M(TYPE,VAR,INFO) { \ + INFO.name = #VAR; \ + COMP_ALIGNMENT(TYPE, INFO.comp_align); \ } /* Detect alignment for C structure */ -#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \ +#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \ struct { \ char c; \ TYPE x; \ @@ -417,67 +427,67 @@ precision (detected_t *d) } #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) -#define ALIGNMENT(TYPE,INFO) { \ - char *volatile _buf = NULL; \ - TYPE _val = 1, _val2; \ - volatile size_t _ano = 0; \ - void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ - void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ - void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \ - \ - _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ - if(H5SETJMP(jbuf_g)) _ano++; \ - if(_ano < NELMTS(align_g)) { \ - *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ - _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\ - /* Cray Check: This section helps detect alignment on Cray's */ \ +#define ALIGNMENT(TYPE,INFO) { \ + char *volatile _buf = NULL; \ + TYPE _val = 1, _val2; \ + volatile size_t _ano = 0; \ + void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ + void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ + void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \ + \ + _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ + if(H5SETJMP(jbuf_g)) _ano++; \ + if(_ano < NELMTS(align_g)) { \ + *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ + _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\ + /* Cray Check: This section helps detect alignment on Cray's */ \ /* vector machines (like the SV1) which mask off */ \ - /* pointer values when pointing to non-word aligned */ \ - /* locations with pointers that are supposed to be */ \ - /* word aligned. -QAK */ \ - HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ + /* pointer values when pointing to non-word aligned */ \ + /* locations with pointers that are supposed to be */ \ + /* word aligned. -QAK */ \ + HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ /*How to handle VAX types?*/ \ - if(INFO.perm[0]) /* Big-Endian */ \ - HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ - else /* Little-Endian */ \ - HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ - _val2 = *((TYPE*)(_buf+align_g[_ano])); \ - H5_GCC_DIAG_OFF(float-equal) \ - if(_val!=_val2) \ - H5LONGJMP(jbuf_g, 1); \ - H5_GCC_DIAG_ON(float-equal) \ - /* End Cray Check */ \ - (INFO.align)=align_g[_ano]; \ - } else { \ - (INFO.align)=0; \ - fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ - } \ - HDfree(_buf); \ - HDsignal(SIGBUS, _handler); /*restore original handler*/ \ - HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ - HDsignal(SIGILL, _handler3); /*restore original handler*/ \ + if(INFO.perm[0]) /* Big-Endian */ \ + HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ + else /* Little-Endian */ \ + HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ + _val2 = *((TYPE*)(_buf+align_g[_ano])); \ + H5_GCC_DIAG_OFF(float-equal) \ + if(_val!=_val2) \ + H5LONGJMP(jbuf_g, 1); \ + H5_GCC_DIAG_ON(float-equal) \ + /* End Cray Check */ \ + (INFO.align)=align_g[_ano]; \ + } else { \ + (INFO.align)=0; \ + fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ + } \ + HDfree(_buf); \ + HDsignal(SIGBUS, _handler); /*restore original handler*/ \ + HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ + HDsignal(SIGILL, _handler3); /*restore original handler*/ \ } #else -#define ALIGNMENT(TYPE,INFO) { \ - align_status_g |= STA_NoALIGNMENT; \ - (INFO.align)=0; \ +#define ALIGNMENT(TYPE,INFO) { \ + align_status_g |= STA_NoALIGNMENT; \ + (INFO.align)=0; \ } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigsegv_handler + * Function: sigsegv_handler * - * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Robb Matzke - * Thursday, March 18, 1999 + * Programmer: Robb Matzke + * Thursday, March 18, 1999 * * Modifications: * @@ -502,20 +512,20 @@ sigsegv_handler(int H5_ATTR_UNUSED signo) } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigbus_handler + * Function: sigbus_handler * - * Purpose: Handler for SIGBUS. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGBUS. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Robb Matzke - * Thursday, March 18, 1999 + * Programmer: Robb Matzke + * Thursday, March 18, 1999 * * Modifications: * @@ -540,20 +550,20 @@ sigbus_handler(int H5_ATTR_UNUSED signo) } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigill_handler + * Function: sigill_handler * - * Purpose: Handler for SIGILL. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGILL. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Raymond Lu - * 28 October 2013 + * Programmer: Raymond Lu + * 28 October 2013 * *------------------------------------------------------------------------- */ @@ -576,17 +586,17 @@ sigill_handler(int H5_ATTR_UNUSED signo) } #endif - + /*------------------------------------------------------------------------- - * Function: print_results + * Function: print_results * - * Purpose: Prints information about the detected data types. + * Purpose: Prints information about the detected data types. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 14, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 14, 1996 * * Modifications: * @@ -596,7 +606,7 @@ static void print_results(int nd, detected_t *d, int na, malign_t *misc_align) { int byte_order=0; /*byte order of data types*/ - int i, j; + int i, j; /* Include files */ printf("\ @@ -610,11 +620,11 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) /***********/\n\ /* Headers */\n\ /***********/\n\ -#include \"H5private.h\" /* Generic Functions */\n\ -#include \"H5Eprivate.h\" /* Error handling */\n\ -#include \"H5FLprivate.h\" /* Free Lists */\n\ -#include \"H5Iprivate.h\" /* IDs */\n\ -#include \"H5Tpkg.h\" /* Datatypes */\n\ +#include \"H5private.h\" /* Generic Functions */\n\ +#include \"H5Eprivate.h\" /* Error handling */\n\ +#include \"H5FLprivate.h\" /* Free Lists */\n\ +#include \"H5Iprivate.h\" /* IDs */\n\ +#include \"H5Tpkg.h\" /* Datatypes */\n\ \n\ \n\ /****************/\n\ @@ -663,15 +673,15 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) printf("\n\ \n\ /*-------------------------------------------------------------------------\n\ - * Function: H5T__init_native\n\ + * Function: H5T__init_native\n\ *\n\ - * Purpose: Initialize pre-defined native datatypes from code generated\n\ + * Purpose: Initialize pre-defined native datatypes from code generated\n\ * during the library configuration by H5detect.\n\ *\n\ - * Return: Success: non-negative\n\ - * Failure: negative\n\ + * Return: Success: non-negative\n\ + * Failure: negative\n\ *\n\ - * Programmer: Robb Matzke\n\ + * Programmer: Robb Matzke\n\ * Wednesday, December 16, 1998\n\ *\n\ *-------------------------------------------------------------------------\n\ @@ -679,8 +689,8 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) herr_t\n\ H5T__init_native(void)\n\ {\n\ - H5T_t *dt = NULL;\n\ - herr_t ret_value = SUCCEED;\n\ + H5T_t *dt = NULL;\n\ + herr_t ret_value = SUCCEED;\n\ \n\ FUNC_ENTER_PACKAGE\n"); @@ -702,20 +712,20 @@ H5T__init_native(void)\n\ } } - /* Print a comment to describe this section of definitions. */ - printf("\n /*\n"); - iprint(d+i); - printf(" */\n"); + /* Print a comment to describe this section of definitions. */ + printf("\n /*\n"); + iprint(d+i); + printf(" */\n"); - /* The part common to fixed and floating types */ - printf("\ + /* The part common to fixed and floating types */ + printf("\ if(NULL == (dt = H5T__alloc()))\n\ HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, \"datatype allocation failed\")\n\ dt->shared->state = H5T_STATE_IMMUTABLE;\n\ dt->shared->type = H5T_%s;\n\ dt->shared->size = %d;\n", - d[i].msize ? "FLOAT" : "INTEGER",/*class */ - d[i].size); /*size */ + d[i].msize ? "FLOAT" : "INTEGER",/*class */ + d[i].size); /*size */ if(byte_order==-1) printf("\ @@ -732,18 +742,18 @@ H5T__init_native(void)\n\ dt->shared->u.atomic.prec = %d;\n\ dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\ dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;\n", - d[i].offset, /*offset */ - d[i].precision); /*precision */ + d[i].offset, /*offset */ + d[i].precision); /*precision */ /*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */ - if (0 == d[i].msize) { - /* The part unique to fixed point types */ - printf("\ + if (0 == d[i].msize) { + /* The part unique to fixed point types */ + printf("\ dt->shared->u.atomic.u.i.sign = H5T_SGN_%s;\n", - d[i].sign ? "2" : "NONE"); - } else { - /* The part unique to floating point types */ - printf("\ + d[i].sign ? "2" : "NONE"); + } else { + /* The part unique to floating point types */ + printf("\ dt->shared->u.atomic.u.f.sign = %d;\n\ dt->shared->u.atomic.u.f.epos = %d;\n\ dt->shared->u.atomic.u.f.esize = %d;\n\ @@ -752,22 +762,22 @@ H5T__init_native(void)\n\ dt->shared->u.atomic.u.f.msize = %d;\n\ dt->shared->u.atomic.u.f.norm = H5T_NORM_%s;\n\ dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO;\n", - d[i].sign, /*sign location */ - d[i].epos, /*exponent loc */ - d[i].esize, /*exponent size */ - (unsigned long)(d[i].bias), /*exponent bias */ - d[i].mpos, /*mantissa loc */ - d[i].msize, /*mantissa size */ - d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ - } - - /* Atomize the type */ - printf("\ + d[i].sign, /*sign location */ + d[i].epos, /*exponent loc */ + d[i].esize, /*exponent size */ + (unsigned long)(d[i].bias), /*exponent bias */ + d[i].mpos, /*mantissa loc */ + d[i].msize, /*mantissa size */ + d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ + } + + /* Atomize the type */ + printf("\ if((H5T_NATIVE_%s_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)\n\ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \"can't register ID for built-in datatype\")\n", - d[i].varname); - printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", - d[i].varname, (unsigned long)(d[i].align)); + d[i].varname); + printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", + d[i].varname, (unsigned long)(d[i].align)); /* Variables for alignment of compound datatype */ if(!HDstrcmp(d[i].varname, "SCHAR") || !HDstrcmp(d[i].varname, "SHORT") || @@ -809,69 +819,69 @@ done:\n\ /* Print the ALIGNMENT and signal-handling status as comments */ printf("\n" - "/****************************************/\n" - "/* ALIGNMENT and signal-handling status */\n" - "/****************************************/\n"); + "/****************************************/\n" + "/* ALIGNMENT and signal-handling status */\n" + "/****************************************/\n"); if (align_status_g & STA_NoALIGNMENT) - printf("/* ALIGNAMENT test is not available */\n"); + printf("/* ALIGNAMENT test is not available */\n"); if (align_status_g & STA_NoHandlerVerify) - printf("/* Signal handlers verify test is not available */\n"); + printf("/* Signal handlers verify test is not available */\n"); /* The following is available in H5pubconf.h. Printing them here for */ /* convenience. */ #ifdef H5_HAVE_SIGNAL - printf("/* Signal() support: yes */\n"); + printf("/* Signal() support: yes */\n"); #else - printf("/* Signal() support: no */\n"); + printf("/* Signal() support: no */\n"); #endif #ifdef H5_HAVE_SETJMP - printf("/* setjmp() support: yes */\n"); + printf("/* setjmp() support: yes */\n"); #else - printf("/* setjmp() support: no */\n"); + printf("/* setjmp() support: no */\n"); #endif #ifdef H5_HAVE_LONGJMP - printf("/* longjmp() support: yes */\n"); + printf("/* longjmp() support: yes */\n"); #else - printf("/* longjmp() support: no */\n"); + printf("/* longjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGSETJMP - printf("/* sigsetjmp() support: yes */\n"); + printf("/* sigsetjmp() support: yes */\n"); #else - printf("/* sigsetjmp() support: no */\n"); + printf("/* sigsetjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGLONGJMP - printf("/* siglongjmp() support: yes */\n"); + printf("/* siglongjmp() support: yes */\n"); #else - printf("/* siglongjmp() support: no */\n"); + printf("/* siglongjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGPROCMASK - printf("/* sigprocmask() support: yes */\n"); + printf("/* sigprocmask() support: yes */\n"); #else - printf("/* sigprocmask() support: no */\n"); + printf("/* sigprocmask() support: no */\n"); #endif /* Print the statics of signal handlers called for debugging */ printf("\n" - "/******************************/\n" - "/* signal handlers statistics */\n" - "/******************************/\n"); + "/******************************/\n" + "/* signal handlers statistics */\n" + "/******************************/\n"); printf("/* signal_handlers tested: %d times */\n", signal_handler_tested_g); printf("/* sigbus_handler called: %d times */\n", sigbus_handler_called_g); printf("/* sigsegv_handler called: %d times */\n", sigsegv_handler_called_g); printf("/* sigill_handler called: %d times */\n", sigill_handler_called_g); } /* end print_results() */ - + /*------------------------------------------------------------------------- - * Function: iprint + * Function: iprint * - * Purpose: Prints information about the fields of a floating point - * format. + * Purpose: Prints information about the fields of a floating point + * format. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -945,22 +955,22 @@ iprint(detected_t *d) } - + /*------------------------------------------------------------------------- - * Function: byte_cmp + * Function: byte_cmp * - * Purpose: Compares two chunks of memory A and B and returns the - * byte index into those arrays of the first byte that - * differs between A and B. Ignores differences where the + * Purpose: Compares two chunks of memory A and B and returns the + * byte index into those arrays of the first byte that + * differs between A and B. Ignores differences where the * corresponding bit in pad_mask is set to 0. * - * Return: Success: Index of differing byte. + * Return: Success: Index of differing byte. * - * Failure: -1 if all bytes are the same. + * Failure: -1 if all bytes are the same. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: * @@ -980,17 +990,17 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask) return -1; } - + /*------------------------------------------------------------------------- - * Function: bit_cmp + * Function: bit_cmp * - * Purpose: Compares two bit vectors and returns the index for the - * first bit that differs between the two vectors. The - * size of the vector is NBYTES. PERM is a mapping from - * actual order to little endian. Ignores differences where + * Purpose: Compares two bit vectors and returns the index for the + * first bit that differs between the two vectors. The + * size of the vector is NBYTES. PERM is a mapping from + * actual order to little endian. Ignores differences where * the corresponding bit in pad_mask is set to 0. * - * Return: Index of first differing bit. + * Return: Index of first differing bit. * *------------------------------------------------------------------------- */ @@ -1021,23 +1031,23 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, return 0; } - + /*------------------------------------------------------------------------- - * Function: fix_order + * Function: fix_order * - * Purpose: Given an array PERM with elements FIRST through LAST - * initialized with zero origin byte numbers, this function - * creates a permutation vector that maps the actual order - * of a floating point number to little-endian. + * Purpose: Given an array PERM with elements FIRST through LAST + * initialized with zero origin byte numbers, this function + * creates a permutation vector that maps the actual order + * of a floating point number to little-endian. * - * This function assumes that the mantissa byte ordering - * implies the total ordering. + * This function assumes that the mantissa byte ordering + * implies the total ordering. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -1046,81 +1056,81 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, static void fix_order(int n, int last, int *perm, const char **mesg) { - int i; + int i; if (last > 1) { - /* - * We have at least three points to consider. - */ - if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { - /* - * Little endian. - */ - if (mesg) *mesg = "Little-endian"; - for (i = 0; i < n; i++) perm[i] = i; - - } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { - /* - * Big endian. - */ - if (mesg) *mesg = "Big-endian"; - for (i = 0; i < n; i++) perm[i] = (n - 1) - i; - - } else { - /* - * Bi-endian machines like VAX. + /* + * We have at least three points to consider. + */ + if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { + /* + * Little endian. + */ + if (mesg) *mesg = "Little-endian"; + for (i = 0; i < n; i++) perm[i] = i; + + } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { + /* + * Big endian. + */ + if (mesg) *mesg = "Big-endian"; + for (i = 0; i < n; i++) perm[i] = (n - 1) - i; + + } else { + /* + * Bi-endian machines like VAX. * (NOTE: This is not an actual determination of the VAX-endianess. * It could have some other endianess and fall into this * case - JKM & QAK) - */ - HDassert(0 == n % 2); - if (mesg) *mesg = "VAX"; - for (i = 0; i < n; i += 2) { - perm[i] = (n - 2) - i; - perm[i + 1] = (n - 1) - i; - } - } + */ + HDassert(0 == n % 2); + if (mesg) *mesg = "VAX"; + for (i = 0; i < n; i += 2) { + perm[i] = (n - 2) - i; + perm[i + 1] = (n - 1) - i; + } + } } else { - fprintf(stderr, - "Failed to detect byte order of %d-byte floating point.\n", n); - HDexit(1); + fprintf(stderr, + "Failed to detect byte order of %d-byte floating point.\n", n); + HDexit(1); } } - + /*------------------------------------------------------------------------- - * Function: imp_bit + * Function: imp_bit * - * Purpose: Looks for an implicit bit in the mantissa. The value - * of _A should be 1.0 and the value of _B should be 0.5. - * Some floating-point formats discard the most significant - * bit of the mantissa after normalizing since it will always - * be a one (except for 0.0). If this is true for the native - * floating point values stored in _A and _B then the function - * returns non-zero. + * Purpose: Looks for an implicit bit in the mantissa. The value + * of _A should be 1.0 and the value of _B should be 0.5. + * Some floating-point formats discard the most significant + * bit of the mantissa after normalizing since it will always + * be a one (except for 0.0). If this is true for the native + * floating point values stored in _A and _B then the function + * returns non-zero. * - * This function assumes that the exponent occupies higher - * order bits than the mantissa and that the most significant - * bit of the mantissa is next to the least signficant bit - * of the exponent. + * This function assumes that the exponent occupies higher + * order bits than the mantissa and that the most significant + * bit of the mantissa is next to the least signficant bit + * of the exponent. * * - * Return: Success: Non-zero if the most significant bit - * of the mantissa is discarded (ie, the - * mantissa has an implicit `one' as the - * most significant bit). Otherwise, - * returns zero. + * Return: Success: Non-zero if the most significant bit + * of the mantissa is discarded (ie, the + * mantissa has an implicit `one' as the + * most significant bit). Otherwise, + * returns zero. * - * Failure: exit(1) + * Failure: exit(1) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug that occurs with non-implicit architectures. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug that occurs with non-implicit architectures. * *------------------------------------------------------------------------- */ @@ -1150,26 +1160,26 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_ return (a[perm[major]] >> minor) & 0x01 ? 0 : 1; } - + /*------------------------------------------------------------------------- - * Function: find_bias + * Function: find_bias * - * Purpose: Determines the bias of the exponent. This function should - * be called with _A having a value of `1'. + * Purpose: Determines the bias of the exponent. This function should + * be called with _A having a value of `1'. * - * Return: Success: The exponent bias. + * Return: Success: The exponent bias. * - * Failure: + * Failure: * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug with non-implicit architectures returning the - * wrong exponent bias. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug with non-implicit architectures returning the + * wrong exponent bias. * *------------------------------------------------------------------------- */ @@ -1193,17 +1203,17 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a) return bias; } - + /*------------------------------------------------------------------------- - * Function: print_header + * Function: print_header * - * Purpose: Prints the C file header for the generated file. + * Purpose: Prints the C file header for the generated file. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Mar 12 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Mar 12 1997 * * Modifications: * @@ -1213,22 +1223,22 @@ static void print_header(void) { - time_t now = HDtime(NULL); - struct tm *tm = HDlocaltime(&now); - char real_name[30]; - char host_name[256]; - int i; - const char *s; + time_t now = HDtime(NULL); + struct tm *tm = HDlocaltime(&now); + char real_name[30]; + char host_name[256]; + int i; + const char *s; #ifdef H5_HAVE_GETPWUID - struct passwd *pwd = NULL; + struct passwd *pwd = NULL; #else - int pwd = 1; + int pwd = 1; #endif - static const char *month_name[] = + static const char *month_name[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - static const char *purpose = "\ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + static const char *purpose = "\ This machine-generated source code contains\n\ information about the various integer and\n\ floating point numeric formats found on this\n\ @@ -1240,7 +1250,7 @@ Each of the numeric formats listed below are\n\ printed from most significant bit to least\n\ significant bit even though the actual bytes\n\ might be stored in a different order in\n\ -memory. The integers above each binary byte\n\ +memory. The integers above each binary byte\n\ indicate the relative order of the bytes in\n\ memory; little-endian machines have\n\ decreasing numbers while big-endian machines\n\ @@ -1251,8 +1261,8 @@ letters with `S' for the mantissa sign bit,\n\ `M' for the mantissa magnitude, and `E' for\n\ the exponent. The exponent has an associated\n\ bias which can be subtracted to find the\n\ -true exponent. The radix point is assumed\n\ -to be before the first `M' bit. Any bit\n\ +true exponent. The radix point is assumed\n\ +to be before the first `M' bit. Any bit\n\ of a floating-point value not falling into one\n\ of these categories is printed as a question\n\ mark. Bits of integer types are printed as\n\ @@ -1271,20 +1281,20 @@ bit.\n"; */ #ifdef H5_HAVE_GETPWUID { - size_t n; - char *comma; - if ((pwd = HDgetpwuid(HDgetuid()))) { - if ((comma = HDstrchr(pwd->pw_gecos, ','))) { - n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); - HDstrncpy(real_name, pwd->pw_gecos, n); - real_name[n] = '\0'; - } else { - HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); - real_name[sizeof(real_name) - 1] = '\0'; - } - } else { - real_name[0] = '\0'; - } + size_t n; + char *comma; + if ((pwd = HDgetpwuid(HDgetuid()))) { + if ((comma = HDstrchr(pwd->pw_gecos, ','))) { + n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); + HDstrncpy(real_name, pwd->pw_gecos, n); + real_name[n] = '\0'; + } else { + HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); + real_name[sizeof(real_name) - 1] = '\0'; + } + } else { + real_name[0] = '\0'; + } } #else real_name[0] = '\0'; @@ -1295,7 +1305,7 @@ bit.\n"; */ #ifdef H5_HAVE_GETHOSTNAME if (HDgethostname(host_name, sizeof(host_name)) < 0) { - host_name[0] = '\0'; + host_name[0] = '\0'; } #else host_name[0] = '\0'; @@ -1305,24 +1315,24 @@ bit.\n"; * The file header: warning, copyright notice, build information. */ printf("/* Generated automatically by H5detect -- do not edit */\n\n\n"); - HDputs(FileHeader); /*the copyright notice--see top of this file */ + HDputs(FileHeader); /*the copyright notice--see top of this file */ printf(" *\n * Created:\t\t%s %2d, %4d\n", - month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); + month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); if (pwd || real_name[0] || host_name[0]) { - printf(" *\t\t\t"); - if (real_name[0]) printf("%s <", real_name); + printf(" *\t\t\t"); + if (real_name[0]) printf("%s <", real_name); #ifdef H5_HAVE_GETPWUID - if (pwd) HDfputs(pwd->pw_name, stdout); + if (pwd) HDfputs(pwd->pw_name, stdout); #endif - if (host_name[0]) printf("@%s", host_name); - if (real_name[0]) printf(">"); - HDputchar('\n'); + if (host_name[0]) printf("@%s", host_name); + if (real_name[0]) printf(">"); + HDputchar('\n'); } printf(" *\n * Purpose:\t\t"); for (s = purpose; *s; s++) { - HDputchar(*s); - if ('\n' == *s && s[1]) printf(" *\t\t\t"); + HDputchar(*s); + if ('\n' == *s && s[1]) printf(" *\t\t\t"); } printf(" *\n * Modifications:\n *\n"); @@ -1335,84 +1345,84 @@ bit.\n"; } - + /*------------------------------------------------------------------------- - * Function: detect_C89_integers + * Function: detect_C89_integers * - * Purpose: Detect C89 integer types + * Purpose: Detect C89 integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C89_integers(void) +detect_C89_integers(void) HDF_NO_UBSAN { - DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++; - DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++; - DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; - DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++; - DETECT_I(int, INT, d_g[nd_g]); nd_g++; - DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++; - DETECT_I(long, LONG, d_g[nd_g]); nd_g++; - DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; + DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++; + DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++; + DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; + DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++; + DETECT_I(int, INT, d_g[nd_g]); nd_g++; + DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++; + DETECT_I(long, LONG, d_g[nd_g]); nd_g++; + DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- - * Function: detect_C89_floats + * Function: detect_C89_floats * - * Purpose: Detect C89 floating point types + * Purpose: Detect C89 floating point types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C89_floats(void) +detect_C89_floats(void) HDF_NO_UBSAN { DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers8 + * Function: detect_C99_integers8 * - * Purpose: Detect C99 8 bit integer types + * Purpose: Detect C99 8 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers8(void) +detect_C99_integers8(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT8_T>0 #if H5_SIZEOF_INT8_T==1 DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++; #else - DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++; + DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT8_T>0 #if H5_SIZEOF_UINT8_T==1 - DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++; + DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++; #else DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++; #endif @@ -1421,147 +1431,147 @@ detect_C99_integers8(void) #if H5_SIZEOF_INT_LEAST8_T==1 DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; + DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT_LEAST8_T>0 #if H5_SIZEOF_UINT_LEAST8_T==1 DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; + DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_INT_FAST8_T>0 #if H5_SIZEOF_INT_FAST8_T==1 DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; + DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT_FAST8_T>0 #if H5_SIZEOF_UINT_FAST8_T==1 - DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; + DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; #else DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; #endif #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers16 + * Function: detect_C99_integers16 * - * Purpose: Detect C99 16 bit integer types + * Purpose: Detect C99 16 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers16(void) +detect_C99_integers16(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT16_T>0 - DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; + DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT16_T>0 - DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++; + DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST16_T>0 - DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++; + DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST16_T>0 - DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++; + DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST16_T>0 - DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++; + DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST16_T>0 - DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers32 + * Function: detect_C99_integers32 * - * Purpose: Detect C99 32 bit integer types + * Purpose: Detect C99 32 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers32(void) +detect_C99_integers32(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT32_T>0 - DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; + DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT32_T>0 - DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++; + DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST32_T>0 - DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++; + DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST32_T>0 - DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++; + DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST32_T>0 - DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++; + DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST32_T>0 - DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers64 + * Function: detect_C99_integers64 * - * Purpose: Detect C99 64 bit integer types + * Purpose: Detect C99 64 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers64(void) +detect_C99_integers64(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT64_T>0 - DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; + DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT64_T>0 - DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++; + DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST64_T>0 - DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++; + DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST64_T>0 - DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++; + DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST64_T>0 - DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++; + DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST64_T>0 - DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_LONG_LONG>0 - DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; + DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++; #else /* @@ -1569,28 +1579,28 @@ detect_C99_integers64(void) * so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG since * `long long' is probably equivalent to `long' here anyway. */ - DETECT_I(long, LLONG, d_g[nd_g]); nd_g++; - DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++; + DETECT_I(long, LLONG, d_g[nd_g]); nd_g++; + DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers + * Function: detect_C99_integers * - * Purpose: Detect C99 integer types + * Purpose: Detect C99 integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers(void) +detect_C99_integers(void) HDF_NO_UBSAN { /* break it down to more subroutines so that each module subroutine */ /* is smaller and takes less time to compile with optimization on. */ @@ -1600,23 +1610,23 @@ detect_C99_integers(void) detect_C99_integers64(); } - + /*------------------------------------------------------------------------- - * Function: detect_C99_floats + * Function: detect_C99_floats * - * Purpose: Detect C99 floating point types + * Purpose: Detect C99 floating point types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_floats(void) +detect_C99_floats(void) HDF_NO_UBSAN { #if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE /* @@ -1625,29 +1635,29 @@ detect_C99_floats(void) * some systems and `long double' is probably the same as `double' here * anyway. */ - DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++; #elif H5_SIZEOF_LONG_DOUBLE !=0 - DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_alignments + * Function: detect_alignments * - * Purpose: Detect structure alignments + * Purpose: Detect structure alignments * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_alignments(void) +detect_alignments(void) HDF_NO_UBSAN { /* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */ DETECT_M(void *, POINTER, m_g[na_g]); na_g++; @@ -1656,7 +1666,7 @@ detect_alignments(void) DETECT_M(hdset_reg_ref_t, HDSETREGREF, m_g[na_g]); na_g++; } - + #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) /* Verify the signal handler for signal signum works correctly multiple times. * One possible cause of failure is that the signal handling is blocked or @@ -1664,64 +1674,70 @@ detect_alignments(void) * Return 0 for success, -1 for failure. */ static int verify_signal_handlers(int signum, void (*handler)(int)) -{ - void (*save_handler)(int) = HDsignal(signum, handler); +{ +#if defined(__has_feature) +#if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer) + /* Under the address and thread sanitizers, don't raise any signals. */ + return 0; +#endif +#endif + void (*save_handler)(int) = HDsignal(signum, handler); volatile int i, val; int ntries=5; volatile int nfailures=0; volatile int nsuccesses=0; - - for (i=0;i0 || nsuccesses != ntries){ - fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. " - "Found %d failures and %d successes\n", - signum, ntries, nfailures, nsuccesses); - return(-1); + fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. " + "Found %d failures and %d successes\n", + signum, ntries, nfailures, nsuccesses); + return(-1); }else{ - /* all succeeded */ - return(0); + /* all succeeded */ + return(0); } -} +} #endif - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Main entry point. + * Purpose: Main entry point. * - * Return: Success: exit(0) + * Return: Success: exit(0) * - * Failure: exit(1) + * Failure: exit(1) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: - * Albert Cheng, 2004/05/20 - * Some compilers, e.g., Intel C v7.0, took a long time to compile + * Albert Cheng, 2004/05/20 + * Some compilers, e.g., Intel C v7.0, took a long time to compile * with optimization when a module routine contains many code lines. * Divide up all those types detections macros into subroutines, both * to avoid the compiler optimization error and cleaner codes. @@ -1729,7 +1745,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int)) *------------------------------------------------------------------------- */ int -main(void) +main(void) HDF_NO_UBSAN { #if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) @@ -1738,12 +1754,12 @@ main(void) * Make sure unaligned access generates SIGBUS and doesn't print warning * messages so that we can detect alignment constraints on the DEC Alpha. */ - int nvpairs[2]; + int nvpairs[2]; nvpairs[0] = SSIN_UACPROC; nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS; if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) { - fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", - HDstrerror(errno)); + fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", + HDstrerror(errno)); } #endif #endif -- cgit v0.12 From 435fd5afa57eb8c3157600431f0c8d4df6257cd4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 16:03:03 -0600 Subject: HDFFV-10398 add support for Emscriptem build system --- CMakeLists.txt | 10 +++++++--- src/CMakeLists.txt | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee5fc2a..00ec70a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -528,9 +528,13 @@ endif () #----------------------------------------------------------------------------- # Option to embed library info into executables #----------------------------------------------------------------------------- -option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) -if (HDF5_ENABLE_EMBEDDED_LIBINFO) - set (H5_HAVE_EMBEDDED_LIBINFO 1) +if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + set (H5_HAVE_EMBEDDED_LIBINFO 0) +else () + option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) + if (HDF5_ENABLE_EMBEDDED_LIBINFO) + set (H5_HAVE_EMBEDDED_LIBINFO 1) + endif () endif () include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0cc68ac..aaedfda 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -852,6 +852,9 @@ TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif () +if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + set_property(TARGET H5detect PROPERTY LINK_FLAGS "-O0") +endif () add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c @@ -865,6 +868,9 @@ TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif () +if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + set_property(TARGET H5make_libsettings PROPERTY LINK_FLAGS "-O0") +endif () add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c -- cgit v0.12 From b005c5653e3f74ff1548d1de10e3f065bd805982 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jan 2018 16:22:18 -0600 Subject: HDFFV-10398 fix detection of repeat checks --- config/cmake/ConfigureChecks.cmake | 17 +---------------- config/cmake_ext_mod/ConfigureChecks.cmake | 6 +++--- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 0848e66..7d73c09 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -179,7 +179,7 @@ endif () # Macro to determine the various conversion capabilities #----------------------------------------------------------------------------- macro (H5ConversionTests TEST msg) - if ("${TEST}" MATCHES "^${TEST}$") + if (NOT DEFINED ${TEST}) # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${CMAKE_BINARY_DIR} @@ -210,21 +210,6 @@ macro (H5ConversionTests TEST msg) endmacro () #----------------------------------------------------------------------------- -# Macro to make some of the conversion tests easier to write/read -#----------------------------------------------------------------------------- -macro (H5MiscConversionTest VAR TEST msg) - if ("${TEST}" MATCHES "^${TEST}$") - if (${VAR}) - set (${TEST} 1 CACHE INTERNAL ${msg}) - message (STATUS "${msg}... yes") - else () - set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") - endif () - endif () -endmacro () - -#----------------------------------------------------------------------------- # Check various conversion capabilities #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index e1b8853..3797768 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -145,7 +145,7 @@ endif () # For other specific tests, use this MACRO. macro (HDF_FUNCTION_TEST OTHER_TEST) - if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") + if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST}) set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) @@ -587,7 +587,7 @@ endif () # For other CXX specific tests, use this MACRO. macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) - if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + if (NOT DEFINED ${OTHER_TEST}) set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) @@ -656,7 +656,7 @@ endif () if (WINDOWS) if (NOT HDF_NO_IOEO_TEST) message (STATUS "Checking for InitOnceExecuteOnce:") - if ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$") + if (NOT DEFINED ${${HDF_PREFIX}_HAVE_IOEO}) if (LARGEFILE) set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" -- cgit v0.12 From 1bc7dc396a818d3f13624ab9386999db0c56aa71 Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 31 Jan 2018 14:20:41 -0600 Subject: Correct AM_MAINTAINER_MODE default to 'enable'. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6bd650f..98c97cc 100644 --- a/configure.ac +++ b/configure.ac @@ -48,7 +48,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where a ## ## By default, it is enabled. Users can configure with ## --disable-maintainer-mode to prevent running the autotools. -AM_MAINTAINER_MODE([disable]) +AM_MAINTAINER_MODE([enable]) ## ---------------------------------------------------------------------- ## Set prefix default (install directory) to a directory in the build area. -- cgit v0.12 From b57c5490e0901c451a77a356ceb1f6071dc89123 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 1 Feb 2018 09:42:14 -0600 Subject: JHDFFV-10398 add note --- release_docs/RELEASE.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 74b73a4..c13b247 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -236,7 +236,17 @@ Bug Fixes since HDF5-1.10.1 release ------------- - CMake - Correct usuage of CMAKE_BUILD_TYPE variable. + Update CMake commands configuration. + + A number of improvements were made to the CMake commands. Most + changes simplify usage or eliminate unused constructs. Also, + some changes support better cross-platform support. + + (ADB - 2018/02/01, HDFFV-10398) + + - CMake + + Correct usage of CMAKE_BUILD_TYPE variable. The use of the CMAKE_BUILD_TYPE is incorrect for multi-config generators (Visual Studio and XCode) and is optional for single -- cgit v0.12 From 4c0440e61f5bc57f12406b523e9545980e9e6b70 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 1 Feb 2018 09:49:50 -0600 Subject: Added gen_bounds.c --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 2db6d6b..7f4c377 100644 --- a/MANIFEST +++ b/MANIFEST @@ -981,6 +981,7 @@ ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c ./test/gen_bogus.c +./test/gen_bounds.c ./test/gen_cross.c ./test/gen_deflate.c ./test/gen_file_image.c -- cgit v0.12 From a32b998b824a488c7822b0d607ab7f01ac9ccd23 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 1 Feb 2018 10:08:34 -0600 Subject: Added gen_bounds.c --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index efdc1ca..ab81f50 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -95,7 +95,7 @@ endif BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ - gen_sizes_lheap gen_file_image gen_plist gen_bad_offset + gen_sizes_lheap gen_file_image gen_plist gen_bad_offset gen_bounds if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) -- cgit v0.12 From f325002db905f7da14e66a3bb30ac508d0cfb7fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 12:38:20 -0600 Subject: HDFFV-10345 spelling errors --- fortran/src/H5Df.c | 10 ++-- fortran/src/H5Gf.c | 42 +++++++------- fortran/src/H5Pf.c | 10 ++-- fortran/src/H5Pff.F90 | 2 +- fortran/src/H5Rff.F90 | 66 +++++++++++----------- hl/fortran/src/H5LTf90proto.h | 4 +- hl/fortran/src/H5TBfc.c | 6 +- hl/test/test_ds.c | 8 +-- src/H5Zscaleoffset.c | 112 +++++++++++++++++++------------------- src/H5detect.c | 4 +- tools/src/h5import/h5import.c | 4 +- tools/test/h5copy/h5copygentest.c | 2 +- 12 files changed, 135 insertions(+), 135 deletions(-) diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 588ea9f..14fac6b 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -567,7 +567,7 @@ DONE: * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -641,7 +641,7 @@ DONE: * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -882,7 +882,7 @@ h5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -956,7 +956,7 @@ DONE: * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -1209,7 +1209,7 @@ h5dwrite_f_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 720bd49..cbe4175 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -47,7 +47,7 @@ */ int_f h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, - hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) + hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) /******/ { hid_t c_gcpl_id = -1; /* Group creation property list */ @@ -69,11 +69,11 @@ h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, else { /* Create the group creation property list */ if((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto DONE; + goto DONE; /* Set the local heap size hint */ if(H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0) - goto DONE; + goto DONE; /* Create the group */ c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT); @@ -308,9 +308,9 @@ h5gclose_c(hid_t_f *grp_id) * link_type - link type * current_name - name of the existing object for hard link, * anything for the soft link - * current_namelen - current name lenghth + * current_namelen - current name length * new_name - new name for the object - * new_namelen - new_name lenghth + * new_namelen - new_name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -365,7 +365,7 @@ h5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, goto DONE; break; /* End of the warnings fix */ - + default: /* Unknown/unhandled link type */ goto DONE; } /* end switch */ @@ -390,12 +390,12 @@ DONE: * cur_name - name of the existing object for hard link releative * to cur_loc_id location, * anything for the soft link - * current_namelen - current name lenghth + * current_namelen - current name length * link_type - link type * new_loc_id - location identifier * new_name - new name for the object releative to the new_loc_id * location - * new_namelen - new_name lenghth + * new_namelen - new_name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -515,9 +515,9 @@ DONE: * INPUTS * loc_id - identifier of file or group * src_name - name of the original object - * src_namelen - original name lenghth + * src_namelen - original name length * dst_name - new name for the object - * dst_namelen - new name lenghth + * dst_namelen - new name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -565,10 +565,10 @@ DONE: * INPUTS * src_loc_id - identifier of file or group * src_name - name of the original object relative to src_loc_id - * src_namelen - original name lenghth + * src_namelen - original name length * dst_loc_id - new location identifier * dst_name - new name for the object relative to dst_loc_id - * dst_namelen - new name lenghth + * dst_namelen - new name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -617,8 +617,8 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of the object that symbolic link points to - * namelen - the name lenghth - * size - lenghth of retrurned value + * namelen - the name length + * size - length of retrurned value * OUTPUTS * value - name to be returned * RETURNS @@ -681,9 +681,9 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset - * namelen - the name lenghth + * namelen - the name length * comment - the new comment - * commentlen - new comment lenghth + * commentlen - new comment length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -732,7 +732,7 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset - * namelen - the name lenghth + * namelen - the name length * bufsize - at most bufsize characters * comment - the new comment * RETURNS @@ -948,8 +948,8 @@ done: */ int_f h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) + int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) /******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ @@ -965,7 +965,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, * Call H5Gget_info_by_idx function. */ if(H5Gget_info_by_idx((hid_t)*loc_id,c_group_name, (H5_index_t)*index_type,(H5_iter_order_t)*order,(hsize_t)*n, - &ginfo, (hid_t)*lapl_id) < 0) + &ginfo, (hid_t)*lapl_id) < 0) HGOTO_DONE(FAIL); /* Unpack the structure */ @@ -1018,7 +1018,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, */ int_f h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) /******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index a114e8b..9fdd19b 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -2638,7 +2638,7 @@ h5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) * INPUTS * parent - property list class identifier * name - name of the new class - * name_len - lenght of the "name" buffer + * name_len - length of the "name" buffer * OUTPUTS * class - new class identifier * RETURNS @@ -3415,8 +3415,8 @@ h5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) * mem_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names - * len - array with the lenght of each name - * lenmax - lenght of the name a sdeclared in Fortran + * len - array with the length of each name + * lenmax - length of the name a sdeclared in Fortran * flag - flag allowing partila access when one of the files is missing * RETURNS * 0 on success, -1 on failure @@ -3537,12 +3537,12 @@ h5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) * Call H5Pget_fapl_multi to set multi file dirver * INPUTS * prp_id - file_creation property list identifier - * lenmax - lenght of the name a sdeclared in Fortran + * lenmax - length of the name a sdeclared in Fortran * OUTPUTS * memb_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names - * len - array with the lenght of each name + * len - array with the length of each name * flag - flag allowing partila access when one of the files is missing * RETURNS * 0 on success, -1 on failure diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index b69d4d0..178aa80 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -5313,7 +5313,7 @@ CONTAINS ! ! expression - buffer to hold transform expression ! hdferr - Error code -! Success: Actual lenght of the expression +! Success: Actual length of the expression ! If provided buffer "expression" is ! smaller, than expression will be ! truncated to fit into diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index 6d6371b..f5a9c6e 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -38,7 +38,7 @@ ! !***** -MODULE H5R +MODULE H5R USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_SIGNED_CHAR USE H5GLOBAL @@ -62,7 +62,7 @@ MODULE H5R END INTERFACE - TYPE :: hdset_reg_ref_t_f03 + TYPE :: hdset_reg_ref_t_f03 INTEGER(C_SIGNED_CHAR), DIMENSION(1:H5R_DSET_REG_REF_BUF_SIZE_F) :: ref END TYPE hdset_reg_ref_t_f03 @@ -165,16 +165,16 @@ CONTAINS ! Retrieves the type of object that an object reference points to. ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the objects -! ref - reference to open +! ref - reference to open ! OUTPUTS -! obj_type - object_type, possible values: +! obj_type - object_type, possible values: ! H5G_UNKNOWN_F -! H5G_GROUP_F +! H5G_GROUP_F ! H5G_DATASET_F ! H5G_TYPE_F -! hdferr - Returns 0 if successful and -1 if fails +! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR ! Elena Pourmal @@ -227,17 +227,17 @@ CONTAINS ! Retrieves a dataspace with the specified region selected ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the regions -! ref - reference to open +! ref - reference to open ! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 ! -! HISTORY +! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). February 28, 2001 @@ -276,16 +276,16 @@ CONTAINS ! h5rget_region_ptr_f ! ! PURPOSE -! Retrieves a dataspace with the specified region +! Retrieves a dataspace with the specified region ! selected using pointer ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the regions -! ref - reference to open +! ref - reference to open ! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! M. Scot Breitenfeld ! August 4, 2012 @@ -319,7 +319,7 @@ CONTAINS ! loc_id - location identifier ! name - name of the object at the specified location ! Outputs: -! ref - reference to the specified object +! ref - reference to the specified object ! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal @@ -363,11 +363,11 @@ CONTAINS ! Creates reference to the dataset region ! ! INPUTS -! loc_id - location identifier -! name - name of the dataset at the specified location -! space_id - dataspace identifier that describes selected region +! loc_id - location identifier +! name - name of the dataset at the specified location +! space_id - dataspace identifier that describes selected region ! OUTPUTS -! ref - reference to the dataset region +! ref - reference to the dataset region ! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal @@ -424,12 +424,12 @@ CONTAINS ! ! Inputs: ! loc_id - location identifier -! name - name of the dataset at the specified location +! name - name of the dataset at the specified location ! ref_type - type of reference: ! H5R_OBJECT ! H5T_STD_REF_DSETREG ! Outputs: -! ref - reference created by the function call. +! ref - reference created by the function call. ! hdferr - returns 0 if successful and -1 if fails. ! OPTIONAL ! space_id - dataspace identifier that describes selected region @@ -474,7 +474,7 @@ CONTAINS ! Inputs: ! dset_id - identifier of the dataset containing ! reference -! ref - reference to open +! ref - reference to open ! Outputs: ! obj_id - object_identifier ! hdferr - returns 0 if successful and -1 if fails @@ -515,8 +515,8 @@ CONTAINS ! ! Inputs: ! dset_id - identifier of the dataset containing -! reference to teh regions -! ref - reference to open +! reference to the regions +! ref - reference to open ! Outputs: ! obj_id - dataspace identifier ! hdferr - returns 0 if successful and -1 if fails @@ -585,7 +585,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Identifier of referenced object INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** +!***** hdferr = h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) END SUBROUTINE h5rdereference_ptr_f @@ -600,14 +600,14 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. +! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. ! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: -! size - The size of the name buffer, returning 0 (zero) if no name is associated +! size - The size of the name buffer, returning 0 (zero) if no name is associated ! with the identifier. ! ! AUTHOR @@ -648,7 +648,7 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. +! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. @@ -747,12 +747,12 @@ CONTAINS ! ref - Reference to query. ! ! Outputs: - ! obj_type - Type of referenced object. + ! obj_type - Type of referenced object. ! H5G_UNKNOWN_F ! H5G_GROUP_F ! H5G_DATASET_F ! H5G_TYPE_F - ! + ! ! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 35b08a1..031db2c 100644 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -303,7 +303,7 @@ h5tbmake_table_c(size_t_f *namelen1, hid_t_f *field_types, hsize_t_f *chunk_size, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ _fcd buf); /* field_names */ @@ -334,7 +334,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, hsize_t_f *chunk_size, void *fill_data, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names, /* field_names */ void *data); diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index c0d053f..331f0bc 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -38,7 +38,7 @@ int_f h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names) /* field_names */ { @@ -143,7 +143,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size, void *fill_data, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names, void *data) /* field_names */ @@ -638,7 +638,7 @@ done: int_f h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, size_t_f *field_sizes, size_t_f *field_offsets, size_t_f *type_size, - size_t_f *namelen2, /* field_names lenghts */ + size_t_f *namelen2, /* field_names lengths */ size_t_f *lenmax, /* character len max */ _fcd field_names, /* field_names */ size_t_f *maxlen_out) diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 91f1505..49dc72f 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -3080,7 +3080,7 @@ static int test_simple(void) /*------------------------------------------------------------------------- - * get the label using a static buffer smaller than the string lenght + * get the label using a static buffer smaller than the string length *------------------------------------------------------------------------- */ @@ -3118,7 +3118,7 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - /* get the lenght of the scale name (pass NULL in name) */ + /* get the length of the scale name (pass NULL in name) */ if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) < 0) goto out; @@ -3151,7 +3151,7 @@ static int test_simple(void) goto out; /*------------------------------------------------------------------------- - * get the scale name using a static buffer smaller than the string lenght + * get the scale name using a static buffer smaller than the string length *------------------------------------------------------------------------- */ @@ -4925,7 +4925,7 @@ static int test_errors2(void) hsize_t dimd[2] = {3,3}; /* size of data dataset */ hsize_t dims[1] = {3}; /* size of scale dataset */ char lbuf[255]; /* label buffer */ - ssize_t label_len; /* label lenght */ + ssize_t label_len; /* label length */ int scale_idx; /* scale index */ int nscales; /* number of scales in DIM */ int count; /* visitor data */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index b86d785..37f5675 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -13,16 +13,16 @@ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ #include "H5Oprivate.h" /* Object headers */ -#include "H5Sprivate.h" /* Dataspaces */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5Zpkg.h" /* Data filters */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5Zpkg.h" /* Data filters */ /* Struct of parameters needed for compressing/decompressing one atomic datatype */ typedef struct { @@ -78,13 +78,13 @@ static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, uns /* This message derives from H5Z */ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SCALEOFFSET, /* Filter id number */ + H5Z_FILTER_SCALEOFFSET, /* Filter id number */ 1, /* Assume encoder present: check before registering */ 1, /* decoder_present flag (set to true) */ - "scaleoffset", /* Filter name for debugging */ - H5Z_can_apply_scaleoffset, /* The "can apply" callback */ + "scaleoffset", /* Filter name for debugging */ + H5Z_can_apply_scaleoffset, /* The "can apply" callback */ H5Z_set_local_scaleoffset, /* The "set local" callback */ - H5Z_filter_scaleoffset, /* The actual filter function */ + H5Z_filter_scaleoffset, /* The actual filter function */ }}; /* Local macros */ @@ -665,15 +665,15 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_modify_4(i, type, pow_fun, buf, d_nelmts, min, D_val) \ } - + /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_scaleoffset + * Function: H5Z_can_apply_scaleoffset * - * Purpose: Check the parameters for scaleoffset compression for + * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Xiaowen Wu * Friday, February 4, 2005 @@ -685,7 +685,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ static htri_t H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { - const H5T_t *type; /* Datatype */ + const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ @@ -694,20 +694,20 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Get datatype's class, for checking the "datatype class" */ if((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") /* Get datatype's size, for checking the "datatype size" */ if(H5T_get_size(type) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") if(dtype_class == H5T_INTEGER || dtype_class == H5T_FLOAT) { /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") /* Range check datatype's endianness order */ if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) @@ -719,17 +719,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_can_apply_scaleoffset() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_get_type + * Function: H5Z_scaleoffset_get_type * - * Purpose: Get the specific integer type based on datatype size and sign + * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size * - * Return: Success: id number of integer type - * Failure: 0 + * Return: Success: id number of integer type + * Failure: 0 * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Wednesday, April 13, 2005 * * Modifications: @@ -784,14 +784,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_set_parms_fillval + * Function: H5Z_scaleoffset_set_parms_fillval * - * Purpose: Get the fill value of the dataset and store in cd_values[] + * Purpose: Get the fill value of the dataset and store in cd_values[] * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Xiaowen Wu * Monday, March 7, 2005 @@ -836,17 +836,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_scaleoffset_set_parms_fillval() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_set_local_scaleoffset + * Function: H5Z_set_local_scaleoffset * - * Purpose: Set the "local" dataset parameters for scaleoffset + * Purpose: Set the "local" dataset parameters for scaleoffset * compression. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Friday, February 4, 2005 * * Modifications: @@ -857,8 +857,8 @@ static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ - H5T_t *type; /* Datatype */ - const H5S_t *ds; /* Dataspace */ + H5T_t *type; /* Datatype */ + const H5S_t *ds; /* Dataspace */ unsigned flags; /* Filter flags */ size_t cd_nelmts = H5Z_SCALEOFFSET_USER_NPARMS; /* Number of filter parameters */ unsigned cd_values[H5Z_SCALEOFFSET_TOTAL_NPARMS]; /* Filter parameters */ @@ -879,14 +879,14 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Initialize the parameters to a known state */ HDmemset(cd_values, 0, sizeof(cd_values)); /* Get the filter's current parameters */ if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SCALEOFFSET, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") /* Get dataspace */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -930,7 +930,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype's size */ if((dtype_size = H5T_get_size(type)) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") /* Set "local" parameter for datatype size */ H5_CHECK_OVERFLOW(dtype_size, size_t, unsigned); @@ -1008,23 +1008,23 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Modify the filter's parameters for this dataset */ if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SCALEOFFSET, flags, (size_t)H5Z_SCALEOFFSET_TOTAL_NPARMS, cd_values) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_set_local_scaleoffset() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_filter_scaleoffset + * Function: H5Z_filter_scaleoffset * - * Purpose: Implement an I/O filter for storing packed integer + * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. * - * Return: Success: Size of buffer filtered - * Failure: 0 + * Return: Success: Size of buffer filtered + * Failure: 0 * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Monday, February 7, 2005 * * Modifications: @@ -1051,13 +1051,13 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value unsigned char *outbuf = NULL; /* pointer to new output buffer */ unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */ unsigned i; /* index */ - parms_atomic p; /* paramters needed for compress/decompress functions */ + parms_atomic p; /* parameters needed for compress/decompress functions */ FUNC_ENTER_NOAPI_NOINIT /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of paramters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters") /* Check if memory byte order matches dataset datatype byte order */ switch(H5T_native_order_g) { @@ -1107,7 +1107,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* if scale_factor is less than 0 for integer, library will reset it to 0 * in this case, library will calculate the minimum-bits */ - if(scale_factor < 0) scale_factor = 0; + if(scale_factor < 0) scale_factor = 0; } /* fixed-minimum-bits method is not implemented and is forbidden */ @@ -1128,7 +1128,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value minbits = (uint32_t)scale_factor; } - /* prepare paramters to pass to compress/decompress functions */ + /* prepare parameters to pass to compress/decompress functions */ p.size = cd_values[H5Z_SCALEOFFSET_PARM_SIZE]; p.mem_order = H5T_native_order_g; @@ -1310,7 +1310,7 @@ done: * atomic datatype is treated on byte basis */ - + /* change byte order of input buffer either from little-endian to big-endian * or from big-endian to little-endian 2/21/2005 */ diff --git a/src/H5detect.c b/src/H5detect.c index 2cc8366..ff163cf 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -37,7 +37,7 @@ static const char *FileHeader = "\n\ * * Detects machine byte order and floating point * format and generates a C source file (H5Tinit.c) - * to describe those paramters. + * to describe those parameters. * * Assumptions: We have an ANSI compiler. We're on a Unix like * system or configure has detected those Unix @@ -75,7 +75,7 @@ static const char *FileHeader = "\n\ /* Define H5SETJMP/H5LONGJMP depending on if sigsetjmp/siglongjmp are */ /* supported. */ #if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP) -/* Always save blocked signals to be restore by siglongjmp. */ +/* Always save blocked signals to be restored by siglongjmp. */ #define H5JMP_BUF sigjmp_buf #define H5SETJMP(buf) HDsigsetjmp(buf, 1) #define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 36a8c21..76e78af 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -1405,7 +1405,7 @@ static int processConfigurationFile(char *infile, struct Input *in) const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n"; const char *err14b = "Error in retrieving the compression parameter from %s.\n"; const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n"; - const char *err15b = "Error in retrieving the external storage paramters from %s.\n"; + const char *err15b = "Error in retrieving the external storage parameters from %s.\n"; const char *err16a = "MAXIMUM-DIMENSIONS keyword appears twice in %s.\n"; const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n"; const char *err16c = "Error in retrieving the maximum dimension sizes from %s.\n"; @@ -3690,7 +3690,7 @@ static int getCompressionParameter(struct Input *in, FILE *strm) { /* currently supports only GZIP */ /* can be extended by adding more values to COMPRESSION-TYPE and */ - /* handling the paramters here by adding more cases */ + /* handling the parameters here by adding more cases */ int ival; const char *err1 = "Unable to get integer value.\n"; diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 35f9132..9f5d916 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -225,7 +225,7 @@ static void gent_compressed(hid_t loc_id) /*------------------------------------------------------------------------- * Function: gent_named_vl * - * Purpose: Generate a variable lenght named datatype for a dataset in + * Purpose: Generate a variable length named datatype for a dataset in LOC_ID * *------------------------------------------------------------------------- -- cgit v0.12 From d08f56e027762fde54be6959b9c4e76514578ae1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 12:47:31 -0600 Subject: HDFFV-10345 whitespace corrections --- fortran/src/H5Gf.c | 4 ++-- src/H5Zscaleoffset.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index cbe4175..b829b20 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -69,11 +69,11 @@ h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, else { /* Create the group creation property list */ if((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto DONE; + goto DONE; /* Set the local heap size hint */ if(H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0) - goto DONE; + goto DONE; /* Create the group */ c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT); diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 37f5675..58bcf8b 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -694,20 +694,20 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Get datatype's class, for checking the "datatype class" */ if((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") /* Get datatype's size, for checking the "datatype size" */ if(H5T_get_size(type) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") if(dtype_class == H5T_INTEGER || dtype_class == H5T_FLOAT) { /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") /* Range check datatype's endianness order */ if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) @@ -879,14 +879,14 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Initialize the parameters to a known state */ HDmemset(cd_values, 0, sizeof(cd_values)); /* Get the filter's current parameters */ if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SCALEOFFSET, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") /* Get dataspace */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -930,7 +930,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype's size */ if((dtype_size = H5T_get_size(type)) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") /* Set "local" parameter for datatype size */ H5_CHECK_OVERFLOW(dtype_size, size_t, unsigned); @@ -1008,7 +1008,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Modify the filter's parameters for this dataset */ if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SCALEOFFSET, flags, (size_t)H5Z_SCALEOFFSET_TOTAL_NPARMS, cd_values) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1057,7 +1057,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters") /* Check if memory byte order matches dataset datatype byte order */ switch(H5T_native_order_g) { @@ -1107,7 +1107,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* if scale_factor is less than 0 for integer, library will reset it to 0 * in this case, library will calculate the minimum-bits */ - if(scale_factor < 0) scale_factor = 0; + if(scale_factor < 0) scale_factor = 0; } /* fixed-minimum-bits method is not implemented and is forbidden */ -- cgit v0.12 From fbaa2192f8171ddb5af175d7f750c19dcad3ae4f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 16:14:00 -0600 Subject: Remove old dependency construct --- CMakeLists.txt | 1 - tools/CMakeLists.txt | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ec70a..3c7bb38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -725,7 +725,6 @@ if (BUILD_TESTING) if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - add_subdirectory (tools/lib) add_subdirectory (test) endif () if (H5_HAVE_PARALLEL) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8d442e0..41a9fdc 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -9,9 +9,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- -if (NOT BUILD_TESTING) - add_subdirectory (lib) -endif () +add_subdirectory (lib) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12 From 2fbdfcc4574a141bc668795db9cb48678ba9e336 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 6 Feb 2018 21:42:02 -0600 Subject: Modifications made based on comments from pull request. --- src/H5Aint.c | 2 +- src/H5Dint.c | 1 + src/H5Fint.c | 8 +- src/H5Fprivate.h | 10 +- src/H5Fquery.c | 4 +- src/H5Ofill.c | 4 +- src/H5Pfapl.c | 36 +- src/H5Tcommit.c | 1 + src/H5trace.c | 1040 +++++++++++------------ test/testfiles/plist_files/dapl_32be | Bin 186 -> 199 bytes test/testfiles/plist_files/dapl_32le | Bin 186 -> 199 bytes test/testfiles/plist_files/dapl_64be | Bin 186 -> 199 bytes test/testfiles/plist_files/dapl_64le | Bin 186 -> 199 bytes test/testfiles/plist_files/def_dapl_32be | Bin 181 -> 194 bytes test/testfiles/plist_files/def_dapl_32le | Bin 181 -> 194 bytes test/testfiles/plist_files/def_dapl_64be | Bin 181 -> 194 bytes test/testfiles/plist_files/def_dapl_64le | Bin 181 -> 194 bytes test/testfiles/plist_files/def_fapl_32be | Bin 1697 -> 1711 bytes test/testfiles/plist_files/def_fapl_32le | Bin 1697 -> 1711 bytes test/testfiles/plist_files/def_fapl_64be | Bin 1697 -> 1711 bytes test/testfiles/plist_files/def_fapl_64le | Bin 1697 -> 1711 bytes test/testfiles/plist_files/fapl_32be | Bin 1699 -> 1713 bytes test/testfiles/plist_files/fapl_32le | Bin 1699 -> 1713 bytes test/testfiles/plist_files/fapl_64be | Bin 1699 -> 1713 bytes test/testfiles/plist_files/fapl_64le | Bin 1699 -> 1713 bytes test/testfiles/plist_files/lapl_32be | Bin 1802 -> 1816 bytes test/testfiles/plist_files/lapl_32le | Bin 1802 -> 1816 bytes test/testfiles/plist_files/lapl_64be | Bin 1802 -> 1816 bytes test/testfiles/plist_files/lapl_64le | Bin 1802 -> 1816 bytes tools/src/h5repack/h5repack_main.c | 8 +- tools/test/h5repack/testfiles/h5repack-help.txt | 8 +- 31 files changed, 562 insertions(+), 560 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index 666f11d..55c46f6 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -215,7 +215,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, if(H5T_set_loc(attr->shared->dt, loc->oloc->file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location") - /* Set the latest format for datatype, if requested */ + /* Set the version for datatype */ if(H5T_set_version(loc->oloc->file, attr->shared->dt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of datatype") diff --git a/src/H5Dint.c b/src/H5Dint.c index 9af1689..fc191ff 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -661,6 +661,7 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if(H5T_set_loc(dset->shared->type, file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't set datatype location") + /* Set the version for datatype */ if(H5T_set_version(file, dset->shared->type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") diff --git a/src/H5Fint.c b/src/H5Fint.c index 86627ea..c41453a 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -161,9 +161,9 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't sieve buffer size") if(H5P_set(new_plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(f->shared->sdata_aggr.alloc_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size") - if(H5P_set(new_plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &f->shared->low_bound) < 0) + if(H5P_set(new_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &f->shared->low_bound) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions") - if(H5P_set(new_plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &f->shared->high_bound) < 0) + if(H5P_set(new_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &f->shared->high_bound) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions") if(H5P_set(new_plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &(f->shared->read_attempts)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'read attempts ' flag") @@ -902,9 +902,9 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get garbage collect reference") if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &(f->shared->sieve_buf_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get sieve buffer size") - if(H5P_get(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'low' bound for library format versions") - if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'high' bound for library format versions") if(H5P_get(plist, H5F_ACS_USE_MDC_LOGGING_NAME, &(f->shared->use_mdc_logging)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'use mdc logging' flag") diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index e426a4b..856e618 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -484,8 +484,8 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */ #define H5F_ACS_MULTI_TYPE_NAME "multi_type" /* Data type in multi file driver */ -#define H5F_ACS_FORMAT_LOW_BOUND_NAME "low_bound" /* 'low' bound of library format versions */ -#define H5F_ACS_FORMAT_HIGH_BOUND_NAME "high_bound" /* 'high' bound of library format versions */ +#define H5F_ACS_LIBVER_LOW_BOUND_NAME "libver_low_bound" /* 'low' bound of library format versions */ +#define H5F_ACS_LIBVER_HIGH_BOUND_NAME "libver_high_bound" /* 'high' bound of library format versions */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ @@ -720,9 +720,9 @@ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); -/* Functions than retrieve values from the file struct */ -H5_DLL unsigned H5F_get_low_bound(const H5F_t *f); -H5_DLL unsigned H5F_get_high_bound(const H5F_t *f); +/* Functions that retrieve values from the file struct */ +H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f); +H5_DLL H5F_libver_t H5F_get_high_bound(const H5F_t *f); H5_DLL unsigned H5F_get_intent(const H5F_t *f); H5_DLL char *H5F_get_open_name(const H5F_t *f); H5_DLL char *H5F_get_actual_name(const H5F_t *f); diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 32c893e..f7e222e 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -109,7 +109,7 @@ H5F_get_intent(const H5F_t *f) * *------------------------------------------------------------------------- */ -unsigned +H5F_libver_t H5F_get_low_bound(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -134,7 +134,7 @@ H5F_get_low_bound(const H5F_t *f) * *------------------------------------------------------------------------- */ -unsigned +H5F_libver_t H5F_get_high_bound(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 6dc3064..74f69d1 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -929,10 +929,10 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Data type:"); if(fill->type) { H5T_debug(fill->type, stream); - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); } /* end if */ else - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_fill_debug() */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7b358a9..7802535 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -142,16 +142,16 @@ #define H5F_ACS_MULTI_TYPE_DEC H5P__facc_multi_type_dec /* Definition for "low" bound of library format versions */ -#define H5F_ACS_FORMAT_LOW_BOUND_SIZE sizeof(H5F_libver_t) -#define H5F_ACS_FORMAT_LOW_BOUND_DEF H5F_LIBVER_EARLIEST -#define H5F_ACS_FORMAT_LOW_BOUND_ENC H5P__facc_libver_type_enc -#define H5F_ACS_FORMAT_LOW_BOUND_DEC H5P__facc_libver_type_dec +#define H5F_ACS_LIBVER_LOW_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_LIBVER_LOW_BOUND_DEF H5F_LIBVER_EARLIEST +#define H5F_ACS_LIBVER_LOW_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_LIBVER_LOW_BOUND_DEC H5P__facc_libver_type_dec /* Definition for "high" bound of library format versions */ -#define H5F_ACS_FORMAT_HIGH_BOUND_SIZE sizeof(H5F_libver_t) -#define H5F_ACS_FORMAT_HIGH_BOUND_DEF H5F_LIBVER_LATEST -#define H5F_ACS_FORMAT_HIGH_BOUND_ENC H5P__facc_libver_type_enc -#define H5F_ACS_FORMAT_HIGH_BOUND_DEC H5P__facc_libver_type_dec +#define H5F_ACS_LIBVER_HIGH_BOUND_SIZE sizeof(H5F_libver_t) +#define H5F_ACS_LIBVER_HIGH_BOUND_DEF H5F_LIBVER_LATEST +#define H5F_ACS_LIBVER_HIGH_BOUND_ENC H5P__facc_libver_type_enc +#define H5F_ACS_LIBVER_HIGH_BOUND_DEC H5P__facc_libver_type_dec /* Definition for whether to query the file descriptor from the core VFD * instead of the memory address. (Private to library) @@ -363,8 +363,8 @@ static const hsize_t H5F_def_family_newsize_g = H5F_ACS_FAMILY_NEWSIZE_DEF; static const hbool_t H5F_def_family_to_sec2_g = H5F_ACS_FAMILY_TO_SEC2_DEF; /* Default ?? for family VFD */ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; /* Default file space type for multi VFD */ -static const H5F_libver_t H5F_def_format_low_bound_g = H5F_ACS_FORMAT_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */ -static const H5F_libver_t H5F_def_format_high_bound_g = H5F_ACS_FORMAT_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */ +static const H5F_libver_t H5F_def_libver_low_bound_g = H5F_ACS_LIBVER_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */ +static const H5F_libver_t H5F_def_libver_high_bound_g = H5F_ACS_LIBVER_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */ static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ @@ -505,14 +505,14 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'low' bound of library format versions */ - if(H5P_register_real(pclass, H5F_ACS_FORMAT_LOW_BOUND_NAME, H5F_ACS_FORMAT_LOW_BOUND_SIZE, &H5F_def_format_low_bound_g, - NULL, NULL, NULL, H5F_ACS_FORMAT_LOW_BOUND_ENC, H5F_ACS_FORMAT_LOW_BOUND_DEC, + if(H5P_register_real(pclass, H5F_ACS_LIBVER_LOW_BOUND_NAME, H5F_ACS_LIBVER_LOW_BOUND_SIZE, &H5F_def_libver_low_bound_g, + NULL, NULL, NULL, H5F_ACS_LIBVER_LOW_BOUND_ENC, H5F_ACS_LIBVER_LOW_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 'high' bound of library format versions */ - if(H5P_register_real(pclass, H5F_ACS_FORMAT_HIGH_BOUND_NAME, H5F_ACS_FORMAT_HIGH_BOUND_SIZE, &H5F_def_format_high_bound_g, - NULL, NULL, NULL, H5F_ACS_FORMAT_HIGH_BOUND_ENC, H5F_ACS_FORMAT_HIGH_BOUND_DEC, + if(H5P_register_real(pclass, H5F_ACS_LIBVER_HIGH_BOUND_NAME, H5F_ACS_LIBVER_HIGH_BOUND_SIZE, &H5F_def_libver_high_bound_g, + NULL, NULL, NULL, H5F_ACS_LIBVER_HIGH_BOUND_ENC, H5F_ACS_LIBVER_HIGH_BOUND_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -2374,9 +2374,9 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set values */ - if(H5P_set(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, &low) < 0) + if(H5P_set(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set low bound for library format versions") - if(H5P_set(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, &high) < 0) + if(H5P_set(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &high) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set high bound for library format versions") done: FUNC_LEAVE_API(ret_value) @@ -2412,12 +2412,12 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, /* Get values */ if(low) { - if(H5P_get(plist, H5F_ACS_FORMAT_LOW_BOUND_NAME, low) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions") } if(high) { - if(H5P_get(plist, H5F_ACS_FORMAT_HIGH_BOUND_NAME, high) < 0) + if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions") } diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 02a6add..cd0597c 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -349,6 +349,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path") loc_init = TRUE; + /* Set the version for datatype */ if(H5T_set_version(file, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype") diff --git a/src/H5trace.c b/src/H5trace.c index b1f05ba..32e05a7 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -174,26 +174,26 @@ H5_trace(const double *returning, const char *func, const char *type, ...) if(H5_debug_g.ttimes) { char tmp[128]; - sprintf(tmp, "%.6f", event_time.etime-first_time.etime); - fprintf(out, " %*s ", (int)HDstrlen(tmp), ""); + HDsprintf(tmp, "%.6f", event_time.etime-first_time.etime); + HDfprintf(out, " %*s ", (int)HDstrlen(tmp), ""); } /* end if */ for(i = 0; i < current_depth; i++) HDfputc('+', out); - fprintf(out, "%*s%s = ", 2*current_depth, "", func); + HDfprintf(out, "%*s%s = ", 2*current_depth, "", func); } /* end if */ else { /* Continue current line with return value */ - fprintf(out, " = "); + HDfprintf(out, " = "); } /* end else */ } /* end if */ else { if(current_depth>last_call_depth) HDfputs(" = \n", out); if(H5_debug_g.ttimes) - fprintf(out, "@%.6f ", event_time.etime - first_time.etime); + HDfprintf(out, "@%.6f ", event_time.etime - first_time.etime); for(i = 0; i < current_depth; i++) HDfputc('+', out); - fprintf(out, "%*s%s(", 2*current_depth, "", func); + HDfprintf(out, "%*s%s(", 2*current_depth, "", func); } /* end else */ /* Clear array sizes */ @@ -235,7 +235,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) buf[MIN((int)sizeof(buf) - 1, n)] = '\0'; argname = buf; } /* end if */ - fprintf(out, "%s%s=", argno?", ":"", argname); + HDfprintf(out, "%s%s=", argno?", ":"", argname); } /* end if */ else argname = ""; @@ -247,9 +247,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { haddr_t addr = va_arg(ap, haddr_t); @@ -261,33 +261,33 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'b': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { /* Can't pass hbool_t to va_arg() */ hbool_t bool_var = (hbool_t)va_arg(ap, int); if(TRUE == bool_var) - fprintf(out, "TRUE"); + HDfprintf(out, "TRUE"); else if(!bool_var) - fprintf(out, "FALSE"); + HDfprintf(out, "FALSE"); else - fprintf(out, "TRUE(%u)", (unsigned)bool_var); + HDfprintf(out, "TRUE(%u)", (unsigned)bool_var); } break; case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { double dbl = va_arg(ap, double); - fprintf(out, "%g", dbl); + HDfprintf(out, "%g", dbl); } /* end else */ break; @@ -296,36 +296,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - fprintf (out, "0x%lx", (unsigned long)vp); + HDfprintf (out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)va_arg(ap, int); switch(alloc_time) { case H5D_ALLOC_TIME_ERROR: - fprintf(out, "H5D_ALLOC_TIME_ERROR"); + HDfprintf(out, "H5D_ALLOC_TIME_ERROR"); break; case H5D_ALLOC_TIME_DEFAULT: - fprintf(out, "H5D_ALLOC_TIME_DEFAULT"); + HDfprintf(out, "H5D_ALLOC_TIME_DEFAULT"); break; case H5D_ALLOC_TIME_EARLY: - fprintf(out, "H5D_ALLOC_TIME_EARLY"); + HDfprintf(out, "H5D_ALLOC_TIME_EARLY"); break; case H5D_ALLOC_TIME_LATE: - fprintf(out, "H5D_ALLOC_TIME_LATE"); + HDfprintf(out, "H5D_ALLOC_TIME_LATE"); break; case H5D_ALLOC_TIME_INCR: - fprintf(out, "H5D_ALLOC_TIME_INCR"); + HDfprintf(out, "H5D_ALLOC_TIME_INCR"); break; default: - fprintf(out, "%ld", (long)alloc_time); + HDfprintf(out, "%ld", (long)alloc_time); break; } /* end switch */ } /* end else */ @@ -334,24 +334,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)va_arg(ap, int); switch(opt) { case H5FD_MPIO_COLLECTIVE_IO: - fprintf(out, "H5FD_MPIO_COLLECTIVE_IO"); + HDfprintf(out, "H5FD_MPIO_COLLECTIVE_IO"); break; case H5FD_MPIO_INDIVIDUAL_IO: - fprintf(out, "H5FD_MPIO_INDIVIDUAL_IO"); + HDfprintf(out, "H5FD_MPIO_INDIVIDUAL_IO"); break; default: - fprintf(out, "%ld", (long)opt); + HDfprintf(out, "%ld", (long)opt); break; } /* end switch */ } /* end else */ @@ -360,32 +360,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'f': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_fill_time_t fill_time = (H5D_fill_time_t)va_arg(ap, int); switch(fill_time) { case H5D_FILL_TIME_ERROR: - fprintf(out, "H5D_FILL_TIME_ERROR"); + HDfprintf(out, "H5D_FILL_TIME_ERROR"); break; case H5D_FILL_TIME_ALLOC: - fprintf(out, "H5D_FILL_TIME_ALLOC"); + HDfprintf(out, "H5D_FILL_TIME_ALLOC"); break; case H5D_FILL_TIME_NEVER: - fprintf(out, "H5D_FILL_TIME_NEVER"); + HDfprintf(out, "H5D_FILL_TIME_NEVER"); break; case H5D_FILL_TIME_IFSET: - fprintf(out, "H5D_FILL_TIME_IFSET"); + HDfprintf(out, "H5D_FILL_TIME_IFSET"); break; default: - fprintf(out, "%ld", (long)fill_time); + HDfprintf(out, "%ld", (long)fill_time); break; } /* end switch */ } /* end else */ @@ -394,32 +394,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'F': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_fill_value_t fill_value = (H5D_fill_value_t)va_arg(ap, int); switch(fill_value) { case H5D_FILL_VALUE_ERROR: - fprintf(out, "H5D_FILL_VALUE_ERROR"); + HDfprintf(out, "H5D_FILL_VALUE_ERROR"); break; case H5D_FILL_VALUE_UNDEFINED: - fprintf(out, "H5D_FILL_VALUE_UNDEFINED"); + HDfprintf(out, "H5D_FILL_VALUE_UNDEFINED"); break; case H5D_FILL_VALUE_DEFAULT: - fprintf(out, "H5D_FILL_VALUE_DEFAULT"); + HDfprintf(out, "H5D_FILL_VALUE_DEFAULT"); break; case H5D_FILL_VALUE_USER_DEFINED: - fprintf(out, "H5D_FILL_VALUE_USER_DEFINED"); + HDfprintf(out, "H5D_FILL_VALUE_USER_DEFINED"); break; default: - fprintf(out, "%ld", (long)fill_value); + HDfprintf(out, "%ld", (long)fill_value); break; } /* end switch */ } /* end else */ @@ -428,28 +428,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'h': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)va_arg(ap, int); switch(opt) { case H5FD_MPIO_CHUNK_DEFAULT: - fprintf(out, "H5FD_MPIO_CHUNK_DEFAULT"); + HDfprintf(out, "H5FD_MPIO_CHUNK_DEFAULT"); break; case H5FD_MPIO_CHUNK_ONE_IO: - fprintf(out, "H5FD_MPIO_CHUNK_ONE_IO"); + HDfprintf(out, "H5FD_MPIO_CHUNK_ONE_IO"); break; case H5FD_MPIO_CHUNK_MULTI_IO: - fprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO"); + HDfprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO"); break; default: - fprintf(out, "%ld", (long)opt); + HDfprintf(out, "%ld", (long)opt); break; } /* end switch */ } /* end else */ @@ -458,36 +458,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_mpio_actual_io_mode_t actual_io_mode = (H5D_mpio_actual_io_mode_t)va_arg(ap, int); switch(actual_io_mode) { case H5D_MPIO_NO_COLLECTIVE: - fprintf(out, "H5D_MPIO_NO_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_NO_COLLECTIVE"); break; case H5D_MPIO_CHUNK_INDEPENDENT: - fprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT"); + HDfprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT"); break; case H5D_MPIO_CHUNK_COLLECTIVE: - fprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE"); break; case H5D_MPIO_CHUNK_MIXED: - fprintf(out, "H5D_MPIO_CHUNK_MIXED"); + HDfprintf(out, "H5D_MPIO_CHUNK_MIXED"); break; case H5D_MPIO_CONTIGUOUS_COLLECTIVE: - fprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); break; default: - fprintf(out, "%ld", (long)actual_io_mode); + HDfprintf(out, "%ld", (long)actual_io_mode); break; } /* end switch */ } /* end else */ @@ -496,44 +496,44 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'k': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_chunk_index_t idx = (H5D_chunk_index_t)va_arg(ap, int); switch(idx) { case H5D_CHUNK_IDX_BTREE: - fprintf(out, "H5D_CHUNK_IDX_BTREE"); + HDfprintf(out, "H5D_CHUNK_IDX_BTREE"); break; case H5D_CHUNK_IDX_NONE: - fprintf(out, "H5D_CHUNK_IDX_NONE"); + HDfprintf(out, "H5D_CHUNK_IDX_NONE"); break; case H5D_CHUNK_IDX_FARRAY: - fprintf(out, "H5D_CHUNK_IDX_FARRAY"); + HDfprintf(out, "H5D_CHUNK_IDX_FARRAY"); break; case H5D_CHUNK_IDX_EARRAY: - fprintf(out, "H5D_CHUNK_IDX_EARRAY"); + HDfprintf(out, "H5D_CHUNK_IDX_EARRAY"); break; case H5D_CHUNK_IDX_BT2: - fprintf(out, "H5D_CHUNK_IDX_BT2"); + HDfprintf(out, "H5D_CHUNK_IDX_BT2"); break; case H5D_CHUNK_IDX_SINGLE: - fprintf(out, "H5D_CHUNK_IDX_SINGLE"); + HDfprintf(out, "H5D_CHUNK_IDX_SINGLE"); break; case H5D_CHUNK_IDX_NTYPES: - fprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); + HDfprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); break; default: - fprintf(out, "UNKNOWN VALUE: %ld", (long)idx); + HDfprintf(out, "UNKNOWN VALUE: %ld", (long)idx); break; } /* end switch */ } /* end else */ @@ -542,40 +542,40 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_layout_t layout = (H5D_layout_t)va_arg(ap, int); switch(layout) { case H5D_LAYOUT_ERROR: - fprintf(out, "H5D_LAYOUT_ERROR"); + HDfprintf(out, "H5D_LAYOUT_ERROR"); break; case H5D_COMPACT: - fprintf(out, "H5D_COMPACT"); + HDfprintf(out, "H5D_COMPACT"); break; case H5D_CONTIGUOUS: - fprintf(out, "H5D_CONTIGUOUS"); + HDfprintf(out, "H5D_CONTIGUOUS"); break; case H5D_CHUNKED: - fprintf(out, "H5D_CHUNKED"); + HDfprintf(out, "H5D_CHUNKED"); break; case H5D_VIRTUAL: - fprintf(out, "H5D_VIRTUAL"); + HDfprintf(out, "H5D_VIRTUAL"); break; case H5D_NLAYOUTS: - fprintf(out, "H5D_NLAYOUTS"); + HDfprintf(out, "H5D_NLAYOUTS"); break; default: - fprintf(out, "%ld", (long)layout); + HDfprintf(out, "%ld", (long)layout); break; } /* end switch */ } /* end else */ @@ -584,9 +584,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'n': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_mpio_no_collective_cause_t nocol_cause_mode = (H5D_mpio_no_collective_cause_t)va_arg(ap, int); @@ -594,65 +594,65 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* Check for all bit-flags which might be set */ if(nocol_cause_mode & H5D_MPIO_COLLECTIVE) { - fprintf(out, "H5D_MPIO_COLLECTIVE"); + HDfprintf(out, "H5D_MPIO_COLLECTIVE"); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) { - fprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) { - fprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) { - fprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) { - fprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) { - fprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if(nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { - fprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : ""); + HDfprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ /* Display '' if there's no flags set */ if(!flag_already_displayed) - fprintf(out, ""); + HDfprintf(out, ""); } /* end else */ break; case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = (H5D_mpio_actual_chunk_opt_mode_t)va_arg(ap, int); switch(chunk_opt_mode) { case H5D_MPIO_NO_CHUNK_OPTIMIZATION: - fprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); + HDfprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); break; case H5D_MPIO_LINK_CHUNK: - fprintf(out, "H5D_MPIO_LINK_CHUNK"); + HDfprintf(out, "H5D_MPIO_LINK_CHUNK"); break; case H5D_MPIO_MULTI_CHUNK: - fprintf(out, "H5D_MPIO_MULTI_CHUNK"); + HDfprintf(out, "H5D_MPIO_MULTI_CHUNK"); break; default: - fprintf(out, "%ld", (long)chunk_opt_mode); + HDfprintf(out, "%ld", (long)chunk_opt_mode); break; } /* end switch */ } /* end else */ @@ -661,32 +661,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_space_status_t space_status = (H5D_space_status_t)va_arg(ap, int); switch(space_status) { case H5D_SPACE_STATUS_NOT_ALLOCATED: - fprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED"); + HDfprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED"); break; case H5D_SPACE_STATUS_PART_ALLOCATED: - fprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED"); + HDfprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED"); break; case H5D_SPACE_STATUS_ALLOCATED: - fprintf(out, "H5D_SPACE_STATUS_ALLOCATED"); + HDfprintf(out, "H5D_SPACE_STATUS_ALLOCATED"); break; case H5D_SPACE_STATUS_ERROR: - fprintf(out, "H5D_SPACE_STATUS_ERROR"); + HDfprintf(out, "H5D_SPACE_STATUS_ERROR"); break; default: - fprintf(out, "%ld", (long)space_status); + HDfprintf(out, "%ld", (long)space_status); break; } /* end switch */ } /* end else */ @@ -695,24 +695,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)va_arg(ap, int); switch(transfer) { case H5FD_MPIO_INDEPENDENT: - fprintf(out, "H5FD_MPIO_INDEPENDENT"); + HDfprintf(out, "H5FD_MPIO_INDEPENDENT"); break; case H5FD_MPIO_COLLECTIVE: - fprintf(out, "H5FD_MPIO_COLLECTIVE"); + HDfprintf(out, "H5FD_MPIO_COLLECTIVE"); break; default: - fprintf(out, "%ld", (long)transfer); + HDfprintf(out, "%ld", (long)transfer); break; } /* end switch */ } /* end else */ @@ -721,35 +721,35 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'v': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5D_vds_view_t view = (H5D_vds_view_t)va_arg(ap, int); switch(view) { case H5D_VDS_ERROR: - fprintf(out, "H5D_VDS_ERROR"); + HDfprintf(out, "H5D_VDS_ERROR"); break; case H5D_VDS_FIRST_MISSING: - fprintf(out, "H5D_VDS_FIRST_MISSING"); + HDfprintf(out, "H5D_VDS_FIRST_MISSING"); break; case H5D_VDS_LAST_AVAILABLE: - fprintf(out, "H5D_VDS_LAST_AVAILABLE"); + HDfprintf(out, "H5D_VDS_LAST_AVAILABLE"); break; default: - fprintf(out, "%ld", (long)view); + HDfprintf(out, "%ld", (long)view); break; } /* end switch */ } /* end else */ break; default: - fprintf (out, "BADTYPE(D%c)", type[1]); + HDfprintf (out, "BADTYPE(D%c)", type[1]); goto error; } /* end switch */ break; @@ -757,17 +757,17 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { herr_t status = va_arg(ap, herr_t); if(status >= 0) - fprintf(out, "SUCCEED"); + HDfprintf(out, "SUCCEED"); else - fprintf(out, "FAIL"); + HDfprintf(out, "FAIL"); } /* end else */ break; @@ -776,24 +776,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5E_direction_t direction = (H5E_direction_t)va_arg(ap, int); switch(direction) { case H5E_WALK_UPWARD: - fprintf(out, "H5E_WALK_UPWARD"); + HDfprintf(out, "H5E_WALK_UPWARD"); break; case H5E_WALK_DOWNWARD: - fprintf(out, "H5E_WALK_DOWNWARD"); + HDfprintf(out, "H5E_WALK_DOWNWARD"); break; default: - fprintf(out, "%ld", (long)direction); + HDfprintf(out, "%ld", (long)direction); break; } /* end switch */ } /* end else */ @@ -802,45 +802,45 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5E_error2_t *error = va_arg(ap, H5E_error2_t *); - fprintf(out, "0x%lx", (unsigned long)error); + HDfprintf(out, "0x%lx", (unsigned long)error); } /* end else */ break; case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5E_type_t etype = (H5E_type_t)va_arg(ap, int); switch(etype) { case H5E_MAJOR: - fprintf(out, "H5E_MAJOR"); + HDfprintf(out, "H5E_MAJOR"); break; case H5E_MINOR: - fprintf(out, "H5E_MINOR"); + HDfprintf(out, "H5E_MINOR"); break; default: - fprintf(out, "%ld", (long)etype); + HDfprintf(out, "%ld", (long)etype); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(E%c)", type[1]); + HDfprintf(out, "BADTYPE(E%c)", type[1]); goto error; } /* end switch */ break; @@ -850,32 +850,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_close_degree_t degree = (H5F_close_degree_t)va_arg(ap, int); switch(degree) { case H5F_CLOSE_DEFAULT: - fprintf(out, "H5F_CLOSE_DEFAULT"); + HDfprintf(out, "H5F_CLOSE_DEFAULT"); break; case H5F_CLOSE_WEAK: - fprintf(out, "H5F_CLOSE_WEAK"); + HDfprintf(out, "H5F_CLOSE_WEAK"); break; case H5F_CLOSE_SEMI: - fprintf(out, "H5F_CLOSE_SEMI"); + HDfprintf(out, "H5F_CLOSE_SEMI"); break; case H5F_CLOSE_STRONG: - fprintf(out, "H5F_CLOSE_STRONG"); + HDfprintf(out, "H5F_CLOSE_STRONG"); break; default: - fprintf(out, "%ld", (long)degree); + HDfprintf(out, "%ld", (long)degree); break; } /* end switch */ } /* end else */ @@ -884,33 +884,33 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'f': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_fspace_strategy_t fs_strategy = (H5F_fspace_strategy_t)va_arg(ap, int); switch(fs_strategy) { case H5F_FSPACE_STRATEGY_FSM_AGGR: - fprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR"); break; case H5F_FSPACE_STRATEGY_PAGE: - fprintf(out, "H5F_FSPACE_STRATEGY_PAGE"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_PAGE"); break; case H5F_FSPACE_STRATEGY_AGGR: - fprintf(out, "H5F_FSPACE_STRATEGY_AGGR"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_AGGR"); break; case H5F_FSPACE_STRATEGY_NONE: - fprintf(out, "H5F_FSPACE_STRATEGY_NONE"); + HDfprintf(out, "H5F_FSPACE_STRATEGY_NONE"); break; case H5F_FSPACE_STRATEGY_NTYPES: default: - fprintf(out, "%ld", (long)fs_strategy); + HDfprintf(out, "%ld", (long)fs_strategy); break; } /* end switch */ } /* end else */ @@ -919,49 +919,49 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'm': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_mem_t mem_type = (H5F_mem_t)va_arg(ap, int); switch(mem_type) { case H5FD_MEM_NOLIST: - fprintf(out, "H5FD_MEM_NOLIST"); + HDfprintf(out, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - fprintf(out, "H5FD_MEM_DEFAULT"); + HDfprintf(out, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - fprintf(out, "H5FD_MEM_SUPER"); + HDfprintf(out, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - fprintf(out, "H5FD_MEM_BTREE"); + HDfprintf(out, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - fprintf(out, "H5FD_MEM_DRAW"); + HDfprintf(out, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - fprintf(out, "H5FD_MEM_GHEAP"); + HDfprintf(out, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - fprintf(out, "H5FD_MEM_LHEAP"); + HDfprintf(out, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - fprintf(out, "H5FD_MEM_OHDR"); + HDfprintf(out, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: default: - fprintf(out, "%ld", (long)mem_type); + HDfprintf(out, "%ld", (long)mem_type); break; } /* end switch */ } /* end else */ @@ -970,24 +970,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_scope_t scope = (H5F_scope_t)va_arg(ap, int); switch(scope) { case H5F_SCOPE_LOCAL: - fprintf(out, "H5F_SCOPE_LOCAL"); + HDfprintf(out, "H5F_SCOPE_LOCAL"); break; case H5F_SCOPE_GLOBAL: - fprintf(out, "H5F_SCOPE_GLOBAL"); + HDfprintf(out, "H5F_SCOPE_GLOBAL"); break; default: - fprintf(out, "%ld", (long)scope); + HDfprintf(out, "%ld", (long)scope); break; } /* end switch */ } /* end else */ @@ -996,47 +996,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ break; case 'v': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5F_libver_t libver_vers = (H5F_libver_t)va_arg(ap, int); switch(libver_vers) { case H5F_LIBVER_EARLIEST: - fprintf(out, "H5F_LIBVER_EARLIEST"); + HDfprintf(out, "H5F_LIBVER_EARLIEST"); break; case H5F_LIBVER_V18: - fprintf(out, "H5F_LIBVER_V18"); + HDfprintf(out, "H5F_LIBVER_V18"); break; case H5F_LIBVER_V110: - HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); - fprintf(out, "H5F_LIBVER_LATEST"); + HDcompile_assert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); + HDfprintf(out, "H5F_LIBVER_LATEST"); break; case H5F_LIBVER_ERROR: case H5F_LIBVER_NBOUNDS: default: - fprintf(out, "%ld", (long)libver_vers); + HDfprintf(out, "%ld", (long)libver_vers); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(F%c)", type[1]); + HDfprintf(out, "BADTYPE(F%c)", type[1]); goto error; } /* end switch */ break; @@ -1047,46 +1047,46 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5G_obj_t obj_type = (H5G_obj_t)va_arg(ap, int); switch(obj_type) { case H5G_UNKNOWN: - fprintf(out, "H5G_UNKNOWN"); + HDfprintf(out, "H5G_UNKNOWN"); break; case H5G_GROUP: - fprintf(out, "H5G_GROUP"); + HDfprintf(out, "H5G_GROUP"); break; case H5G_DATASET: - fprintf(out, "H5G_DATASET"); + HDfprintf(out, "H5G_DATASET"); break; case H5G_TYPE: - fprintf(out, "H5G_TYPE"); + HDfprintf(out, "H5G_TYPE"); break; case H5G_LINK: - fprintf(out, "H5G_LINK"); + HDfprintf(out, "H5G_LINK"); break; case H5G_UDLINK: - fprintf(out, "H5G_UDLINK"); + HDfprintf(out, "H5G_UDLINK"); break; case H5G_RESERVED_5: case H5G_RESERVED_6: case H5G_RESERVED_7: - fprintf(out, "H5G_RESERVED(%ld)", (long)obj_type); + HDfprintf(out, "H5G_RESERVED(%ld)", (long)obj_type); break; default: - fprintf(out, "%ld", (long)obj_type); + HDfprintf(out, "%ld", (long)obj_type); break; } /* end switch */ } /* end else */ @@ -1095,20 +1095,20 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf (out, "0x%lx", (unsigned long)vp); + HDfprintf (out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*); - fprintf(out, "0x%lx", (unsigned long)statbuf); + HDfprintf(out, "0x%lx", (unsigned long)statbuf); } break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ default: - fprintf(out, "BADTYPE(G%c)", type[1]); + HDfprintf(out, "BADTYPE(G%c)", type[1]); goto error; } break; @@ -1116,22 +1116,22 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'h': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { hsize_t *p = (hsize_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) { if(H5S_UNLIMITED == p[i]) HDfprintf(out, "%sH5S_UNLIMITED", (i ? ", " : "")); else HDfprintf(out, "%s%Hu", (i ? ", " : ""), p[i]); } /* end for */ - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hsize_t hsize = va_arg(ap, hsize_t); @@ -1150,18 +1150,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { hssize_t *p = (hssize_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Hd", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hssize_t hssize = va_arg(ap, hssize_t); @@ -1172,7 +1172,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - fprintf (out, "BADTYPE(H%c)", type[1]); + HDfprintf (out, "BADTYPE(H%c)", type[1]); goto error; } /* end switch */ break; @@ -1180,130 +1180,130 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hid_t obj = va_arg(ap, hid_t); if(H5P_DEFAULT == obj) - fprintf(out, "H5P_DEFAULT"); + HDfprintf(out, "H5P_DEFAULT"); else if(obj < 0) - fprintf(out, "FAIL"); + HDfprintf(out, "FAIL"); else { switch(H5I_TYPE(obj)) { /* Use internal H5I macro instead of function call */ case H5I_UNINIT: - fprintf(out, "%ld (uninit - error)", (long)obj); + HDfprintf(out, "%ld (uninit - error)", (long)obj); break; case H5I_BADID: - fprintf(out, "%ld (error)", (long)obj); + HDfprintf(out, "%ld (error)", (long)obj); break; case H5I_FILE: - fprintf(out, "%ld (file)", (long)obj); + HDfprintf(out, "%ld (file)", (long)obj); break; case H5I_GROUP: - fprintf(out, "%ld (group)", (long)obj); + HDfprintf(out, "%ld (group)", (long)obj); break; case H5I_DATATYPE: if(obj == H5T_NATIVE_SCHAR_g) - fprintf(out, "H5T_NATIVE_SCHAR"); + HDfprintf(out, "H5T_NATIVE_SCHAR"); else if(obj == H5T_NATIVE_UCHAR_g) - fprintf(out, "H5T_NATIVE_UCHAR"); + HDfprintf(out, "H5T_NATIVE_UCHAR"); else if(obj == H5T_NATIVE_SHORT_g) - fprintf(out, "H5T_NATIVE_SHORT"); + HDfprintf(out, "H5T_NATIVE_SHORT"); else if(obj == H5T_NATIVE_USHORT_g) - fprintf(out, "H5T_NATIVE_USHORT"); + HDfprintf(out, "H5T_NATIVE_USHORT"); else if(obj == H5T_NATIVE_INT_g) - fprintf(out, "H5T_NATIVE_INT"); + HDfprintf(out, "H5T_NATIVE_INT"); else if(obj == H5T_NATIVE_UINT_g) - fprintf(out, "H5T_NATIVE_UINT"); + HDfprintf(out, "H5T_NATIVE_UINT"); else if(obj == H5T_NATIVE_LONG_g) - fprintf(out, "H5T_NATIVE_LONG"); + HDfprintf(out, "H5T_NATIVE_LONG"); else if(obj == H5T_NATIVE_ULONG_g) - fprintf(out, "H5T_NATIVE_ULONG"); + HDfprintf(out, "H5T_NATIVE_ULONG"); else if(obj == H5T_NATIVE_LLONG_g) - fprintf(out, "H5T_NATIVE_LLONG"); + HDfprintf(out, "H5T_NATIVE_LLONG"); else if(obj == H5T_NATIVE_ULLONG_g) - fprintf(out, "H5T_NATIVE_ULLONG"); + HDfprintf(out, "H5T_NATIVE_ULLONG"); else if(obj == H5T_NATIVE_FLOAT_g) - fprintf(out, "H5T_NATIVE_FLOAT"); + HDfprintf(out, "H5T_NATIVE_FLOAT"); else if(obj == H5T_NATIVE_DOUBLE_g) - fprintf(out, "H5T_NATIVE_DOUBLE"); + HDfprintf(out, "H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE !=0 else if(obj == H5T_NATIVE_LDOUBLE_g) - fprintf(out, "H5T_NATIVE_LDOUBLE"); + HDfprintf(out, "H5T_NATIVE_LDOUBLE"); #endif else if(obj == H5T_IEEE_F32BE_g) - fprintf(out, "H5T_IEEE_F32BE"); + HDfprintf(out, "H5T_IEEE_F32BE"); else if(obj == H5T_IEEE_F32LE_g) - fprintf(out, "H5T_IEEE_F32LE"); + HDfprintf(out, "H5T_IEEE_F32LE"); else if(obj == H5T_IEEE_F64BE_g) - fprintf(out, "H5T_IEEE_F64BE"); + HDfprintf(out, "H5T_IEEE_F64BE"); else if(obj == H5T_IEEE_F64LE_g) - fprintf(out, "H5T_IEEE_F64LE"); + HDfprintf(out, "H5T_IEEE_F64LE"); else if(obj == H5T_STD_I8BE_g) - fprintf(out, "H5T_STD_I8BE"); + HDfprintf(out, "H5T_STD_I8BE"); else if(obj == H5T_STD_I8LE_g) - fprintf(out, "H5T_STD_I8LE"); + HDfprintf(out, "H5T_STD_I8LE"); else if(obj == H5T_STD_I16BE_g) - fprintf(out, "H5T_STD_I16BE"); + HDfprintf(out, "H5T_STD_I16BE"); else if(obj == H5T_STD_I16LE_g) - fprintf(out, "H5T_STD_I16LE"); + HDfprintf(out, "H5T_STD_I16LE"); else if(obj == H5T_STD_I32BE_g) - fprintf(out, "H5T_STD_I32BE"); + HDfprintf(out, "H5T_STD_I32BE"); else if(obj == H5T_STD_I32LE_g) - fprintf(out, "H5T_STD_I32LE"); + HDfprintf(out, "H5T_STD_I32LE"); else if(obj == H5T_STD_I64BE_g) - fprintf(out, "H5T_STD_I64BE"); + HDfprintf(out, "H5T_STD_I64BE"); else if(obj == H5T_STD_I64LE_g) - fprintf(out, "H5T_STD_I64LE"); + HDfprintf(out, "H5T_STD_I64LE"); else if(obj == H5T_STD_U8BE_g) - fprintf(out, "H5T_STD_U8BE"); + HDfprintf(out, "H5T_STD_U8BE"); else if(obj == H5T_STD_U8LE_g) - fprintf(out, "H5T_STD_U8LE"); + HDfprintf(out, "H5T_STD_U8LE"); else if(obj == H5T_STD_U16BE_g) - fprintf(out, "H5T_STD_U16BE"); + HDfprintf(out, "H5T_STD_U16BE"); else if(obj == H5T_STD_U16LE_g) - fprintf(out, "H5T_STD_U16LE"); + HDfprintf(out, "H5T_STD_U16LE"); else if(obj == H5T_STD_U32BE_g) - fprintf(out, "H5T_STD_U32BE"); + HDfprintf(out, "H5T_STD_U32BE"); else if(obj == H5T_STD_U32LE_g) - fprintf(out, "H5T_STD_U32LE"); + HDfprintf(out, "H5T_STD_U32LE"); else if(obj == H5T_STD_U64BE_g) - fprintf(out, "H5T_STD_U64BE"); + HDfprintf(out, "H5T_STD_U64BE"); else if(obj == H5T_STD_U64LE_g) - fprintf(out, "H5T_STD_U64LE"); + HDfprintf(out, "H5T_STD_U64LE"); else if(obj == H5T_STD_B8BE_g) - fprintf(out, "H5T_STD_B8BE"); + HDfprintf(out, "H5T_STD_B8BE"); else if(obj == H5T_STD_B8LE_g) - fprintf(out, "H5T_STD_B8LE"); + HDfprintf(out, "H5T_STD_B8LE"); else if(obj == H5T_STD_B16BE_g) - fprintf(out, "H5T_STD_B16BE"); + HDfprintf(out, "H5T_STD_B16BE"); else if(obj == H5T_STD_B16LE_g) - fprintf(out, "H5T_STD_B16LE"); + HDfprintf(out, "H5T_STD_B16LE"); else if(obj == H5T_STD_B32BE_g) - fprintf(out, "H5T_STD_B32BE"); + HDfprintf(out, "H5T_STD_B32BE"); else if(obj == H5T_STD_B32LE_g) - fprintf(out, "H5T_STD_B32LE"); + HDfprintf(out, "H5T_STD_B32LE"); else if(obj == H5T_STD_B64BE_g) - fprintf(out, "H5T_STD_B64BE"); + HDfprintf(out, "H5T_STD_B64BE"); else if(obj == H5T_STD_B64LE_g) - fprintf(out, "H5T_STD_B64LE"); + HDfprintf(out, "H5T_STD_B64LE"); else if(obj == H5T_C_S1_g) - fprintf(out, "H5T_C_S1"); + HDfprintf(out, "H5T_C_S1"); else if(obj == H5T_FORTRAN_S1_g) - fprintf(out, "H5T_FORTRAN_S1"); + HDfprintf(out, "H5T_FORTRAN_S1"); else - fprintf(out, "%ld (dtype)", (long)obj); + HDfprintf(out, "%ld (dtype)", (long)obj); break; case H5I_DATASPACE: - fprintf(out, "%ld (dspace)", (long)obj); + HDfprintf(out, "%ld (dspace)", (long)obj); /* Save the rank of simple data spaces for arrays */ /* This may generate recursive call to the library... -QAK */ { @@ -1316,47 +1316,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_DATASET: - fprintf(out, "%ld (dset)", (long)obj); + HDfprintf(out, "%ld (dset)", (long)obj); break; case H5I_ATTR: - fprintf(out, "%ld (attr)", (long)obj); + HDfprintf(out, "%ld (attr)", (long)obj); break; case H5I_REFERENCE: - fprintf(out, "%ld (reference)", (long)obj); + HDfprintf(out, "%ld (reference)", (long)obj); break; case H5I_VFL: - fprintf(out, "%ld (file driver)", (long)obj); + HDfprintf(out, "%ld (file driver)", (long)obj); break; case H5I_GENPROP_CLS: - fprintf(out, "%ld (genprop class)", (long)obj); + HDfprintf(out, "%ld (genprop class)", (long)obj); break; case H5I_GENPROP_LST: - fprintf(out, "%ld (genprop list)", (long)obj); + HDfprintf(out, "%ld (genprop list)", (long)obj); break; case H5I_ERROR_CLASS: - fprintf(out, "%ld (err class)", (long)obj); + HDfprintf(out, "%ld (err class)", (long)obj); break; case H5I_ERROR_MSG: - fprintf(out, "%ld (err msg)", (long)obj); + HDfprintf(out, "%ld (err msg)", (long)obj); break; case H5I_ERROR_STACK: - fprintf(out, "%ld (err stack)", (long)obj); + HDfprintf(out, "%ld (err stack)", (long)obj); break; case H5I_NTYPES: - fprintf (out, "%ld (ntypes - error)", (long)obj); + HDfprintf (out, "%ld (ntypes - error)", (long)obj); break; default: - fprintf(out, "%ld (unknown class)", (long)obj); + HDfprintf(out, "%ld (unknown class)", (long)obj); break; } /* end switch */ } /* end else */ @@ -1368,32 +1368,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5_index_t idx_type = (H5_index_t)va_arg(ap, int); switch(idx_type) { case H5_INDEX_UNKNOWN: - fprintf(out, "H5_INDEX_UNKNOWN"); + HDfprintf(out, "H5_INDEX_UNKNOWN"); break; case H5_INDEX_NAME: - fprintf(out, "H5_INDEX_NAME"); + HDfprintf(out, "H5_INDEX_NAME"); break; case H5_INDEX_CRT_ORDER: - fprintf(out, "H5_INDEX_CRT_ORDER"); + HDfprintf(out, "H5_INDEX_CRT_ORDER"); break; case H5_INDEX_N: - fprintf(out, "H5_INDEX_N"); + HDfprintf(out, "H5_INDEX_N"); break; default: - fprintf(out, "%ld", (long)idx_type); + HDfprintf(out, "%ld", (long)idx_type); break; } /* end switch */ } /* end else */ @@ -1402,36 +1402,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5_iter_order_t order = (H5_iter_order_t)va_arg(ap, int); switch(order) { case H5_ITER_UNKNOWN: - fprintf(out, "H5_ITER_UNKNOWN"); + HDfprintf(out, "H5_ITER_UNKNOWN"); break; case H5_ITER_INC: - fprintf(out, "H5_ITER_INC"); + HDfprintf(out, "H5_ITER_INC"); break; case H5_ITER_DEC: - fprintf(out, "H5_ITER_DEC"); + HDfprintf(out, "H5_ITER_DEC"); break; case H5_ITER_NATIVE: - fprintf(out, "H5_ITER_NATIVE"); + HDfprintf(out, "H5_ITER_NATIVE"); break; case H5_ITER_N: - fprintf(out, "H5_ITER_N"); + HDfprintf(out, "H5_ITER_N"); break; default: - fprintf(out, "%ld", (long)order); + HDfprintf(out, "%ld", (long)order); break; } /* end switch */ } /* end else */ @@ -1440,23 +1440,23 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { int *p = (int*)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) - fprintf(out, "%s%d", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "%s%d", (i ? ", " : ""), p[i]); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { int is = va_arg(ap, int); - fprintf (out, "%d", is); + HDfprintf (out, "%d", is); asize[argno] = is; } /* end else */ break; @@ -1464,80 +1464,80 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5I_type_t id_type = (H5I_type_t)va_arg(ap, int); switch (id_type) { case H5I_UNINIT: - fprintf(out, "H5I_UNINIT"); + HDfprintf(out, "H5I_UNINIT"); break; case H5I_BADID: - fprintf(out, "H5I_BADID"); + HDfprintf(out, "H5I_BADID"); break; case H5I_FILE: - fprintf(out, "H5I_FILE"); + HDfprintf(out, "H5I_FILE"); break; case H5I_GROUP: - fprintf(out, "H5I_GROUP"); + HDfprintf(out, "H5I_GROUP"); break; case H5I_DATATYPE: - fprintf(out, "H5I_DATATYPE"); + HDfprintf(out, "H5I_DATATYPE"); break; case H5I_DATASPACE: - fprintf(out, "H5I_DATASPACE"); + HDfprintf(out, "H5I_DATASPACE"); break; case H5I_DATASET: - fprintf(out, "H5I_DATASET"); + HDfprintf(out, "H5I_DATASET"); break; case H5I_ATTR: - fprintf(out, "H5I_ATTR"); + HDfprintf(out, "H5I_ATTR"); break; case H5I_REFERENCE: - fprintf(out, "H5I_REFERENCE"); + HDfprintf(out, "H5I_REFERENCE"); break; case H5I_VFL: - fprintf(out, "H5I_VFL"); + HDfprintf(out, "H5I_VFL"); break; case H5I_GENPROP_CLS: - fprintf(out, "H5I_GENPROP_CLS"); + HDfprintf(out, "H5I_GENPROP_CLS"); break; case H5I_GENPROP_LST: - fprintf(out, "H5I_GENPROP_LST"); + HDfprintf(out, "H5I_GENPROP_LST"); break; case H5I_ERROR_CLASS: - fprintf(out, "H5I_ERROR_CLASS"); + HDfprintf(out, "H5I_ERROR_CLASS"); break; case H5I_ERROR_MSG: - fprintf(out, "H5I_ERROR_MSG"); + HDfprintf(out, "H5I_ERROR_MSG"); break; case H5I_ERROR_STACK: - fprintf(out, "H5I_ERROR_STACK"); + HDfprintf(out, "H5I_ERROR_STACK"); break; case H5I_NTYPES: - fprintf(out, "H5I_NTYPES"); + HDfprintf(out, "H5I_NTYPES"); break; default: - fprintf(out, "%ld", (long)id_type); + HDfprintf(out, "%ld", (long)id_type); break; } /* end switch */ } /* end else */ @@ -1546,29 +1546,29 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'u': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned *p = (unsigned*)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%u", i?", ":"", p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { unsigned iu = va_arg(ap, unsigned); - fprintf(out, "%u", iu); + HDfprintf(out, "%u", iu); asize[argno] = iu; } /* end else */ break; default: - fprintf (out, "BADTYPE(I%c)", type[1]); + HDfprintf (out, "BADTYPE(I%c)", type[1]); goto error; } /* end switch */ break; @@ -1578,43 +1578,43 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - fprintf (out, "0x%lx", (unsigned long)vp); + HDfprintf (out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5L_type_t link_type = (H5L_type_t)va_arg(ap, int); switch(link_type) { case H5L_TYPE_ERROR: - fprintf(out, "H5L_TYPE_ERROR"); + HDfprintf(out, "H5L_TYPE_ERROR"); break; case H5L_TYPE_HARD: - fprintf(out, "H5L_TYPE_HARD"); + HDfprintf(out, "H5L_TYPE_HARD"); break; case H5L_TYPE_SOFT: - fprintf(out, "H5L_TYPE_SOFT"); + HDfprintf(out, "H5L_TYPE_SOFT"); break; case H5L_TYPE_EXTERNAL: - fprintf(out, "H5L_TYPE_EXTERNAL"); + HDfprintf(out, "H5L_TYPE_EXTERNAL"); break; case H5L_TYPE_MAX: - fprintf(out, "H5L_TYPE_MAX"); + HDfprintf(out, "H5L_TYPE_MAX"); break; default: - fprintf(out, "%ld", (long)link_type); + HDfprintf(out, "%ld", (long)link_type); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(G%c)", type[1]); + HDfprintf(out, "BADTYPE(G%c)", type[1]); goto error; } /* end switch */ break; @@ -1624,15 +1624,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ #ifdef H5_HAVE_PARALLEL else { MPI_Comm comm = va_arg(ap, MPI_Comm); - fprintf(out, "%ld", (long)comm); + HDfprintf(out, "%ld", (long)comm); } /* end else */ #endif /* H5_HAVE_PARALLEL */ break; @@ -1640,15 +1640,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ #ifdef H5_HAVE_PARALLEL else { MPI_Info info = va_arg(ap, MPI_Info); - fprintf(out, "%ld", (long)info); + HDfprintf(out, "%ld", (long)info); } /* end else */ #endif /* H5_HAVE_PARALLEL */ break; @@ -1656,52 +1656,52 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5FD_mem_t mt = (H5FD_mem_t)va_arg(ap, int); switch(mt) { case H5FD_MEM_NOLIST: - fprintf(out, "H5FD_MEM_NOLIST"); + HDfprintf(out, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - fprintf(out, "H5FD_MEM_DEFAULT"); + HDfprintf(out, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - fprintf(out, "H5FD_MEM_SUPER"); + HDfprintf(out, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - fprintf(out, "H5FD_MEM_BTREE"); + HDfprintf(out, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - fprintf(out, "H5FD_MEM_DRAW"); + HDfprintf(out, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - fprintf(out, "H5FD_MEM_GHEAP"); + HDfprintf(out, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - fprintf(out, "H5FD_MEM_LHEAP"); + HDfprintf(out, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - fprintf(out, "H5FD_MEM_OHDR"); + HDfprintf(out, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: - fprintf(out, "H5FD_MEM_NTYPES"); + HDfprintf(out, "H5FD_MEM_NTYPES"); break; default: - fprintf(out, "%ld", (long)mt); + HDfprintf(out, "%ld", (long)mt); break; } /* end switch */ } /* end else */ @@ -1715,14 +1715,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { off_t offset = va_arg(ap, off_t); - fprintf (out, "%ld", (long)offset); + HDfprintf (out, "%ld", (long)offset); } /* end else */ break; @@ -1731,43 +1731,43 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5O_type_t objtype = (H5O_type_t)va_arg(ap, int); switch(objtype) { case H5O_TYPE_UNKNOWN: - fprintf(out, "H5O_TYPE_UNKNOWN"); + HDfprintf(out, "H5O_TYPE_UNKNOWN"); break; case H5O_TYPE_GROUP: - fprintf(out, "H5O_TYPE_GROUP"); + HDfprintf(out, "H5O_TYPE_GROUP"); break; case H5O_TYPE_DATASET: - fprintf(out, "H5O_TYPE_DATASET"); + HDfprintf(out, "H5O_TYPE_DATASET"); break; case H5O_TYPE_NAMED_DATATYPE: - fprintf(out, "H5O_TYPE_NAMED_DATATYPE"); + HDfprintf(out, "H5O_TYPE_NAMED_DATATYPE"); break; case H5O_TYPE_NTYPES: - fprintf(out, "H5O_TYPE_TYPES"); + HDfprintf(out, "H5O_TYPE_TYPES"); break; default: - fprintf(out, "BADTYPE(%ld)", (long)objtype); + HDfprintf(out, "BADTYPE(%ld)", (long)objtype); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(S%c)", type[1]); + HDfprintf(out, "BADTYPE(S%c)", type[1]); goto error; } /* end switch */ break; @@ -1775,9 +1775,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'p': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hid_t pclass_id = va_arg(ap, hid_t); @@ -1788,20 +1788,20 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* (This may generate recursive call to the library... -QAK) */ if(NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) && NULL != (class_name = H5P_get_class_name(pclass))) { - fprintf(out, "%s", class_name); + HDfprintf(out, "%s", class_name); H5MM_xfree(class_name); } /* end if */ else - fprintf(out, "%ld", (long)pclass_id); + HDfprintf(out, "%ld", (long)pclass_id); } /* end else */ break; case 'r': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { hobj_ref_t ref = va_arg(ap, hobj_ref_t); @@ -1815,39 +1815,39 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5R_type_t reftype = (H5R_type_t)va_arg(ap, int); switch(reftype) { case H5R_BADTYPE: - fprintf(out, "H5R_BADTYPE"); + HDfprintf(out, "H5R_BADTYPE"); break; case H5R_OBJECT: - fprintf(out, "H5R_OBJECT"); + HDfprintf(out, "H5R_OBJECT"); break; case H5R_DATASET_REGION: - fprintf(out, "H5R_DATASET_REGION"); + HDfprintf(out, "H5R_DATASET_REGION"); break; case H5R_MAXTYPE: - fprintf(out, "H5R_MAXTYPE"); + HDfprintf(out, "H5R_MAXTYPE"); break; default: - fprintf(out, "BADTYPE(%ld)", (long)reftype); + HDfprintf(out, "BADTYPE(%ld)", (long)reftype); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(S%c)", type[1]); + HDfprintf(out, "BADTYPE(S%c)", type[1]); goto error; } break; @@ -1857,32 +1857,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5S_class_t cls = (H5S_class_t)va_arg(ap, int); switch(cls) { case H5S_NO_CLASS: - fprintf(out, "H5S_NO_CLASS"); + HDfprintf(out, "H5S_NO_CLASS"); break; case H5S_SCALAR: - fprintf(out, "H5S_SCALAR"); + HDfprintf(out, "H5S_SCALAR"); break; case H5S_SIMPLE: - fprintf(out, "H5S_SIMPLE"); + HDfprintf(out, "H5S_SIMPLE"); break; case H5S_NULL: - fprintf(out, "H5S_NULL"); + HDfprintf(out, "H5S_NULL"); break; default: - fprintf(out, "%ld", (long)cls); + HDfprintf(out, "%ld", (long)cls); break; } /* end switch */ } /* end else */ @@ -1891,56 +1891,56 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5S_seloper_t so = (H5S_seloper_t)va_arg(ap, int); switch(so) { case H5S_SELECT_NOOP: - fprintf(out, "H5S_NOOP"); + HDfprintf(out, "H5S_NOOP"); break; case H5S_SELECT_SET: - fprintf(out, "H5S_SELECT_SET"); + HDfprintf(out, "H5S_SELECT_SET"); break; case H5S_SELECT_OR: - fprintf(out, "H5S_SELECT_OR"); + HDfprintf(out, "H5S_SELECT_OR"); break; case H5S_SELECT_AND: - fprintf(out, "H5S_SELECT_AND"); + HDfprintf(out, "H5S_SELECT_AND"); break; case H5S_SELECT_XOR: - fprintf(out, "H5S_SELECT_XOR"); + HDfprintf(out, "H5S_SELECT_XOR"); break; case H5S_SELECT_NOTB: - fprintf(out, "H5S_SELECT_NOTB"); + HDfprintf(out, "H5S_SELECT_NOTB"); break; case H5S_SELECT_NOTA: - fprintf(out, "H5S_SELECT_NOTA"); + HDfprintf(out, "H5S_SELECT_NOTA"); break; case H5S_SELECT_APPEND: - fprintf(out, "H5S_SELECT_APPEND"); + HDfprintf(out, "H5S_SELECT_APPEND"); break; case H5S_SELECT_PREPEND: - fprintf(out, "H5S_SELECT_PREPEND"); + HDfprintf(out, "H5S_SELECT_PREPEND"); break; case H5S_SELECT_INVALID: - fprintf(out, "H5S_SELECT_INVALID"); + HDfprintf(out, "H5S_SELECT_INVALID"); break; default: - fprintf(out, "%ld", (long)so); + HDfprintf(out, "%ld", (long)so); break; } /* end switch */ } /* end else */ @@ -1949,47 +1949,47 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5S_sel_type st = (H5S_sel_type)va_arg(ap, int); switch(st) { case H5S_SEL_ERROR: - fprintf(out, "H5S_SEL_ERROR"); + HDfprintf(out, "H5S_SEL_ERROR"); break; case H5S_SEL_NONE: - fprintf(out, "H5S_SEL_NONE"); + HDfprintf(out, "H5S_SEL_NONE"); break; case H5S_SEL_POINTS: - fprintf(out, "H5S_SEL_POINTS"); + HDfprintf(out, "H5S_SEL_POINTS"); break; case H5S_SEL_HYPERSLABS: - fprintf(out, "H5S_SEL_HYPERSLABS"); + HDfprintf(out, "H5S_SEL_HYPERSLABS"); break; case H5S_SEL_ALL: - fprintf(out, "H5S_SEL_ALL"); + HDfprintf(out, "H5S_SEL_ALL"); break; case H5S_SEL_N: - fprintf(out, "H5S_SEL_N"); + HDfprintf(out, "H5S_SEL_N"); break; default: - fprintf(out, "%ld", (long)st); + HDfprintf(out, "%ld", (long)st); break; } /* end switch */ } /* end else */ break; default: - fprintf(out, "BADTYPE(S%c)", type[1]); + HDfprintf(out, "BADTYPE(S%c)", type[1]); goto error; } /* end switch */ break; @@ -1997,14 +1997,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { const char *str = va_arg(ap, const char *); - fprintf(out, "\"%s\"", str); + HDfprintf(out, "\"%s\"", str); } /* end else */ break; @@ -2013,24 +2013,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_cset_t cset = (H5T_cset_t)va_arg(ap, int); switch(cset) { case H5T_CSET_ERROR: - fprintf(out, "H5T_CSET_ERROR"); + HDfprintf(out, "H5T_CSET_ERROR"); break; case H5T_CSET_ASCII: - fprintf(out, "H5T_CSET_ASCII"); + HDfprintf(out, "H5T_CSET_ASCII"); break; case H5T_CSET_UTF8: - fprintf(out, "H5T_CSET_UTF8"); + HDfprintf(out, "H5T_CSET_UTF8"); break; case H5T_CSET_RESERVED_2: @@ -2047,11 +2047,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5T_CSET_RESERVED_13: case H5T_CSET_RESERVED_14: case H5T_CSET_RESERVED_15: - fprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset); + HDfprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset); break; default: - fprintf(out, "%ld", (long)cset); + HDfprintf(out, "%ld", (long)cset); break; } /* end switch */ } /* end else */ @@ -2060,28 +2060,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_direction_t direct = (H5T_direction_t)va_arg(ap, int); switch(direct) { case H5T_DIR_DEFAULT: - fprintf(out, "H5T_DIR_DEFAULT"); + HDfprintf(out, "H5T_DIR_DEFAULT"); break; case H5T_DIR_ASCEND: - fprintf(out, "H5T_DIR_ASCEND"); + HDfprintf(out, "H5T_DIR_ASCEND"); break; case H5T_DIR_DESCEND: - fprintf(out, "H5T_DIR_DESCEND"); + HDfprintf(out, "H5T_DIR_DESCEND"); break; default: - fprintf(out, "%ld", (long)direct); + HDfprintf(out, "%ld", (long)direct); break; } /* end switch */ } /* end else */ @@ -2090,28 +2090,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_pers_t pers = (H5T_pers_t)va_arg(ap, int); switch(pers) { case H5T_PERS_DONTCARE: - fprintf(out, "H5T_PERS_DONTCARE"); + HDfprintf(out, "H5T_PERS_DONTCARE"); break; case H5T_PERS_SOFT: - fprintf(out, "H5T_PERS_SOFT"); + HDfprintf(out, "H5T_PERS_SOFT"); break; case H5T_PERS_HARD: - fprintf(out, "H5T_PERS_HARD"); + HDfprintf(out, "H5T_PERS_HARD"); break; default: - fprintf(out, "%ld", (long)pers); + HDfprintf(out, "%ld", (long)pers); break; } /* end switch */ } /* end else */ @@ -2120,32 +2120,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'n': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_norm_t norm = (H5T_norm_t)va_arg(ap, int); switch(norm) { case H5T_NORM_ERROR: - fprintf(out, "H5T_NORM_ERROR"); + HDfprintf(out, "H5T_NORM_ERROR"); break; case H5T_NORM_IMPLIED: - fprintf(out, "H5T_NORM_IMPLIED"); + HDfprintf(out, "H5T_NORM_IMPLIED"); break; case H5T_NORM_MSBSET: - fprintf(out, "H5T_NORM_MSBSET"); + HDfprintf(out, "H5T_NORM_MSBSET"); break; case H5T_NORM_NONE: - fprintf(out, "H5T_NORM_NONE"); + HDfprintf(out, "H5T_NORM_NONE"); break; default: - fprintf(out, "%ld", (long)norm); + HDfprintf(out, "%ld", (long)norm); break; } /* end switch */ } /* end else */ @@ -2154,40 +2154,40 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_order_t order = (H5T_order_t)va_arg(ap, int); switch(order) { case H5T_ORDER_ERROR: - fprintf(out, "H5T_ORDER_ERROR"); + HDfprintf(out, "H5T_ORDER_ERROR"); break; case H5T_ORDER_LE: - fprintf(out, "H5T_ORDER_LE"); + HDfprintf(out, "H5T_ORDER_LE"); break; case H5T_ORDER_BE: - fprintf(out, "H5T_ORDER_BE"); + HDfprintf(out, "H5T_ORDER_BE"); break; case H5T_ORDER_VAX: - fprintf(out, "H5T_ORDER_VAX"); + HDfprintf(out, "H5T_ORDER_VAX"); break; case H5T_ORDER_MIXED: - fprintf(out, "H5T_ORDER_MIXED"); + HDfprintf(out, "H5T_ORDER_MIXED"); break; case H5T_ORDER_NONE: - fprintf(out, "H5T_ORDER_NONE"); + HDfprintf(out, "H5T_ORDER_NONE"); break; default: - fprintf(out, "%ld", (long)order); + HDfprintf(out, "%ld", (long)order); break; } /* end switch */ } /* end else */ @@ -2196,36 +2196,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'p': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_pad_t pad = (H5T_pad_t)va_arg(ap, int); switch(pad) { case H5T_PAD_ERROR: - fprintf(out, "H5T_PAD_ERROR"); + HDfprintf(out, "H5T_PAD_ERROR"); break; case H5T_PAD_ZERO: - fprintf(out, "H5T_PAD_ZERO"); + HDfprintf(out, "H5T_PAD_ZERO"); break; case H5T_PAD_ONE: - fprintf(out, "H5T_PAD_ONE"); + HDfprintf(out, "H5T_PAD_ONE"); break; case H5T_PAD_BACKGROUND: - fprintf(out, "H5T_PAD_BACKGROUND"); + HDfprintf(out, "H5T_PAD_BACKGROUND"); break; case H5T_NPAD: - fprintf(out, "H5T_NPAD"); + HDfprintf(out, "H5T_NPAD"); break; default: - fprintf(out, "%ld", (long)pad); + HDfprintf(out, "%ld", (long)pad); break; } /* end switch */ } /* end else */ @@ -2234,32 +2234,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_sign_t sign = (H5T_sign_t)va_arg(ap, int); switch(sign) { case H5T_SGN_ERROR: - fprintf(out, "H5T_SGN_ERROR"); + HDfprintf(out, "H5T_SGN_ERROR"); break; case H5T_SGN_NONE: - fprintf(out, "H5T_SGN_NONE"); + HDfprintf(out, "H5T_SGN_NONE"); break; case H5T_SGN_2: - fprintf(out, "H5T_SGN_2"); + HDfprintf(out, "H5T_SGN_2"); break; case H5T_NSGN: - fprintf(out, "H5T_NSGN"); + HDfprintf(out, "H5T_NSGN"); break; default: - fprintf(out, "%ld", (long)sign); + HDfprintf(out, "%ld", (long)sign); break; } /* end switch */ } /* end else */ @@ -2268,68 +2268,68 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_class_t type_class = (H5T_class_t)va_arg(ap, int); switch(type_class) { case H5T_NO_CLASS: - fprintf(out, "H5T_NO_CLASS"); + HDfprintf(out, "H5T_NO_CLASS"); break; case H5T_INTEGER: - fprintf(out, "H5T_INTEGER"); + HDfprintf(out, "H5T_INTEGER"); break; case H5T_FLOAT: - fprintf(out, "H5T_FLOAT"); + HDfprintf(out, "H5T_FLOAT"); break; case H5T_TIME: - fprintf(out, "H5T_TIME"); + HDfprintf(out, "H5T_TIME"); break; case H5T_STRING: - fprintf(out, "H5T_STRING"); + HDfprintf(out, "H5T_STRING"); break; case H5T_BITFIELD: - fprintf(out, "H5T_BITFIELD"); + HDfprintf(out, "H5T_BITFIELD"); break; case H5T_OPAQUE: - fprintf(out, "H5T_OPAQUE"); + HDfprintf(out, "H5T_OPAQUE"); break; case H5T_COMPOUND: - fprintf(out, "H5T_COMPOUND"); + HDfprintf(out, "H5T_COMPOUND"); break; case H5T_REFERENCE: - fprintf(out, "H5T_REFERENCE"); + HDfprintf(out, "H5T_REFERENCE"); break; case H5T_ENUM: - fprintf(out, "H5T_ENUM"); + HDfprintf(out, "H5T_ENUM"); break; case H5T_VLEN: - fprintf(out, "H5T_VLEN"); + HDfprintf(out, "H5T_VLEN"); break; case H5T_ARRAY: - fprintf(out, "H5T_ARRAY"); + HDfprintf(out, "H5T_ARRAY"); break; case H5T_NCLASSES: - fprintf(out, "H5T_NCLASSES"); + HDfprintf(out, "H5T_NCLASSES"); break; default: - fprintf(out, "%ld", (long)type_class); + HDfprintf(out, "%ld", (long)type_class); break; } /* end switch */ } /* end else */ @@ -2338,28 +2338,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'z': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5T_str_t str = (H5T_str_t)va_arg(ap, int); switch(str) { case H5T_STR_ERROR: - fprintf(out, "H5T_STR_ERROR"); + HDfprintf(out, "H5T_STR_ERROR"); break; case H5T_STR_NULLTERM: - fprintf(out, "H5T_STR_NULLTERM"); + HDfprintf(out, "H5T_STR_NULLTERM"); break; case H5T_STR_NULLPAD: - fprintf(out, "H5T_STR_NULLPAD"); + HDfprintf(out, "H5T_STR_NULLPAD"); break; case H5T_STR_SPACEPAD: - fprintf(out, "H5T_STR_SPACEPAD"); + HDfprintf(out, "H5T_STR_SPACEPAD"); break; case H5T_STR_RESERVED_3: @@ -2375,18 +2375,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5T_STR_RESERVED_13: case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: - fprintf(out, "H5T_STR_RESERVED(%ld)",(long)str); + HDfprintf(out, "H5T_STR_RESERVED(%ld)",(long)str); break; default: - fprintf(out, "%ld", (long)str); + HDfprintf(out, "%ld", (long)str); break; } /* end switch */ } /* end else */ break; default: - fprintf (out, "BADTYPE(T%c)", type[1]); + HDfprintf (out, "BADTYPE(T%c)", type[1]); goto error; } /* end switch */ break; @@ -2394,19 +2394,19 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { htri_t tri_var = va_arg (ap, htri_t); if(tri_var>0) - fprintf (out, "TRUE"); + HDfprintf (out, "TRUE"); else if(!tri_var) - fprintf (out, "FALSE"); + HDfprintf (out, "FALSE"); else - fprintf(out, "FAIL(%d)", (int)tri_var); + HDfprintf(out, "FAIL(%d)", (int)tri_var); } /* end else */ break; @@ -2415,23 +2415,23 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned long *p = (unsigned long *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%lu", i?", ":"", p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { unsigned long iul = va_arg(ap, unsigned long); - fprintf(out, "%lu", iul); + HDfprintf(out, "%lu", iul); asize[argno] = (hssize_t)iul; } /* end else */ break; @@ -2439,29 +2439,29 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'L': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned long long *p = (unsigned long long *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%llu", i?", ":"", p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { unsigned long long iull = va_arg(ap, unsigned long long); - fprintf(out, "%llu", iull); + HDfprintf(out, "%llu", iull); asize[argno] = (hssize_t)iull; } /* end else */ break; default: - fprintf (out, "BADTYPE(U%c)", type[1]); + HDfprintf (out, "BADTYPE(U%c)", type[1]); goto error; } /* end switch */ break; @@ -2469,48 +2469,48 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'x': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { void **p = (void**)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) { if(p[i]) - fprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i])); + HDfprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i])); else - fprintf(out, "%sNULL", (i ? ", " : "")); + HDfprintf(out, "%sNULL", (i ? ", " : "")); } /* end for */ - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { vp = va_arg (ap, void *); if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end else */ break; case 'z': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { size_t *p = (size_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Zu", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { size_t size = va_arg(ap, size_t); @@ -2525,28 +2525,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)va_arg(ap, int); switch(scale_type) { case H5Z_SO_FLOAT_DSCALE: - fprintf(out, "H5Z_SO_FLOAT_DSCALE"); + HDfprintf(out, "H5Z_SO_FLOAT_DSCALE"); break; case H5Z_SO_FLOAT_ESCALE: - fprintf(out, "H5Z_SO_FLOAT_ESCALE"); + HDfprintf(out, "H5Z_SO_FLOAT_ESCALE"); break; case H5Z_SO_INT: - fprintf(out, "H5Z_SO_INT"); + HDfprintf(out, "H5Z_SO_INT"); break; default: - fprintf(out, "%ld", (long)scale_type); + HDfprintf(out, "%ld", (long)scale_type); break; } /* end switch */ } /* end else */ @@ -2555,68 +2555,68 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*); - fprintf(out, "0x%lx", (unsigned long)filter); + HDfprintf(out, "0x%lx", (unsigned long)filter); } /* end else */ break; case 'e': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_EDC_t edc = (H5Z_EDC_t)va_arg(ap, int); if(H5Z_DISABLE_EDC == edc) - fprintf(out, "H5Z_DISABLE_EDC"); + HDfprintf(out, "H5Z_DISABLE_EDC"); else if (H5Z_ENABLE_EDC == edc) - fprintf(out, "H5Z_ENABLE_EDC"); + HDfprintf(out, "H5Z_ENABLE_EDC"); else - fprintf(out, "%ld", (long)edc); + HDfprintf(out, "%ld", (long)edc); } /* end else */ break; case 'f': if(ptr) { if(vp) - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { H5Z_filter_t id = va_arg(ap, H5Z_filter_t); if(H5Z_FILTER_DEFLATE == id) - fprintf(out, "H5Z_FILTER_DEFLATE"); + HDfprintf(out, "H5Z_FILTER_DEFLATE"); else - fprintf(out, "%ld", (long)id); + HDfprintf(out, "%ld", (long)id); } /* end else */ break; case 's': if(ptr) { if(vp) { - fprintf(out, "0x%lx", (unsigned long)vp); + HDfprintf(out, "0x%lx", (unsigned long)vp); if(asize_idx >= 0 && asize[asize_idx] >= 0) { ssize_t *p = (ssize_t *)vp; - fprintf(out, " {"); + HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Zd", (i ? ", " : ""), p[i]); - fprintf(out, "}"); + HDfprintf(out, "}"); } /* end if */ } /* end if */ else - fprintf(out, "NULL"); + HDfprintf(out, "NULL"); } /* end if */ else { ssize_t ssize = va_arg(ap, ssize_t); @@ -2627,32 +2627,32 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - fprintf(out, "BADTYPE(Z%c)", type[1]); + HDfprintf(out, "BADTYPE(Z%c)", type[1]); goto error; } /* end switch */ break; default: if(HDisupper(type[0])) - fprintf(out, "BADTYPE(%c%c)", type[0], type[1]); + HDfprintf(out, "BADTYPE(%c%c)", type[0], type[1]); else - fprintf(out, "BADTYPE(%c)", type[0]); + HDfprintf(out, "BADTYPE(%c)", type[0]); goto error; } /* end switch */ } /* end for */ /* Display event time for return */ if(returning && H5_debug_g.ttimes) - fprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime), + HDfprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime), (event_time.etime - *returning)); error: va_end(ap); if(returning) - fprintf(out, ";\n"); + HDfprintf(out, ";\n"); else { last_call_depth = current_depth++; - fprintf (out, ")"); + HDfprintf (out, ")"); } /* end else */ HDfflush(out); diff --git a/test/testfiles/plist_files/dapl_32be b/test/testfiles/plist_files/dapl_32be index 4dedda2..8dcf239 100644 Binary files a/test/testfiles/plist_files/dapl_32be and b/test/testfiles/plist_files/dapl_32be differ diff --git a/test/testfiles/plist_files/dapl_32le b/test/testfiles/plist_files/dapl_32le index 4dedda2..8dcf239 100644 Binary files a/test/testfiles/plist_files/dapl_32le and b/test/testfiles/plist_files/dapl_32le differ diff --git a/test/testfiles/plist_files/dapl_64be b/test/testfiles/plist_files/dapl_64be index 4dedda2..8dcf239 100644 Binary files a/test/testfiles/plist_files/dapl_64be and b/test/testfiles/plist_files/dapl_64be differ diff --git a/test/testfiles/plist_files/dapl_64le b/test/testfiles/plist_files/dapl_64le index 4dedda2..8dcf239 100644 Binary files a/test/testfiles/plist_files/dapl_64le and b/test/testfiles/plist_files/dapl_64le differ diff --git a/test/testfiles/plist_files/def_dapl_32be b/test/testfiles/plist_files/def_dapl_32be index 3df7289..880eae5 100644 Binary files a/test/testfiles/plist_files/def_dapl_32be and b/test/testfiles/plist_files/def_dapl_32be differ diff --git a/test/testfiles/plist_files/def_dapl_32le b/test/testfiles/plist_files/def_dapl_32le index 3df7289..880eae5 100644 Binary files a/test/testfiles/plist_files/def_dapl_32le and b/test/testfiles/plist_files/def_dapl_32le differ diff --git a/test/testfiles/plist_files/def_dapl_64be b/test/testfiles/plist_files/def_dapl_64be index 3df7289..880eae5 100644 Binary files a/test/testfiles/plist_files/def_dapl_64be and b/test/testfiles/plist_files/def_dapl_64be differ diff --git a/test/testfiles/plist_files/def_dapl_64le b/test/testfiles/plist_files/def_dapl_64le index 3df7289..880eae5 100644 Binary files a/test/testfiles/plist_files/def_dapl_64le and b/test/testfiles/plist_files/def_dapl_64le differ diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be index 199f5c2..6e94011 100644 Binary files a/test/testfiles/plist_files/def_fapl_32be and b/test/testfiles/plist_files/def_fapl_32be differ diff --git a/test/testfiles/plist_files/def_fapl_32le b/test/testfiles/plist_files/def_fapl_32le index 199f5c2..6e94011 100644 Binary files a/test/testfiles/plist_files/def_fapl_32le and b/test/testfiles/plist_files/def_fapl_32le differ diff --git a/test/testfiles/plist_files/def_fapl_64be b/test/testfiles/plist_files/def_fapl_64be index 199f5c2..6e94011 100644 Binary files a/test/testfiles/plist_files/def_fapl_64be and b/test/testfiles/plist_files/def_fapl_64be differ diff --git a/test/testfiles/plist_files/def_fapl_64le b/test/testfiles/plist_files/def_fapl_64le index 199f5c2..6e94011 100644 Binary files a/test/testfiles/plist_files/def_fapl_64le and b/test/testfiles/plist_files/def_fapl_64le differ diff --git a/test/testfiles/plist_files/fapl_32be b/test/testfiles/plist_files/fapl_32be index 108d63f..237b291 100644 Binary files a/test/testfiles/plist_files/fapl_32be and b/test/testfiles/plist_files/fapl_32be differ diff --git a/test/testfiles/plist_files/fapl_32le b/test/testfiles/plist_files/fapl_32le index 108d63f..237b291 100644 Binary files a/test/testfiles/plist_files/fapl_32le and b/test/testfiles/plist_files/fapl_32le differ diff --git a/test/testfiles/plist_files/fapl_64be b/test/testfiles/plist_files/fapl_64be index 108d63f..237b291 100644 Binary files a/test/testfiles/plist_files/fapl_64be and b/test/testfiles/plist_files/fapl_64be differ diff --git a/test/testfiles/plist_files/fapl_64le b/test/testfiles/plist_files/fapl_64le index 108d63f..237b291 100644 Binary files a/test/testfiles/plist_files/fapl_64le and b/test/testfiles/plist_files/fapl_64le differ diff --git a/test/testfiles/plist_files/lapl_32be b/test/testfiles/plist_files/lapl_32be index 6423d30..9d81759 100644 Binary files a/test/testfiles/plist_files/lapl_32be and b/test/testfiles/plist_files/lapl_32be differ diff --git a/test/testfiles/plist_files/lapl_32le b/test/testfiles/plist_files/lapl_32le index 6423d30..9d81759 100644 Binary files a/test/testfiles/plist_files/lapl_32le and b/test/testfiles/plist_files/lapl_32le differ diff --git a/test/testfiles/plist_files/lapl_64be b/test/testfiles/plist_files/lapl_64be index 6423d30..9d81759 100644 Binary files a/test/testfiles/plist_files/lapl_64be and b/test/testfiles/plist_files/lapl_64be differ diff --git a/test/testfiles/plist_files/lapl_64le b/test/testfiles/plist_files/lapl_64le index 6423d30..9d81759 100644 Binary files a/test/testfiles/plist_files/lapl_64le and b/test/testfiles/plist_files/lapl_64le differ diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 6121f81..0fa268e 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -83,12 +83,12 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n"); - PRINTVALSTREAM(rawoutstream, " -E --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n"); - PRINTVALSTREAM(rawoutstream, " -j BOUND, --low=BOUND The low bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " --low=BOUND The low bound for library release versions to use when creating\n"); PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_EARLIEST)\n"); - PRINTVALSTREAM(rawoutstream, " -k BOUND, --high=BOUND The high bound for library release versions to use when creating\n"); + PRINTVALSTREAM(rawoutstream, " --high=BOUND The high bound for library release versions to use when creating\n"); PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_LATEST)\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); @@ -217,7 +217,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " Using latest file format with maximum compact group size of 10 and\n"); PRINTVALSTREAM(rawoutstream, " and minimum shared datatype size of 20\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "5) h5repack -j 0 -k 1 file1 file2\n"); + PRINTVALSTREAM(rawoutstream, "5) h5repack --low=0 --high=1 file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when\n"); PRINTVALSTREAM(rawoutstream, " creating the repacked file: file2\n"); diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 723711d..0eef0f5 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -6,12 +6,12 @@ usage: h5repack [OPTIONS] file1 file2 -v, --verbose Verbose mode, print object information -V, --version Print version number and exit -n, --native Use a native HDF5 type when repacking - -E --enable-error-stack Prints messages from the HDF5 error stack as they occur + --enable-error-stack Prints messages from the HDF5 error stack as they occur -L, --latest Use latest version of file format This option will take precedence over the -j and -k options - -j BOUND, --low=BOUND The low bound for library release versions to use when creating + --low=BOUND The low bound for library release versions to use when creating objects in the file (default is H5F_LIBVER_EARLIEST) - -k BOUND, --high=BOUND The high bound for library release versions to use when creating + --high=BOUND The high bound for library release versions to use when creating objects in the file (default is H5F_LIBVER_LATEST) -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format @@ -140,7 +140,7 @@ Examples of use: Using latest file format with maximum compact group size of 10 and and minimum shared datatype size of 20 -5) h5repack -j 0 -k 1 file1 file2 +5) h5repack --low=0 --high=1 file1 file2 Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when creating the repacked file: file2 -- cgit v0.12 From 74f74f60bb92cc614616d8ae3d91ecc2921aade1 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 7 Feb 2018 11:33:31 -0600 Subject: Cleaned up per comments in PR# 876 Platforms tested: Linux/64 (jelly) Darwin (osx1010test) --- test/gen_bounds.c | 528 +++++++++++++++++++++++++++--------------------------- 1 file changed, 262 insertions(+), 266 deletions(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 50b4acc..b3ef0e3 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -12,9 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Oct 24, 2017 - * - * Purpose: This program is run to generate HDF5 data files used to test + * Purpose: This program is to generate HDF5 data files used to test * version bounds. * * Description @@ -25,10 +23,11 @@ * - bounds_latest_latest.h5 * - bounds_v18_latest.h5 * - bounds_v18_v18.h5 - * + * These files are copied to 1.6 and 1.8 libraries for verifying + * that they can or cannot read particular file format. */ -#include "hdf5.h" +#include "h5test.h" /*********************************************************************** * gen_earliest_latest() creates file "bounds_earliest_latest.h5" @@ -38,118 +37,121 @@ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_E_L "bounds_earliest_latest.h5" + +/* File names for different file format */ +#define FILENAME_E_L "bounds_earliest_latest.h5" +#define FILENAME_E_18 "bounds_earliest_v18.h5" +#define FILENAME_L_L "bounds_latest_latest.h5" +#define FILENAME_18_L "bounds_v18_latest.h5" +#define FILENAME_18_18 "bounds_v18_v18.h5" /* 2-D dataset with fixed dimensions */ -#define RANK 2 -#define DIM1 100 -#define DIM2 200 -#define CHUNK_DIM1 50 -#define CHUNK_DIM2 50 +#define RANK 2 +#define DIM1 100 +#define DIM2 200 +#define CHK_DIM1 50 +#define CHK_DIM2 50 -int gen_earliest_latest() +static herr_t gen_earliest_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the earliest/latest version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_E_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; /* Close property list and dataset, will reuse dataspace */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) */ /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Disable partial chunk filters, triggers layout version 4 */ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) - goto error; + TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -159,8 +161,9 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_earliest_latest */ /*********************************************************************** @@ -170,83 +173,83 @@ error: * - Version 0 superblock (default) * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_E_18 "bounds_earliest_v18.h5" - -int gen_earliest_v18() +static herr_t gen_earliest_v18(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the earliest/v18 version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_E_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -256,8 +259,9 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_earliest_v18 */ /*********************************************************************** @@ -267,66 +271,69 @@ error: * - Version 3 superblock (H5Fcreate with H5F_ACC_SWMR_WRITE) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_L_L "bounds_latest_latest.h5" - -int gen_latest_latest() +static herr_t gen_latest_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ - if((fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT)) <0) - goto error; + fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT); + if (fid < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Disable partial chunk filters, triggers layout version 4 */ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) - goto error; + TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -334,8 +341,9 @@ error: H5Sclose(space); H5Pclose(dcpl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_latest_latest */ /*********************************************************************** @@ -345,83 +353,82 @@ error: * - Version 2 superblock * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_18_L "bounds_v18_latest.h5" - -int gen_v18_latest() +static herr_t gen_v18_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the v18/latest version of the format" bounds for creating objects in the file, also trigger version 2 superblock */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_18_L, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close property list and dataset, will reuse dataspace */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -431,8 +438,9 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_v18_latest */ /*********************************************************************** @@ -443,128 +451,120 @@ error: * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * Return: SUCCEED/FAIL + * ***********************************************************************/ -#define FILENAME_18_18 "bounds_v18_v18.h5" - -int gen_v18_v18() +static herr_t gen_v18_v18(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hsize_t dims[RANK] = {DIM1, DIM2}; - hsize_t chunk_dims[RANK] = {CHUNK_DIM1, CHUNK_DIM2}; - float buf[DIM1][DIM2]; /* Buffer for writing data */ - int i, j; + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + float *buf = NULL; /* Buffer for writing data */ + float *bufp = NULL; /* Pointer to data buffer */ + hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ + hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */ + int i, j; + herr_t ret = SUCCEED; /* Generic return value */ /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the v18 version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0) - goto error; + TEST_ERROR; /* Create file */ if((fid = H5Fcreate(FILENAME_18_18, H5F_ACC_TRUNC, fcpl, fapl)) <0) - goto error; + TEST_ERROR; /* Close file property lists */ - if(H5Pclose(fapl) < 0) - goto error; - if(H5Pclose(fcpl) < 0) - goto error; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Pclose(fcpl) < 0) TEST_ERROR; /* * Add a chunked dataset with layout version 3 (default) */ + buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + if (buf == NULL) TEST_ERROR; + /* Fill sample data */ + bufp = buf; for (i = 0; i < DIM1; i++) for (j = 0; j < DIM2; j++) - buf[i][j] = 100.0F; + *bufp = 100.0F; /* Create the dataspace */ - if((space = H5Screate_simple(RANK, dims, NULL)) < 0) - goto error; + if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; /* Close property list and dataset, will reuse dataspace */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; /* Close the file, then reopen it with the latest version */ - if(H5Fclose(fid) < 0) - goto error; + if(H5Fclose(fid) < 0) TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set the "use the v18/latest version of the format" bounds for creating a layout version 4 object in the file */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) - goto error; + TEST_ERROR; if((fid = H5Fopen(FILENAME_18_18, H5F_ACC_RDWR, fapl)) < 0) - goto error; + TEST_ERROR; /* * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) */ /* Create the dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set up for chunked data */ - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) - goto error; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR; /* Disable partial chunk filters */ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) - goto error; + TEST_ERROR; /* Create and write the dataset */ - if((dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR; + ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (ret < 0) TEST_ERROR; + + /* Release allocated buffer */ + HDfree(buf); + bufp = buf = NULL; /* Close everything */ - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Pclose(fapl) < 0) - goto error; - if(H5Dclose(dset) < 0) - goto error; - if(H5Sclose(space) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; - return 0; + if(H5Pclose(dcpl) < 0) TEST_ERROR; + if(H5Pclose(fapl) < 0) TEST_ERROR; + if(H5Dclose(dset) < 0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; + if(H5Fclose(fid) < 0) TEST_ERROR; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -574,35 +574,31 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); + HDfree(buf); } H5E_END_TRY; - return 1; + return FAIL; } /* gen_v18_v18 */ int main(void) { /* Generate file bounds_earliest_latest.h5 */ - if (gen_earliest_latest() < 0) - goto error; + if (gen_earliest_latest() < 0) TEST_ERROR; /* Generate file bounds_earliest_v18.h5 */ - if (gen_earliest_v18() < 0) - goto error; + if (gen_earliest_v18() < 0) TEST_ERROR; /* Generate file bounds_latest_latest.h5 */ - if (gen_latest_latest() < 0) - goto error; + if (gen_latest_latest() < 0) TEST_ERROR; /* Generate file bounds_v18_latest.h5 */ - if (gen_v18_latest() < 0) - goto error; + if (gen_v18_latest() < 0) TEST_ERROR; /* Generate file bounds_v18_v18.h5 */ - if (gen_v18_v18() < 0) - goto error; + if (gen_v18_v18() < 0) TEST_ERROR; - return 0; + return EXIT_SUCCESS; error: - return 1; + return EXIT_FAILURE; } -- cgit v0.12 From ae2577ff5e1b985a498bb57fc69ab7e85347ec7f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 8 Feb 2018 12:59:23 -0600 Subject: Added gen_bounds --- test/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index e6b364c..06bbd06 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1355,6 +1355,7 @@ if (HDF5_BUILD_GENERATORS) gen_bad_offset gen_bad_ohdr gen_bogus + gen_bounds gen_cross gen_deflate gen_filters -- cgit v0.12 From 83211cf8f6051be2ea8dfd84637c195b2b0213c1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 8 Feb 2018 15:45:57 -0600 Subject: HDFFV-10403 Fix soname setting --- config/cmake/HDF5Macros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index f08349e..c3dea9a 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -17,12 +17,12 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) if (ARGN) set (PACKAGE_SOVERSION ${ARGN}) else () - set (PACKAGE_SOVERSION ${HDF5_PACKAGE_SOVERSION}) + set (PACKAGE_SOVERSION ${H5_SOVERS_MAJOR}) endif () if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) else () - set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) + set (LIBHDF_VERSION ${HDF5_PACKAGE_SOVERSION}) endif () set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) if (WIN32) -- cgit v0.12 From 0a61befddc6f93cec1aa669e3c348e40e83ff0e7 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 13 Feb 2018 11:05:08 -0600 Subject: Additional tests Description: - Revised and add more variety to version bound tests per review - Revised gen_bounds.c per review Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test) --- test/dsets.c | 419 ++++++++++++++++++++++++++++++++++++++++++++++-------- test/objcopy.c | 199 ++++++++++++++++++++++++++ test/ohdr.c | 86 ++++++++--- test/set_extent.c | 31 +++- test/tfile.c | 130 +++++++++++++++++ test/th5o.c | 191 +++++++++++++------------ test/th5s.c | 149 +++++++++++++++++++ 7 files changed, 1026 insertions(+), 179 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 0fff2d1..09f553e 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -24,8 +24,31 @@ #define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#include "h5test.h" +#include "hdf5.h" +#include "testhdf5.h" #include "H5srcdir.h" + +#include "H5Bprivate.h" +#include "H5Iprivate.h" +#include "H5Pprivate.h" + +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_TESTING +#include "H5Fpkg.h" /* File access */ + +#define H5S_FRIEND /*suppress error about including H5Spkg */ +#include "H5Spkg.h" /* Dataspace */ + +#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#include "H5Tpkg.h" /* Datatype */ + +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Apkg.h" /* Attributes */ + +/* Use in version bound test */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Opkg.h" /* Object headers */ + #include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" @@ -60,8 +83,10 @@ const char *FILENAME[] = { "storage_size", /* 22 */ "dls_01_strings", /* 23 */ "power2up", /* 24 */ + "version_bounds", /* 25 */ NULL }; + #define FILENAME_BUF_SIZE 1024 #define KB 1024 @@ -722,10 +747,15 @@ static herr_t test_compact_io(hid_t fapl) { hid_t file, dataset, space, plist; + hid_t verfile = -1, new_fapl = -1; hsize_t dims[2]; int wbuf[16][8], rbuf[16][8]; char filename[FILENAME_BUF_SIZE]; + H5F_libver_t low, high; /* File format bounds */ + H5F_t *fp; /* Internal file pointer */ + H5D_t *dsetp; /* Internal dataset pointer */ int i, j, n; + herr_t ret; /* Generic return value */ TESTING("compact dataset I/O"); @@ -764,8 +794,6 @@ test_compact_io(hid_t fapl) if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR /* Close file */ - if(H5Sclose(space) < 0) TEST_ERROR - if(H5Pclose(plist) < 0) TEST_ERROR if(H5Dclose(dataset) < 0) TEST_ERROR if(H5Fclose(file) < 0) TEST_ERROR @@ -789,16 +817,110 @@ test_compact_io(hid_t fapl) printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); goto error; - } /* end if */ + } /* end */ if(H5Dclose(dataset) < 0) TEST_ERROR if(H5Fclose(file) < 0) TEST_ERROR - PASSED(); - return 0; + /************************************** + * Additional test for version bounds * + **************************************/ + + /* Create a copy of file access property list */ + if((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combinations. + - Create a file, create and write a compact dataset, and verify its data + - Verify the dataset's layout and fill message versions */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a file */ + h5_fixname(FILENAME[25], new_fapl, filename, sizeof filename); + if((verfile = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl)) < 0) + TEST_ERROR + + /* Create the compact dataset */ + dataset = H5Dcreate2(verfile, DSET_DEFAULT_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT); + if(dataset < 0) TEST_ERROR + + /* Write the same data as of DSET_COMPACT_IO_NAME */ + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) + TEST_ERROR + + /* Close DSET_DEFAULT_NAME, then reopen it to read and verify + the data */ + if(H5Dclose(dataset) < 0) TEST_ERROR + if((dataset = H5Dopen2(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) + TEST_ERROR + + /* Check that the values read are the same as the values written */ + for(i = 0; i < 16; i++) + for(j = 0; j < 8; j++) + if(rbuf[i][j] != wbuf[i][j]) { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %d,%d\n", i, j); + printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]); + printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]); + goto error; + } /* end */ + + /* Get the internal file pointer */ + if((fp = (H5F_t *)H5I_object(verfile)) == NULL) TEST_ERROR + + /* Get the internal dataset pointer */ + if((dsetp = (H5D_t *)H5I_object(dataset)) == NULL) TEST_ERROR + + /* Verify the dataset's layout and fill message versions */ + if(fp->shared->low_bound == H5F_LIBVER_EARLIEST) { + VERIFY(dsetp->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "layout_ver_bounds"); + VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "fill_ver_bounds"); + } else { + VERIFY(dsetp->shared->layout.version, H5O_layout_ver_bounds[fp->shared->low_bound], "layout_ver_bounds"); + VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[fp->shared->low_bound], "fill_ver_bounds"); + } + + /* Close the dataset and delete from the file */ + if(H5Dclose(dataset) < 0) TEST_ERROR + if(H5Ldelete(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT) < 0) + TEST_ERROR + + /* Close the file */ + if(H5Fclose(verfile) < 0) TEST_ERROR + + } /* end for high */ + } /* end for low */ + + if(H5Pclose(new_fapl) < 0) TEST_ERROR + if(H5Sclose(space) < 0) TEST_ERROR + if(H5Pclose(plist) < 0) TEST_ERROR + + PASSED(); + return 0; error: - return -1; + H5E_BEGIN_TRY { + H5Sclose(space); + H5Pclose(plist); + H5Pclose(new_fapl); + H5Dclose(dataset); + H5Fclose(file); + H5Fclose(verfile); + } H5E_END_TRY; + + return -1; } @@ -5045,16 +5167,16 @@ error: /*------------------------------------------------------------------------- * Function: test_multiopen * - * Purpose: Tests that a bug no longer exists. If a dataset is opened - * twice and one of the handles is used to extend the dataset, - * then the other handle should return the new size when - * queried. + * Purpose: Tests that a bug no longer exists. If a dataset is opened + * twice and one of the handles is used to extend the dataset, + * then the other handle should return the new size when + * queried. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -5062,10 +5184,10 @@ error: static herr_t test_multiopen (hid_t file) { - hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1; - hsize_t cur_size[1] = {10}; - static hsize_t max_size[1] = {H5S_UNLIMITED}; - hsize_t tmp_size[1]; + hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1; + hsize_t cur_size[1] = {10}; + hsize_t tmp_size[1]; + static hsize_t max_size[1] = {H5S_UNLIMITED}; TESTING("multi-open with extending"); @@ -5085,9 +5207,9 @@ test_multiopen (hid_t file) if((space = H5Dget_space(dset2)) < 0) goto error; if(H5Sget_simple_extent_dims(space, tmp_size, NULL) < 0) goto error; if(cur_size[0] != tmp_size[0]) { - H5_FAILED(); - printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]); - goto error; + H5_FAILED(); + printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]); + goto error; } /* end if */ if(H5Dclose(dset1) < 0) goto error; @@ -9790,6 +9912,7 @@ test_single_chunk(hid_t fapl) } /* end for */ #endif /* H5_HAVE_FILTER_DEFLATE */ + /* Release buffers */ HDfree(wbuf); HDfree(rbuf); @@ -10152,7 +10275,7 @@ error: /*------------------------------------------------------------------------- * Function: test_zero_dim_dset * - * Purpose: Tests support for reading a 1D chunled dataset with + * Purpose: Tests support for reading a 1D chunked dataset with * dimension size = 0. * * Return: Success: 0 @@ -10173,40 +10296,59 @@ test_zero_dim_dset(hid_t fapl) hid_t dsid = -1; /* Dataset ID */ hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ int data[1]; + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Generic return value */ - TESTING("shrinking large chunk"); + TESTING("chunked dataset with zero dimension"); - h5_fixname(FILENAME[16], fapl, filename, sizeof filename); + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combination, and verify support for reading a 1D + chunked dataset with dimension size = 0 */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - /* Create file */ - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR + /* Set version bounds before opening the file */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; - /* Create dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR + if (ret < 0) /* Invalid low/high combinations */ + continue; - /* Set 1 chunk size */ - chunk_dim = 1; - if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[16], fapl, filename, sizeof filename); - /* Create 1D dataspace with 0 dim size */ - dim = 0; - if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR + /* Create file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR - /* Create chunked dataset */ - if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + /* Create dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - /* write 0 elements from dataset */ - if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + /* Set 1 chunk size */ + chunk_dim = 1; + if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR - /* Read 0 elements from dataset */ - if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + /* Create 1D dataspace with 0 dim size */ + dim = 0; + if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR - /* Close everything */ - if(H5Sclose(sid) < 0) FAIL_STACK_ERROR - if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR - if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR - if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + /* Create chunked dataset */ + if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* write 0 elements from dataset */ + if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + + /* Read 0 elements from dataset */ + if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR + + /* Close everything */ + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + + } /* end for high */ + } /* end for low */ PASSED(); @@ -12728,34 +12870,186 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: test_versionbounds * - * Purpose: Tests the dataset interface (H5D) + * Purpose: Tests various format versions. + * (Currently, only virtual dataset feature) + * + * Return: Success: 0 + * Failure: -1 + * Description: + * This function attempts to create a virtual dataset in all + * valid combinations of low/high library format bounds. Creation + * of virtual dataset should only succeed in H5F_LIBVER_V110. + * -BMR, January 2018 + * + *------------------------------------------------------------------------- + */ +#define VDS_FNAME1 "virtual_file1" +#define VDS_FNAME2 "virtual_file2" +#define SRC_FNAME "source_file" +#define SRC_DSET "src_dset" +#define V_DSET "v_dset" +static herr_t +test_versionbounds() +{ + hid_t fapl = -1; + hid_t srcfile = -1; /* Files with source dsets */ + hid_t vfile = -1; /* File with virtual dset */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t srcspace = -1; /* Source dataspaces */ + hid_t vspace = -1; /* Virtual dset dataspaces */ + hid_t srcdset = -1; /* Source datset */ + hid_t vdset = -1; /* Virtual dataset */ + hid_t null_dspace = -1; /* Data space of H5S_NULL */ + hsize_t dims[1] = {3}; /* Data space current size */ + char srcfilename[FILENAME_BUF_SIZE]; + char vfilename1[FILENAME_BUF_SIZE]; + char vfilename2[FILENAME_BUF_SIZE]; + H5F_libver_t low, high; /* File format bounds */ + herr_t ret; /* Generic return value */ + + TESTING("version bounds of datasets"); + + /* Create a copy of file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR + + h5_fixname(VDS_FNAME1, fapl, vfilename1, sizeof vfilename1); + h5_fixname(VDS_FNAME2, fapl, vfilename2, sizeof vfilename2); + h5_fixname(SRC_FNAME, fapl, srcfilename, sizeof srcfilename); + + /* Create DCPL */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Clear virtual layout in DCPL */ + if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0) + TEST_ERROR + + /* Create source dataspace */ + if((srcspace = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Create virtual dataspace */ + if((vspace = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Add virtual layout mapping */ + if(H5Pset_virtual(dcpl, vspace, srcfilename, SRC_DSET, srcspace) < 0) + TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds */ + /* Create a source file and a dataset in it. Create a virtual file and + virtual dataset. Creation of virtual dataset should only succeed in + H5F_LIBVER_V110 */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds, skip for invalid low/high combination */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a source file and dataset */ + if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + if((srcdset = H5Dcreate2(srcfile, SRC_DSET, H5T_NATIVE_INT, srcspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Create a virtual file */ + if((vfile = H5Fcreate(vfilename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create the virtual dataset */ + H5E_BEGIN_TRY { + vdset = H5Dcreate2(vfile, V_DSET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } H5E_END_TRY; + + if (vdset > 0) /* dataset created successfully */ + { + /* Virtual dataset is only available starting in V110 */ + VERIFY(high, H5F_LIBVER_V110, "virtual dataset"); + + if(H5Dclose(vdset) < 0) TEST_ERROR + vdset = -1; + } + + /* Close virtual file */ + if(H5Fclose(vfile) < 0) TEST_ERROR + vfile = -1; + + /* Close srcdset and srcfile */ + if(H5Dclose(srcdset) < 0) TEST_ERROR + srcdset = -1; + + if(H5Fclose(srcfile) < 0) TEST_ERROR + srcfile = -1; + + } /* for high */ + } /* for low */ + + /* Close dataspaces and properties */ + if(H5Sclose(srcspace) < 0) + TEST_ERROR + srcspace = -1; + if(H5Sclose(vspace) < 0) + TEST_ERROR + vspace = -1; + if(H5Pclose(fapl) < 0) + TEST_ERROR + fapl = -1; + if(H5Pclose(dcpl) < 0) + TEST_ERROR + dcpl = -1; + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + H5Sclose(srcspace); + H5Sclose(vspace); + H5Pclose(dcpl); + H5Pclose(fapl); + H5Dclose(srcdset); + H5Dclose(vdset); + H5Fclose(srcfile); + H5Fclose(vfile); + } H5E_END_TRY; + return -1; +} /* test_versionbounds() */ + + +/*------------------------------------------------------------------------- + * Function: main * - * Return: Success: exit(EXIT_SUCCESS) + * Purpose: Tests the dataset interface (H5D) * - * Failure: exit(EXIT_FAILURE) + * Return: Success: exit(EXIT_SUCCESS) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ int main(void) { - char filename[FILENAME_BUF_SIZE]; - hid_t file, grp, fapl, fapl2; - hid_t fcpl = -1, fcpl2 = -1; + char filename[FILENAME_BUF_SIZE]; + hid_t file, grp, fapl, fapl2; + hid_t fcpl = -1, fcpl2 = -1; unsigned new_format; unsigned paged; - int mdc_nelmts; - size_t rdcc_nelmts; - size_t rdcc_nbytes; - double rdcc_w0; - int nerrors = 0; + int mdc_nelmts; + size_t rdcc_nelmts; + size_t rdcc_nbytes; + double rdcc_w0; + int nerrors = 0; const char *envval; - hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ + hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ /* Don't run this test using certain file drivers */ envval = HDgetenv("HDF5_DRIVER"); @@ -12924,6 +13218,9 @@ main(void) nerrors += (test_scatter_error() < 0 ? 1 : 0); nerrors += (test_gather_error() < 0 ? 1 : 0); + /* Tests version bounds using its own file */ + nerrors += (test_versionbounds() < 0 ? 1 : 0); + /* Run misc tests */ nerrors += dls_01_main(); diff --git a/test/objcopy.c b/test/objcopy.c index 216d111..c4bcbf3 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -18,9 +18,18 @@ * Purpose: Test H5Ocopy(). */ +#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" +#include "H5Bprivate.h" +#include "H5Iprivate.h" +#include "H5Pprivate.h" + +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_TESTING +#include "H5Fpkg.h" /* File access */ + /* * This file needs to access private information from the H5S package. * This file also needs to access the dataspace testing code. @@ -45,12 +54,22 @@ #define H5D_TESTING #include "H5Dpkg.h" /* Datasets */ +/* + * This file needs to access private information from the H5O package. + * This file also needs to access the dataspace testing code. + */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_TESTING +#include "H5Opkg.h" /* Object header */ + const char *FILENAME[] = { "objcopy_src", "objcopy_dst", "objcopy_ext", "objcopy_src2", + "verbound_src", + "verbound_dst", NULL }; @@ -127,6 +146,7 @@ const char *FILENAME[] = { #define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere" #define NAME_OLD_FORMAT "/dset1" +#define NAME_DSET_NULL "DSET_NULL" #define NAME_BUF_SIZE 1024 #define ATTR_NAME_LEN 80 @@ -2089,6 +2109,184 @@ error: /*------------------------------------------------------------------------- + * Function: test_copy_dataset_versionbounds + * + * Purpose: Verify copying dataset works as expected in various version + * bound combination. + * + * Description: + * Create a simple dataset in SRC file using default versions. + * For each valid version bound combination, create a DST file, + * and attempt to copy the SRC dataset to the DST file. + * When copying fails, verify that the failure is a result of + * the invalid bounds, that is, DST has lower bounds than SRC. + * + * Return: Success: 0 + * Failure: 1 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) +{ + hid_t fid_src = -1, fid_dst = -1; /* Source and destination file IDs */ + hid_t fapl_dst = -1; /* File access plist for dest file */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did_src = -1, did_dst = -1; /* Source and destination dataset IDs */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + char src_fname[NAME_BUF_SIZE]; /* Name of source file */ + char dst_fname[NAME_BUF_SIZE]; /* Name of destination file */ + H5F_libver_t low, high; /* File format bounds */ + H5F_libver_t low_src, high_src; /* Source file format bounds */ + unsigned srcdset_fillversion; /* Fill version of source dataset */ + hbool_t valid_high = FALSE; /* TRUE if high bound is valid */ + int i, j; /* Local index variables */ + H5D_t *dsetp = NULL; /* Pointer to internal dset structure */ + herr_t ret; /* Generic return value */ + + TESTING("H5Ocopy(): simple dataset with version bounds"); + + /* Initialize write buffer */ + for (i=0; ishared->dcpl_cache.fill.version; + + /* Close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did_src) < 0) TEST_ERROR + + /* Close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* Open the source file with read-only */ + fid_src = H5Fopen(src_fname, H5F_ACC_RDONLY, fapl_src); + if (fid_src < 0) TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combinations. Create a destination file and copy the + source dataset to it, then verify */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl_dst, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create destination file */ + fid_dst = H5Fcreate(dst_fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_dst); + if (fid_dst < 0) TEST_ERROR + + /* Create an uncopied object in destination file so that addresses + in source and destination files aren't the same */ + if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Try to copy the dataset */ + H5E_BEGIN_TRY { + ret = H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT); + } H5E_END_TRY; + + /* If copy failed, check if the failure is expected */ + if (ret < 0) + { + /* Failure is valid if fill version of source dataset is + greater than destination */ + if (srcdset_fillversion <= H5O_fill_ver_bounds[high]) + TEST_ERROR + + /* Close the DST file before continue */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + continue; + } + + /* Close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* Open destination file */ + fid_dst = H5Fopen(dst_fname, H5F_ACC_RDWR, fapl_dst); + if (fid_dst < 0) TEST_ERROR + + /* Open the datasets to compare */ + did_src = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT); + if (did_src < 0) TEST_ERROR + did_dst = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT); + if (did_dst < 0) TEST_ERROR + + /* Check if the datasets are equal */ + if (compare_datasets(did_src, did_dst, H5P_DEFAULT, buf) != TRUE) + TEST_ERROR + + /* Close the datasets */ + if(H5Dclose(did_dst) < 0) TEST_ERROR + if(H5Dclose(did_src) < 0) TEST_ERROR + + /* Close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + } /* for high */ + } /* for low */ + + /* Close property list and source file */ + if (H5Pclose(fapl_dst) < 0) TEST_ERROR + if (H5Fclose(fid_src) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(did_dst); + H5Dclose(did_src); + H5Sclose(sid); + H5Pclose(fapl_dst); + H5Fclose(fid_dst); + H5Fclose(fid_src); + } H5E_END_TRY; + + return 1; +} /* end test_copy_dataset_versionbounds */ + + +/*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_samefile * * Purpose: Create a simple dataset in SRC file and copy it to SRC file @@ -14017,6 +14215,7 @@ main(void) /* The tests... */ nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_versionbounds(fcpl_src, src_fapl); nerrors += test_copy_dataset_simple_samefile(fcpl_src, src_fapl); /* Test with dataset opened in the file or not */ diff --git a/test/ohdr.c b/test/ohdr.c index 3915b38..43346a5 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -738,6 +738,42 @@ error: return FAIL; } /* test_unknown() */ +#define STR_EARLIEST "earliest" +#define STR_V18 "v18" +#define STR_LATEST "latest" +char *version_string(H5F_libver_t libver) +{ + char *str = NULL; + + str = (char *) malloc(20 * sizeof(char)); + if (str == NULL) + { + fprintf(stderr, "Allocation failed\n"); + exit(1); + } + + switch(libver) { + case H5F_LIBVER_EARLIEST: + strcpy(str, STR_EARLIEST); + break; + + case H5F_LIBVER_V18: + strcpy(str, STR_V18); + break; + + case H5F_LIBVER_V110: + HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); + strcpy(str, STR_LATEST); + break; + + case H5F_LIBVER_ERROR: + case H5F_LIBVER_NBOUNDS: + default: + sprintf(str, "%ld", (long)libver); + break; + } /* end switch */ +} /* end of version_string */ + /*------------------------------------------------------------------------- * Function: main @@ -755,32 +791,40 @@ error: int main(void) { - hid_t fapl = -1, file = -1; - H5F_t *f = NULL; - char filename[1024]; - H5O_hdr_info_t hdr_info; /* Object info */ - H5O_loc_t oh_loc; /* Object header locations */ - time_t time_new, ro; - int i; /* Local index variable */ - unsigned b; /* Index for "new format" loop */ - herr_t ret; /* Generic return value */ + hid_t fapl = -1; + hid_t file = -1; + H5F_t *f = NULL; + char filename[1024]; + H5O_hdr_info_t hdr_info; /* Object info */ + H5O_loc_t oh_loc; /* Object header locations */ + H5F_libver_t low, high; /* File format bounds */ + time_t time_new, ro; + unsigned b; /* Index for "new format" loop */ + char msg[80]; /* Message for file format version */ + int i; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Reset library */ h5_reset(); fapl = h5_fileaccess(); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - /* Loop over old & new formats */ - for(b = FALSE; b <= TRUE; b++) { - /* Display info about testing */ - if(b) - HDputs("Using new file format:"); - else - HDputs("Using default file format:"); + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - /* Set the format to use for the file */ - if(H5Pset_libver_bounds(fapl, (b ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST) < 0) - FAIL_STACK_ERROR + /* Set version bounds before opening the file */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Display info about testing */ + sprintf(msg, "Using file format version: (%s, %s)", version_string(low), + version_string(high)); + HDputs(msg); /* test on object continuation block */ if(test_cont(filename, fapl) < 0) @@ -977,7 +1021,9 @@ main(void) /* Test object header creation metadata cache issues */ if(test_ohdr_cache(filename, fapl) < 0) TEST_ERROR - } /* end for */ + + } /* high */ + } /* low */ /* Verify symbol table messages are cached */ if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR diff --git a/test/set_extent.c b/test/set_extent.c index b9536e5..0467073 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -427,14 +427,35 @@ error: */ static int do_layouts( hid_t fapl ) { + H5F_libver_t low, high; /* Low and high bounds */ + herr_t ret; /* Generic return value */ - TESTING("storage layout use"); + TESTING("storage layout use - tested with all low/high library format bounds"); + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - if (test_layouts( H5D_COMPACT, fapl ) < 0) - goto error; + hid_t new_fapl; - if (test_layouts( H5D_CONTIGUOUS, fapl ) < 0) - goto error; + /* Copy plist to use locally to avoid modifying the original */ + new_fapl = H5Pcopy(fapl); + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(new_fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + if (test_layouts( H5D_COMPACT, new_fapl ) < 0) + goto error; + + if (test_layouts( H5D_CONTIGUOUS, new_fapl ) < 0) + goto error; + + } /* end for high */ + } /* end for low */ PASSED(); diff --git a/test/tfile.c b/test/tfile.c index 03a5233..8b66603 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4953,6 +4953,134 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_real() */ + +/*------------------------------------------------------------------------- + * Function: test_libver_bounds_open + * + * Purpose: Tests opening latest file with various low/high bounds. + * + * Return: Success: 0 + * Failure: number of errors + * + *------------------------------------------------------------------------- + */ +#define VERBFNAME "tverbounds_dspace.h5" +#define VERBDSNAME "dataset 1" +#define SPACE1_DIM1 3 +static int +test_libver_bounds_open(void) +{ + hid_t file = -1; /* File ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t new_fapl = -1;/* File access property list ID for reopened file */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hsize_t dim[1] = {SPACE1_DIM1}; /* Dataset dimensions */ + H5F_libver_t low, high; /* File format bounds */ + hsize_t chunk_dim[1] = {SPACE1_DIM1}; /* Chunk dimensions */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Opening File in Various Version Bounds\n")); + + /* Create a file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Create dataspace */ + space = H5Screate_simple(1, dim, NULL); + CHECK(space, FAIL, "H5Screate_simple"); + + /* Create a dataset creation property list */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + + /* Create and set chunk plist */ + ret = H5Pset_chunk(dcpl, 1, chunk_dim); + CHECK(ret, FAIL, "H5Pset_chunk"); + ret = H5Pset_deflate(dcpl, 9); + CHECK(ret, FAIL, "H5Pset_deflate"); + ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS); + CHECK(ret, FAIL, "H5Pset_chunk_opts"); + + /* Create a file with (LATEST, LATEST) bounds, create a layout version 4 + dataset, then close the file */ + + /* Set version bounds to (LATEST, LATEST) */ + low = H5F_LIBVER_LATEST; + high = H5F_LIBVER_LATEST; + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Create the file */ + file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(file, FAIL, "H5Fcreate"); + + /* Create dataset */ + dset = H5Dcreate2(file, VERBDSNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); + + /* Close dataset and file */ + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); + + /* Attempt to open latest file with (earliest, v18), should fail */ + ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18); + H5E_BEGIN_TRY { + file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); + } H5E_END_TRY; + VERIFY(file, FAIL, "Attempted to open latest file with earliest version"); + + /* Attempt to open latest file with (v18, v18), should fail */ + ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18); + H5E_BEGIN_TRY { + file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); + } H5E_END_TRY; + VERIFY(file, FAIL, "Attempted to open latest file with v18 bounds"); + + /* Opening VERBFNAME in these combination should succeed. + For each low bound, verify that it is upgraded properly */ + high = H5F_LIBVER_LATEST; + for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) + { + H5F_libver_t new_low = H5F_LIBVER_EARLIEST; + + /* Set version bounds for opening file */ + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Open the file */ + file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); + CHECK(file, FAIL, "H5Fopen"); + + /* Get the new file access property */ + new_fapl = H5Fget_access_plist(file); + CHECK(new_fapl, FAIL, "H5Fget_access_plist"); + + /* Get new low bound and verify that it has been upgraded properly */ + ret = H5Pget_libver_bounds(new_fapl, &new_low, NULL); + CHECK(ret, FAIL, "H5Pget_libver_bounds"); + VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST"); + + ret = H5Pclose(new_fapl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); + } /* for low */ + + /* Close dataspace and property lists */ + ret = H5Sclose(space); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); +} /* end test_libver_bounds_open() */ + + /**************************************************************** ** ** test_libver_bounds(): @@ -4970,6 +5098,7 @@ test_libver_bounds(void) /* Run the tests */ test_libver_bounds_real(H5F_LIBVER_EARLIEST, 1, H5F_LIBVER_LATEST, 2); test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2); + test_libver_bounds_open(); } /* end test_libver_bounds() */ /************************************************************************************** @@ -6249,6 +6378,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: * --the library will only use basic version */ + if(dtype->shared->type == H5T_COMPOUND || dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { diff --git a/test/th5o.c b/test/th5o.c index 144ea4c..00d706c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -774,7 +774,7 @@ test_h5o_link(void) hid_t lcpl_id=-1; hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2}; htri_t committed; /* Whether the named datatype is committed */ - unsigned new_format; /* Whether to use the new format or not */ + H5F_libver_t low, high; /* File format bounds */ int *wdata; int *rdata; int i, n; @@ -801,98 +801,103 @@ test_h5o_link(void) ret = H5Pset_create_intermediate_group(lcpl_id, TRUE); CHECK(ret, FAIL, "H5Pset_create_intermediate_group"); - /* Loop over using new group format */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { - - /* Make a FAPL that uses the "use the latest version of the format" bounds */ - fapl_id = H5Pcreate(H5P_FILE_ACCESS); - CHECK(fapl_id, FAIL, "H5Pcreate"); - - /* Set the "use the latest version of the format" bounds for creating objects in the file */ - ret = H5Pset_libver_bounds(fapl_id, (new_format ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST); - CHECK(ret, FAIL, "H5Pset_libver_bounds"); - - /* Create a new HDF5 file */ - file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); - CHECK(file_id, FAIL, "H5Fcreate"); - - /* Close the FAPL */ - ret = H5Pclose(fapl_id); - CHECK(ret, FAIL, "H5Pclose"); - - - /* Create and commit a datatype with no name */ - type_id = H5Tcopy(H5T_NATIVE_INT); - CHECK(type_id, FAIL, "H5Fcreate"); - ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Tcommit_anon"); - committed = H5Tcommitted(type_id); - VERIFY(committed, TRUE, "H5Tcommitted"); - - /* Create a dataset with no name using the committed datatype*/ - dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate_anon"); - - /* Verify that we can write to and read from the dataset */ - - /* Write the data to the dataset */ - ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - CHECK(ret, FAIL, "H5Dwrite"); - - /* Read the data back */ - ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); - CHECK(ret, FAIL, "H5Dread"); - - /* Verify the data */ - for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) - VERIFY(wdata[i], rdata[i], "H5Dread"); - - /* Create a group with no name*/ - group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); - CHECK(group_id, FAIL, "H5Gcreate_anon"); - - /* Link nameless datatype into nameless group */ - ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Olink"); - - /* Link nameless dataset into nameless group with intermediate group */ - ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Olink"); - - /* Close IDs for dataset and datatype */ - ret = H5Dclose(dset_id); - CHECK(ret, FAIL, "H5Dclose"); - ret = H5Tclose(type_id); - CHECK(ret, FAIL, "H5Tclose"); - - /* Re-open datatype using new link */ - type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT); - CHECK(type_id, FAIL, "H5Topen2"); - - /* Link nameless group to root group and close the group ID*/ - ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Olink"); - ret = H5Gclose(group_id); - CHECK(ret, FAIL, "H5Gclose"); - - /* Open dataset through root group and verify its data */ - dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dopen2"); - - /* Read data from dataset */ - ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); - CHECK(ret, FAIL, "H5Dread"); - for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) - VERIFY(wdata[i], rdata[i], "H5Dread"); - - /* Close open IDs */ - ret = H5Dclose(dset_id); - CHECK(ret, FAIL, "H5Dclose"); - ret = H5Tclose(type_id); - CHECK(ret, FAIL, "H5Tclose"); - ret = H5Fclose(file_id); - CHECK(ret, FAIL, "H5Fclose"); - } /* end for */ + /* Create a file access property list */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl_id, FAIL, "H5Pcreate"); + + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl_id, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a new HDF5 file */ + file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); + CHECK(file_id, FAIL, "H5Fcreate"); + + /* Close the FAPL */ + ret = H5Pclose(fapl_id); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create and commit a datatype with no name */ + type_id = H5Tcopy(H5T_NATIVE_INT); + CHECK(type_id, FAIL, "H5Fcreate"); + ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit_anon"); + committed = H5Tcommitted(type_id); + VERIFY(committed, TRUE, "H5Tcommitted"); + + /* Create a dataset with no name using the committed datatype*/ + dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate_anon"); + + /* Verify that we can write to and read from the dataset */ + + /* Write the data to the dataset */ + ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Read the data back */ + ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + CHECK(ret, FAIL, "H5Dread"); + + /* Verify the data */ + for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) + VERIFY(wdata[i], rdata[i], "H5Dread"); + + /* Create a group with no name*/ + group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); + CHECK(group_id, FAIL, "H5Gcreate_anon"); + + /* Link nameless datatype into nameless group */ + ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Olink"); + + /* Link nameless dataset into nameless group with intermediate group */ + ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Olink"); + + /* Close IDs for dataset and datatype */ + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Tclose(type_id); + CHECK(ret, FAIL, "H5Tclose"); + + /* Re-open datatype using new link */ + type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT); + CHECK(type_id, FAIL, "H5Topen2"); + + /* Link nameless group to root group and close the group ID*/ + ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Olink"); + ret = H5Gclose(group_id); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open dataset through root group and verify its data */ + dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dopen2"); + + /* Read data from dataset */ + ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + CHECK(ret, FAIL, "H5Dread"); + for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) + VERIFY(wdata[i], rdata[i], "H5Dread"); + + /* Close open IDs */ + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Tclose(type_id); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); + } /* for high */ + } /* for low */ /* Close remaining IDs */ ret = H5Sclose(space_id); diff --git a/test/th5s.c b/test/th5s.c index c63320a..81ac2ac 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -19,9 +19,29 @@ * *************************************************************/ +#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" +#include "H5Bprivate.h" +#include "H5Iprivate.h" +#include "H5Pprivate.h" + +/* + * This file needs to access private information from the H5S package. + * This file also needs to access the dataspace testing code. + */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ +#include "H5Spkg.h" /* Dataspaces */ + +/* + * This file needs to access private information from the H5O package. + * This file also needs to access the dataspace testing code. + */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_TESTING +#include "H5Opkg.h" /* Object header */ + #include "H5private.h" #include "H5Bprivate.h" #include "H5Sprivate.h" @@ -2364,6 +2384,133 @@ test_h5s_bug1(void) CHECK(ret, FAIL, "H5Sclose"); } /* test_h5s_bug1() */ + +/*------------------------------------------------------------------------- + * Function: test_versionbounds + * + * Purpose: Tests version bounds with dataspace. + * + * Description: + * This function creates a file with lower bounds then later + * reopens it with higher bounds to show that the dataspace + * version is upgraded appropriately. + * + * Return: Success: 0 + * Failure: number of errors + * + *------------------------------------------------------------------------- + */ +#define VERBFNAME "tverbounds_dspace.h5" +#define BASIC_DSET "Basic Dataset" +#define LATEST_DSET "Latest Dataset" +static void +test_versionbounds(void) +{ + hid_t file = -1; /* File ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fapl = -1; /* File access property list ID */ + hid_t dset_space = -1; /* Retrieved dataset's dataspace ID */ + hsize_t dim[1]; /* Dataset dimensions */ + H5F_libver_t low, high; /* File format bounds */ + H5S_t *spacep = NULL; /* Pointer to internal dataspace */ + herr_t ret = 0; /* Generic return value */ +hid_t sid = -1; +H5S_t *spaceptr = NULL; + + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Version Bounds\n")); + + /* Create a file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Create dataspace */ + dim[0] = 10; + space = H5Screate_simple(1, dim, NULL); + CHECK(space, FAIL, "H5Screate"); + + /* Its version should be H5O_SDSPACE_VERSION_1 */ + spacep = (H5S_t *)H5I_object(space); + CHECK(spacep, NULL, "H5I_object"); + VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound"); + + /* Set high bound to V18 */ + low = H5F_LIBVER_EARLIEST; + high = H5F_LIBVER_V18; + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Create the file */ + file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(file, FAIL, "H5Fcreate"); + + /* Create a basic dataset */ + dset = H5Dcreate2(file, BASIC_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (dset > 0) /* dataset created successfully */ + { + /* Get the internal dataspace pointer */ + dset_space = H5Dget_space(dset); + CHECK(dset_space, FAIL, "H5Dget_space"); + spacep = (H5S_t *)H5I_object(dset_space); + CHECK(spacep, NULL, "H5I_object"); + + /* Dataspace version should remain as H5O_SDSPACE_VERSION_1 */ + VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound"); + + /* Close dataspace */ + ret = H5Sclose(dset_space); + CHECK(ret, FAIL, "H5Sclose"); + } + + /* Close basic dataset and the file */ + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); + + /* Set low and high bounds to latest to trigger the increment of the + dataspace version */ + low = H5F_LIBVER_LATEST; + high = H5F_LIBVER_LATEST; + ret = H5Pset_libver_bounds(fapl, low, high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Reopen the file with new version bounds, LATEST/LATEST */ + file = H5Fopen(VERBFNAME, H5F_ACC_RDWR, fapl); + + /* Create another dataset using the same dspace as the previous dataset */ + dset = H5Dcreate2(file, LATEST_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); + + /* Dataset created successfully. Verify that dataspace version has been + upgraded per the low bound */ + + /* Get the internal dataspace pointer */ + dset_space = H5Dget_space(dset); + CHECK(dset_space, FAIL, "H5Dget_space"); + spacep = (H5S_t *)H5I_object(dset_space); + CHECK(spacep, NULL, "H5I_object"); + + /* Verify the dataspace version */ + VERIFY(spacep->extent.version, H5O_sdspace_ver_bounds[low], "upgraded dataspace version"); + + /* Close everything */ + ret = H5Sclose(dset_space); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + + ret = H5Sclose(space); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); +} /* end test_versionbounds() */ + + /**************************************************************** ** ** test_h5s(): Main H5S (dataspace) testing routine. @@ -2391,6 +2538,7 @@ test_h5s(void) test_h5s_extent_equal(); /* Test extent comparison code */ test_h5s_extent_copy(); /* Test extent copy code */ test_h5s_bug1(); /* Test bug in offset initialization */ + test_versionbounds(); /* Test version bounds with dataspace */ } /* test_h5s() */ @@ -2415,4 +2563,5 @@ cleanup_h5s(void) remove(NULLFILE); remove(BASICFILE); remove(ZEROFILE); + remove(VERBFNAME); } -- cgit v0.12 From 551e58e683e76af4aca68998aa718e7e03d8f4f1 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 13 Feb 2018 12:29:51 -0600 Subject: Fixed typos Platforms tested: Linux/32 (jam) --- test/th5s.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/th5s.c b/test/th5s.c index 81ac2ac..4154c5f 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -2400,7 +2400,7 @@ test_h5s_bug1(void) * *------------------------------------------------------------------------- */ -#define VERBFNAME "tverbounds_dspace.h5" +#define VERBFNAME "tverbounds_dspace.h5" #define BASIC_DSET "Basic Dataset" #define LATEST_DSET "Latest Dataset" static void @@ -2415,9 +2415,6 @@ test_versionbounds(void) H5F_libver_t low, high; /* File format bounds */ H5S_t *spacep = NULL; /* Pointer to internal dataspace */ herr_t ret = 0; /* Generic return value */ -hid_t sid = -1; -H5S_t *spaceptr = NULL; - /* Output message about test being performed */ MESSAGE(5, ("Testing Version Bounds\n")); -- cgit v0.12 From 9a480c34e5ea3df0c1f12df465fc96e5d9e092af Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 13 Feb 2018 15:24:41 -0600 Subject: Added comment for clarification about latest as 1.10. Platforms tested: Linux/64 (jelly) Linux/32 (jam) --- test/gen_bounds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index b3ef0e3..9702176 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -268,9 +268,11 @@ error: * gen_latest_latest() creates file "bounds_latest_latest.h5" * * File contents: - * - Version 3 superblock (H5Fcreate with H5F_ACC_SWMR_WRITE) + * - Version 3 superblock (triggered by H5Fcreate with H5F_ACC_SWMR_WRITE) * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) * + * NOTE: As of Feb 2018, latest is 1.10. + * * Return: SUCCEED/FAIL * ***********************************************************************/ -- cgit v0.12 From 300b219d43b434631d334004ecc1e84be1c51d74 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 14 Feb 2018 09:40:39 -0600 Subject: Fixed DT failure Description: Added a missing return statement to a non-void function. Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test) --- test/ohdr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/ohdr.c b/test/ohdr.c index 43346a5..e886bf9 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -745,7 +745,7 @@ char *version_string(H5F_libver_t libver) { char *str = NULL; - str = (char *) malloc(20 * sizeof(char)); + str = (char *) HDmalloc(20); if (str == NULL) { fprintf(stderr, "Allocation failed\n"); @@ -772,6 +772,9 @@ char *version_string(H5F_libver_t libver) sprintf(str, "%ld", (long)libver); break; } /* end switch */ + + /* Return the formed version bound string */ + return(str); } /* end of version_string */ @@ -780,12 +783,16 @@ char *version_string(H5F_libver_t libver) * * Purpose: Exercise private object header behavior and routines * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * * Programmer: Robb Matzke * Tuesday, November 24, 1998 * + * Modification: + * - Added loop of combinations of low/high library format bounds + * (BMR, Feb 2018) + * *------------------------------------------------------------------------- */ int -- cgit v0.12 From 205d33f332bc6974b7698160ac6d399a36c93fcf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Feb 2018 10:08:09 -0600 Subject: Cleanup overuse of include files --- test/chunk_info.c | 1 - test/dangle.c | 103 +- test/gen_cross.c | 45 +- test/gheap.c | 396 +++--- test/h5test.h | 5 + test/hyperslab.c | 412 +++---- test/istore.c | 500 ++++---- test/swmr.c | 1 - test/tattr.c | 96 +- test/testhdf5.h | 27 +- test/th5s.c | 272 ++-- test/ttsafe.h | 3 - testpar/t_cache.c | 2745 ++++++++++++++++++++--------------------- testpar/t_cache_image.c | 679 +++++----- testpar/t_pflush1.c | 113 +- testpar/t_pread.c | 73 +- testpar/t_shapesame.c | 1706 +++++++++++++------------ testpar/t_span_tree.c | 704 ++++++----- tools/test/perform/pio_perf.h | 25 +- tools/test/perform/sio_perf.h | 1 - 20 files changed, 3939 insertions(+), 3968 deletions(-) diff --git a/test/chunk_info.c b/test/chunk_info.c index 1f19963..e3006cc 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -21,7 +21,6 @@ */ -#include "hdf5.h" #include "h5test.h" #define PRINT_DATA diff --git a/test/dangle.c b/test/dangle.c index 1717d12..75e9c84 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -15,10 +15,9 @@ * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * - * Purpose: Test dangling IDs + * Purpose: Test dangling IDs */ #include "h5test.h" -#include "H5private.h" const char *FILENAME[] = { "dangle", @@ -32,17 +31,17 @@ const char *FILENAME[] = { #define TYPENAME "Type" #define ATTRNAME "Attribute" - + /*------------------------------------------------------------------------- - * Function: test_dangle_dataset + * Function: test_dangle_dataset * - * Purpose: Check for dangling dataset IDs causing problems on library + * Purpose: Check for dangling dataset IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -52,7 +51,7 @@ const char *FILENAME[] = { static int test_dangle_dataset(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t dsid; /* Dataset ID */ @@ -128,17 +127,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_group + * Function: test_dangle_group * - * Purpose: Check for dangling group IDs causing problems on library + * Purpose: Check for dangling group IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -148,7 +147,7 @@ error: static int test_dangle_group(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t gid; /* Group ID */ @@ -219,17 +218,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_datatype1 + * Function: test_dangle_datatype1 * - * Purpose: Check for dangling datatype IDs causing problems on library + * Purpose: Check for dangling datatype IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -239,7 +238,7 @@ error: static int test_dangle_datatype1(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t tid; /* Datatype ID */ @@ -315,17 +314,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_datatype2 + * Function: test_dangle_datatype2 * - * Purpose: Check for dangling datatype IDs causing problems on library + * Purpose: Check for dangling datatype IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 25, 2005 * * Modifications: @@ -335,7 +334,7 @@ error: static int test_dangle_datatype2(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t did; /* Dataset ID */ @@ -402,17 +401,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_attribute + * Function: test_dangle_attribute * - * Purpose: Check for dangling attribute IDs causing problems on library + * Purpose: Check for dangling attribute IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 18, 2003 * * Modifications: @@ -422,7 +421,7 @@ error: static int test_dangle_attribute(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t dsid; /* Dataset ID */ @@ -509,17 +508,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_force + * Function: test_dangle_force * - * Purpose: Shut down all danging IDs with generic file & ID routines, + * Purpose: Shut down all danging IDs with generic file & ID routines, * instead of letting library shut then down. * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, October 29, 2010 * *------------------------------------------------------------------------- @@ -527,7 +526,7 @@ error: static int test_dangle_force(void) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t gid, gid2; /* Group IDs */ hid_t dsid, dsid2; /* Dataset IDs */ @@ -625,7 +624,7 @@ test_dangle_force(void) /* Release object ID array */ HDfree(objs); - + PASSED(); return 0; @@ -635,16 +634,16 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Executes dangling ID tests + * Purpose: Executes dangling ID tests * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -654,7 +653,7 @@ error: int main(void) { - int nerrors=0; + int nerrors=0; /* Run tests w/weak file close */ puts("Testing dangling objects with weak file close:"); diff --git a/test/gen_cross.c b/test/gen_cross.c index cf3fc35..f7a1938 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -26,7 +26,6 @@ * worth keeping around for now. */ -#include #include "h5test.h" #define H5FILE_NAME "data.h5" @@ -79,7 +78,7 @@ int create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid); int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid); int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid); - + /*------------------------------------------------------------------------- * Function: create_normal_dset * @@ -108,8 +107,8 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = ((float)(i + j + 1)) / 3; + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1)) / 3; } /* * 1/3 2/3 3/3 4/3 5/3 6/3 @@ -143,7 +142,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR - /* + /* * Close dataset */ if(H5Dclose(dataset) < 0) @@ -163,7 +162,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR - /* + /* * Close dataset */ if(H5Dclose(dataset) < 0) @@ -186,7 +185,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dsets_float * @@ -277,7 +276,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dsets_double * @@ -307,8 +306,8 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = ((double)(i + j + 1))/3; + for (i = 0; i < NY; i++) + data[j][i] = ((double)(i + j + 1))/3; } /* @@ -368,7 +367,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_char * @@ -467,7 +466,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_short * @@ -566,7 +565,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_int * @@ -596,8 +595,8 @@ create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = i + j; + for (i = 0; i < NY; i++) + data[j][i] = i + j; } /* * 0 1 2 3 4 5 @@ -665,7 +664,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_long_long * @@ -765,7 +764,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_fletcher_dsets_float * @@ -856,7 +855,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_deflate_dsets_float * @@ -957,7 +956,7 @@ error: } #ifdef H5_HAVE_FILTER_SZIP - + /*------------------------------------------------------------------------- * Function: create_szip_dsets_float * @@ -1049,7 +1048,7 @@ error: } #endif /* H5_HAVE_FILTER_SZIP */ - + /*------------------------------------------------------------------------- * Function: create_shuffle_dsets_float * @@ -1140,7 +1139,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_nbit_dsets_float * @@ -1225,7 +1224,7 @@ create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) TEST_ERROR /* Now create a dataset with a big-endian type */ - if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) TEST_ERROR if((dataset = H5Dcreate2(fid, DATASETNAME23, datatype, fsid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -1252,7 +1251,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: main * diff --git a/test/gheap.c b/test/gheap.c index 7564afa..110255b 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -15,14 +15,12 @@ * Programmer: Robb Matzke * Tuesday, March 31, 1998 * - * Purpose: Tests the global heap. The global heap is the set of all - * collections but the collections are not related to one - * another by anything that appears in the file format. + * Purpose: Tests the global heap. The global heap is the set of all + * collections but the collections are not related to one + * another by anything that appears in the file format. */ #include "h5test.h" -#include "H5private.h" #include "H5ACprivate.h" -#include "H5Eprivate.h" #include "H5Fprivate.h" #include "H5Gprivate.h" #include "H5HGprivate.h" @@ -56,18 +54,18 @@ const char *FILENAME[] = { NULL }; - + /*------------------------------------------------------------------------- - * Function: test_1 + * Function: test_1 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is larger than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is larger than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -77,16 +75,16 @@ const char *FILENAME[] = { static int test_1 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("monotonically increasing lengths"); @@ -97,11 +95,11 @@ test_1 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* @@ -110,37 +108,37 @@ test_1 (hid_t fapl) * be monotonically increasing. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if(status < 0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { - H5_FAILED(); - puts(" Collection addresses are not monotonically increasing"); - nerrors++; - } + size = u + 1; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if(status < 0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { + H5_FAILED(); + puts(" Collection addresses are not monotonically increasing"); + nerrors++; + } } /* * Now try to read each object back. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { - H5_FAILED(); - puts(" Unable to read object"); - nerrors++; - } else if(HDmemcmp(in, out, size)) { - H5_FAILED(); - puts(" Value read doesn't match value written"); - nerrors++; - } + size = u + 1; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + H5_FAILED(); + puts(" Unable to read object"); + nerrors++; + } else if(HDmemcmp(in, out, size)) { + H5_FAILED(); + puts(" Value read doesn't match value written"); + nerrors++; + } } /* Release buffer */ @@ -155,25 +153,25 @@ test_1 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_2 + * Function: test_2 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is smaller than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is smaller than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -183,15 +181,15 @@ error: static int test_2 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + int nerrors = 0; + char filename[1024]; TESTING("monotonically decreasing lengths"); @@ -202,43 +200,43 @@ test_2 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* * Write the objects, monotonically decreasing in length. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } + size = GHEAP_TEST_NOBJS - u; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } } /* * Now try to read each object back. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { - H5_FAILED(); - puts(" Unable to read object"); - nerrors++; - } else if (memcmp (in, out, size)) { - H5_FAILED(); - puts(" Value read doesn't match value written"); - nerrors++; - } + size = GHEAP_TEST_NOBJS - u; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + H5_FAILED(); + puts(" Unable to read object"); + nerrors++; + } else if (memcmp (in, out, size)) { + H5_FAILED(); + puts(" Value read doesn't match value written"); + nerrors++; + } } /* Release buffer */ @@ -253,25 +251,25 @@ test_2 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_3 + * Function: test_3 * - * Purpose: Creates a few global heap objects and then removes them all. - * The collection should also be removed. + * Purpose: Creates a few global heap objects and then removes them all. + * The collection should also be removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -281,15 +279,15 @@ test_2 (hid_t fapl) static int test_3 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("complete object removal"); @@ -300,34 +298,34 @@ test_3 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* Create some stuff */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } + size = u % 30 + 100; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } } /* Remove everything */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to remove object"); - nerrors++; - } + status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to remove object"); + nerrors++; + } } /* Release buffer */ @@ -342,26 +340,26 @@ test_3 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_4 + * Function: test_4 * - * Purpose: Tests the H5HG_remove() feature by writing lots of objects - * and occassionally removing some. When we're done they're all - * removed. + * Purpose: Tests the H5HG_remove() feature by writing lots of objects + * and occassionally removing some. When we're done they're all + * removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -371,15 +369,15 @@ test_3 (hid_t fapl) static int test_4 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("partial object removal"); @@ -390,40 +388,40 @@ test_4 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - /* Insert */ - size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } - - /* - * Remove every third one beginning with the second, but after the - * next one has already been inserted. That is, insert A, B, C; - * remove B, insert D, E, F; remove E; etc. - */ - if(1 == (u % 3)) { - H5Eclear2(H5E_DEFAULT); - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); - if (status<0) { - H5_FAILED(); - puts(" Unable to remove object"); - nerrors++; - } - HDmemset(obj + u - 1, 0, sizeof *obj); - } + /* Insert */ + size = u % 30 + 100; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } + + /* + * Remove every third one beginning with the second, but after the + * next one has already been inserted. That is, insert A, B, C; + * remove B, insert D, E, F; remove E; etc. + */ + if(1 == (u % 3)) { + H5Eclear2(H5E_DEFAULT); + status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); + if (status<0) { + H5_FAILED(); + puts(" Unable to remove object"); + nerrors++; + } + HDmemset(obj + u - 1, 0, sizeof *obj); + } } /* Release buffer */ @@ -438,27 +436,27 @@ test_4 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_ooo_indices + * Function: test_ooo_indices * - * Purpose: Tests that indices can be stored out of order. This can + * Purpose: Tests that indices can be stored out of order. This can * happen when the indices "wrap around" due to many * insertions and deletions (for example, from rewriting a * VL dataset). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, October 26, 2009 * * Modifications: @@ -468,13 +466,13 @@ test_4 (hid_t fapl) static int test_ooo_indices(hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - unsigned i, j; - H5HG_t *obj = NULL; - herr_t status; - int nerrors=0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + unsigned i, j; + H5HG_t *obj = NULL; + herr_t status; + int nerrors=0; + char filename[1024]; TESTING("out of order indices"); @@ -552,24 +550,24 @@ test_ooo_indices(hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } /* end test_ooo_indices */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests global heap. + * Purpose: Tests global heap. * - * Return: Success: zero + * Return: Success: zero * - * Failure: non-zero + * Failure: non-zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -579,8 +577,8 @@ test_ooo_indices(hid_t fapl) int main (void) { - int nerrors=0; - hid_t fapl; + int nerrors=0; + hid_t fapl; h5_reset(); fapl = h5_fileaccess(); diff --git a/test/h5test.h b/test/h5test.h index ce5c64d..8e87192 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -20,8 +20,13 @@ #ifndef _H5TEST_H #define _H5TEST_H +/* + * Include required headers. This file tests internal library functions, + * so we include the private headers here. + */ #include "hdf5.h" #include "H5private.h" +#include "H5Eprivate.h" /* * Predefined test verbosity levels. diff --git a/test/hyperslab.c b/test/hyperslab.c index c28d872..feb96bd 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -11,110 +11,108 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Friday, October 10, 1997 +/* Programmer: Robb Matzke + * Friday, October 10, 1997 * - * Purpose: Hyperslab operations are rather complex, so this file - * attempts to test them extensively so we can be relatively - * sure they really work. We only test 1d, 2d, and 3d cases - * because testing general dimensionalities would require us to - * rewrite much of the hyperslab stuff. + * Purpose: Hyperslab operations are rather complex, so this file + * attempts to test them extensively so we can be relatively + * sure they really work. We only test 1d, 2d, and 3d cases + * because testing general dimensionalities would require us to + * rewrite much of the hyperslab stuff. */ #include "h5test.h" -#include "H5private.h" -#include "H5Eprivate.h" #include "H5VMprivate.h" -#define TEST_SMALL 0x0001 -#define TEST_MEDIUM 0x0002 +#define TEST_SMALL 0x0001 +#define TEST_MEDIUM 0x0002 -#define VARIABLE_SRC 0 -#define VARIABLE_DST 1 -#define VARIABLE_BOTH 2 +#define VARIABLE_SRC 0 +#define VARIABLE_DST 1 +#define VARIABLE_BOTH 2 #define ARRAY_FILL_SIZE 4 #define ARRAY_OFFSET_NDIMS 3 - + /*------------------------------------------------------------------------- - * Function: init_full + * Function: init_full * - * Purpose: Initialize full array. + * Purpose: Initialize full array. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static unsigned init_full(uint8_t *array, size_t nx, size_t ny, size_t nz) { - uint8_t acc = 128; - unsigned total = 0; - size_t i, j, k; + uint8_t acc = 128; + unsigned total = 0; + size_t i, j, k; for(i = 0; i < nx; i++) - for(j = 0; j < ny; j++) - for(k = 0; k < nz; k++) { - total += acc; - *array = acc; - acc++; - array++; - } /* end for */ + for(j = 0; j < ny; j++) + for(k = 0; k < nz; k++) { + total += acc; + *array = acc; + acc++; + array++; + } /* end for */ return total; } /* end init_full() */ - + /*------------------------------------------------------------------------- - * Function: print_array + * Function: print_array * - * Purpose: Prints the values in an array + * Purpose: Prints the values in an array * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static void print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) { - size_t i, j, k; + size_t i, j, k; for(i = 0; i < nx; i++) { - if(nz > 1) - printf("i=%lu:\n", (unsigned long)i); - else - printf("%03lu:", (unsigned long)i); - - for(j = 0; j < ny; j++) { - if(nz > 1) - printf("%03lu:", (unsigned long)j); - for(k = 0; k < nz; k++) - printf(" %3d", *array++); - if(nz > 1) - printf("\n"); - } /* end for */ - printf("\n"); + if(nz > 1) + printf("i=%lu:\n", (unsigned long)i); + else + printf("%03lu:", (unsigned long)i); + + for(j = 0; j < ny; j++) { + if(nz > 1) + printf("%03lu:", (unsigned long)j); + for(k = 0; k < nz; k++) + printf(" %3d", *array++); + if(nz > 1) + printf("\n"); + } /* end for */ + printf("\n"); } /* end for */ } /* end print_array() */ - + /*------------------------------------------------------------------------- - * Function: print_ref + * Function: print_ref * - * Purpose: Prints the reference value + * Purpose: Prints the reference value * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: + * Failure: * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ @@ -131,37 +129,37 @@ print_ref(size_t nx, size_t ny, size_t nz) } /* end if */ } /* end print_ref() */ - + /*------------------------------------------------------------------------- - * Function: test_fill + * Function: test_fill * - * Purpose: Tests the H5VM_hyper_fill() function. + * Purpose: Tests the H5VM_hyper_fill() function. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_fill(size_t nx, size_t ny, size_t nz, - size_t di, size_t dj, size_t dk, - size_t ddx, size_t ddy, size_t ddz) + size_t di, size_t dj, size_t dk, + size_t ddx, size_t ddy, size_t ddz) { - uint8_t *dst = NULL; /*destination array */ - hsize_t hs_size[3]; /*hyperslab size */ - hsize_t dst_size[3]; /*destination total size */ + uint8_t *dst = NULL; /*destination array */ + hsize_t hs_size[3]; /*hyperslab size */ + hsize_t dst_size[3]; /*destination total size */ hsize_t dst_offset[3]; /*offset of hyperslab in dest */ - unsigned ref_value; /*reference value */ - unsigned acc; /*accumulator */ - size_t i, j, k, dx, dy, dz; /*counters */ + unsigned ref_value; /*reference value */ + unsigned acc; /*accumulator */ + size_t i, j, k, dx, dy, dz; /*counters */ size_t u, v, w; - unsigned ndims; /*hyperslab dimensionality */ - char dim[64], s[256]; /*temp string */ - unsigned fill_value; /*fill value */ + unsigned ndims; /*hyperslab dimensionality */ + char dim[64], s[256]; /*temp string */ + unsigned fill_value; /*fill value */ /* * Dimensionality. @@ -190,7 +188,7 @@ test_fill(size_t nx, size_t ny, size_t nz, /* Allocate array */ if(NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) TEST_ERROR - + init_full(dst, nx, ny, nz); for(i = 0; i < nx; i += di) { @@ -279,52 +277,52 @@ error: return FAIL; } /* end test_fill() */ - + /*------------------------------------------------------------------------- - * Function: test_copy + * Function: test_copy * - * Purpose: Tests H5VM_hyper_copy(). + * Purpose: Tests H5VM_hyper_copy(). * - * The NX, NY, and NZ arguments are the size for the source and - * destination arrays. You may pass zero for NZ or for NY and - * NZ to test the 2-d and 1-d cases respectively. + * The NX, NY, and NZ arguments are the size for the source and + * destination arrays. You may pass zero for NZ or for NY and + * NZ to test the 2-d and 1-d cases respectively. * - * A hyperslab is copied from/to (depending on MODE) various - * places in SRC and DST beginning at 0,0,0 and increasing - * location by DI,DJ,DK in the x, y, and z directions. + * A hyperslab is copied from/to (depending on MODE) various + * places in SRC and DST beginning at 0,0,0 and increasing + * location by DI,DJ,DK in the x, y, and z directions. * - * For each hyperslab location, various sizes of hyperslabs are - * tried beginning with 1x1x1 and increasing the size in each - * dimension by DDX,DDY,DDZ. + * For each hyperslab location, various sizes of hyperslabs are + * tried beginning with 1x1x1 and increasing the size in each + * dimension by DDX,DDY,DDZ. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static herr_t test_copy(int mode, - size_t nx, size_t ny, size_t nz, - size_t di, size_t dj, size_t dk, - size_t ddx, size_t ddy, size_t ddz) + size_t nx, size_t ny, size_t nz, + size_t di, size_t dj, size_t dk, + size_t ddx, size_t ddy, size_t ddz) { - uint8_t *src = NULL; /*source array */ - uint8_t *dst = NULL; /*destination array */ - hsize_t hs_size[3]; /*hyperslab size */ - hsize_t dst_size[3]; /*destination total size */ - hsize_t src_size[3]; /*source total size */ - hsize_t dst_offset[3]; /*offset of hyperslab in dest */ + uint8_t *src = NULL; /*source array */ + uint8_t *dst = NULL; /*destination array */ + hsize_t hs_size[3]; /*hyperslab size */ + hsize_t dst_size[3]; /*destination total size */ + hsize_t src_size[3]; /*source total size */ + hsize_t dst_offset[3]; /*offset of hyperslab in dest */ hsize_t src_offset[3]; /*offset of hyperslab in source */ - unsigned ref_value; /*reference value */ - unsigned acc; /*accumulator */ - hsize_t i, j, k, dx, dy, dz; /*counters */ + unsigned ref_value; /*reference value */ + unsigned acc; /*accumulator */ + hsize_t i, j, k, dx, dy, dz; /*counters */ hsize_t u, v, w; - unsigned ndims; /*hyperslab dimensionality */ - char dim[64], s[256]; /*temp string */ + unsigned ndims; /*hyperslab dimensionality */ + char dim[64], s[256]; /*temp string */ const char *sub; /* @@ -493,7 +491,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + printf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -535,7 +533,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + printf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -563,38 +561,38 @@ error: return FAIL; } /* end test_copy() */ - + /*------------------------------------------------------------------------- - * Function: test_multifill + * Function: test_multifill * - * Purpose: Tests the H5VM_stride_copy() function by using it to fill a - * hyperslab by replicating a multi-byte sequence. This might - * be useful to initialize an array of structs with a default - * struct value, or to initialize an array of floating-point - * values with a default bit-pattern. + * Purpose: Tests the H5VM_stride_copy() function by using it to fill a + * hyperslab by replicating a multi-byte sequence. This might + * be useful to initialize an array of structs with a default + * struct value, or to initialize an array of floating-point + * values with a default bit-pattern. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_multifill(size_t nx) { - hsize_t size; - hsize_t src_stride; - hsize_t dst_stride; - char s[64]; + hsize_t size; + hsize_t src_stride; + hsize_t dst_stride; + char s[64]; struct a_struct { int left; double mid; int right; } fill, *src = NULL, *dst = NULL; - hsize_t i, j; + hsize_t i, j; printf("%-70s", "Testing multi-byte fill value"); fflush(stdout); @@ -615,7 +613,7 @@ test_multifill(size_t nx) } /* end for */ /* - * Describe the fill value. The zero stride says to read the same thing + * Describe the fill value. The zero stride says to read the same thing * over and over again. */ fill.left = 55555555; @@ -684,32 +682,32 @@ error: return FAIL; } /* end test_multifill() */ - + /*------------------------------------------------------------------------- - * Function: test_endian + * Function: test_endian * - * Purpose: Tests the H5VM_stride_copy() function by using it to copy an - * array of integers and swap the byte ordering from little - * endian to big endian or vice versa depending on the hardware. + * Purpose: Tests the H5VM_stride_copy() function by using it to copy an + * array of integers and swap the byte ordering from little + * endian to big endian or vice versa depending on the hardware. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_endian(size_t nx) { - uint8_t *src = NULL; /*source array */ - uint8_t *dst = NULL; /*destination array */ - hssize_t src_stride[2]; /*source strides */ - hssize_t dst_stride[2]; /*destination strides */ - hsize_t size[2]; /*size vector */ - hsize_t i, j; + uint8_t *src = NULL; /*source array */ + uint8_t *dst = NULL; /*destination array */ + hssize_t src_stride[2]; /*source strides */ + hssize_t dst_stride[2]; /*destination strides */ + hsize_t size[2]; /*size vector */ + hsize_t i, j; printf("%-70s", "Testing endian conversion by stride"); fflush(stdout); @@ -747,7 +745,7 @@ test_endian(size_t nx) printf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j); printf(" Source array is:\n"); print_array(src, nx, (size_t)4, (size_t)1); - printf("\n Result is:\n"); + printf("\n Result is:\n"); print_array(dst, nx, (size_t)4, (size_t)1); } /* end if */ goto error; @@ -771,31 +769,31 @@ error: return FAIL; } /* end test_endian() */ - + /*------------------------------------------------------------------------- - * Function: test_transpose + * Function: test_transpose * - * Purpose: Copy a 2d array from here to there and transpose the elements - * as it's copied. + * Purpose: Copy a 2d array from here to there and transpose the elements + * as it's copied. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_transpose(size_t nx, size_t ny) { - int *src = NULL; - int *dst = NULL; - hsize_t src_stride[2], dst_stride[2]; - hsize_t size[2]; - char s[256]; - hsize_t i, j; + int *src = NULL; + int *dst = NULL; + hsize_t src_stride[2], dst_stride[2]; + hsize_t size[2]; + char s[256]; + hsize_t i, j; sprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny); @@ -843,7 +841,7 @@ test_transpose(size_t nx, size_t ny) printf(" %6d", src[i * ny + j]); printf("\n"); } /* end for */ - printf("\n Destination is:\n"); + printf("\n Destination is:\n"); for (i = 0; i < ny; i++) { printf("%3lu:", (unsigned long)i); for(j = 0; j < nx; j++) @@ -872,35 +870,35 @@ error: return FAIL; } /* end test_transpose() */ - + /*------------------------------------------------------------------------- - * Function: test_sub_super + * Function: test_sub_super * - * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image - * by copying half the pixels in the X and Y directions. Then - * we use the small image and duplicate every pixel to result in - * a 2x2 square. + * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image + * by copying half the pixels in the X and Y directions. Then + * we use the small image and duplicate every pixel to result in + * a 2x2 square. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Monday, October 13, 1997 + * Programmer: Robb Matzke + * Monday, October 13, 1997 * *------------------------------------------------------------------------- */ static herr_t test_sub_super(size_t nx, size_t ny) { - uint8_t *full = NULL; /*original image */ - uint8_t *half = NULL; /*image at 1/2 resolution */ - uint8_t *twice = NULL; /*2x2 pixels */ - hsize_t src_stride[4]; /*source stride info */ - hsize_t dst_stride[4]; /*destination stride info */ - hsize_t size[4]; /*number of sample points */ - hsize_t i, j; - char s[256]; + uint8_t *full = NULL; /*original image */ + uint8_t *half = NULL; /*image at 1/2 resolution */ + uint8_t *twice = NULL; /*2x2 pixels */ + hsize_t src_stride[4]; /*source stride info */ + hsize_t dst_stride[4]; /*destination stride info */ + hsize_t size[4]; /*number of sample points */ + hsize_t i, j; + char s[256]; sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx), (unsigned long)(2 * ny), @@ -942,7 +940,7 @@ test_sub_super(size_t nx, size_t ny) (unsigned long)i, (unsigned long)j); printf(" full is:\n"); print_array(full, 2 * nx, 2 * ny, (size_t)1); - printf("\n half is:\n"); + printf("\n half is:\n"); print_array(half, nx, ny, (size_t)1); } /* end if */ goto error; @@ -1005,7 +1003,7 @@ test_sub_super(size_t nx, size_t ny) AT(); printf(" %s\n Half is:\n", s); print_array(half, nx, ny, (size_t)1); - printf("\n Twice is:\n"); + printf("\n Twice is:\n"); print_array(twice, 2 * nx, 2 * ny, (size_t)1); } /* end if */ goto error; @@ -1032,20 +1030,20 @@ error: return FAIL; } /* test_sub_super() */ - + /*------------------------------------------------------------------------- - * Function: test_array_fill + * Function: test_array_fill * - * Purpose: Tests H5VM_array_fill routine by copying a multibyte value + * Purpose: Tests H5VM_array_fill routine by copying a multibyte value * (an array of ints, in our case) into all the elements of an * array. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, April 21, 2003 + * Programmer: Quincey Koziol + * Monday, April 21, 2003 * *------------------------------------------------------------------------- */ @@ -1054,8 +1052,8 @@ test_array_fill(size_t lo, size_t hi) { int *dst = NULL; /* Destination */ int src[ARRAY_FILL_SIZE]; /* Source to duplicate */ - size_t u, v, w; /* Local index variables */ - char s[256]; + size_t u, v, w; /* Local index variables */ + char s[256]; sprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi); TESTING(s); @@ -1093,20 +1091,20 @@ error: return FAIL; } /* end test_array_fill() */ - + /*------------------------------------------------------------------------- - * Function: test_array_offset_n_calc + * Function: test_array_offset_n_calc * - * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing + * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing * computed array offsets against calculated ones and then going * back to the coordinates from the offset and checking those. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, April 21, 2003 + * Programmer: Quincey Koziol + * Monday, April 21, 2003 * *------------------------------------------------------------------------- */ @@ -1116,11 +1114,11 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) hsize_t *a = NULL; hsize_t *temp_a; /* Array for stored calculated offsets */ hsize_t off; /* Offset in array */ - size_t u, v, w; /* Local index variables */ + size_t u, v, w; /* Local index variables */ hsize_t dims[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of array to check */ hsize_t coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates to check offset of */ hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */ - char s[256]; + char s[256]; sprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x); TESTING(s); @@ -1178,29 +1176,29 @@ error: return FAIL; } /* end test_array_offset_n_calc() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test various hyperslab operations. Give the words - * `small' and/or `medium' on the command line or only `small' - * is assumed. + * Purpose: Test various hyperslab operations. Give the words + * `small' and/or `medium' on the command line or only `small' + * is assumed. * - * Return: Success: exit(EXIT_SUCCESS) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(EXIT_FAILURE) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ int main(int argc, char *argv[]) { - herr_t status; - int nerrors = 0; - unsigned size_of_test; + herr_t status; + int nerrors = 0; + unsigned size_of_test; /* Parse arguments or assume `small' & `medium' */ if(1 == argc) diff --git a/test/istore.c b/test/istore.c index c401e87..f100fe4 100644 --- a/test/istore.c +++ b/test/istore.c @@ -11,24 +11,22 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Wednesday, October 15, 1997 +/* Programmer: Robb Matzke + * Wednesday, October 15, 1997 * - * Purpose: Tests various aspects of indexed raw data storage. + * Purpose: Tests various aspects of indexed raw data storage. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "h5test.h" -#include "H5private.h" + #include "H5Dprivate.h" -#include "H5Eprivate.h" #include "H5Iprivate.h" #include "H5Pprivate.h" #include "H5Fpkg.h" #include "H5Gprivate.h" #include "H5Oprivate.h" -#include "H5Pprivate.h" #include "H5VMprivate.h" const char *FILENAME[] = { @@ -37,9 +35,9 @@ const char *FILENAME[] = { }; -#define TEST_SMALL 0x0001 -#define TEST_MEDIUM 0x0002 -#define TEST_LARGE 0x0004 +#define TEST_SMALL 0x0001 +#define TEST_MEDIUM 0x0002 +#define TEST_LARGE 0x0004 /* The datatype of the dataset operated on by this test */ #define TEST_DATATYPE H5T_NATIVE_UCHAR @@ -50,19 +48,19 @@ const char *FILENAME[] = { hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; hsize_t zero[H5O_LAYOUT_NDIMS]; - + /*------------------------------------------------------------------------- - * Function: is_sparse + * Function: is_sparse * - * Purpose: Determines if the file system of the current working - * directory supports holes. + * Purpose: Determines if the file system of the current working + * directory supports holes. * - * Return: Success: Non-zero if holes are supported; zero - * otherwise. + * Return: Success: Non-zero if holes are supported; zero + * otherwise. * - * Failure: zero + * Failure: zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, July 15, 1998 * *------------------------------------------------------------------------- @@ -70,8 +68,8 @@ hsize_t zero[H5O_LAYOUT_NDIMS]; static int is_sparse(void) { - int fd; - h5_stat_t sb; + int fd; + h5_stat_t sb; if ((fd = HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; @@ -86,16 +84,16 @@ is_sparse(void) #endif } - + /*------------------------------------------------------------------------- - * Function: print_array + * Function: print_array * - * Purpose: Prints the values in an array + * Purpose: Prints the values in an array * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * * Modifications: * @@ -104,41 +102,41 @@ is_sparse(void) static void print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) { - size_t i, j, k; + size_t i, j, k; for (i = 0; i < nx; i++) { - if (nz > 1) { - fprintf(stderr,"i=%lu:\n", (unsigned long)i); - } else { - fprintf(stderr,"%03lu:", (unsigned long)i); - } - - for (j = 0; j < ny; j++) { - if (nz > 1) - fprintf(stderr,"%03lu:", (unsigned long)j); - for (k = 0; k < nz; k++) { - fprintf(stderr," %3d", *array++); - } - if (nz > 1) - fprintf(stderr,"\n"); - } - fprintf(stderr,"\n"); + if (nz > 1) { + fprintf(stderr,"i=%lu:\n", (unsigned long)i); + } else { + fprintf(stderr,"%03lu:", (unsigned long)i); + } + + for (j = 0; j < ny; j++) { + if (nz > 1) + fprintf(stderr,"%03lu:", (unsigned long)j); + for (k = 0; k < nz; k++) { + fprintf(stderr," %3d", *array++); + } + if (nz > 1) + fprintf(stderr,"\n"); + } + fprintf(stderr,"\n"); } } - + /*------------------------------------------------------------------------- - * Function: new_object + * Function: new_object * - * Purpose: Creates a new object that refers to a indexed storage of raw - * data. No raw data is stored. + * Purpose: Creates a new object that refers to a indexed storage of raw + * data. No raw data is stored. * - * Return: Success: ID of dataset + * Return: Success: ID of dataset * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * Converted to use datasets instead of directly messing with @@ -182,19 +180,19 @@ error: return -1; } - + /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Creates a named object that refers to indexed storage of raw - * data. No raw data is stored. + * Purpose: Creates a named object that refers to indexed storage of raw + * data. No raw data is stored. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -217,9 +215,9 @@ test_create(hid_t f, const char *prefix) dims[u] = my_chunk_dims[u] = 2; /* Create chunked dataset of this dimensionality */ - HDsnprintf(name, sizeof name, "%s_%02u", prefix, u); - if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0) - return FAIL; + HDsnprintf(name, sizeof name, "%s_%02u", prefix, u); + if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0) + return FAIL; /* Close dataset created */ if(H5Dclose(dataset) < 0) @@ -230,20 +228,20 @@ test_create(hid_t f, const char *prefix) return SUCCEED; } - + /*------------------------------------------------------------------------- - * Function: test_extend + * Function: test_extend * - * Purpose: Creates an empty object and then writes to it in such a way - * as to always extend the object's domain without creating - * holes and without causing the object to become concave. + * Purpose: Creates an empty object and then writes to it in such a way + * as to always extend the object's domain without creating + * holes and without causing the object to become concave. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -251,35 +249,35 @@ test_create(hid_t f, const char *prefix) */ static herr_t test_extend(hid_t f, const char *prefix, - size_t nx, size_t ny, size_t nz) + size_t nx, size_t ny, size_t nz) { hid_t dataset; /* Dataset ID */ hid_t fspace; /* Dataset's file dataspace */ hid_t mspace; /* Dataset's memory dataspace */ - size_t i, j, k, ctr; - int ndims; - uint8_t *buf = NULL, *check = NULL, *whole = NULL; - char dims[64], s[256], name[256]; - hsize_t offset[3]; - hsize_t max_corner[3]; - hsize_t size[3]; - hsize_t whole_size[3]; - hsize_t nelmts; + size_t i, j, k, ctr; + int ndims; + uint8_t *buf = NULL, *check = NULL, *whole = NULL; + char dims[64], s[256], name[256]; + hsize_t offset[3]; + hsize_t max_corner[3]; + hsize_t size[3]; + hsize_t whole_size[3]; + hsize_t nelmts; if (!nz) { - if (!ny) { - ndims = 1; - ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); - } else { - ndims = 2; - nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); - } + if (!ny) { + ndims = 1; + ny = nz = 1; + sprintf(dims, "%lu", (unsigned long) nx); } else { - ndims = 3; - sprintf(dims, "%lux%lux%lu", - (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); + ndims = 2; + nz = 1; + sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + } + } else { + ndims = 3; + sprintf(dims, "%lux%lux%lu", + (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } sprintf(s, "istore extend: %s", dims); @@ -298,57 +296,57 @@ test_extend(hid_t f, const char *prefix, /* Build the new empty object */ sprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, whole_size)) < 0) { - fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); - goto error; + fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; for (ctr = 0; - H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size); - ctr++) { - - /* Size and location */ - if (0 == ctr) { - offset[0] = offset[1] = offset[2] = 0; - size[0] = size[1] = size[2] = 1; - nelmts = 1; - } else { - for (i=0, nelmts=1; i<(size_t)ndims; i++) { - if (ctr % (size_t)ndims == i) { - offset[i] = max_corner[i]; - size[i] = MIN(1, whole_size[i] - offset[i]); - } else { - offset[i] = 0; - size[i] = max_corner[i]; - } - nelmts *= size[i]; - } - } + H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size); + ctr++) { + + /* Size and location */ + if (0 == ctr) { + offset[0] = offset[1] = offset[2] = 0; + size[0] = size[1] = size[2] = 1; + nelmts = 1; + } else { + for (i=0, nelmts=1; i<(size_t)ndims; i++) { + if (ctr % (size_t)ndims == i) { + offset[i] = max_corner[i]; + size[i] = MIN(1, whole_size[i] - offset[i]); + } else { + offset[i] = 0; + size[i] = max_corner[i]; + } + nelmts *= size[i]; + } + } #if 0 - if (0 == ctr) - fprintf(stderr,"\n"); - fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); - if (ndims > 1) - fprintf(stderr,",%ld", (long)offset[1]); - if (ndims > 2) - fprintf(stderr,",%ld", (long)offset[2]); - fprintf(stderr,"), size=(%lu", (unsigned long)size[0]); - if (ndims > 1) - fprintf(stderr,",%lu", (unsigned long)size[1]); - if (ndims > 2) - fprintf(stderr,",%lu", (unsigned long)size[2]); - fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); - if (0 == nelmts) - fprintf(stderr," *SKIPPED*"); - fprintf(stderr,"\n"); + if (0 == ctr) + fprintf(stderr,"\n"); + fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); + if (ndims > 1) + fprintf(stderr,",%ld", (long)offset[1]); + if (ndims > 2) + fprintf(stderr,",%ld", (long)offset[2]); + fprintf(stderr,"), size=(%lu", (unsigned long)size[0]); + if (ndims > 1) + fprintf(stderr,",%lu", (unsigned long)size[1]); + if (ndims > 2) + fprintf(stderr,",%lu", (unsigned long)size[2]); + fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); + if (0 == nelmts) + fprintf(stderr," *SKIPPED*"); + fprintf(stderr,"\n"); #endif - /* Fill the source array */ - if (0 == nelmts) continue; - HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); + /* Fill the source array */ + if (0 == nelmts) continue; + HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); /* Create dataspace for selection in memory */ if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR; @@ -356,72 +354,72 @@ test_extend(hid_t f, const char *prefix, /* Select region in file dataspace */ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; - /* Write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); - goto error; - } - - /* Read from disk */ - HDmemset(check, 0xff, (size_t)nelmts); - if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { - H5_FAILED(); - fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); - goto error; - } - if (HDmemcmp(buf, check, (size_t)nelmts)) { - H5_FAILED(); - fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); - fprintf(stderr," Wrote:\n"); - print_array(buf, (size_t)size[0], (size_t)size[1], - (size_t)size[2]); - fprintf(stderr," Read:\n"); - print_array(check, (size_t)size[0], (size_t)size[1], - (size_t)size[2]); - goto error; - } + /* Write to disk */ + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { + H5_FAILED(); + fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); + goto error; + } + + /* Read from disk */ + HDmemset(check, 0xff, (size_t)nelmts); + if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { + H5_FAILED(); + fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); + goto error; + } + if (HDmemcmp(buf, check, (size_t)nelmts)) { + H5_FAILED(); + fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); + fprintf(stderr," Wrote:\n"); + print_array(buf, (size_t)size[0], (size_t)size[1], + (size_t)size[2]); + fprintf(stderr," Read:\n"); + print_array(check, (size_t)size[0], (size_t)size[1], + (size_t)size[2]); + goto error; + } /* Close memory dataspace */ if(H5Sclose(mspace) < 0) TEST_ERROR; - /* Write to `whole' buffer for later checking */ - H5VM_hyper_copy((unsigned)ndims, size, - whole_size, offset, whole, /*dst*/ - size, H5VM_ZERO, buf); /*src*/ + /* Write to `whole' buffer for later checking */ + H5VM_hyper_copy((unsigned)ndims, size, + whole_size, offset, whole, /*dst*/ + size, H5VM_ZERO, buf); /*src*/ - /* Update max corner */ - for (i=0; i<(size_t)ndims; i++) - max_corner[i] = MAX(max_corner[i], offset[i]+size[i]); + /* Update max corner */ + for (i=0; i<(size_t)ndims; i++) + max_corner[i] = MAX(max_corner[i], offset[i]+size[i]); } /* Now read the entire array back out and check it */ HDmemset(buf, 0xff, nx * ny * nz); if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - fprintf(stderr," Read failed for whole array.\n"); - goto error; + H5_FAILED(); + fprintf(stderr," Read failed for whole array.\n"); + goto error; } for (i=0; i 1) { - fprintf(stderr,", j=%lu", (unsigned long)j); - } - if (ndims > 2) { - fprintf(stderr,", k=%lu", (unsigned long)k); - } - fprintf(stderr,"\n Check array is:\n"); - print_array(whole, nx, ny, nz); - fprintf(stderr," Value read is:\n"); - print_array(buf, nx, ny, nz); - goto error; - } - } - } + for (j=0; j 1) { + fprintf(stderr,", j=%lu", (unsigned long)j); + } + if (ndims > 2) { + fprintf(stderr,", k=%lu", (unsigned long)k); + } + fprintf(stderr,"\n Check array is:\n"); + print_array(whole, nx, ny, nz); + fprintf(stderr," Value read is:\n"); + print_array(buf, nx, ny, nz); + goto error; + } + } + } } /* Close dataset's dataspace */ @@ -445,19 +443,19 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: test_sparse + * Function: test_sparse * - * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed - * blocks each of size NX,NY,NZ. + * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed + * blocks each of size NX,NY,NZ. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * * Modifications: * @@ -465,34 +463,34 @@ error: */ static herr_t test_sparse(hid_t f, const char *prefix, size_t nblocks, - size_t nx, size_t ny, size_t nz, int skip_test) + size_t nx, size_t ny, size_t nz, int skip_test) { hid_t dataset; /* Dataset ID */ hid_t fspace; /* Dataset's file dataspace */ hid_t mspace; /* Dataset's memory dataspace */ - int ndims; - hsize_t ctr; - char dims[64], s[256], name[256]; - hsize_t offset[3]; - hsize_t size[3], total = 0; - uint8_t *buf = NULL; - hsize_t whole_size[3]; /* Size of dataset's dataspace */ + int ndims; + hsize_t ctr; + char dims[64], s[256], name[256]; + hsize_t offset[3]; + hsize_t size[3], total = 0; + uint8_t *buf = NULL; + hsize_t whole_size[3]; /* Size of dataset's dataspace */ size_t u; /* Local index variable */ if (!nz) { - if (!ny) { - ndims = 1; - ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); - } else { - ndims = 2; - nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); - } + if (!ny) { + ndims = 1; + ny = nz = 1; + sprintf(dims, "%lu", (unsigned long) nx); } else { - ndims = 3; - sprintf(dims, "%lux%lux%lu", - (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); + ndims = 2; + nz = 1; + sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + } + } else { + ndims = 3; + sprintf(dims, "%lux%lux%lu", + (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } sprintf(s, "istore sparse: %s", dims); @@ -516,8 +514,8 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, /* Build the new empty object */ sprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, chunk_dims)) < 0) { - printf(" Cannot create %u-d object `%s'\n", ndims, name); - goto error; + printf(" Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ @@ -534,29 +532,29 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, /* Select region in file dataspace */ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; - /* write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); - printf(" offset=(%lu", (unsigned long) (offset[0])); - if (ndims > 1) - printf(",%lu", (unsigned long) (offset[1])); - if (ndims > 2) - printf(",%lu", (unsigned long) (offset[2])); - printf("), size=(%lu", (unsigned long) (size[0])); - if (ndims > 1) - printf(",%lu", (unsigned long) (size[1])); - if (ndims > 2) - printf(",%lu", (unsigned long) (size[2])); - printf(")\n"); - goto error; - } - total += nx * ny * nz; + /* write to disk */ + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { + H5_FAILED(); + printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); + printf(" offset=(%lu", (unsigned long) (offset[0])); + if (ndims > 1) + printf(",%lu", (unsigned long) (offset[1])); + if (ndims > 2) + printf(",%lu", (unsigned long) (offset[2])); + printf("), size=(%lu", (unsigned long) (size[0])); + if (ndims > 1) + printf(",%lu", (unsigned long) (size[1])); + if (ndims > 2) + printf(",%lu", (unsigned long) (size[2])); + printf(")\n"); + goto error; + } + total += nx * ny * nz; #if 0 - HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total); + HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total); #endif - /* We don't test reading yet.... */ + /* We don't test reading yet.... */ } /* Close memory dataspace */ @@ -577,18 +575,18 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests indexed storage stuff. + * Purpose: Tests indexed storage stuff. * - * Return: Success: exit(EXIT_SUCCESS) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(EXIT_FAILURE) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -597,12 +595,12 @@ error: int main(int argc, char *argv[]) { - hid_t fapl=-1, file=-1, fcpl=-1; - herr_t status; - int nerrors = 0; - unsigned size_of_test; + hid_t fapl=-1, file=-1, fcpl=-1; + herr_t status; + int nerrors = 0; + unsigned size_of_test; unsigned u; /* Local index variable */ - char filename[1024]; + char filename[1024]; int skip_test = 0; int has_sparse_support = 0; @@ -610,7 +608,7 @@ main(int argc, char *argv[]) if (1 == argc) { size_of_test = TEST_SMALL | TEST_MEDIUM | TEST_LARGE; } else { - int i; + int i; for (i = 1, size_of_test = 0; i < argc; i++) { if (!strcmp(argv[i], "small")) { size_of_test |= TEST_SMALL; diff --git a/test/swmr.c b/test/swmr.c index 3b1bd09..0b352e2 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -24,7 +24,6 @@ * *************************************************************/ -#include "hdf5.h" #include "h5test.h" #include "H5Iprivate.h" diff --git a/test/tattr.c b/test/tattr.c index 2d333e9..525898d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -20,8 +20,6 @@ *************************************************************/ #include "testhdf5.h" -#include "h5test.h" -#include "hdf5.h" /* * This file needs to access private information from the H5O package. @@ -153,7 +151,7 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data); - + /**************************************************************** ** ** test_attr_basic_write(): Test basic H5A (attribute) code. @@ -393,7 +391,7 @@ test_attr_basic_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_write() */ - + /**************************************************************** ** ** test_attr_basic_read(): Test basic H5A (attribute) code. @@ -484,7 +482,7 @@ test_attr_basic_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_read() */ - + /**************************************************************** ** ** test_attr_flush(): Test H5A (attribute) code for performing @@ -551,7 +549,7 @@ test_attr_flush(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_flush() */ - + /**************************************************************** ** ** test_attr_plist(): Test Attribute Creation Property Lists @@ -664,7 +662,7 @@ test_attr_plist(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_plist() */ - + /**************************************************************** ** ** test_attr_compound_write(): Test H5A (attribute) code. @@ -753,7 +751,7 @@ test_attr_compound_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_write() */ - + /**************************************************************** ** ** test_attr_compound_read(): Test basic H5A (attribute) code. @@ -903,7 +901,7 @@ test_attr_compound_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_read() */ - + /**************************************************************** ** ** test_attr_scalar_write(): Test scalar H5A (attribute) writing code. @@ -969,7 +967,7 @@ test_attr_scalar_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_write() */ - + /**************************************************************** ** ** test_attr_scalar_read(): Test scalar H5A (attribute) reading code. @@ -1040,7 +1038,7 @@ test_attr_scalar_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_read() */ - + /**************************************************************** ** ** test_attr_mult_write(): Test basic H5A (attribute) code. @@ -1161,7 +1159,7 @@ test_attr_mult_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_write() */ - + /**************************************************************** ** ** test_attr_mult_read(): Test basic H5A (attribute) code. @@ -1383,7 +1381,7 @@ test_attr_mult_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_read() */ - + /**************************************************************** ** ** attr_op1(): Attribute operator @@ -1423,7 +1421,7 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR return(ret); } /* end attr_op1() */ - + /**************************************************************** ** ** test_attr_iterate(): Test H5A (attribute) iterator code. @@ -1495,7 +1493,7 @@ test_attr_iterate(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_iterate() */ - + /**************************************************************** ** ** test_attr_delete(): Test H5A (attribute) code for deleting objects. @@ -1615,7 +1613,7 @@ test_attr_delete(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_delete() */ - + /**************************************************************** ** ** test_attr_dtype_shared(): Test H5A (attribute) code for using @@ -1792,7 +1790,7 @@ test_attr_dtype_shared(hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dtype_shared() */ - + /**************************************************************** ** ** test_attr_duplicate_ids(): Test operations with more than @@ -2037,7 +2035,7 @@ test_attr_duplicate_ids(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_duplicate_ids() */ - + /**************************************************************** ** ** test_attr_dense_verify(): Test basic H5A (attribute) code. @@ -2107,7 +2105,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) return(-1); } /* test_attr_dense_verify() */ - + /**************************************************************** ** ** test_attr_dense_create(): Test basic H5A (attribute) code. @@ -2238,7 +2236,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_create() */ - + /**************************************************************** ** ** test_attr_dense_open(): Test basic H5A (attribute) code. @@ -2377,7 +2375,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_open() */ - + /**************************************************************** ** ** test_attr_dense_delete(): Test basic H5A (attribute) code. @@ -2555,7 +2553,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_delete() */ - + /**************************************************************** ** ** test_attr_dense_rename(): Test basic H5A (attribute) code. @@ -2714,7 +2712,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_rename() */ - + /**************************************************************** ** ** test_attr_dense_unlink(): Test basic H5A (attribute) code. @@ -2844,7 +2842,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_unlink() */ - + /**************************************************************** ** ** test_attr_dense_limits(): Test basic H5A (attribute) code. @@ -3009,7 +3007,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_limits() */ - + /**************************************************************** ** ** test_attr_dense_dup_ids(): Test operations with multiple ID @@ -3532,7 +3530,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_dense_dup_ids() */ - + /**************************************************************** ** ** test_attr_big(): Test basic H5A (attribute) code. @@ -3802,7 +3800,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_big() */ - + /**************************************************************** ** ** test_attr_null_space(): Test basic H5A (attribute) code. @@ -4020,7 +4018,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_null_space() */ - + /**************************************************************** ** ** test_attr_deprec(): Test basic H5A (attribute) code. @@ -4129,7 +4127,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_attr_deprec() */ - + /**************************************************************** ** ** test_attr_many(): Test basic H5A (attribute) code. @@ -4258,7 +4256,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_many() */ - + /**************************************************************** ** ** test_attr_corder_create_empty(): Test basic H5A (attribute) code. @@ -4374,7 +4372,7 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_basic() */ - + /**************************************************************** ** ** test_attr_corder_create_compact(): Test basic H5A (attribute) code. @@ -4572,7 +4570,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_compact() */ - + /**************************************************************** ** ** test_attr_corder_create_dense(): Test basic H5A (attribute) code. @@ -4799,7 +4797,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_dense() */ - + /**************************************************************** ** ** test_attr_corder_create_reopen(): Test basic H5A (attribute) code. @@ -4907,7 +4905,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_create_reopen() */ - + /**************************************************************** ** ** test_attr_corder_transition(): Test basic H5A (attribute) code. @@ -5313,7 +5311,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_transition() */ - + /**************************************************************** ** ** test_attr_corder_delete(): Test basic H5A (attribute) code. @@ -5514,7 +5512,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_delete() */ - + /*------------------------------------------------------------------------- * Function: attr_info_by_idx_check * @@ -5661,7 +5659,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, return(-1); } /* end attr_info_by_idx_check() */ - + /**************************************************************** ** ** test_attr_info_by_idx(): Test basic H5A (attribute) code. @@ -5871,7 +5869,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_info_by_idx() */ - + /**************************************************************** ** ** test_attr_delete_by_idx(): Test basic H5A (attribute) code. @@ -6403,7 +6401,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_delete_by_idx() */ - + /**************************************************************** ** ** attr_iterate2_cb(): Revised attribute operator @@ -6477,7 +6475,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); } /* end attr_iterate2_cb() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /**************************************************************** ** ** attr_iterate1_cb(): Attribute operator @@ -6490,7 +6488,7 @@ attr_iterate1_cb(hid_t loc_id, const char *attr_name, void *_op_data) } /* end attr_iterate1_cb() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: attr_iterate2_fail_cb * @@ -6512,7 +6510,7 @@ attr_iterate2_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED * return(H5_ITER_ERROR); } /* end attr_iterate2_fail_cb() */ - + /*------------------------------------------------------------------------- * Function: attr_iterate_check * @@ -6812,7 +6810,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_iterate_check() */ - + /**************************************************************** ** ** test_attr_iterate2(): Test basic H5A (attribute) code. @@ -7116,7 +7114,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) HDfree(visited); } /* test_attr_iterate2() */ - + /*------------------------------------------------------------------------- * Function: attr_open_by_idx_check * @@ -7176,7 +7174,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, return(-1); } /* end attr_open_by_idx_check() */ - + /**************************************************************** ** ** test_attr_open_by_idx(): Test basic H5A (attribute) code. @@ -7438,7 +7436,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_idx() */ - + /*------------------------------------------------------------------------- * Function: attr_open_check * @@ -7524,7 +7522,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_open_check() */ - + /**************************************************************** ** ** test_attr_open_by_name(): Test basic H5A (attribute) code. @@ -7779,7 +7777,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_name() */ - + /**************************************************************** ** ** test_attr_create_by_name(): Test basic H5A (attribute) code. @@ -10866,7 +10864,7 @@ test_attr(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_attr() */ - + /*------------------------------------------------------------------------- * Function: cleanup_attr * diff --git a/test/testhdf5.h b/test/testhdf5.h index 127c687..1f3f6a0 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -18,13 +18,6 @@ #ifndef TESTHDF5_H #define TESTHDF5_H -/* - * Include required headers. This file tests internal library functions, - * so we include the private headers here. - */ -#include "H5private.h" -#include "H5Eprivate.h" - /* Include generic testing header also */ #include "h5test.h" @@ -204,12 +197,12 @@ void test_vlstrings(void); void test_iterate(void); void test_array(void); void test_genprop(void); -void test_configure(void); -void test_misc(void); -void test_ids(void); -void test_skiplist(void); -void test_sohm(void); -void test_unicode(void); +void test_configure(void); +void test_misc(void); +void test_ids(void); +void test_skiplist(void); +void test_sohm(void); +void test_unicode(void); /* Prototypes for the cleanup routines */ void cleanup_metadata(void); @@ -227,10 +220,10 @@ void cleanup_vlstrings(void); void cleanup_iterate(void); void cleanup_array(void); void cleanup_genprop(void); -void cleanup_configure(void); -void cleanup_sohm(void); -void cleanup_misc(void); -void cleanup_unicode(void); +void cleanup_configure(void); +void cleanup_sohm(void); +void cleanup_misc(void); +void cleanup_unicode(void); #ifdef __cplusplus } diff --git a/test/th5s.c b/test/th5s.c index 4154c5f..0b0a2e7 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -13,13 +13,12 @@ /*********************************************************** * -* Test program: th5s +* Test program: th5s * * Test the dataspace functionality * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -42,7 +41,6 @@ #define H5O_TESTING #include "H5Opkg.h" /* Object header */ -#include "H5private.h" #include "H5Bprivate.h" #include "H5Sprivate.h" #include "H5Pprivate.h" @@ -63,31 +61,31 @@ #define EXTFILE_NAME "ext_file" /* 3-D dataset with fixed dimensions */ -#define SPACE1_RANK 3 -#define SPACE1_DIM1 3 -#define SPACE1_DIM2 15 -#define SPACE1_DIM3 13 +#define SPACE1_RANK 3 +#define SPACE1_DIM1 3 +#define SPACE1_DIM2 15 +#define SPACE1_DIM3 13 /* 4-D dataset with one unlimited dimension */ -#define SPACE2_RANK 4 -#define SPACE2_DIM1 0 -#define SPACE2_DIM2 15 -#define SPACE2_DIM3 13 -#define SPACE2_DIM4 23 -#define SPACE2_MAX1 H5S_UNLIMITED -#define SPACE2_MAX2 15 -#define SPACE2_MAX3 13 -#define SPACE2_MAX4 23 +#define SPACE2_RANK 4 +#define SPACE2_DIM1 0 +#define SPACE2_DIM2 15 +#define SPACE2_DIM3 13 +#define SPACE2_DIM4 23 +#define SPACE2_MAX1 H5S_UNLIMITED +#define SPACE2_MAX2 15 +#define SPACE2_MAX3 13 +#define SPACE2_MAX4 23 /* Scalar dataset with simple datatype */ -#define SPACE3_RANK 0 +#define SPACE3_RANK 0 unsigned space3_data=65; /* Scalar dataset with compound datatype */ -#define SPACE4_FIELDNAME1 "c1" -#define SPACE4_FIELDNAME2 "u" -#define SPACE4_FIELDNAME3 "f" -#define SPACE4_FIELDNAME4 "c2" +#define SPACE4_FIELDNAME1 "c1" +#define SPACE4_FIELDNAME2 "u" +#define SPACE4_FIELDNAME3 "f" +#define SPACE4_FIELDNAME4 "c2" size_t space4_field1_off=0; size_t space4_field2_off=0; size_t space4_field3_off=0; @@ -107,21 +105,21 @@ struct space4_struct { static void test_h5s_basic(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t sid1, sid2; /* Dataspace ID */ - hid_t dset1; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t sid1, sid2; /* Dataspace ID */ + hid_t dset1; /* Dataset ID */ hid_t aid1; /* Attribute ID */ - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, - SPACE2_DIM4}; - hsize_t dims3[H5S_MAX_RANK+1]; - hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, - SPACE2_MAX4}; - hsize_t tdims[4]; /* Dimension array to test with */ - hsize_t tmax[4]; - hssize_t n; /* Number of dataspace elements */ - herr_t ret; /* Generic return value */ + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, + SPACE2_DIM4}; + hsize_t dims3[H5S_MAX_RANK+1]; + hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, + SPACE2_MAX4}; + hsize_t tdims[4]; /* Dimension array to test with */ + hsize_t tmax[4]; + hssize_t n; /* Number of dataspace elements */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace Manipulation\n")); @@ -132,7 +130,7 @@ test_h5s_basic(void) n = H5Sget_simple_extent_npoints(sid1); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(sid1); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -141,7 +139,7 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid1, tdims, NULL); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); sid2 = H5Screate_simple(SPACE2_RANK, dims2, max2); CHECK(sid2, FAIL, "H5Screate_simple"); @@ -149,7 +147,7 @@ test_h5s_basic(void) n = H5Sget_simple_extent_npoints(sid2); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(sid2); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -158,9 +156,9 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid2, tdims, tmax); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); /* Change max dims to be equal to the dimensions */ ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL); @@ -168,9 +166,9 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid1, tdims, tmax); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tmax, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); @@ -183,7 +181,7 @@ test_h5s_basic(void) * dimensions. */ H5E_BEGIN_TRY { - sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL); + sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL); } H5E_END_TRY; VERIFY(sid1, FAIL, "H5Screate_simple"); @@ -306,7 +304,7 @@ test_h5s_basic(void) CHECK(ret, FAIL, "H5Sclose"); ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_basic() */ +} /* test_h5s_basic() */ /**************************************************************** ** @@ -366,16 +364,16 @@ test_h5s_null(void) hsize_t start[1]={0}; hsize_t count[1]={0}; - ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_hyperslab"); /* Check to be sure we can't set a point selection on a null dataspace */ H5E_BEGIN_TRY { - hsize_t coord[1][1]; /* Coordinates for point selection */ + hsize_t coord[1][1]; /* Coordinates for point selection */ coord[0][0]=0; - ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_elements"); @@ -536,18 +534,18 @@ test_h5s_null(void) static void test_h5s_zero_dim(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t sid1, attr_sid; /* Dataspace ID */ - hid_t sid_chunk; /* Dataspace ID for chunked dataset */ - hid_t dset1; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t sid1, attr_sid; /* Dataspace ID */ + hid_t sid_chunk; /* Dataspace ID for chunked dataset */ + hid_t dset1; /* Dataset ID */ hid_t plist_id; /* Dataset creation property list */ hid_t attr; /* Attribute ID */ - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t chunk_dims[] = {SPACE1_DIM1, SPACE1_DIM2/3, SPACE1_DIM3}; - hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */ + hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */ int wdata[SPACE1_DIM2][SPACE1_DIM3]; int rdata[SPACE1_DIM2][SPACE1_DIM3]; short wdata_short[SPACE1_DIM2][SPACE1_DIM3]; @@ -557,12 +555,12 @@ test_h5s_zero_dim(void) int val = 3; hsize_t start[] = {0, 0, 0}; hsize_t count[] = {3, 15, 13}; - hsize_t coord[1][3]; /* Coordinates for point selection */ + hsize_t coord[1][3]; /* Coordinates for point selection */ hssize_t nelem; /* Number of elements */ H5S_sel_type sel_type; /* Type of selection currently */ H5S_class_t stype; /* dataspace type */ H5D_alloc_time_t alloc_time; /* Space allocation time */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ unsigned int i, j, k; /* Output message about test being performed */ @@ -638,8 +636,8 @@ test_h5s_zero_dim(void) CHECK(sid_chunk, FAIL, "H5Screate_simple"); /*============================================ - * Make sure we can use 0-dimension to create - * contiguous, chunked, compact, and external + * Make sure we can use 0-dimension to create + * contiguous, chunked, compact, and external * datasets, and also attribute. *============================================ */ @@ -703,7 +701,7 @@ test_h5s_zero_dim(void) } } - /* Select a hyperslab beyond its current dimension sizes, then try to write + /* Select a hyperslab beyond its current dimension sizes, then try to write * the data. It should fail. */ ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -717,7 +715,7 @@ test_h5s_zero_dim(void) ret = H5Sselect_none(sid1); CHECK(ret, FAIL, "H5Sselect_none"); - /* Select a point beyond the dimension size, then try to write the data. + /* Select a point beyond the dimension size, then try to write the data. * It should fail. */ coord[0][0]=2; coord[0][1]=5; coord[0][2]=3; ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); @@ -769,8 +767,8 @@ test_h5s_zero_dim(void) } } - /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure - * we can write data to it */ + /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure + * we can write data to it */ extend_dims[0] = SPACE1_DIM1; ret = H5Dset_extent(dset1, extend_dims); CHECK(ret, FAIL, "H5Dset_extent"); @@ -970,10 +968,10 @@ test_h5s_zero_dim(void) CHECK(ret, FAIL, "H5Aclose"); /*=============================================================== - * Extend the dimension to make it a normal dataspace (3x15x13). - * Verify that data can be written to and read from the chunked - * dataset now. - *=============================================================== + * Extend the dimension to make it a normal dataspace (3x15x13). + * Verify that data can be written to and read from the chunked + * dataset now. + *=============================================================== */ dims1[0]=SPACE1_DIM1; ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,max_dims); @@ -1174,14 +1172,14 @@ test_h5s_zero_dim(void) static void test_h5s_encode(void) { - hid_t sid1, sid2, sid3; /* Dataspace ID */ + hid_t sid1, sid2, sid3; /* Dataspace ID */ hid_t decoded_sid1, decoded_sid2, decoded_sid3; - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; size_t sbuf_size=0, null_size=0, scalar_size=0; unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL; - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ hsize_t start[] = {0, 0, 0}; hsize_t stride[] = {2, 5, 3}; hsize_t count[] = {2, 2, 2}; @@ -1189,8 +1187,8 @@ test_h5s_encode(void) H5S_sel_type sel_type; H5S_class_t space_type; hssize_t nblocks; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace Encoding and Decoding\n")); @@ -1214,7 +1212,7 @@ test_h5s_encode(void) /* Try decoding bogus buffer */ H5E_BEGIN_TRY { - ret_id = H5Sdecode(sbuf); + ret_id = H5Sdecode(sbuf); } H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Sdecode"); @@ -1229,7 +1227,7 @@ test_h5s_encode(void) n = H5Sget_simple_extent_npoints(decoded_sid1); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(decoded_sid1); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -1238,7 +1236,7 @@ test_h5s_encode(void) rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); /* Verify hyperslabe selection */ sel_type = H5Sget_select_type(decoded_sid1); @@ -1328,7 +1326,7 @@ test_h5s_encode(void) HDfree(sbuf); HDfree(null_sbuf); HDfree(scalar_buf); -} /* test_h5s_encode() */ +} /* test_h5s_encode() */ /**************************************************************** ** @@ -1338,14 +1336,14 @@ test_h5s_encode(void) static void test_h5s_scalar_write(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ H5S_class_t ext_type; /* Extent type */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation during Writing\n")); @@ -1397,7 +1395,7 @@ test_h5s_scalar_write(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_scalar_write() */ +} /* test_h5s_scalar_write() */ /**************************************************************** ** @@ -1407,14 +1405,14 @@ test_h5s_scalar_write(void) static void test_h5s_scalar_read(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - unsigned rdata; /* Scalar data read in */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + unsigned rdata; /* Scalar data read in */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -1461,7 +1459,7 @@ test_h5s_scalar_read(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_scalar_read() */ +} /* test_h5s_scalar_read() */ /**************************************************************** ** @@ -1472,14 +1470,14 @@ test_h5s_scalar_read(void) static void test_h5s_compound_scalar_write(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Writing Compound Datatypes\n")); @@ -1493,19 +1491,19 @@ test_h5s_compound_scalar_write(void) CHECK(tid1, FAIL, "H5Tcreate"); space4_field1_off=HOFFSET(struct space4_struct, c1); ret = H5Tinsert(tid1, SPACE4_FIELDNAME1, space4_field1_off, - H5T_NATIVE_SCHAR); + H5T_NATIVE_SCHAR); CHECK(ret, FAIL, "H5Tinsert"); space4_field2_off=HOFFSET(struct space4_struct, u); ret = H5Tinsert(tid1, SPACE4_FIELDNAME2, space4_field2_off, - H5T_NATIVE_UINT); + H5T_NATIVE_UINT); CHECK(ret, FAIL, "H5Tinsert"); space4_field3_off=HOFFSET(struct space4_struct, f); ret = H5Tinsert(tid1, SPACE4_FIELDNAME3, space4_field3_off, - H5T_NATIVE_FLOAT); + H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); space4_field4_off=HOFFSET(struct space4_struct, c2); ret = H5Tinsert(tid1, SPACE4_FIELDNAME4, space4_field4_off, - H5T_NATIVE_SCHAR); + H5T_NATIVE_SCHAR); CHECK(ret, FAIL, "H5Tinsert"); /* Create scalar dataspace */ @@ -1545,7 +1543,7 @@ test_h5s_compound_scalar_write(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_compound_scalar_write() */ +} /* test_h5s_compound_scalar_write() */ /**************************************************************** ** @@ -1556,15 +1554,15 @@ test_h5s_compound_scalar_write(void) static void test_h5s_compound_scalar_read(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t type; /* Datatype */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - struct space4_struct rdata; /* Scalar data read in */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t type; /* Datatype */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + struct space4_struct rdata; /* Scalar data read in */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Reading Compound Datatypes\n")); @@ -1618,7 +1616,7 @@ test_h5s_compound_scalar_read(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_compound_scalar_read() */ +} /* test_h5s_compound_scalar_read() */ /* Data arrays for chunk test */ double chunk_data_dbl[50000][3]; @@ -2384,7 +2382,7 @@ test_h5s_bug1(void) CHECK(ret, FAIL, "H5Sclose"); } /* test_h5s_bug1() */ - + /*------------------------------------------------------------------------- * Function: test_versionbounds * @@ -2395,8 +2393,8 @@ test_h5s_bug1(void) * reopens it with higher bounds to show that the dataspace * version is upgraded appropriately. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * *------------------------------------------------------------------------- */ @@ -2501,13 +2499,13 @@ test_versionbounds(void) ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); } /* end test_versionbounds() */ - + /**************************************************************** ** ** test_h5s(): Main H5S (dataspace) testing routine. @@ -2519,34 +2517,34 @@ test_h5s(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspaces\n")); - test_h5s_basic(); /* Test basic H5S code */ - test_h5s_null(); /* Test Null dataspace H5S code */ + test_h5s_basic(); /* Test basic H5S code */ + test_h5s_null(); /* Test Null dataspace H5S code */ test_h5s_zero_dim(); /* Test dataspace with zero dimension size */ test_h5s_encode(); /* Test encoding and decoding */ - test_h5s_scalar_write(); /* Test scalar H5S writing code */ - test_h5s_scalar_read(); /* Test scalar H5S reading code */ + test_h5s_scalar_write(); /* Test scalar H5S writing code */ + test_h5s_scalar_read(); /* Test scalar H5S reading code */ - test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */ - test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */ + test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */ + test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */ /* This test was added later to exercise a bug in chunked I/O */ - test_h5s_chunk(); /* Exercise bug fix for chunked I/O */ + test_h5s_chunk(); /* Exercise bug fix for chunked I/O */ - test_h5s_extent_equal(); /* Test extent comparison code */ + test_h5s_extent_equal(); /* Test extent comparison code */ test_h5s_extent_copy(); /* Test extent copy code */ test_h5s_bug1(); /* Test bug in offset initialization */ test_versionbounds(); /* Test version bounds with dataspace */ } /* test_h5s() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_h5s + * Function: cleanup_h5s * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/test/ttsafe.h b/test/ttsafe.h index 6cf449f..c29fadc 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -22,9 +22,6 @@ * Include required headers. This file tests internal library functions, * so we include the private headers here. */ -#include "hdf5.h" -#include "H5private.h" -#include "H5Eprivate.h" #include "testhdf5.h" diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 700e993..5768e35 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -16,12 +16,11 @@ * */ -#include "h5test.h" #include "testpar.h" -#define H5AC_FRIEND /*suppress error about including H5ACpkg */ -#define H5C_FRIEND /*suppress error about including H5Cpkg */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5AC_FRIEND /*suppress error about including H5ACpkg */ +#define H5C_FRIEND /*suppress error about including H5Cpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5ACpkg.h" #include "H5Cpkg.h" @@ -33,9 +32,9 @@ #define BASE_ADDR (haddr_t)1024 -int nerrors = 0; -int failures = 0; -hbool_t verbose = TRUE; /* used to control error messages */ +int nerrors = 0; +int failures = 0; +hbool_t verbose = TRUE; /* used to control error messages */ #define NFILENAME 2 #define PARATESTFILE filenames[0] @@ -45,23 +44,23 @@ const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL}; #endif /* !PATH_MAX */ char filenames[NFILENAME][PATH_MAX]; hid_t fapl; /* file access property list */ -haddr_t max_addr = 0; /* used to store the end of - * the address space used by - * the data array (see below). - */ -hbool_t callbacks_verbose = FALSE; /* flag used to control whether - * the callback functions are in - * verbose mode. - */ +haddr_t max_addr = 0; /* used to store the end of + * the address space used by + * the data array (see below). + */ +hbool_t callbacks_verbose = FALSE; /* flag used to control whether + * the callback functions are in + * verbose mode. + */ -int world_mpi_size = -1; -int world_mpi_rank = -1; -int world_server_mpi_rank = -1; -MPI_Comm world_mpi_comm = MPI_COMM_NULL; -int file_mpi_size = -1; -int file_mpi_rank = -1; -MPI_Comm file_mpi_comm = MPI_COMM_NULL; +int world_mpi_size = -1; +int world_mpi_rank = -1; +int world_server_mpi_rank = -1; +MPI_Comm world_mpi_comm = MPI_COMM_NULL; +int file_mpi_size = -1; +int file_mpi_rank = -1; +MPI_Comm file_mpi_comm = MPI_COMM_NULL; /* the following globals are used to maintain rudementary statistics @@ -74,67 +73,67 @@ long datum_destroys = 0; long datum_flushes = 0; long datum_pinned_flushes = 0; long datum_loads = 0; -long global_pins = 0; -long global_dirty_pins = 0; -long local_pins = 0; +long global_pins = 0; +long global_dirty_pins = 0; +long local_pins = 0; /* the following fields are used by the server process only */ -int total_reads = 0; +int total_reads = 0; int total_writes = 0; /***************************************************************************** * struct datum * - * Instances of struct datum are used to store information on entries - * that may be loaded into the cache. The individual fields are - * discussed below: + * Instances of struct datum are used to store information on entries + * that may be loaded into the cache. The individual fields are + * discussed below: * - * header: Instance of H5C_cache_entry_t used by the for its data. - * This field is only used on the file processes, not on the - * server process. + * header: Instance of H5C_cache_entry_t used by the for its data. + * This field is only used on the file processes, not on the + * server process. * - * This field MUST be the first entry in this structure. + * This field MUST be the first entry in this structure. * - * base_addr: Base address of the entry. + * base_addr: Base address of the entry. * - * len: Length of the entry. + * len: Length of the entry. * - * local_len: Length of the entry according to the cache. This - * value must be positive, and may not be larger than len. + * local_len: Length of the entry according to the cache. This + * value must be positive, and may not be larger than len. * - * The field exists to allow us change the sizes of entries - * in the cache without upsetting the server. This value - * is only used locally, and is never sent to the server. + * The field exists to allow us change the sizes of entries + * in the cache without upsetting the server. This value + * is only used locally, and is never sent to the server. * - * ver: Version number of the entry. This number is initialize - * to zero, and incremented each time the entry is modified. + * ver: Version number of the entry. This number is initialize + * to zero, and incremented each time the entry is modified. * - * dirty: Boolean flag indicating whether the entry is dirty. + * dirty: Boolean flag indicating whether the entry is dirty. * - * For current purposes, an entry is clean until it is - * modified, and dirty until written to the server (cache - * on process 0) or until it is marked clean (all other - * caches). + * For current purposes, an entry is clean until it is + * modified, and dirty until written to the server (cache + * on process 0) or until it is marked clean (all other + * caches). * - * valid: Boolean flag indicating whether the entry contains - * valid data. Attempts to read an entry whose valid - * flag is not set should trigger an error. + * valid: Boolean flag indicating whether the entry contains + * valid data. Attempts to read an entry whose valid + * flag is not set should trigger an error. * - * locked: Boolean flag that is set to true iff the entry is in - * the cache and locked. + * locked: Boolean flag that is set to true iff the entry is in + * the cache and locked. * - * global_pinned: Boolean flag that is set to true iff the entry has - * been pinned collectively in all caches. Since writes must - * be collective across all processes, only entries pinned - * in this fashion may be marked dirty. + * global_pinned: Boolean flag that is set to true iff the entry has + * been pinned collectively in all caches. Since writes must + * be collective across all processes, only entries pinned + * in this fashion may be marked dirty. * - * local_pinned: Boolean flag that is set to true iff the entry - * has been pinned in the local cache, but probably not all - * caches. Such pins will typically not be consistant across - * processes, and thus cannot be marked as dirty unless they - * happen to overlap some collective operation. + * local_pinned: Boolean flag that is set to true iff the entry + * has been pinned in the local cache, but probably not all + * caches. Such pins will typically not be consistant across + * processes, and thus cannot be marked as dirty unless they + * happen to overlap some collective operation. * * cleared: Boolean flag that is set to true whenever the entry is * dirty, and is cleared via a call to datum_notify with the @@ -143,61 +142,61 @@ int total_writes = 0; * flushed: Boolean flag that is set to true whenever the entry is * dirty, and is flushed by the metadata cache. * - * reads: Integer field used to maintain a count of the number of - * times this entry has been read from the server since - * the last time the read and write counts were reset. + * reads: Integer field used to maintain a count of the number of + * times this entry has been read from the server since + * the last time the read and write counts were reset. * - * writes: Integer field used to maintain a count of the number of - * times this entry has been written to the server since - * the last time the read and write counts were reset. + * writes: Integer field used to maintain a count of the number of + * times this entry has been written to the server since + * the last time the read and write counts were reset. * - * index: Index of this instance of datum in the data_index[] array - * discussed below. + * index: Index of this instance of datum in the data_index[] array + * discussed below. * - * aux_ptr: Pointer to the instance of H5AC_aux_t associated with the - * instance of the metadata cache within which this entry - * resides. This field was added to allow us to pass this - * value to the notify callback from the serialize callback. - * It should be NULL when not in use. + * aux_ptr: Pointer to the instance of H5AC_aux_t associated with the + * instance of the metadata cache within which this entry + * resides. This field was added to allow us to pass this + * value to the notify callback from the serialize callback. + * It should be NULL when not in use. * *****************************************************************************/ struct datum { - H5C_cache_entry_t header; - haddr_t base_addr; - size_t len; - size_t local_len; - int ver; - hbool_t dirty; - hbool_t valid; - hbool_t locked; - hbool_t global_pinned; - hbool_t local_pinned; - hbool_t cleared; + H5C_cache_entry_t header; + haddr_t base_addr; + size_t len; + size_t local_len; + int ver; + hbool_t dirty; + hbool_t valid; + hbool_t locked; + hbool_t global_pinned; + hbool_t local_pinned; + hbool_t cleared; hbool_t flushed; - int reads; - int writes; - int index; + int reads; + int writes; + int index; struct H5AC_aux_t * aux_ptr; }; /***************************************************************************** * data array * - * The data array is an array of instances of datum of size - * NUM_DATA_ENTRIES that is used to track the particulars of all - * the entries that may be loaded into the cache. + * The data array is an array of instances of datum of size + * NUM_DATA_ENTRIES that is used to track the particulars of all + * the entries that may be loaded into the cache. * - * It exists on all processes, although the master copy is maintained - * by the server process. If the cache is performing correctly, all - * versions should be effectively identical. By that I mean that - * the data received from the server should always match that in - * the local version of the data array. + * It exists on all processes, although the master copy is maintained + * by the server process. If the cache is performing correctly, all + * versions should be effectively identical. By that I mean that + * the data received from the server should always match that in + * the local version of the data array. * *****************************************************************************/ -#define NUM_DATA_ENTRIES 100000 +#define NUM_DATA_ENTRIES 100000 struct datum data[NUM_DATA_ENTRIES]; @@ -216,10 +215,10 @@ struct datum data[NUM_DATA_ENTRIES]; * Further, this value must be consistant across all processes. */ -#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES -#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10) +#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES +#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10) /* Use a smaller test size to avoid creating huge MPE logfiles. */ -#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100) +#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100) int virt_num_data_entries = NUM_DATA_ENTRIES; @@ -227,14 +226,14 @@ int virt_num_data_entries = NUM_DATA_ENTRIES; /***************************************************************************** * data_index array * - * The data_index array is an array of integer used to maintain a list - * of instances of datum in the data array in increasing base_addr order. + * The data_index array is an array of integer used to maintain a list + * of instances of datum in the data array in increasing base_addr order. * - * This array is necessary, as move operations can swap the values - * of the base_addr fields of two instances of datum. Without this - * array, we would no longer be able to use a binary search on a sorted - * list to find the indexes of instances of datum given the values of - * their base_addr fields. + * This array is necessary, as move operations can swap the values + * of the base_addr fields of two instances of datum. Without this + * array, we would no longer be able to use a binary search on a sorted + * list to find the indexes of instances of datum given the values of + * their base_addr fields. * *****************************************************************************/ @@ -243,99 +242,99 @@ int data_index[NUM_DATA_ENTRIES]; /***************************************************************************** * The following two #defines are used to control code that is in turn used - * to force "POSIX" semantics on the server process used to simulate metadata - * reads and writes. Without some such mechanism, the test code contains + * to force "POSIX" semantics on the server process used to simulate metadata + * reads and writes. Without some such mechanism, the test code contains * race conditions that will frequently cause spurious failures. * * When set to TRUE, DO_WRITE_REQ_ACK forces the server to send an ack after - * each write request, and the client to wait until the ack is received + * each write request, and the client to wait until the ack is received * before proceeding. This was my first solution to the problem, and at * first glance, it would seem to have a lot of unnecessary overhead. * * In an attempt to reduce the overhead, I implemented a second solution - * in which no acks are sent after writes. Instead, the metadata cache is - * provided with a callback function to call after each sequence of writes. - * This callback simply causes the client to send the server process a + * in which no acks are sent after writes. Instead, the metadata cache is + * provided with a callback function to call after each sequence of writes. + * This callback simply causes the client to send the server process a * "sync" message and and await an ack in reply. * - * Strangely, at least on Phoenix, the first solution runs faster by a - * rather large margin. However, I can imagine this changing with + * Strangely, at least on Phoenix, the first solution runs faster by a + * rather large margin. However, I can imagine this changing with * different OS's and MPI implementatins. * - * Thus I have left code supporting the second solution in place. + * Thus I have left code supporting the second solution in place. * - * Note that while one of these two #defines must be set to TRUE, there - * should never be any need to set both of them to TRUE (although the + * Note that while one of these two #defines must be set to TRUE, there + * should never be any need to set both of them to TRUE (although the * tests will still function with this setting). *****************************************************************************/ -#define DO_WRITE_REQ_ACK TRUE -#define DO_SYNC_AFTER_WRITE FALSE +#define DO_WRITE_REQ_ACK TRUE +#define DO_SYNC_AFTER_WRITE FALSE /***************************************************************************** * struct mssg * - * The mssg structure is used as a generic container for messages to - * and from the server. Not all fields are used in all cases. + * The mssg structure is used as a generic container for messages to + * and from the server. Not all fields are used in all cases. * - * req: Integer field containing the type of the message. + * req: Integer field containing the type of the message. * - * src: World communicator MPI rank of the sending process. + * src: World communicator MPI rank of the sending process. * - * dest: World communicator MPI rank of the destination process. + * dest: World communicator MPI rank of the destination process. * - * mssg_num: Serial number assigned to the message by the sender. + * mssg_num: Serial number assigned to the message by the sender. * - * base_addr: Base address of a datum. Not used in all mssgs. + * base_addr: Base address of a datum. Not used in all mssgs. * - * len: Length of a datum (in bytes). Not used in all mssgs. + * len: Length of a datum (in bytes). Not used in all mssgs. * - * ver: Version number of a datum. Not used in all mssgs. + * ver: Version number of a datum. Not used in all mssgs. * - * count: Reported number of total/entry reads/writes. Not used - * in all mssgs. + * count: Reported number of total/entry reads/writes. Not used + * in all mssgs. * - * magic: Magic number for error detection. Must be set to - * MSSG_MAGIC. + * magic: Magic number for error detection. Must be set to + * MSSG_MAGIC. * *****************************************************************************/ -#define WRITE_REQ_CODE 0 -#define WRITE_REQ_ACK_CODE 1 -#define READ_REQ_CODE 2 -#define READ_REQ_REPLY_CODE 3 -#define SYNC_REQ_CODE 4 -#define SYNC_ACK_CODE 5 -#define REQ_TTL_WRITES_CODE 6 -#define REQ_TTL_WRITES_RPLY_CODE 7 -#define REQ_TTL_READS_CODE 8 -#define REQ_TTL_READS_RPLY_CODE 9 -#define REQ_ENTRY_WRITES_CODE 10 -#define REQ_ENTRY_WRITES_RPLY_CODE 11 -#define REQ_ENTRY_READS_CODE 12 -#define REQ_ENTRY_READS_RPLY_CODE 13 -#define REQ_RW_COUNT_RESET_CODE 14 -#define REQ_RW_COUNT_RESET_RPLY_CODE 15 -#define DONE_REQ_CODE 16 -#define MAX_REQ_CODE 16 - -#define MSSG_MAGIC 0x1248 +#define WRITE_REQ_CODE 0 +#define WRITE_REQ_ACK_CODE 1 +#define READ_REQ_CODE 2 +#define READ_REQ_REPLY_CODE 3 +#define SYNC_REQ_CODE 4 +#define SYNC_ACK_CODE 5 +#define REQ_TTL_WRITES_CODE 6 +#define REQ_TTL_WRITES_RPLY_CODE 7 +#define REQ_TTL_READS_CODE 8 +#define REQ_TTL_READS_RPLY_CODE 9 +#define REQ_ENTRY_WRITES_CODE 10 +#define REQ_ENTRY_WRITES_RPLY_CODE 11 +#define REQ_ENTRY_READS_CODE 12 +#define REQ_ENTRY_READS_RPLY_CODE 13 +#define REQ_RW_COUNT_RESET_CODE 14 +#define REQ_RW_COUNT_RESET_RPLY_CODE 15 +#define DONE_REQ_CODE 16 +#define MAX_REQ_CODE 16 + +#define MSSG_MAGIC 0x1248 struct mssg_t { - int req; - int src; - int dest; - long int mssg_num; - haddr_t base_addr; - unsigned len; - int ver; - unsigned count; - unsigned magic; + int req; + int src; + int dest; + long int mssg_num; + haddr_t base_addr; + unsigned len; + int ver; + unsigned count; + unsigned magic; }; -MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */ +MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */ /*****************************************************************************/ @@ -409,24 +408,24 @@ static herr_t datum_notify(H5C_notify_action_t action, void *thing); static herr_t datum_free_icr(void * thing); /* Masquerade as object header entries to the cache */ -#define DATUM_ENTRY_TYPE H5AC_OHDR_ID +#define DATUM_ENTRY_TYPE H5AC_OHDR_ID -#define NUMBER_OF_ENTRY_TYPES 1 +#define NUMBER_OF_ENTRY_TYPES 1 /* Note the use of the H5AC__CLASS_SKIP_READS and H5AC__CLASS_SKIP_WRITES * flags. As a result of these flags, the metadata cache does no file I/O * on metadata of the datum type. * - * Instead, this test uses a server process to keep track of who has + * Instead, this test uses a server process to keep track of who has * written and read what, and to verify that there are no messages from * the past / future. * - * In the callbacks for the version 2 cache, this activity was hidden in + * In the callbacks for the version 2 cache, this activity was hidden in * the load and flush callbacks. However, now we handle this function in * notify callbacks for the after load and after flush events. * - * JRM -- 1/13/15 + * JRM -- 1/13/15 */ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { @@ -474,9 +473,9 @@ static void pin_protected_entry(int32_t idx, hbool_t global); static void move_entry(H5F_t * file_ptr, int32_t old_idx, int32_t new_idx); static hbool_t reset_server_counts(void); static void resize_entry(int32_t idx, size_t new_size); -static hbool_t setup_cache_for_test(hid_t * fid_ptr, +static hbool_t setup_cache_for_test(hid_t * fid_ptr, H5F_t ** file_ptr_ptr, - H5C_t ** cache_ptr_ptr, + H5C_t ** cache_ptr_ptr, int metadata_write_strategy); static void setup_rand(void); static hbool_t take_down_cache(hid_t fid, H5C_t * cache_ptr); @@ -550,17 +549,17 @@ print_stats(void) /***************************************************************************** * - * Function: reset_stats() + * Function: reset_stats() * - * Purpose: Reset the rudementary stats maintained by t_cache. + * Purpose: Reset the rudementary stats maintained by t_cache. * - * Return: void + * Return: void * - * Programmer: JRM -- 4/17/06 + * Programmer: JRM -- 4/17/06 * * Modifications: * - * None. + * None. * *****************************************************************************/ @@ -573,9 +572,9 @@ reset_stats(void) datum_flushes = 0; datum_pinned_flushes = 0; datum_loads = 0; - global_pins = 0; - global_dirty_pins = 0; - local_pins = 0; + global_pins = 0; + global_dirty_pins = 0; + local_pins = 0; return; @@ -588,20 +587,20 @@ reset_stats(void) /***************************************************************************** * - * Function: set_up_file_communicator() + * Function: set_up_file_communicator() * - * Purpose: Create the MPI communicator used to open a HDF5 file with. - * In passing, also initialize the file_mpi... globals. + * Purpose: Create the MPI communicator used to open a HDF5 file with. + * In passing, also initialize the file_mpi... globals. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 11/16/05 + * Programmer: JRM -- 11/16/05 * * Modifications: * - * None. + * None. * *****************************************************************************/ @@ -623,7 +622,7 @@ set_up_file_communicator(void) nerrors++; success = FALSE; - if ( verbose ) { + if ( verbose ) { fprintf(stdout, "%d:%s: MPI_Comm_group() failed with error %d.\n", world_mpi_rank, FUNC, mpi_result); @@ -740,16 +739,16 @@ set_up_file_communicator(void) /***************************************************************************** * - * Function: addr_to_datum_index() + * Function: addr_to_datum_index() * - * Purpose: Given the base address of a datum, find and return its index - * in the data array. + * Purpose: Given the base address of a datum, find and return its index + * in the data array. * - * Return: Success: index of target datum. + * Return: Success: index of target datum. * - * Failure: -1. + * Failure: -1. * - * Programmer: JRM -- 12/20/05 + * Programmer: JRM -- 12/20/05 * *****************************************************************************/ static int @@ -787,16 +786,16 @@ addr_to_datum_index(haddr_t base_addr) /***************************************************************************** * - * Function: init_data() + * Function: init_data() * - * Purpose: Initialize the data array, from which cache entries are - * loaded. + * Purpose: Initialize the data array, from which cache entries are + * loaded. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/20/05 + * Programmer: JRM -- 12/20/05 * *****************************************************************************/ static void @@ -831,14 +830,14 @@ init_data(void) data[i].dirty = FALSE; data[i].valid = FALSE; data[i].locked = FALSE; - data[i].global_pinned = FALSE; - data[i].local_pinned = FALSE; - data[i].cleared = FALSE; + data[i].global_pinned = FALSE; + data[i].local_pinned = FALSE; + data[i].cleared = FALSE; data[i].flushed = FALSE; data[i].reads = 0; data[i].writes = 0; - data[i].index = i; - data[i].aux_ptr = NULL; + data[i].index = i; + data[i].aux_ptr = NULL; data_index[i] = i; @@ -862,22 +861,22 @@ init_data(void) /***************************************************************************** * - * Function: do_express_test() + * Function: do_express_test() * - * Purpose: Do an MPI_Allreduce to obtain the maximum value returned - * by GetTestExpress() across all processes. Return this - * value. + * Purpose: Do an MPI_Allreduce to obtain the maximum value returned + * by GetTestExpress() across all processes. Return this + * value. * - * Envirmoment variables can be different across different - * processes. This function ensures that all processes agree - * on whether to do an express test. + * Envirmoment variables can be different across different + * processes. This function ensures that all processes agree + * on whether to do an express test. * - * Return: Success: Maximum of the values returned by - * GetTestExpress() across all processes. + * Return: Success: Maximum of the values returned by + * GetTestExpress() across all processes. * - * Failure: -1 + * Failure: -1 * - * Programmer: JRM -- 4/25/06 + * Programmer: JRM -- 4/25/06 * *****************************************************************************/ static int @@ -913,19 +912,19 @@ do_express_test(void) /***************************************************************************** * - * Function: do_sync() + * Function: do_sync() * - * Purpose: Ensure that all messages sent by this process have been - * processed before proceeding. + * Purpose: Ensure that all messages sent by this process have been + * processed before proceeding. * - * Do this by exchanging sync req / sync ack messages with - * the server. + * Do this by exchanging sync req / sync ack messages with + * the server. * - * Do nothing if nerrors is greater than zero. + * Do nothing if nerrors is greater than zero. * - * Return: void + * Return: void * - * Programmer: JRM -- 5/10/06 + * Programmer: JRM -- 5/10/06 * *****************************************************************************/ static void @@ -937,7 +936,7 @@ do_sync(void) if ( nerrors <= 0 ) { /* compose the message */ - mssg.req = SYNC_REQ_CODE; + mssg.req = SYNC_REQ_CODE; mssg.src = world_mpi_rank; mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ @@ -947,10 +946,10 @@ do_sync(void) mssg.count = 0; mssg.magic = MSSG_MAGIC; - if ( ! send_mssg(&mssg, FALSE) ) { + if ( ! send_mssg(&mssg, FALSE) ) { - nerrors++; - if ( verbose ) { + nerrors++; + if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC); } @@ -959,24 +958,24 @@ do_sync(void) if ( nerrors <= 0 ) { - if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) { + if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) { nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC); } - } else if ( ( mssg.req != SYNC_ACK_CODE ) || + } else if ( ( mssg.req != SYNC_ACK_CODE ) || ( mssg.src != world_server_mpi_rank ) || ( mssg.dest != world_mpi_rank ) || - ( mssg.magic != MSSG_MAGIC ) ) { + ( mssg.magic != MSSG_MAGIC ) ) { nerrors++; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in sync ack.\n", world_mpi_rank, FUNC); } - } + } } return; @@ -986,17 +985,17 @@ do_sync(void) /***************************************************************************** * - * Function: get_max_nerrors() + * Function: get_max_nerrors() * - * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors - * across all processes. Return this value. + * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors + * across all processes. Return this value. * - * Return: Success: Maximum of the nerrors global variables across - * all processes. + * Return: Success: Maximum of the nerrors global variables across + * all processes. * - * Failure: -1 + * Failure: -1 * - * Programmer: JRM -- 1/3/06 + * Programmer: JRM -- 1/3/06 * *****************************************************************************/ static int @@ -1033,29 +1032,29 @@ get_max_nerrors(void) /***************************************************************************** * - * Function: recv_mssg() + * Function: recv_mssg() * - * Purpose: Receive a message from any process in the provided instance - * of struct mssg. + * Purpose: Receive a message from any process in the provided instance + * of struct mssg. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * * Modifications: * - * JRM -- 5/10/06 - * Added mssg_tag_offset parameter and supporting code. + * JRM -- 5/10/06 + * Added mssg_tag_offset parameter and supporting code. * *****************************************************************************/ -#define CACHE_TEST_TAG 99 /* different from any used by the library */ +#define CACHE_TEST_TAG 99 /* different from any used by the library */ static hbool_t recv_mssg(struct mssg_t *mssg_ptr, - int mssg_tag_offset) + int mssg_tag_offset) { hbool_t success = TRUE; int mssg_tag = CACHE_TEST_TAG; @@ -1117,28 +1116,28 @@ recv_mssg(struct mssg_t *mssg_ptr, /***************************************************************************** * - * Function: send_mssg() + * Function: send_mssg() * - * Purpose: Send the provided instance of mssg to the indicated target. + * Purpose: Send the provided instance of mssg to the indicated target. * - * Note that all source and destination ranks are in the - * global communicator. + * Note that all source and destination ranks are in the + * global communicator. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * * Modifications: * - * JRM -- 5/10/06 - * Added the add_req_to_tag parameter and supporting code. + * JRM -- 5/10/06 + * Added the add_req_to_tag parameter and supporting code. * *****************************************************************************/ static hbool_t send_mssg(struct mssg_t *mssg_ptr, - hbool_t add_req_to_tag) + hbool_t add_req_to_tag) { hbool_t success = TRUE; int mssg_tag = CACHE_TEST_TAG; @@ -1166,10 +1165,10 @@ send_mssg(struct mssg_t *mssg_ptr, mssg_ptr->mssg_num = mssg_num++; - if ( add_req_to_tag ) { + if ( add_req_to_tag ) { - mssg_tag += mssg_ptr->req; - } + mssg_tag += mssg_ptr->req; + } result = MPI_Send((void *)mssg_ptr, 1, mpi_mssg_t, mssg_ptr->dest, mssg_tag, world_mpi_comm); @@ -1189,19 +1188,19 @@ send_mssg(struct mssg_t *mssg_ptr, } /* send_mssg() */ - + /***************************************************************************** * - * Function: setup_derived_types() + * Function: setup_derived_types() * - * Purpose: Set up the derived types used by the test bed. At present, - * only the mpi_mssg derived type is needed. + * Purpose: Set up the derived types used by the test bed. At present, + * only the mpi_mssg derived type is needed. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * *****************************************************************************/ static hbool_t @@ -1278,19 +1277,19 @@ setup_derived_types(void) } /* setup_derived_types */ - + /***************************************************************************** * - * Function: takedown_derived_types() + * Function: takedown_derived_types() * - * Purpose: take down the derived types used by the test bed. At present, - * only the mpi_mssg derived type is needed. + * Purpose: take down the derived types used by the test bed. At present, + * only the mpi_mssg derived type is needed. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * *****************************************************************************/ static hbool_t @@ -1322,16 +1321,16 @@ takedown_derived_types(void) /***************************************************************************** * - * Function: reset_server_counters() + * Function: reset_server_counters() * - * Purpose: Reset the counters maintained by the server, doing a - * sanity check in passing. + * Purpose: Reset the counters maintained by the server, doing a + * sanity check in passing. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -1363,7 +1362,7 @@ reset_server_counters(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%ld).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, actual_total_reads, total_reads); } } @@ -1374,7 +1373,7 @@ reset_server_counters(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%ld).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, actual_total_writes, total_writes); } } @@ -1389,25 +1388,25 @@ reset_server_counters(void) /***************************************************************************** * - * Function: server_main() + * Function: server_main() * - * Purpose: Main function for the server process. This process exists - * to provide an independant view of the data array. + * Purpose: Main function for the server process. This process exists + * to provide an independant view of the data array. * - * The function handles request from the other processes in - * the test until the count of done messages received equals - * the number of client processes. + * The function handles request from the other processes in + * the test until the count of done messages received equals + * the number of client processes. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * * Modifications: * - * JRM -- 5/10/06 - * Updated for sync message. + * JRM -- 5/10/06 + * Updated for sync message. * *****************************************************************************/ static hbool_t @@ -1437,98 +1436,98 @@ server_main(void) switch ( mssg.req ) { - case WRITE_REQ_CODE: - success = serve_write_request(&mssg); - break; + case WRITE_REQ_CODE: + success = serve_write_request(&mssg); + break; - case WRITE_REQ_ACK_CODE: + case WRITE_REQ_ACK_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received write ack?!?.\n", FUNC); - break; + break; - case READ_REQ_CODE: + case READ_REQ_CODE: success = serve_read_request(&mssg); - break; + break; - case READ_REQ_REPLY_CODE: + case READ_REQ_REPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received read req reply?!?.\n", FUNC); - break; + break; - case SYNC_REQ_CODE: + case SYNC_REQ_CODE: success = serve_sync_request(&mssg); - break; + break; - case SYNC_ACK_CODE: + case SYNC_ACK_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received sync ack?!?.\n", FUNC); - break; + break; - case REQ_TTL_WRITES_CODE: - success = serve_total_writes_request(&mssg); - break; + case REQ_TTL_WRITES_CODE: + success = serve_total_writes_request(&mssg); + break; - case REQ_TTL_WRITES_RPLY_CODE: + case REQ_TTL_WRITES_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received total writes reply?!?.\n", FUNC); - break; + break; - case REQ_TTL_READS_CODE: - success = serve_total_reads_request(&mssg); - break; + case REQ_TTL_READS_CODE: + success = serve_total_reads_request(&mssg); + break; - case REQ_TTL_READS_RPLY_CODE: + case REQ_TTL_READS_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received total reads reply?!?.\n", FUNC); - break; + break; - case REQ_ENTRY_WRITES_CODE: - success = serve_entry_writes_request(&mssg); - break; + case REQ_ENTRY_WRITES_CODE: + success = serve_entry_writes_request(&mssg); + break; - case REQ_ENTRY_WRITES_RPLY_CODE: + case REQ_ENTRY_WRITES_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", FUNC); - break; + break; - case REQ_ENTRY_READS_CODE: - success = serve_entry_reads_request(&mssg); - break; + case REQ_ENTRY_READS_CODE: + success = serve_entry_reads_request(&mssg); + break; - case REQ_ENTRY_READS_RPLY_CODE: + case REQ_ENTRY_READS_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", FUNC); - break; + break; - case REQ_RW_COUNT_RESET_CODE: - success = serve_rw_count_reset_request(&mssg); - break; + case REQ_RW_COUNT_RESET_CODE: + success = serve_rw_count_reset_request(&mssg); + break; - case REQ_RW_COUNT_RESET_RPLY_CODE: + case REQ_RW_COUNT_RESET_RPLY_CODE: success = FALSE; if(verbose) HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", FUNC); - break; + break; - case DONE_REQ_CODE: - done_count++; - if(done_count >= file_mpi_size) - done = TRUE; - break; + case DONE_REQ_CODE: + done_count++; + if(done_count >= file_mpi_size) + done = TRUE; + break; - default: + default: nerrors++; success = FALSE; if(verbose) - HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC); - break; + HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC); + break; } } } @@ -1537,23 +1536,23 @@ server_main(void) } /* server_main() */ - + /***************************************************************************** * - * Function: serve_read_request() + * Function: serve_read_request() * - * Purpose: Serve a read request. + * Purpose: Serve a read request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * a copy of the indicated datum from the data array to - * the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * a copy of the indicated datum from the data array to + * the requesting process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/22/05 + * Programmer: JRM -- 12/22/05 * *****************************************************************************/ static hbool_t @@ -1609,8 +1608,8 @@ serve_read_request(struct mssg_t * mssg_ptr) "%d:%s: proc %d read invalid entry. idx/base_addr = %d/%a.\n", world_mpi_rank, FUNC, mssg_ptr->src, - target_index, - data[target_index].base_addr); + target_index, + data[target_index].base_addr); } } else { @@ -1622,11 +1621,11 @@ serve_read_request(struct mssg_t * mssg_ptr) reply.base_addr = data[target_index].base_addr; reply.len = data[target_index].len; reply.ver = data[target_index].ver; - reply.count = 0; + reply.count = 0; reply.magic = MSSG_MAGIC; - /* and update the counters */ - total_reads++; + /* and update the counters */ + total_reads++; (data[target_index].reads)++; } } @@ -1641,7 +1640,7 @@ serve_read_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d read 0x%llx. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); @@ -1649,38 +1648,38 @@ serve_read_request(struct mssg_t * mssg_ptr) } else { HDfprintf(stdout, "%d read 0x%llx FAILED. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); } - } + } return(success); } /* serve_read_request() */ - + /***************************************************************************** * - * Function: serve_sync_request() + * Function: serve_sync_request() * - * Purpose: Serve a sync request. + * Purpose: Serve a sync request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends a - * sync ack to the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends a + * sync ack to the requesting process. * - * This service exist to allow the sending process to ensure - * that all previous messages have been processed before - * proceeding. + * This service exist to allow the sending process to ensure + * that all previous messages have been processed before + * proceeding. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/10/06 + * Programmer: JRM -- 5/10/06 * *****************************************************************************/ static hbool_t @@ -1712,7 +1711,7 @@ serve_sync_request(struct mssg_t * mssg_ptr) reply.base_addr = 0; reply.len = 0; reply.ver = 0; - reply.count = 0; + reply.count = 0; reply.magic = MSSG_MAGIC; } @@ -1732,29 +1731,29 @@ serve_sync_request(struct mssg_t * mssg_ptr) HDfprintf(stdout, "%d sync FAILED.\n", (int)(mssg_ptr->src)); } - } + } return(success); } /* serve_sync_request() */ - + /***************************************************************************** * - * Function: serve_write_request() + * Function: serve_write_request() * - * Purpose: Serve a write request. + * Purpose: Serve a write request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it updates - * the version number of the target data array entry as - * specified in the message. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it updates + * the version number of the target data array entry as + * specified in the message. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/21/05 + * Programmer: JRM -- 12/21/05 * *****************************************************************************/ static hbool_t @@ -1812,7 +1811,7 @@ serve_write_request(struct mssg_t * mssg_ptr) new_ver_num = mssg_ptr->ver; /* this check should catch duplicate writes */ - if ( new_ver_num <= data[target_index].ver ) { + if ( new_ver_num <= data[target_index].ver ) { nerrors++; success = FALSE; @@ -1826,12 +1825,12 @@ serve_write_request(struct mssg_t * mssg_ptr) if ( success ) { - /* process the write */ + /* process the write */ data[target_index].ver = new_ver_num; data[target_index].valid = TRUE; /* and update the counters */ - total_writes++; + total_writes++; (data[target_index].writes)++; #if DO_WRITE_REQ_ACK @@ -1847,7 +1846,7 @@ serve_write_request(struct mssg_t * mssg_ptr) reply.count = 0; reply.magic = MSSG_MAGIC; - /* and send it */ + /* and send it */ success = send_mssg(&reply, TRUE); #endif /* DO_WRITE_REQ_ACK */ @@ -1859,7 +1858,7 @@ serve_write_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d write 0x%llx. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); @@ -1867,36 +1866,36 @@ serve_write_request(struct mssg_t * mssg_ptr) } else { HDfprintf(stdout, "%d write 0x%llx FAILED. len = %d. ver = %d.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (int)(data[target_index].len), (int)(data[target_index].ver)); } - } + } return(success); } /* serve_write_request() */ - + /***************************************************************************** * - * Function: serve_total_writes_request() + * Function: serve_total_writes_request() * - * Purpose: Serve a request for the total number of writes recorded since - * the last reset. + * Purpose: Serve a request for the total number of writes recorded since + * the last reset. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the current value of the total_writes global variable to - * the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the current value of the total_writes global variable to + * the requesting process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -1942,40 +1941,40 @@ serve_total_writes_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request total writes %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_writes); } else { HDfprintf(stdout, "%d request total writes %ld -- FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_writes); } - } + } return(success); } /* serve_total_writes_request() */ - + /***************************************************************************** * - * Function: serve_total_reads_request() + * Function: serve_total_reads_request() * - * Purpose: Serve a request for the total number of reads recorded since - * the last reset. + * Purpose: Serve a request for the total number of reads recorded since + * the last reset. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the current value of the total_reads global variable to - * the requesting process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the current value of the total_reads global variable to + * the requesting process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2021,40 +2020,40 @@ serve_total_reads_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request total reads %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_reads); } else { HDfprintf(stdout, "%d request total reads %ld -- FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), total_reads); } - } + } return(success); } /* serve_total_reads_request() */ - + /***************************************************************************** * - * Function: serve_entry_writes_request() + * Function: serve_entry_writes_request() * - * Purpose: Serve an entry writes request. + * Purpose: Serve an entry writes request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the number of times that the indicated datum has been - * written since the last counter reset to the requesting - * process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the number of times that the indicated datum has been + * written since the last counter reset to the requesting + * process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2101,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = data[target_index].writes; + reply.count = data[target_index].writes; reply.magic = MSSG_MAGIC; } } @@ -2116,42 +2115,42 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request entry 0x%llx writes = %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].writes)); } else { HDfprintf(stdout, "%d request entry 0x%llx writes = %ld FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].writes)); } - } + } return(success); } /* serve_entry_writes_request() */ - + /***************************************************************************** * - * Function: serve_entry_reads_request() + * Function: serve_entry_reads_request() * - * Purpose: Serve an entry reads request. + * Purpose: Serve an entry reads request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it sends - * the number of times that the indicated datum has been - * read since the last counter reset to the requesting - * process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it sends + * the number of times that the indicated datum has been + * read since the last counter reset to the requesting + * process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2198,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = (long)(data[target_index].reads); + reply.count = (long)(data[target_index].reads); reply.magic = MSSG_MAGIC; } } @@ -2213,41 +2212,41 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) if ( success ) { HDfprintf(stdout, "%d request entry 0x%llx reads = %ld.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].reads)); } else { HDfprintf(stdout, "%d request entry 0x%llx reads = %ld FAILED.\n", - (int)(mssg_ptr->src), + (int)(mssg_ptr->src), (long long)(data[target_index].base_addr), (long)(data[target_index].reads)); } - } + } return(success); } /* serve_entry_reads_request() */ - + /***************************************************************************** * - * Function: serve_rw_count_reset_request() + * Function: serve_rw_count_reset_request() * - * Purpose: Serve read/write count reset request. + * Purpose: Serve read/write count reset request. * - * The function accepts a pointer to an instance of struct - * mssg_t as input. If all sanity checks pass, it resets the - * read/write counters, and sends a confirmation message to - * the calling process. + * The function accepts a pointer to an instance of struct + * mssg_t as input. If all sanity checks pass, it resets the + * read/write counters, and sends a confirmation message to + * the calling process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/5/10 + * Programmer: JRM -- 5/5/10 * *****************************************************************************/ static hbool_t @@ -2272,7 +2271,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) if ( success ) { success = reset_server_counters(); - } + } if ( success ) { @@ -2306,7 +2305,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) (int)(mssg_ptr->src)); } - } + } return(success); @@ -2317,15 +2316,15 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) /**************************** Call back functions ****************************/ /*****************************************************************************/ - + /*------------------------------------------------------------------------- - * Function: datum_get_initial_load_size + * Function: datum_get_initial_load_size * - * Purpose: Query the image size for an entry before deserializing it + * Purpose: Query the image size for an entry before deserializing it * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * 5/18/10 * *------------------------------------------------------------------------- @@ -2355,9 +2354,9 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr) if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: get_initial_load_size() idx = %d, addr = %ld, len = %d.\n", + "%d: get_initial_load_size() idx = %d, addr = %ld, len = %d.\n", world_mpi_rank, idx, (long)addr, (int)entry_ptr->local_len); - fflush(stdout); + fflush(stdout); } /* Set image length size */ @@ -2366,15 +2365,15 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr) return(SUCCEED); } /* get_initial_load_size() */ - + /*------------------------------------------------------------------------- - * Function: datum_deserialize + * Function: datum_deserialize * - * Purpose: deserialize the entry. + * Purpose: deserialize the entry. * - * Return: void * (pointer to the in core representation of the entry) + * Return: void * (pointer to the in core representation of the entry) * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/20/07 * *------------------------------------------------------------------------- @@ -2409,10 +2408,10 @@ datum_deserialize(const void * image_ptr, if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n", - world_mpi_rank, idx, (long)addr, (int)len, - (int)(entry_ptr->header.is_dirty)); - fflush(stdout); + "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n", + world_mpi_rank, idx, (long)addr, (int)len, + (int)(entry_ptr->header.is_dirty)); + fflush(stdout); } *dirty_ptr = FALSE; @@ -2427,18 +2426,18 @@ datum_deserialize(const void * image_ptr, } /* deserialize() */ - + /*------------------------------------------------------------------------- - * Function: datum_image_len + * Function: datum_image_len * - * Purpose: Return the real (and possibly reduced) length of the image. - * The helper functions verify that the correct version of - * deserialize is being called, and then call deserialize - * proper. + * Purpose: Return the real (and possibly reduced) length of the image. + * The helper functions verify that the correct version of + * deserialize is being called, and then call deserialize + * proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/19/07 * *------------------------------------------------------------------------- @@ -2465,10 +2464,10 @@ datum_image_len(const void *thing, size_t *image_len) if(callbacks_verbose) { HDfprintf(stdout, - "%d: image_len() idx = %d, addr = %ld, len = %d.\n", - world_mpi_rank, idx, (long)(entry_ptr->base_addr), - (int)(entry_ptr->local_len)); - fflush(stdout); + "%d: image_len() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)(entry_ptr->base_addr), + (int)(entry_ptr->local_len)); + fflush(stdout); } HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); @@ -2478,15 +2477,15 @@ datum_image_len(const void *thing, size_t *image_len) return(SUCCEED); } /* datum_image_len() */ - + /*------------------------------------------------------------------------- - * Function: datum_serialize + * Function: datum_serialize * - * Purpose: Serialize the supplied entry. + * Purpose: Serialize the supplied entry. * - * Return: SUCCEED if successful, FAIL otherwise. + * Return: SUCCEED if successful, FAIL otherwise. * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/30/07 * *------------------------------------------------------------------------- @@ -2511,11 +2510,11 @@ datum_serialize(const H5F_t *f, HDassert( f ); HDassert( f->shared ); HDassert( f->shared->cache ); - + cache_ptr = f->shared->cache; HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->aux_ptr ); + HDassert( cache_ptr->aux_ptr ); aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr); @@ -2534,9 +2533,9 @@ datum_serialize(const H5F_t *f, if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: serialize() idx = %d, addr = %ld, len = %d.\n", - world_mpi_rank, idx, (long)entry_ptr->header.addr, (int)len); - fflush(stdout); + "%d: serialize() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)entry_ptr->header.addr, (int)len); + fflush(stdout); } HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); @@ -2557,16 +2556,16 @@ datum_serialize(const H5F_t *f, } /* datum_serialize() */ - + /*------------------------------------------------------------------------- - * Function: datum_notify + * Function: datum_notify * - * Purpose: Do the communication with the server we used to do in the - * flush and load callbacks in the version 2 cache. + * Purpose: Do the communication with the server we used to do in the + * flush and load callbacks in the version 2 cache. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/12/15 * *------------------------------------------------------------------------- @@ -2596,7 +2595,7 @@ datum_notify(H5C_notify_action_t action, void *thing) HDfprintf(stdout, "%d: notify() action = %d, idx = %d, addr = %ld.\n", - world_mpi_rank, (int) action, idx, + world_mpi_rank, (int) action, idx, (long)entry_ptr->header.addr); fflush(stdout); } @@ -2685,62 +2684,62 @@ datum_notify(H5C_notify_action_t action, void *thing) } #if 0 /* This has been useful debugging code -- keep it for now. */ - if ( mssg.req != READ_REQ_REPLY_CODE ) { + if ( mssg.req != READ_REQ_REPLY_CODE ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n", - world_mpi_rank, FUNC); - HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", - world_mpi_rank, FUNC, (int)(mssg.req)); - } + world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", + world_mpi_rank, FUNC, (int)(mssg.req)); + } - if ( mssg.src != world_server_mpi_rank ) { + if ( mssg.src != world_server_mpi_rank ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n", - world_mpi_rank, FUNC); - } + world_mpi_rank, FUNC); + } - if ( mssg.dest != world_mpi_rank ) { + if ( mssg.dest != world_mpi_rank ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n", - world_mpi_rank, FUNC); + world_mpi_rank, FUNC); } - if ( mssg.base_addr != entry_ptr->base_addr ) { + if ( mssg.base_addr != entry_ptr->base_addr ) { - HDfprintf(stdout, - "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", - world_mpi_rank, FUNC); - HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", - world_mpi_rank, FUNC, mssg.base_addr); - HDfprintf(stdout, + HDfprintf(stdout, + "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", + world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", + world_mpi_rank, FUNC, mssg.base_addr); + HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, entry_ptr->base_addr); } - if ( mssg.len != entry_ptr->len ) { + if ( mssg.len != entry_ptr->len ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n", - world_mpi_rank, FUNC); - HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", - world_mpi_rank, FUNC, mssg.len); + world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", + world_mpi_rank, FUNC, mssg.len); } - if ( mssg.ver < entry_ptr->ver ) { + if ( mssg.ver < entry_ptr->ver ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n", - world_mpi_rank, FUNC); + world_mpi_rank, FUNC); } - if ( mssg.magic != MSSG_MAGIC ) { + if ( mssg.magic != MSSG_MAGIC ) { - HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", + world_mpi_rank, FUNC); } #endif /* JRM */ @@ -2753,7 +2752,7 @@ datum_notify(H5C_notify_action_t action, void *thing) } break; - case H5C_NOTIFY_ACTION_AFTER_FLUSH: + case H5C_NOTIFY_ACTION_AFTER_FLUSH: if ( callbacks_verbose ) { HDfprintf(stdout, @@ -2767,11 +2766,11 @@ datum_notify(H5C_notify_action_t action, void *thing) aux_ptr = entry_ptr->aux_ptr; entry_ptr->aux_ptr = NULL; - HDassert(entry_ptr->header.is_dirty); /* JRM */ + HDassert(entry_ptr->header.is_dirty); /* JRM */ - if ( ( file_mpi_rank != 0 ) && + if ( ( file_mpi_rank != 0 ) && ( entry_ptr->dirty ) && - ( aux_ptr->metadata_write_strategy == + ( aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ) ) { ret_value = FAIL; @@ -2784,8 +2783,8 @@ datum_notify(H5C_notify_action_t action, void *thing) if ( entry_ptr->header.is_dirty ) { - was_dirty = TRUE; /* so we will receive the ack - * if requested + was_dirty = TRUE; /* so we will receive the ack + * if requested */ /* compose the message */ @@ -2811,7 +2810,7 @@ datum_notify(H5C_notify_action_t action, void *thing) else { entry_ptr->dirty = FALSE; - entry_ptr->flushed = TRUE; + entry_ptr->flushed = TRUE; } } } @@ -2839,7 +2838,7 @@ datum_notify(H5C_notify_action_t action, void *thing) nerrors++; ret_value = FAIL; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", world_mpi_rank, FUNC); } @@ -2855,7 +2854,7 @@ datum_notify(H5C_notify_action_t action, void *thing) datum_pinned_flushes++; HDassert(entry_ptr->global_pinned || entry_ptr->local_pinned); } - break; + break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: if ( callbacks_verbose ) { @@ -2950,33 +2949,33 @@ datum_notify(H5C_notify_action_t action, void *thing) /* do nothing */ break; - default: + default: nerrors++; ret_value = FAIL; if ( verbose ) { HDfprintf(stdout, "%d:%s: Unknown notify action.\n", world_mpi_rank, FUNC); } - break; + break; } return(ret_value); } /* datum_notify() */ - + /*------------------------------------------------------------------------- - * Function: datum_free_icr + * Function: datum_free_icr * - * Purpose: Nominally, this callback is supposed to free the - * in core representation of the entry. + * Purpose: Nominally, this callback is supposed to free the + * in core representation of the entry. * - * In the context of this test bed, we use it to do - * do all the processing we used to do on a destroy. + * In the context of this test bed, we use it to do + * do all the processing we used to do on a destroy. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/19/07 * *------------------------------------------------------------------------- @@ -3001,9 +3000,9 @@ datum_free_icr(void * thing) if ( callbacks_verbose ) { HDfprintf(stdout, - "%d: free_icr() idx = %d, dirty = %d.\n", - world_mpi_rank, idx, (int)(entry_ptr->dirty)); - fflush(stdout); + "%d: free_icr() idx = %d, dirty = %d.\n", + world_mpi_rank, idx, (int)(entry_ptr->dirty)); + fflush(stdout); } HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); @@ -3020,7 +3019,7 @@ datum_free_icr(void * thing) return(SUCCEED); } /* datum_free_icr() */ - + /*****************************************************************************/ /************************** test utility functions ***************************/ /*****************************************************************************/ @@ -3029,9 +3028,9 @@ datum_free_icr(void * thing) * Function: expunge_entry() * * Purpose: Expunge the entry indicated by the type and index, mark it - * as clean, and don't increment its version number. + * as clean, and don't increment its version number. * - * Do nothing if nerrors is non-zero on entry. + * Do nothing if nerrors is non-zero on entry. * * Return: void * @@ -3062,36 +3061,36 @@ expunge_entry(H5F_t * file_ptr, if ( nerrors == 0 ) { result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]), - entry_ptr->header.addr, H5AC__NO_FLAGS_SET); + entry_ptr->header.addr, H5AC__NO_FLAGS_SET); if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n", + world_mpi_rank, FUNC); } } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); - HDassert( ! ((entry_ptr->header).is_dirty) ); + HDassert( ! ((entry_ptr->header).is_dirty) ); - result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr, + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - if ( result < 0 ) { + if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n", + world_mpi_rank, FUNC); } } else if ( in_cache ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n", + world_mpi_rank, FUNC); } } } @@ -3100,14 +3099,14 @@ expunge_entry(H5F_t * file_ptr, } /* expunge_entry() */ - + /***************************************************************************** * Function: insert_entry() * * Purpose: Insert the entry indicated by the type and index, mark it - * as dirty, and increment its version number. + * as dirty, and increment its version number. * - * Do nothing if nerrors is non-zero on entry. + * Do nothing if nerrors is non-zero on entry. * * Return: void * @@ -3158,33 +3157,33 @@ insert_entry(H5C_t * cache_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n", + world_mpi_rank, FUNC); } } if ( ! (entry_ptr->header.is_dirty) ) { - /* it is possible that we just exceeded the dirty bytes - * threshold, triggering a write of the newly inserted - * entry. Test for this, and only flag an error if this - * is not the case. - */ + /* it is possible that we just exceeded the dirty bytes + * threshold, triggering a write of the newly inserted + * entry. Test for this, and only flag an error if this + * is not the case. + */ - struct H5AC_aux_t * aux_ptr; + struct H5AC_aux_t * aux_ptr; - aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr)); + aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr)); - if ( ! ( ( aux_ptr != NULL ) && - ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && - ( aux_ptr->dirty_bytes == 0 ) ) ) { + if ( ! ( ( aux_ptr != NULL ) && + ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && + ( aux_ptr->dirty_bytes == 0 ) ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", - world_mpi_rank, FUNC, idx, + HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", + world_mpi_rank, FUNC, idx, (int)(data[idx].header.is_dirty)); - } + } } } @@ -3192,7 +3191,7 @@ insert_entry(H5C_t * cache_ptr, HDassert( entry_ptr->header.is_pinned ); entry_ptr->global_pinned = TRUE; - global_pins++; + global_pins++; } else { @@ -3209,7 +3208,7 @@ insert_entry(H5C_t * cache_ptr, } /* insert_entry() */ - + /***************************************************************************** * Function: local_pin_and_unpin_random_entries() * @@ -3228,8 +3227,8 @@ static void local_pin_and_unpin_random_entries(H5F_t * file_ptr, int min_idx, int max_idx, - int min_count, - int max_count) + int min_count, + int max_count) { if ( nerrors == 0 ) { @@ -3244,40 +3243,40 @@ local_pin_and_unpin_random_entries(H5F_t * file_ptr, HDassert( min_idx < max_idx ); HDassert( max_idx < NUM_DATA_ENTRIES ); HDassert( max_idx < virt_num_data_entries ); - HDassert( 0 <= min_count ); - HDassert( min_count < max_count ); + HDassert( 0 <= min_count ); + HDassert( min_count < max_count ); - count = (HDrand() % (max_count - min_count)) + min_count; + count = (HDrand() % (max_count - min_count)) + min_count; - HDassert( min_count <= count ); - HDassert( count <= max_count ); + HDassert( min_count <= count ); + HDassert( count <= max_count ); - for ( i = 0; i < count; i++ ) - { + for ( i = 0; i < count; i++ ) + { local_pin_random_entry(file_ptr, min_idx, max_idx); - } + } - count = (HDrand() % (max_count - min_count)) + min_count; + count = (HDrand() % (max_count - min_count)) + min_count; - HDassert( min_count <= count ); - HDassert( count <= max_count ); + HDassert( min_count <= count ); + HDassert( count <= max_count ); i = 0; - idx = 0; + idx = 0; - while ( ( i < count ) && ( idx >= 0 ) ) - { - via_unprotect = ( (((unsigned)i) & 0x0001) == 0 ); - idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect); - i++; - } + while ( ( i < count ) && ( idx >= 0 ) ) + { + via_unprotect = ( (((unsigned)i) & 0x0001) == 0 ); + idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect); + i++; + } } return; } /* local_pin_and_unpin_random_entries() */ - + /***************************************************************************** * Function: local_pin_random_entry() * @@ -3309,13 +3308,13 @@ local_pin_random_entry(H5F_t * file_ptr, HDassert( max_idx < NUM_DATA_ENTRIES ); HDassert( max_idx < virt_num_data_entries ); - do - { - idx = (HDrand() % (max_idx - min_idx)) + min_idx; + do + { + idx = (HDrand() % (max_idx - min_idx)) + min_idx; HDassert( min_idx <= idx ); HDassert( idx <= max_idx ); - } - while ( data[idx].global_pinned || data[idx].local_pinned ); + } + while ( data[idx].global_pinned || data[idx].local_pinned ); pin_entry(file_ptr, idx, FALSE, FALSE); } @@ -3324,7 +3323,7 @@ local_pin_random_entry(H5F_t * file_ptr, } /* local_pin_random_entry() */ - + /***************************************************************************** * Function: local_unpin_all_entries() * @@ -3340,7 +3339,7 @@ local_pin_random_entry(H5F_t * file_ptr, *****************************************************************************/ static void local_unpin_all_entries(H5F_t * file_ptr, - hbool_t via_unprotect) + hbool_t via_unprotect) { if ( nerrors == 0 ) { @@ -3349,25 +3348,25 @@ local_unpin_all_entries(H5F_t * file_ptr, HDassert( file_ptr ); - idx = 0; + idx = 0; - while ( idx >= 0 ) - { - idx = local_unpin_next_pinned_entry(file_ptr, - idx, via_unprotect); - } + while ( idx >= 0 ) + { + idx = local_unpin_next_pinned_entry(file_ptr, + idx, via_unprotect); + } } return; } /* local_unpin_all_entries() */ - + /***************************************************************************** * Function: local_unpin_next_pinned_entry() * * Purpose: Find the next locally pinned entry after the specified - * starting point, and unpin it. + * starting point, and unpin it. * * Do nothing if nerrors is non-zero on entry. * @@ -3382,7 +3381,7 @@ local_unpin_all_entries(H5F_t * file_ptr, static int local_unpin_next_pinned_entry(H5F_t * file_ptr, int start_idx, - hbool_t via_unprotect) + hbool_t via_unprotect) { int i = 0; int idx = -1; @@ -3394,39 +3393,39 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr, HDassert( start_idx < NUM_DATA_ENTRIES ); HDassert( start_idx < virt_num_data_entries ); - idx = start_idx; + idx = start_idx; - while ( ( i < virt_num_data_entries ) && - ( ! ( data[idx].local_pinned ) ) ) - { - i++; - idx++; - if ( idx >= virt_num_data_entries ) { - idx = 0; - } - } + while ( ( i < virt_num_data_entries ) && + ( ! ( data[idx].local_pinned ) ) ) + { + i++; + idx++; + if ( idx >= virt_num_data_entries ) { + idx = 0; + } + } - if ( data[idx].local_pinned ) { + if ( data[idx].local_pinned ) { - unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect); + unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect); - } else { + } else { - idx = -1; - } + idx = -1; + } } return(idx); } /* local_unpin_next_pinned_entry() */ - + /***************************************************************************** * Function: lock_and_unlock_random_entries() * * Purpose: Obtain a random number in the closed interval [min_count, - * max_count]. Then protect and unprotect that number of - * random entries. + * max_count]. Then protect and unprotect that number of + * random entries. * * Do nothing if nerrors is non-zero on entry. * @@ -3467,12 +3466,12 @@ lock_and_unlock_random_entries(H5F_t * file_ptr, } /* lock_and_unlock_random_entries() */ - + /***************************************************************************** * Function: lock_and_unlock_random_entry() * * Purpose: Protect and then unprotect a random entry with index in - * the data[] array in the close interval [min_idx, max_idx]. + * the data[] array in the close interval [min_idx, max_idx]. * * Do nothing if nerrors is non-zero on entry. * @@ -3502,15 +3501,15 @@ lock_and_unlock_random_entry(H5F_t * file_ptr, HDassert( min_idx <= idx ); HDassert( idx <= max_idx ); - lock_entry(file_ptr, idx); - unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, idx); + unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET); } return; } /* lock_and_unlock_random_entry() */ - + /***************************************************************************** * Function: lock_entry() * @@ -3525,9 +3524,9 @@ lock_and_unlock_random_entry(H5F_t * file_ptr, * * Modifications: * - * JRM -- 7/11/06 - * Modified asserts to handle the new local_len field in - * datum. + * JRM -- 7/11/06 + * Modified asserts to handle the new local_len field in + * datum. * *****************************************************************************/ static void @@ -3544,30 +3543,30 @@ lock_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert( ! (entry_ptr->locked) ); + HDassert( ! (entry_ptr->locked) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, + cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]), entry_ptr->base_addr, - &entry_ptr->base_addr, + &entry_ptr->base_addr, H5AC__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)(&(entry_ptr->header)) ) || ( entry_ptr->header.type != &(types[0]) ) || ( ( entry_ptr->len != entry_ptr->header.size ) && - ( entry_ptr->local_len != entry_ptr->header.size ) ) || + ( entry_ptr->local_len != entry_ptr->header.size ) ) || ( entry_ptr->base_addr != entry_ptr->header.addr ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n", + world_mpi_rank, FUNC); } } else { - entry_ptr->locked = TRUE; + entry_ptr->locked = TRUE; - } + } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); } @@ -3604,33 +3603,33 @@ mark_entry_dirty(int32_t idx) entry_ptr = &(data[idx]); HDassert ( entry_ptr->locked || entry_ptr->global_pinned ); - HDassert ( ! (entry_ptr->local_pinned) ); + HDassert ( ! (entry_ptr->local_pinned) ); (entry_ptr->ver)++; entry_ptr->dirty = TRUE; - result = H5AC_mark_entry_dirty( (void *)entry_ptr); + result = H5AC_mark_entry_dirty( (void *)entry_ptr); if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: error in H5AC_mark_entry_dirty().\n", world_mpi_rank, FUNC); } } - else if ( ! ( entry_ptr->locked ) ) - { - global_dirty_pins++; - } + else if ( ! ( entry_ptr->locked ) ) + { + global_dirty_pins++; + } } return; } /* mark_entry_dirty() */ - + /***************************************************************************** * Function: pin_entry() * @@ -3647,8 +3646,8 @@ mark_entry_dirty(int32_t idx) static void pin_entry(H5F_t * file_ptr, int32_t idx, - hbool_t global, - hbool_t dirty) + hbool_t global, + hbool_t dirty) { unsigned int flags = H5AC__PIN_ENTRY_FLAG; struct datum * entry_ptr; @@ -3661,35 +3660,35 @@ pin_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert ( ! (entry_ptr->global_pinned) ); - HDassert ( ! (entry_ptr->local_pinned) ); - HDassert ( ! ( dirty && ( ! global ) ) ); + HDassert ( ! (entry_ptr->global_pinned) ); + HDassert ( ! (entry_ptr->local_pinned) ); + HDassert ( ! ( dirty && ( ! global ) ) ); - lock_entry(file_ptr, idx); + lock_entry(file_ptr, idx); - if ( dirty ) { + if ( dirty ) { - flags |= H5AC__DIRTIED_FLAG; - } + flags |= H5AC__DIRTIED_FLAG; + } - unlock_entry(file_ptr, idx, flags); + unlock_entry(file_ptr, idx, flags); HDassert( (entry_ptr->header).is_pinned ); - HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) ); + HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) ); - if ( global ) { + if ( global ) { - entry_ptr->global_pinned = TRUE; + entry_ptr->global_pinned = TRUE; - global_pins++; + global_pins++; - } else { + } else { - entry_ptr->local_pinned = TRUE; + entry_ptr->local_pinned = TRUE; - local_pins++; + local_pins++; - } + } } return; @@ -3697,14 +3696,14 @@ pin_entry(H5F_t * file_ptr, } /* pin_entry() */ #ifdef H5_METADATA_TRACE_FILE - + /***************************************************************************** * Function: pin_protected_entry() * * Purpose: Insert the entry indicated by the type and index, mark it - * as dirty, and increment its version number. + * as dirty, and increment its version number. * - * Do nothing if nerrors is non-zero on entry. + * Do nothing if nerrors is non-zero on entry. * * Return: void * @@ -3714,7 +3713,7 @@ pin_entry(H5F_t * file_ptr, *****************************************************************************/ static void pin_protected_entry(int32_t idx, - hbool_t global) + hbool_t global) { herr_t result; struct datum * entry_ptr; @@ -3728,36 +3727,36 @@ pin_protected_entry(int32_t idx, if ( nerrors == 0 ) { - result = H5AC_pin_protected_entry((void *)entry_ptr); + result = H5AC_pin_protected_entry((void *)entry_ptr); if ( ( result < 0 ) || ( entry_ptr->header.type != &(types[0]) ) || ( ( entry_ptr->len != entry_ptr->header.size ) && - ( entry_ptr->local_len != entry_ptr->header.size ) )|| + ( entry_ptr->local_len != entry_ptr->header.size ) )|| ( entry_ptr->base_addr != entry_ptr->header.addr ) || - ( ! ( (entry_ptr->header).is_pinned ) ) ) { + ( ! ( (entry_ptr->header).is_pinned ) ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, - "%d:%s: Error in H5AC_pin_protected entry().\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, + "%d:%s: Error in H5AC_pin_protected entry().\n", + world_mpi_rank, FUNC); } } if ( global ) { - entry_ptr->global_pinned = TRUE; + entry_ptr->global_pinned = TRUE; - global_pins++; + global_pins++; - } else { + } else { - entry_ptr->local_pinned = TRUE; + entry_ptr->local_pinned = TRUE; - local_pins++; + local_pins++; - } + } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); } @@ -3767,16 +3766,16 @@ pin_protected_entry(int32_t idx, } /* pin_protected_entry() */ #endif /* H5_METADATA_TRACE_FILE */ - + /***************************************************************************** * Function: move_entry() * * Purpose: Move the entry indicated old_idx to the entry indicated - * by new_idex. Touch up the data array so that flush will - * not choke. + * by new_idex. Touch up the data array so that flush will + * not choke. * - * Do nothing if nerrors isn't zero, or if old_idx equals - * new_idx. + * Do nothing if nerrors isn't zero, or if old_idx equals + * new_idx. * * Return: void * @@ -3790,8 +3789,8 @@ move_entry(H5F_t * file_ptr, int32_t new_idx) { herr_t result; - int tmp; - size_t tmp_len; + int tmp; + size_t tmp_len; haddr_t old_addr = HADDR_UNDEF; haddr_t new_addr = HADDR_UNDEF; struct datum * old_entry_ptr; @@ -3819,12 +3818,12 @@ move_entry(H5F_t * file_ptr, /* Moving will mark the entry dirty if it is not already */ old_entry_ptr->dirty = TRUE; - /* touch up versions, base_addrs, and data_index. Do this - * now as it is possible that the rename will trigger a + /* touch up versions, base_addrs, and data_index. Do this + * now as it is possible that the rename will trigger a * sync point. */ if(old_entry_ptr->ver < new_entry_ptr->ver) - old_entry_ptr->ver = new_entry_ptr->ver; + old_entry_ptr->ver = new_entry_ptr->ver; else (old_entry_ptr->ver)++; @@ -3838,11 +3837,11 @@ move_entry(H5F_t * file_ptr, old_entry_ptr->index = new_entry_ptr->index; new_entry_ptr->index = tmp; - if(old_entry_ptr->local_len != new_entry_ptr->local_len) { - tmp_len = old_entry_ptr->local_len; - old_entry_ptr->local_len = new_entry_ptr->local_len; - new_entry_ptr->local_len = tmp_len; - } /* end if */ + if(old_entry_ptr->local_len != new_entry_ptr->local_len) { + tmp_len = old_entry_ptr->local_len; + old_entry_ptr->local_len = new_entry_ptr->local_len; + new_entry_ptr->local_len = tmp_len; + } /* end if */ result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr, H5AC_ind_read_dxpl_id); @@ -3850,8 +3849,8 @@ move_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", + world_mpi_rank, FUNC); } } else { @@ -3860,27 +3859,27 @@ move_entry(H5F_t * file_ptr, if ( ! (old_entry_ptr->header.is_dirty) ) { - /* it is possible that we just exceeded the dirty bytes - * threshold, triggering a write of the newly inserted - * entry. Test for this, and only flag an error if this - * is not the case. - */ + /* it is possible that we just exceeded the dirty bytes + * threshold, triggering a write of the newly inserted + * entry. Test for this, and only flag an error if this + * is not the case. + */ - struct H5AC_aux_t * aux_ptr; + struct H5AC_aux_t * aux_ptr; - aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr)); + aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr)); - if ( ! ( ( aux_ptr != NULL ) && - ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && - ( aux_ptr->dirty_bytes == 0 ) ) ) { + if ( ! ( ( aux_ptr != NULL ) && + ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) && + ( aux_ptr->dirty_bytes == 0 ) ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", - world_mpi_rank, FUNC, new_idx, + world_mpi_rank, FUNC, new_idx, (int)(data[new_idx].header.is_dirty)); - } + } } } else { @@ -3891,19 +3890,19 @@ move_entry(H5F_t * file_ptr, } /* move_entry() */ - + /***************************************************************************** * - * Function: reset_server_counts() + * Function: reset_server_counts() * - * Purpose: Send a message to the server process requesting it to reset - * its counters. Await confirmation message. + * Purpose: Send a message to the server process requesting it to reset + * its counters. Await confirmation message. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/6/10 + * Programmer: JRM -- 5/6/10 * *****************************************************************************/ static hbool_t @@ -3958,7 +3957,7 @@ reset_server_counts(void) nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: Bad data in req r/w counter reset reply.\n", world_mpi_rank, FUNC); } @@ -3969,15 +3968,15 @@ reset_server_counts(void) } /* reset_server_counts() */ - + /***************************************************************************** * Function: resize_entry() * * Purpose: Resize the pinned entry indicated by idx to the new_size. - * Note that new_size must be greater than 0, and must be - * less than or equal to the original size of the entry. + * Note that new_size must be greater than 0, and must be + * less than or equal to the original size of the entry. * - * Do nothing if nerrors isn't zero. + * Do nothing if nerrors isn't zero. * * Return: void * @@ -3987,7 +3986,7 @@ reset_server_counts(void) *****************************************************************************/ static void resize_entry(int32_t idx, - size_t new_size) + size_t new_size) { herr_t result; struct datum * entry_ptr; @@ -4001,21 +4000,21 @@ resize_entry(int32_t idx, HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); HDassert( !(entry_ptr->locked) ); - HDassert( ( entry_ptr->global_pinned ) && - ( ! entry_ptr->local_pinned ) ); - HDassert( ( entry_ptr->header.size == entry_ptr->len ) || - ( entry_ptr->header.size == entry_ptr->local_len ) ); - HDassert( new_size > 0 ); - HDassert( new_size <= entry_ptr->len ); + HDassert( ( entry_ptr->global_pinned ) && + ( ! entry_ptr->local_pinned ) ); + HDassert( ( entry_ptr->header.size == entry_ptr->len ) || + ( entry_ptr->header.size == entry_ptr->local_len ) ); + HDassert( new_size > 0 ); + HDassert( new_size <= entry_ptr->len ); - result = H5AC_resize_entry((void *)entry_ptr, new_size); + result = H5AC_resize_entry((void *)entry_ptr, new_size); if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", - world_mpi_rank, FUNC); + HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", + world_mpi_rank, FUNC); } } else { @@ -4025,7 +4024,7 @@ resize_entry(int32_t idx, HDassert( entry_ptr->header.size == new_size ); entry_ptr->dirty = TRUE; - entry_ptr->local_len = new_size; + entry_ptr->local_len = new_size; /* touch up version. */ @@ -4037,24 +4036,24 @@ resize_entry(int32_t idx, } /* resize_entry() */ - + /***************************************************************************** * - * Function: setup_cache_for_test() + * Function: setup_cache_for_test() * - * Purpose: Setup the parallel cache for a test, and return the file id - * and a pointer to the cache's internal data structures. + * Purpose: Setup the parallel cache for a test, and return the file id + * and a pointer to the cache's internal data structures. * - * To do this, we must create a file, flush it (so that we - * don't have to worry about entries in the metadata cache), - * look up the address of the metadata cache, and then instruct - * the cache to omit sanity checks on dxpl IDs. + * To do this, we must create a file, flush it (so that we + * don't have to worry about entries in the metadata cache), + * look up the address of the metadata cache, and then instruct + * the cache to omit sanity checks on dxpl IDs. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/4/06 + * Programmer: JRM -- 1/4/06 * *****************************************************************************/ static hbool_t @@ -4081,13 +4080,13 @@ setup_cache_for_test(hid_t * fid_ptr, if ( fid < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n", world_mpi_rank, FUNC); } } else if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } else { @@ -4097,7 +4096,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( file_ptr == NULL ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n", + HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n", world_mpi_rank, FUNC); } } else { @@ -4107,13 +4106,13 @@ setup_cache_for_test(hid_t * fid_ptr, if ( cache_ptr == NULL ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n", + HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n", world_mpi_rank, FUNC); } } else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n", + HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n", world_mpi_rank, FUNC); } } else { @@ -4132,7 +4131,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n", world_mpi_rank, FUNC); @@ -4142,9 +4141,9 @@ setup_cache_for_test(hid_t * fid_ptr, config.metadata_write_strategy = metadata_write_strategy; if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); @@ -4167,15 +4166,15 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n", + HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n", world_mpi_rank, FUNC); } - } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != + } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC.\n", world_mpi_rank, FUNC); } @@ -4184,14 +4183,14 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: bad cache_ptr->aux_ptr->metadata_write_strategy\n", world_mpi_rank, FUNC); } } } - /* also verify that the expected metadata write strategy is reported + /* also verify that the expected metadata write strategy is reported * when we get the current configuration. */ @@ -4202,25 +4201,25 @@ setup_cache_for_test(hid_t * fid_ptr, if ( H5AC_get_cache_auto_resize_config(cache_ptr, &test_config) != SUCCEED ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n", world_mpi_rank, FUNC); - } else if ( test_config.metadata_write_strategy != + } else if ( test_config.metadata_write_strategy != metadata_write_strategy ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: unexpected metadata_write_strategy.\n", world_mpi_rank, FUNC); } } } - /* allocate space for test entries -- do this before we set the + /* allocate space for test entries -- do this before we set the * sync point done callback as it will dirty the superblock, requiring * another flush. If the sync point done callback is set, this will * cause a spurious failure. @@ -4233,10 +4232,10 @@ setup_cache_for_test(hid_t * fid_ptr, if ( actual_base_addr == HADDR_UNDEF ) { success = FALSE; - nerrors++; + nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", + HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", world_mpi_rank, FUNC); } @@ -4247,10 +4246,10 @@ setup_cache_for_test(hid_t * fid_ptr, * if the size of the superblock is increase. */ success = FALSE; - nerrors++; + nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", + HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", world_mpi_rank, FUNC); } } @@ -4263,7 +4262,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -4273,62 +4272,62 @@ setup_cache_for_test(hid_t * fid_ptr, if ( success ) { - if ( H5AC__set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) { + if ( H5AC__set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, - "%d:%s: H5C_set_write_done_callback failed.\n", + HDfprintf(stdout, + "%d:%s: H5C_set_write_done_callback failed.\n", world_mpi_rank, FUNC); } - } + } } #endif /* DO_SYNC_AFTER_WRITE */ if ( success ) { - if ( H5AC__set_sync_point_done_callback(cache_ptr, verify_writes) != SUCCEED ) { + if ( H5AC__set_sync_point_done_callback(cache_ptr, verify_writes) != SUCCEED ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, - "%d:%s: H5AC__set_sync_point_done_callback failed.\n", + HDfprintf(stdout, + "%d:%s: H5AC__set_sync_point_done_callback failed.\n", world_mpi_rank, FUNC); } - } + } } return(success); } /* setup_cache_for_test() */ - + /***************************************************************************** * - * Function: verify_writes() + * Function: verify_writes() * - * Purpose: Verify that the indicated entries have been written exactly - * once each, and that the indicated total number of writes - * has been processed by the server process. Flag an error if - * discrepency is noted. Finally reset the counters maintained - * by the server process. + * Purpose: Verify that the indicated entries have been written exactly + * once each, and that the indicated total number of writes + * has been processed by the server process. Flag an error if + * discrepency is noted. Finally reset the counters maintained + * by the server process. * - * This function should only be called by the metadata cache - * as the "sync point done" function, as it must do some - * synchronization to avoid false positives. + * This function should only be called by the metadata cache + * as the "sync point done" function, as it must do some + * synchronization to avoid false positives. * - * Note that at present, this function does not allow for the - * case in which one or more of the indicated entries should - * have been written more than once since the last time the - * server process's counters were reset. That is fine for now, - * as with the current metadata write strategies, no entry - * should be written more than once per sync point. If this - * changes this limitation will have to be revisited. + * Note that at present, this function does not allow for the + * case in which one or more of the indicated entries should + * have been written more than once since the last time the + * server process's counters were reset. That is fine for now, + * as with the current metadata write strategies, no entry + * should be written more than once per sync point. If this + * changes this limitation will have to be revisited. * - * Return: void. + * Return: void. * - * Programmer: JRM -- 5/9/10 + * Programmer: JRM -- 5/9/10 * *****************************************************************************/ static void @@ -4404,7 +4403,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) } /* final barrier to ensure that all processes think that the server - * counters have been reset before we leave the sync point. This + * counters have been reset before we leave the sync point. This * barrier is probaby not necessary at this point in time (5/9/10), * but I can think of at least one likely change to the metadata write * strategies that will require it -- hence its insertion now. @@ -4426,24 +4425,24 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) } /* verify_writes() */ - + /***************************************************************************** * - * Function: setup_rand() + * Function: setup_rand() * - * Purpose: Use gettimeofday() to obtain a seed for rand(), print the - * seed to stdout, and then pass it to srand(). + * Purpose: Use gettimeofday() to obtain a seed for rand(), print the + * seed to stdout, and then pass it to srand(). * - * Increment nerrors if any errors are detected. + * Increment nerrors if any errors are detected. * - * Return: void. + * Return: void. * - * Programmer: JRM -- 1/12/06 + * Programmer: JRM -- 1/12/06 * * Modifications: * - * JRM -- 5/9/06 - * Modified function to facilitate setting predefined seeds. + * JRM -- 5/9/06 + * Modified function to facilitate setting predefined seeds. * *****************************************************************************/ static void @@ -4458,13 +4457,13 @@ setup_rand(void) if ( ( use_predefined_seeds ) && ( world_mpi_size == num_predefined_seeds ) ) { - HDassert( world_mpi_rank >= 0 ); - HDassert( world_mpi_rank < world_mpi_size ); + HDassert( world_mpi_rank >= 0 ); + HDassert( world_mpi_rank < world_mpi_size ); seed = predefined_seeds[world_mpi_rank]; - HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", + HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", world_mpi_rank, FUNC, seed); - fflush(stdout); + fflush(stdout); HDsrand(seed); } else { @@ -4473,7 +4472,7 @@ setup_rand(void) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n", + HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n", world_mpi_rank, FUNC); } } else { @@ -4491,21 +4490,21 @@ setup_rand(void) } /* setup_rand() */ - + /***************************************************************************** * - * Function: take_down_cache() + * Function: take_down_cache() * - * Purpose: Take down the parallel cache after a test. + * Purpose: Take down the parallel cache after a test. * - * To do this, we must close the file, and delete if if - * possible. + * To do this, we must close the file, and delete if if + * possible. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/4/06 + * Programmer: JRM -- 1/4/06 * *****************************************************************************/ static hbool_t @@ -4513,7 +4512,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) { hbool_t success = TRUE; /* will set to FALSE if appropriate. */ - /* flush the file -- this should write out any remaining test + /* flush the file -- this should write out any remaining test * entries in the cache. */ if ( ( success ) && ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) ) { @@ -4526,7 +4525,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) } } - /* Now reset the sync point done callback. Must do this as with + /* Now reset the sync point done callback. Must do this as with * the SWMR mods, the cache will do additional I/O on file close * un-related to the test entries, and thereby corrupt our counts * of entry writes. @@ -4557,7 +4556,7 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) world_mpi_rank, FUNC); } - } + } if ( success ) { @@ -4574,11 +4573,11 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) } } else { - /* verify that there have been no further writes of test + /* verify that there have been no further writes of test * entries during the close */ success = verify_total_writes(0); - + } } @@ -4586,19 +4585,19 @@ take_down_cache(hid_t fid, H5C_t * cache_ptr) } /* take_down_cache() */ - + /***************************************************************************** * Function: verify_entry_reads * - * Purpose: Query the server to determine the number of times the - * indicated entry has been read since the last time the - * server counters were reset. + * Purpose: Query the server to determine the number of times the + * indicated entry has been read since the last time the + * server counters were reset. * - * Return TRUE if successful, and if the supplied expected - * number of reads matches the number of reads reported by - * the server process. + * Return TRUE if successful, and if the supplied expected + * number of reads matches the number of reads reported by + * the server process. * - * Return FALSE and flag an error otherwise. + * Return FALSE and flag an error otherwise. * * Return: TRUE if successful, FALSE otherwise. * @@ -4681,31 +4680,31 @@ verify_entry_reads(haddr_t addr, nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx reads mismatch (%ld/%ld).\n", world_mpi_rank, FUNC, (long long)addr, reported_entry_reads, expected_entry_reads); } - } + } } return(success); } /* verify_entry_reads() */ - + /***************************************************************************** * Function: verify_entry_writes * - * Purpose: Query the server to determine the number of times the - * indicated entry has been written since the last time the - * server counters were reset. + * Purpose: Query the server to determine the number of times the + * indicated entry has been written since the last time the + * server counters were reset. * - * Return TRUE if successful, and if the supplied expected - * number of reads matches the number of reads reported by - * the server process. + * Return TRUE if successful, and if the supplied expected + * number of reads matches the number of reads reported by + * the server process. * - * Return FALSE and flag an error otherwise. + * Return FALSE and flag an error otherwise. * * Return: TRUE if successful, FALSE otherwise. * @@ -4788,36 +4787,36 @@ verify_entry_writes(haddr_t addr, nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx writes mismatch (%ld/%ld).\n", world_mpi_rank, FUNC, (long long)addr, reported_entry_writes, expected_entry_writes); } - } + } } return(success); } /* verify_entry_writes() */ - + /***************************************************************************** * - * Function: verify_total_reads() + * Function: verify_total_reads() * - * Purpose: Query the server to obtain the total reads since the last - * server counter reset, and compare this value with the supplied - * expected value. + * Purpose: Query the server to obtain the total reads since the last + * server counter reset, and compare this value with the supplied + * expected value. * - * If the values match, return TRUE. + * If the values match, return TRUE. * - * If the values don't match, flag an error and return FALSE. + * If the values don't match, flag an error and return FALSE. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/6/10 + * Programmer: JRM -- 5/6/10 * *****************************************************************************/ static hbool_t @@ -4888,9 +4887,9 @@ verify_total_reads(int expected_total_reads) nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: reported/expected total reads mismatch (%ld/%ld).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, reported_total_reads, expected_total_reads); } @@ -4901,24 +4900,24 @@ verify_total_reads(int expected_total_reads) } /* verify_total_reads() */ - + /***************************************************************************** * - * Function: verify_total_writes() + * Function: verify_total_writes() * - * Purpose: Query the server to obtain the total writes since the last - * server counter reset, and compare this value with the supplied - * expected value. + * Purpose: Query the server to obtain the total writes since the last + * server counter reset, and compare this value with the supplied + * expected value. * - * If the values match, return TRUE. + * If the values match, return TRUE. * - * If the values don't match, flag an error and return FALSE. + * If the values don't match, flag an error and return FALSE. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/6/10 + * Programmer: JRM -- 5/6/10 * *****************************************************************************/ static hbool_t @@ -4989,9 +4988,9 @@ verify_total_writes(unsigned expected_total_writes) nerrors++; success = FALSE; if ( verbose ) { - HDfprintf(stdout, + HDfprintf(stdout, "%d:%s: reported/expected total writes mismatch (%u/%u).\n", - world_mpi_rank, FUNC, + world_mpi_rank, FUNC, reported_total_writes, expected_total_writes); } } @@ -5001,7 +5000,7 @@ verify_total_writes(unsigned expected_total_writes) } /* verify_total_writes() */ - + /***************************************************************************** * Function: unlock_entry() * @@ -5016,8 +5015,8 @@ verify_total_writes(unsigned expected_total_writes) * * Modifications: * - * 7/11/06 - * Updated for the new local_len field in datum. + * 7/11/06 + * Updated for the new local_len field in datum. * *****************************************************************************/ static void @@ -5037,7 +5036,7 @@ unlock_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert( entry_ptr->locked ); + HDassert( entry_ptr->locked ); dirtied = ((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG ); @@ -5053,7 +5052,7 @@ unlock_entry(H5F_t * file_ptr, if ( ( result < 0 ) || ( entry_ptr->header.type != &(types[0]) ) || ( ( entry_ptr->len != entry_ptr->header.size ) && - ( entry_ptr->local_len != entry_ptr->header.size ) ) || + ( entry_ptr->local_len != entry_ptr->header.size ) ) || ( entry_ptr->base_addr != entry_ptr->header.addr ) ) { nerrors++; @@ -5065,7 +5064,7 @@ unlock_entry(H5F_t * file_ptr, entry_ptr->locked = FALSE; - } + } HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); @@ -5086,7 +5085,7 @@ unlock_entry(H5F_t * file_ptr, } /* unlock_entry() */ - + /***************************************************************************** * Function: unpin_entry() * @@ -5101,8 +5100,8 @@ unlock_entry(H5F_t * file_ptr, * * Modifications: * - * JRM -- 8/15/06 - * Added assertion that entry is pinned on entry. + * JRM -- 8/15/06 + * Added assertion that entry is pinned on entry. * *****************************************************************************/ static void @@ -5124,54 +5123,54 @@ unpin_entry(H5F_t * file_ptr, entry_ptr = &(data[idx]); - HDassert( (entry_ptr->header).is_pinned ); - HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) ); - HDassert ( ( global && entry_ptr->global_pinned ) || - ( ! global && entry_ptr->local_pinned ) ); - HDassert ( ! ( dirty && ( ! global ) ) ); + HDassert( (entry_ptr->header).is_pinned ); + HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) ); + HDassert ( ( global && entry_ptr->global_pinned ) || + ( ! global && entry_ptr->local_pinned ) ); + HDassert ( ! ( dirty && ( ! global ) ) ); - if ( via_unprotect ) { + if ( via_unprotect ) { - lock_entry(file_ptr, idx); + lock_entry(file_ptr, idx); - if ( dirty ) { + if ( dirty ) { - flags |= H5AC__DIRTIED_FLAG; - } + flags |= H5AC__DIRTIED_FLAG; + } - unlock_entry(file_ptr, idx, flags); + unlock_entry(file_ptr, idx, flags); - } else { + } else { - if ( dirty ) { + if ( dirty ) { - mark_entry_dirty(idx); + mark_entry_dirty(idx); - } + } - result = H5AC_unpin_entry(entry_ptr); + result = H5AC_unpin_entry(entry_ptr); - if ( result < 0 ) { + if ( result < 0 ) { nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n", - world_mpi_rank, FUNC); + world_mpi_rank, FUNC); } - } - } + } + } HDassert( ! ((entry_ptr->header).is_pinned) ); - if ( global ) { + if ( global ) { - entry_ptr->global_pinned = FALSE; + entry_ptr->global_pinned = FALSE; - } else { + } else { - entry_ptr->local_pinned = FALSE; + entry_ptr->local_pinned = FALSE; - } + } } return; @@ -5183,18 +5182,18 @@ unpin_entry(H5F_t * file_ptr, /****************************** test functions *******************************/ /*****************************************************************************/ - + /***************************************************************************** * - * Function: server_smoke_check() + * Function: server_smoke_check() * - * Purpose: Quick smoke check for the server process. + * Purpose: Quick smoke check for the server process. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 12/21/05 + * Programmer: JRM -- 12/21/05 * *****************************************************************************/ static hbool_t @@ -5215,12 +5214,12 @@ server_smoke_check(void) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -5286,9 +5285,9 @@ server_smoke_check(void) #endif /* DO_WRITE_REQ_ACK */ - do_sync(); + do_sync(); - /* barrier to allow all writes to complete */ + /* barrier to allow all writes to complete */ if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) { success = FALSE; @@ -5303,12 +5302,12 @@ server_smoke_check(void) if ( success ) { success = verify_entry_writes(data[world_mpi_rank].base_addr, 1); - } + } if ( success ) { success = verify_entry_reads(data[world_mpi_rank].base_addr, 0); - } + } if ( success ) { @@ -5320,7 +5319,7 @@ server_smoke_check(void) success = verify_total_reads(0); } - /* barrier to allow all writes to complete */ + /* barrier to allow all writes to complete */ if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) { success = FALSE; @@ -5392,7 +5391,7 @@ server_smoke_check(void) } } - /* barrier to allow all writes to complete */ + /* barrier to allow all writes to complete */ if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) { success = FALSE; @@ -5407,12 +5406,12 @@ server_smoke_check(void) if ( success ) { success = verify_entry_writes(data[world_mpi_rank].base_addr, 1); - } + } if ( success ) { success = verify_entry_reads(data[world_mpi_rank].base_addr, 1); - } + } if ( success ) { @@ -5456,12 +5455,12 @@ server_smoke_check(void) if ( success ) { success = verify_entry_writes(data[world_mpi_rank].base_addr, 0); - } + } if ( success ) { success = verify_entry_reads(data[world_mpi_rank].base_addr, 0); - } + } if ( success ) { @@ -5514,9 +5513,9 @@ server_smoke_check(void) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -5531,18 +5530,18 @@ server_smoke_check(void) } /* server_smoke_check() */ - + /***************************************************************************** * - * Function: smoke_check_1() + * Function: smoke_check_1() * - * Purpose: First smoke check for the parallel cache. + * Purpose: First smoke check for the parallel cache. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/4/06 + * Programmer: JRM -- 1/4/06 * *****************************************************************************/ static hbool_t @@ -5558,23 +5557,23 @@ smoke_check_1(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #1 -- process 0 only md write strategy"); + TESTING("smoke check #1 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #1 -- distributed md write strategy"); + TESTING("smoke check #1 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #1 -- unknown md write strategy"); + TESTING("smoke check #1 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -5583,12 +5582,12 @@ smoke_check_1(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -5602,7 +5601,7 @@ smoke_check_1(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -5614,24 +5613,24 @@ smoke_check_1(int metadata_write_strategy) for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); } /* Move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); } if ( fid >= 0 ) { @@ -5640,7 +5639,7 @@ smoke_check_1(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -5686,9 +5685,9 @@ smoke_check_1(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -5703,21 +5702,21 @@ smoke_check_1(int metadata_write_strategy) } /* smoke_check_1() */ - + /***************************************************************************** * - * Function: smoke_check_2() + * Function: smoke_check_2() * - * Purpose: Second smoke check for the parallel cache. + * Purpose: Second smoke check for the parallel cache. * - * Introduce random reads, but keep all processes with roughly - * the same work load. + * Introduce random reads, but keep all processes with roughly + * the same work load. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/12/06 + * Programmer: JRM -- 1/12/06 * *****************************************************************************/ static hbool_t @@ -5733,23 +5732,23 @@ smoke_check_2(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #2 -- process 0 only md write strategy"); + TESTING("smoke check #2 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #2 -- distributed md write strategy"); + TESTING("smoke check #2 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #2 -- unknown md write strategy"); + TESTING("smoke check #2 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -5758,12 +5757,12 @@ smoke_check_2(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -5777,7 +5776,7 @@ smoke_check_2(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -5788,73 +5787,73 @@ smoke_check_2(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10); + lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10); } } - for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) - { - /* Make sure we don't step on any locally pinned entries */ - if ( data[i].local_pinned ) { - unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); - } + for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) + { + /* Make sure we don't step on any locally pinned entries */ + if ( data[i].local_pinned ) { + unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); + } - pin_entry(file_ptr, i, TRUE, FALSE); - } + pin_entry(file_ptr, i, TRUE, FALSE); + } for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 20), - 0, 100); - local_pin_and_unpin_random_entries(file_ptr, 0, - (virt_num_data_entries / 4), - 0, 3); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 20), + 0, 100); + local_pin_and_unpin_random_entries(file_ptr, 0, + (virt_num_data_entries / 4), + 0, 3); } for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 10), - 0, 100); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 10), + 0, 100); } - /* we can't move pinned entries, so release any local pins now. */ - local_unpin_all_entries(file_ptr, FALSE); + /* we can't move pinned entries, so release any local pins now. */ + local_unpin_all_entries(file_ptr, FALSE); /* Move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - ((virt_num_data_entries / 50) - 1), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + ((virt_num_data_entries / 50) - 1), 0, 100); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 100), - 0, 100); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 100), + 0, 100); } - for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) - { - hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 ); - hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 ); + for ( i = 0; i < (virt_num_data_entries / 2); i+=61 ) + { + hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 ); + hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 ); - unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); - } + unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); + } if ( fid >= 0 ) { @@ -5862,7 +5861,7 @@ smoke_check_2(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -5908,9 +5907,9 @@ smoke_check_2(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -5925,24 +5924,24 @@ smoke_check_2(int metadata_write_strategy) } /* smoke_check_2() */ - + /***************************************************************************** * - * Function: smoke_check_3() + * Function: smoke_check_3() * - * Purpose: Third smoke check for the parallel cache. + * Purpose: Third smoke check for the parallel cache. * - * Use random reads to vary the loads on the diffferent - * processors. Also force different cache size adjustments. + * Use random reads to vary the loads on the diffferent + * processors. Also force different cache size adjustments. * - * In this test, load process 0 heavily, and the other - * processes lightly. + * In this test, load process 0 heavily, and the other + * processes lightly. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/13/06 + * Programmer: JRM -- 1/13/06 * *****************************************************************************/ static hbool_t @@ -5962,23 +5961,23 @@ smoke_check_3(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #3 -- process 0 only md write strategy"); + TESTING("smoke check #3 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #3 -- distributed md write strategy"); + TESTING("smoke check #3 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #3 -- unknown md write strategy"); + TESTING("smoke check #3 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -5987,12 +5986,12 @@ smoke_check_3(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6006,7 +6005,7 @@ smoke_check_3(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6020,7 +6019,7 @@ smoke_check_3(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6030,48 +6029,48 @@ smoke_check_3(int metadata_write_strategy) max_count = min_count + 50; for ( i = (virt_num_data_entries / 4); - i < (virt_num_data_entries / 2); - i++ ) + i < (virt_num_data_entries / 2); + i++ ) { insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - if ( i % 59 == 0 ) { + if ( i % 59 == 0 ) { - hbool_t dirty = ( (i % 2) == 0); + hbool_t dirty = ( (i % 2) == 0); - if ( data[i].local_pinned ) { - unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); - } + if ( data[i].local_pinned ) { + unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); + } - pin_entry(file_ptr, i, TRUE, dirty); + pin_entry(file_ptr, i, TRUE, dirty); - HDassert( !dirty || data[i].header.is_dirty ); - HDassert( data[i].header.is_pinned ); - HDassert( data[i].global_pinned ); - HDassert( ! data[i].local_pinned ); - } + HDassert( !dirty || data[i].header.is_dirty ); + HDassert( data[i].header.is_pinned ); + HDassert( data[i].global_pinned ); + HDassert( ! data[i].local_pinned ); + } if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } - local_pin_and_unpin_random_entries(file_ptr, 0, + local_pin_and_unpin_random_entries(file_ptr, 0, virt_num_data_entries / 4, - 0, (file_mpi_rank + 2)); + 0, (file_mpi_rank + 2)); - } + } - /* flush the file to be sure that we have no problems flushing - * pinned entries - */ + /* flush the file to be sure that we have no problems flushing + * pinned entries + */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -6087,27 +6086,27 @@ smoke_check_3(int metadata_write_strategy) for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) { + if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) { hbool_t via_unprotect = ( (((unsigned)i) & 0x02) == 0 ); - hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 ); - - HDassert( data[i].global_pinned ); - HDassert( ! data[i].local_pinned ); - - unpin_entry(file_ptr, i, TRUE, dirty, - via_unprotect); - } - if ( i % 2 == 0 ) { - - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - local_pin_and_unpin_random_entries(file_ptr, 0, - virt_num_data_entries / 2, - 0, 2); - lock_and_unlock_random_entries(file_ptr, + hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 ); + + HDassert( data[i].global_pinned ); + HDassert( ! data[i].local_pinned ); + + unpin_entry(file_ptr, i, TRUE, dirty, + via_unprotect); + } + if ( i % 2 == 0 ) { + + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + local_pin_and_unpin_random_entries(file_ptr, 0, + virt_num_data_entries / 2, + 0, 2); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); - } + } } min_idx = 0; @@ -6120,9 +6119,9 @@ smoke_check_3(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } @@ -6135,22 +6134,22 @@ smoke_check_3(int metadata_write_strategy) /* move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 20), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 20), min_count, max_count); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 40), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 40), min_count, max_count); } @@ -6162,16 +6161,16 @@ smoke_check_3(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - local_pin_and_unpin_random_entries(file_ptr, 0, - (virt_num_data_entries / 2), - 0, 5); + local_pin_and_unpin_random_entries(file_ptr, 0, + (virt_num_data_entries / 2), + 0, 5); - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6185,7 +6184,7 @@ smoke_check_3(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -6232,9 +6231,9 @@ smoke_check_3(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -6249,24 +6248,24 @@ smoke_check_3(int metadata_write_strategy) } /* smoke_check_3() */ - + /***************************************************************************** * - * Function: smoke_check_4() + * Function: smoke_check_4() * - * Purpose: Fourth smoke check for the parallel cache. + * Purpose: Fourth smoke check for the parallel cache. * - * Use random reads to vary the loads on the diffferent - * processors. Also force different cache size adjustments. + * Use random reads to vary the loads on the diffferent + * processors. Also force different cache size adjustments. * - * In this test, load process 0 lightly, and the other - * processes heavily. + * In this test, load process 0 lightly, and the other + * processes heavily. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/13/06 + * Programmer: JRM -- 1/13/06 * *****************************************************************************/ static hbool_t @@ -6286,23 +6285,23 @@ smoke_check_4(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #4 -- process 0 only md write strategy"); + TESTING("smoke check #4 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #4 -- distributed md write strategy"); + TESTING("smoke check #4 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #4 -- unknown md write strategy"); + TESTING("smoke check #4 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -6311,12 +6310,12 @@ smoke_check_4(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6330,7 +6329,7 @@ smoke_check_4(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6345,7 +6344,7 @@ smoke_check_4(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6354,23 +6353,23 @@ smoke_check_4(int metadata_write_strategy) max_count = min_count + 100; for ( i = (virt_num_data_entries / 4); - i < (virt_num_data_entries / 2); - i++ ) + i < (virt_num_data_entries / 2); + i++ ) { - if ( i % 2 == 0 ) { + if ( i % 2 == 0 ) { insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - } else { + } else { - /* Insert some entries pinned, and then unpin them - * immediately. We have tested pinned entries elsewhere, - * so it should be sufficient to verify that the - * entries are in fact pinned (which unpin_entry() should do). - */ + /* Insert some entries pinned, and then unpin them + * immediately. We have tested pinned entries elsewhere, + * so it should be sufficient to verify that the + * entries are in fact pinned (which unpin_entry() should do). + */ insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG); unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); - } + } if ( i % 59 == 0 ) { @@ -6390,19 +6389,19 @@ smoke_check_4(int metadata_write_strategy) if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } local_pin_and_unpin_random_entries(file_ptr, 0, - (virt_num_data_entries / 4), + (virt_num_data_entries / 4), 0, (file_mpi_rank + 2)); } /* flush the file to be sure that we have no problems flushing - * pinned entries - */ + * pinned entries + */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { @@ -6429,13 +6428,13 @@ smoke_check_4(int metadata_write_strategy) unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); } - if ( i % 2 == 0 ) { + if ( i % 2 == 0 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - lock_and_unlock_random_entries(file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); - } + } } min_idx = 0; @@ -6444,14 +6443,14 @@ smoke_check_4(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } - /* we can't move pinned entries, so release any local pins now. */ - local_unpin_all_entries(file_ptr, FALSE); + /* we can't move pinned entries, so release any local pins now. */ + local_unpin_all_entries(file_ptr, FALSE); min_count = 10 * (file_mpi_rank % 4); max_count = min_count + 100; @@ -6459,22 +6458,22 @@ smoke_check_4(int metadata_write_strategy) /* move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 20), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 20), min_count, max_count); } /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(file_ptr, 0, - (virt_num_data_entries / 40), + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, + (virt_num_data_entries / 40), min_count, max_count); } @@ -6486,12 +6485,12 @@ smoke_check_4(int metadata_write_strategy) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); if ( i > 100 ) { - lock_and_unlock_random_entries(file_ptr, (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -6502,7 +6501,7 @@ smoke_check_4(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -6549,9 +6548,9 @@ smoke_check_4(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -6566,19 +6565,19 @@ smoke_check_4(int metadata_write_strategy) } /* smoke_check_4() */ - + /***************************************************************************** * - * Function: smoke_check_5() + * Function: smoke_check_5() * - * Purpose: Similar to smoke check 1, but modified to verify that - * H5AC_mark_entry_dirty() works in the parallel case. + * Purpose: Similar to smoke check 1, but modified to verify that + * H5AC_mark_entry_dirty() works in the parallel case. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 5/18/06 + * Programmer: JRM -- 5/18/06 * *****************************************************************************/ static hbool_t @@ -6594,23 +6593,23 @@ smoke_check_5(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #5 -- process 0 only md write strategy"); + TESTING("smoke check #5 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #5 -- distributed md write strategy"); + TESTING("smoke check #5 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #5 -- unknown md write strategy"); + TESTING("smoke check #5 -- unknown md write strategy"); } - break; + break; } @@ -6620,12 +6619,12 @@ smoke_check_5(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6640,7 +6639,7 @@ smoke_check_5(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6650,60 +6649,60 @@ smoke_check_5(int metadata_write_strategy) insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); } - /* flush the file so we can lock known clean entries. */ + /* flush the file so we can lock known clean entries. */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } for ( i = 0; i < (virt_num_data_entries / 4); i++ ) { - lock_entry(file_ptr, i); + lock_entry(file_ptr, i); - if ( i % 2 == 0 ) - { - mark_entry_dirty(i); - } + if ( i % 2 == 0 ) + { + mark_entry_dirty(i); + } - unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); - if ( i % 2 == 1 ) - { - if ( i % 4 == 1 ) { + if ( i % 2 == 1 ) + { + if ( i % 4 == 1 ) { - lock_entry(file_ptr, i); - unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); - } + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + } - expunge_entry(file_ptr, i); - } + expunge_entry(file_ptr, i); + } } for ( i = (virt_num_data_entries / 2) - 1; i >= (virt_num_data_entries / 4); - i-- ) + i-- ) { - pin_entry(file_ptr, i, TRUE, FALSE); + pin_entry(file_ptr, i, TRUE, FALSE); - if ( i % 2 == 0 ) - { - if ( i % 8 <= 4 ) { + if ( i % 2 == 0 ) + { + if ( i % 8 <= 4 ) { - resize_entry(i, data[i].len / 2); - } + resize_entry(i, data[i].len / 2); + } mark_entry_dirty(i); - if ( i % 8 <= 4 ) { + if ( i % 8 <= 4 ) { - resize_entry(i, data[i].len); - } - } + resize_entry(i, data[i].len); + } + } - unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); + unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); } if ( fid >= 0 ) { @@ -6712,7 +6711,7 @@ smoke_check_5(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -6758,9 +6757,9 @@ smoke_check_5(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -6775,10 +6774,10 @@ smoke_check_5(int metadata_write_strategy) } /* smoke_check_5() */ - + /***************************************************************************** * - * Function: trace_file_check() + * Function: trace_file_check() * * Purpose: A basic test of the trace file capability. In essence, * we invoke all operations that generate trace file output, @@ -6808,11 +6807,11 @@ smoke_check_5(int metadata_write_strategy) * * This test is skipped if H5_METADATA_TRACE_FILE is undefined. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 6/13/06 + * Programmer: JRM -- 6/13/06 * *****************************************************************************/ static hbool_t @@ -6897,25 +6896,25 @@ trace_file_check(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: #ifdef H5_METADATA_TRACE_FILE expected_output = &expected_output_0; #endif /* H5_METADATA_TRACE_FILE */ if ( world_mpi_rank == 0 ) { - TESTING( - "trace file collection -- process 0 only md write strategy"); + TESTING( + "trace file collection -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: #ifdef H5_METADATA_TRACE_FILE expected_output = &expected_output_1; #endif /* H5_METADATA_TRACE_FILE */ if ( world_mpi_rank == 0 ) { - TESTING( - "trace file collection -- distributed md write strategy"); + TESTING( + "trace file collection -- distributed md write strategy"); } - break; + break; default: #ifdef H5_METADATA_TRACE_FILE @@ -6925,9 +6924,9 @@ trace_file_check(int metadata_write_strategy) expected_output = &expected_output_0; #endif /* H5_METADATA_TRACE_FILE */ if ( world_mpi_rank == 0 ) { - TESTING("trace file collection -- unknown md write strategy"); + TESTING("trace file collection -- unknown md write strategy"); } - break; + break; } #ifdef H5_METADATA_TRACE_FILE @@ -6938,12 +6937,12 @@ trace_file_check(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -6958,7 +6957,7 @@ trace_file_check(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -6970,58 +6969,58 @@ trace_file_check(int metadata_write_strategy) if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); } else { config.open_trace_file = TRUE; - strcpy(config.trace_file_name, "t_cache_trace.txt"); + strcpy(config.trace_file_name, "t_cache_trace.txt"); if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); } } } - insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET); - insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET); - insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET); - insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET); + insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET); - lock_entry(file_ptr, 0); - mark_entry_dirty(0); - unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, 0); + mark_entry_dirty(0); + unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET); - lock_entry(file_ptr, 1); + lock_entry(file_ptr, 1); pin_protected_entry(1, TRUE); - unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET); + unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET); unpin_entry(file_ptr, 1, TRUE, FALSE, FALSE); expunge_entry(file_ptr, 1); - lock_entry(file_ptr, 2); + lock_entry(file_ptr, 2); pin_protected_entry(2, TRUE); - unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET); - mark_entry_dirty(2); + unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET); + mark_entry_dirty(2); resize_entry(2, data[2].len / 2); resize_entry(2, data[2].len); unpin_entry(file_ptr, 2, TRUE, FALSE, FALSE); - move_entry(file_ptr, 0, 20); - move_entry(file_ptr, 0, 20); + move_entry(file_ptr, 0, 20); + move_entry(file_ptr, 0, 20); if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -7033,8 +7032,8 @@ trace_file_check(int metadata_write_strategy) if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); @@ -7042,13 +7041,13 @@ trace_file_check(int metadata_write_strategy) config.open_trace_file = FALSE; config.close_trace_file = TRUE; - config.trace_file_name[0] = '\0'; + config.trace_file_name[0] = '\0'; if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { - nerrors++; - HDfprintf(stdout, + nerrors++; + HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, FUNC); } @@ -7061,7 +7060,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -7104,10 +7103,10 @@ trace_file_check(int metadata_write_strategy) if ( nerrors == 0 ) { - sprintf(trace_file_name, "t_cache_trace.txt.%d", - (int)file_mpi_rank); + sprintf(trace_file_name, "t_cache_trace.txt.%d", + (int)file_mpi_rank); - if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) { + if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) { nerrors++; if ( verbose ) { @@ -7115,59 +7114,59 @@ trace_file_check(int metadata_write_strategy) world_mpi_rank, FUNC); } } - } + } - i = 0; - while ( ( nerrors == 0 ) && ( ! done ) ) - { - if ( (*expected_output)[i] == NULL ) { + i = 0; + while ( ( nerrors == 0 ) && ( ! done ) ) + { + if ( (*expected_output)[i] == NULL ) { - expected_line_len = 0; + expected_line_len = 0; - } else { + } else { - expected_line_len = HDstrlen((*expected_output)[i]); - } + expected_line_len = HDstrlen((*expected_output)[i]); + } - if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) { + if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) { - actual_line_len = strlen(buffer); + actual_line_len = strlen(buffer); - } else { + } else { - actual_line_len = 0; - } + actual_line_len = 0; + } - if ( ( actual_line_len == 0 ) && ( expected_line_len == 0 ) ) { + if ( ( actual_line_len == 0 ) && ( expected_line_len == 0 ) ) { - done = TRUE; + done = TRUE; - } else if ( ( actual_line_len != expected_line_len ) || - ( HDstrcmp(buffer, (*expected_output)[i]) != 0 ) ) { + } else if ( ( actual_line_len != expected_line_len ) || + ( HDstrcmp(buffer, (*expected_output)[i]) != 0 ) ) { - nerrors++; + nerrors++; if ( verbose ) { HDfprintf(stdout, - "%d:%s: Unexpected data in trace file line %d.\n", + "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank, FUNC, i); - HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", - world_mpi_rank, FUNC, (*expected_output)[i], - expected_line_len); - HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", - world_mpi_rank, FUNC, buffer, - actual_line_len); + HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", + world_mpi_rank, FUNC, (*expected_output)[i], + expected_line_len); + HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", + world_mpi_rank, FUNC, buffer, + actual_line_len); } - } else { - i++; - } - } + } else { + i++; + } + } - if ( trace_file_ptr != NULL ) { + if ( trace_file_ptr != NULL ) { - HDfclose(trace_file_ptr); - trace_file_ptr = NULL; + HDfclose(trace_file_ptr); + trace_file_ptr = NULL; #if 1 - HDremove(trace_file_name); + HDremove(trace_file_name); #endif } } @@ -7176,9 +7175,9 @@ trace_file_check(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -7204,18 +7203,18 @@ trace_file_check(int metadata_write_strategy) } /* trace_file_check() */ - + /***************************************************************************** * - * Function: smoke_check_6() + * Function: smoke_check_6() * - * Purpose: Sixth smoke check for the parallel cache. + * Purpose: Sixth smoke check for the parallel cache. * - * Return: Success: TRUE + * Return: Success: TRUE * - * Failure: FALSE + * Failure: FALSE * - * Programmer: JRM -- 1/13/06 + * Programmer: JRM -- 1/13/06 * *****************************************************************************/ static hbool_t @@ -7231,23 +7230,23 @@ smoke_check_6(int metadata_write_strategy) switch ( metadata_write_strategy ) { - case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #6 -- process 0 only md write strategy"); + TESTING("smoke check #6 -- process 0 only md write strategy"); } - break; + break; - case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #6 -- distributed md write strategy"); + TESTING("smoke check #6 -- distributed md write strategy"); } - break; + break; default: if ( world_mpi_rank == 0 ) { - TESTING("smoke check #6 -- unknown md write strategy"); + TESTING("smoke check #6 -- unknown md write strategy"); } - break; + break; } nerrors = 0; @@ -7256,12 +7255,12 @@ smoke_check_6(int metadata_write_strategy) if ( world_mpi_rank == world_server_mpi_rank ) { - if ( ! server_main() ) { + if ( ! server_main() ) { /* some error occured in the server -- report failure */ nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: server_main() failed.\n", + HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC); } } @@ -7277,7 +7276,7 @@ smoke_check_6(int metadata_write_strategy) fid = -1; cache_ptr = NULL; if ( verbose ) { - HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", + HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC); } } @@ -7327,11 +7326,11 @@ smoke_check_6(int metadata_write_strategy) HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } - /* flush the file */ + /* flush the file */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } } @@ -7343,7 +7342,7 @@ smoke_check_6(int metadata_write_strategy) struct datum * entry_ptr; entry_ptr = &(data[i]); - lock_entry(file_ptr, i); + lock_entry(file_ptr, i); if(TRUE != entry_ptr->header.coll_access) { nerrors++; @@ -7364,7 +7363,7 @@ smoke_check_6(int metadata_write_strategy) struct datum * entry_ptr; entry_ptr = &(data[i]); - lock_entry(file_ptr, i); + lock_entry(file_ptr, i); if(FALSE != entry_ptr->header.coll_access) { nerrors++; @@ -7389,7 +7388,7 @@ smoke_check_6(int metadata_write_strategy) nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", + HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC); } } @@ -7437,9 +7436,9 @@ smoke_check_6(int metadata_write_strategy) if ( world_mpi_rank == 0 ) { - if ( max_nerrors == 0 ) { + if ( max_nerrors == 0 ) { - PASSED(); + PASSED(); } else { @@ -7454,18 +7453,18 @@ smoke_check_6(int metadata_write_strategy) } /* smoke_check_6() */ - + /***************************************************************************** * - * Function: main() + * Function: main() * - * Purpose: Main function for the parallel cache test. + * Purpose: Main function for the parallel cache test. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: JRM -- 12/23/05 + * Programmer: JRM -- 12/23/05 * *****************************************************************************/ int @@ -7492,7 +7491,7 @@ main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("%d:Failed to turn off atexit processing. Continue.\n", + printf("%d:Failed to turn off atexit processing. Continue.\n", mpi_rank); }; H5open(); @@ -7503,32 +7502,32 @@ main(int argc, char **argv) #endif /* JRM */ if ( express_test ) { - virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES; + virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES; } else { - virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES; + virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES; } #ifdef H5_HAVE_MPE - if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); } + if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); } virt_num_data_entries = MPE_VIRT_NUM_DATA_ENTIES; #endif /* H5_HAVE_MPE */ if (MAINPROCESS){ - printf("===================================\n"); - printf("Parallel metadata cache tests\n"); - printf(" mpi_size = %d\n", mpi_size); - printf(" express_test = %d\n", express_test); - printf("===================================\n"); + printf("===================================\n"); + printf("Parallel metadata cache tests\n"); + printf(" mpi_size = %d\n", mpi_size); + printf(" express_test = %d\n", express_test); + printf("===================================\n"); } if ( mpi_size < 3 ) { if ( MAINPROCESS ) { - printf(" Need at least 3 processes. Exiting.\n"); + printf(" Need at least 3 processes. Exiting.\n"); } goto finish; } @@ -7547,8 +7546,8 @@ main(int argc, char **argv) /* setup file access property list with the world communicator */ if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) { nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", world_mpi_rank, FUNC); } } @@ -7580,8 +7579,8 @@ main(int argc, char **argv) /* close the fapl before we set it up again */ if ( H5Pclose(fapl) < 0 ) { nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", world_mpi_rank, FUNC); } } @@ -7591,9 +7590,9 @@ main(int argc, char **argv) /* setup file access property list */ if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) { - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", + nerrors++; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", world_mpi_rank, FUNC); } } @@ -7601,8 +7600,8 @@ main(int argc, char **argv) if ( H5Pset_fapl_mpio(fapl, file_mpi_comm, MPI_INFO_NULL) < 0 ) { nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", world_mpi_rank, FUNC); } } @@ -7620,7 +7619,7 @@ main(int argc, char **argv) HDfprintf(stdout, "Errors in test initialization. Exiting.\n"); } - goto finish; + goto finish; } /* run the tests */ @@ -7673,16 +7672,16 @@ finish: * and exit. */ MPI_Barrier(MPI_COMM_WORLD); - if (MAINPROCESS){ /* only process 0 reports */ - printf("===================================\n"); - if (failures){ - printf("***metadata cache tests detected %d failures***\n", + if (MAINPROCESS){ /* only process 0 reports */ + printf("===================================\n"); + if (failures){ + printf("***metadata cache tests detected %d failures***\n", failures); - } - else{ - printf("metadata cache tests finished with no failures\n"); - } - printf("===================================\n"); + } + else{ + printf("metadata cache tests finished with no failures\n"); + } + printf("===================================\n"); } takedown_derived_types(); diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 524a63f..7fe0020 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -14,12 +14,11 @@ /* Programmer: John Mainzer * 7/13/15 * - * This file contains tests specific to the cache image - * feature implemented in H5C.c + * This file contains tests specific to the cache image + * feature implemented in H5C.c */ -#include "h5test.h" #include "testphdf5.h" -#include "testpar.h" + #include "cache_common.h" #include "genall5.h" @@ -28,7 +27,7 @@ #define DSET_SIZE (40 * CHUNK_SIZE) #define MAX_NUM_DSETS 256 #define PAR_NUM_DSETS 32 -#define PAGE_SIZE (4 * 1024) +#define PAGE_SIZE (4 * 1024) #define PB_SIZE (64 * PAGE_SIZE) /* global variable declarations: */ @@ -59,8 +58,8 @@ static void open_hdf5_file(const hbool_t create_file, hid_t * file_id_ptr, H5F_t ** file_ptr_ptr, H5C_t ** cache_ptr_ptr, - MPI_Comm comm, - MPI_Info info, + MPI_Comm comm, + MPI_Info info, int l_facc_type, const hbool_t all_coll_metadata_ops, const hbool_t coll_metadata_write, @@ -70,11 +69,11 @@ static void verify_data_sets(hid_t file_id, int min_dset, int max_dset); /* local test function declarations */ -static hbool_t parse_flags(int argc, char * argv[], hbool_t * setup_ptr, +static hbool_t parse_flags(int argc, char * argv[], hbool_t * setup_ptr, hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display); static void usage(void); static unsigned construct_test_file(int test_file_index); -static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, +static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, int mpi_size); static void par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank); static void par_verify_dataset(int dset_num, hid_t file_id, int mpi_rank); @@ -83,15 +82,15 @@ static hbool_t serial_insert_cache_image(int file_name_idx, int mpi_size); static void serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size); /* top level test function declarations */ -static unsigned verify_cache_image_RO(int file_name_id, +static unsigned verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank); -static unsigned verify_cache_image_RW(int file_name_id, +static unsigned verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank); -static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, +static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size); - + /****************************************************************************/ /***************************** Utility Functions ****************************/ /****************************************************************************/ @@ -99,52 +98,52 @@ static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, /*------------------------------------------------------------------------- * Function: construct_test_file() * - * Purpose: This function attempts to mimic the typical "poor man's - * parallel use case in which the file is passed between - * processes, each of which open the file, write some data, - * close the file, and then pass control on to the next - * process. + * Purpose: This function attempts to mimic the typical "poor man's + * parallel use case in which the file is passed between + * processes, each of which open the file, write some data, + * close the file, and then pass control on to the next + * process. * - * In this case, we create one group for each process, and - * populate it with a "zoo" of HDF5 objects selected to - * (ideally) exercise all HDF5 on disk data structures. + * In this case, we create one group for each process, and + * populate it with a "zoo" of HDF5 objects selected to + * (ideally) exercise all HDF5 on disk data structures. * - * The end result is a test file used verify that PHDF5 - * can open a file with a cache image. + * The end result is a test file used verify that PHDF5 + * can open a file with a cache image. * - * Cycle of operation + * Cycle of operation * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create a data set in the file. + * 2) Create a data set in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * Verify that the metadata cache is instructed to load + * Verify that the metadata cache is instructed to load * the metadata cache image. * - * 5) Create a data set in the file. + * 5) Create a data set in the file. * - * 6) Close the file. If enough datasets have been created + * 6) Close the file. If enough datasets have been created * goto 7. Otherwise return to 4. * - * 7) Open the file R/O. + * 7) Open the file R/O. * * Verify that the file contains a metadata cache image * superblock extension message. - * - * 8) Verify all data sets. * - * Verify that the cache image has been loaded. + * 8) Verify all data sets. * - * 9) close the file. + * Verify that the cache image has been loaded. + * + * 9) close the file. * * Return: void * @@ -153,7 +152,7 @@ static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -175,7 +174,7 @@ construct_test_file(int test_file_index) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -184,7 +183,7 @@ construct_test_file(int test_file_index) HDassert(FILENAMES[test_file_index]); - if ( h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT, + if ( h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { @@ -193,13 +192,13 @@ construct_test_file(int test_file_index) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -210,7 +209,7 @@ construct_test_file(int test_file_index) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, + /* config_fsm */ TRUE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -225,7 +224,7 @@ construct_test_file(int test_file_index) /* md_write_strat */ 0); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -247,7 +246,7 @@ construct_test_file(int test_file_index) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -263,7 +262,7 @@ construct_test_file(int test_file_index) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -282,7 +281,7 @@ construct_test_file(int test_file_index) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -356,7 +355,7 @@ construct_test_file(int test_file_index) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -375,7 +374,7 @@ construct_test_file(int test_file_index) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 8) Open and close all data sets. + /* 8) Open and close all data sets. * * Verify that the cache image has been loaded. */ @@ -414,15 +413,15 @@ construct_test_file(int test_file_index) } /* construct_test_file() */ - + /*------------------------------------------------------------------------- * Function: create_data_sets() * * Purpose: If pass is TRUE on entry, create the specified data sets - * in the indicated file. + * in the indicated file. * - * Data sets and their contents must be well know, as we - * will verify that they contain the expected data later. + * Data sets and their contents must be well know, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -436,15 +435,15 @@ construct_test_file(int test_file_index) * * Modifications: * - * Added min_dset and max_dset parameters and supporting - * code. This allows the caller to specify a range of - * datasets to create. - * JRM -- 8/20/15 + * Added min_dset and max_dset parameters and supporting + * code. This allows the caller to specify a range of + * datasets to create. + * JRM -- 8/20/15 * *------------------------------------------------------------------------- */ -static void +static void create_data_sets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "create_data_sets()"; @@ -666,8 +665,8 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -692,7 +691,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", @@ -702,7 +701,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -712,12 +711,12 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { - fprintf(stdout, + fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -768,16 +767,16 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) } /* create_data_sets() */ - + /*------------------------------------------------------------------------- * Function: delete_data_sets() * - * Purpose: If pass is TRUE on entry, verify and then delete the - * dataset(s) indicated by min_dset and max_dset in the - * indicated file. + * Purpose: If pass is TRUE on entry, verify and then delete the + * dataset(s) indicated by min_dset and max_dset in the + * indicated file. * - * Data sets and their contents must be well know, as we - * will verify that they contain the expected data later. + * Data sets and their contents must be well know, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -792,17 +791,17 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) * Modifications: * * None. - * JRM -- 8/20/15 + * JRM -- 8/20/15 * *------------------------------------------------------------------------- */ -#if 0 +#if 0 /* this code will be needed to test full support of cache image * in parallel -- keep it around against that day. * * -- JRM */ -static void +static void delete_data_sets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "delete_data_sets()"; @@ -833,11 +832,11 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) { sprintf(dset_name, "/dset%03d", i); - if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { + if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { pass = FALSE; failure_mssg = "H5Ldelete() failed."; - } + } i++; } @@ -850,32 +849,32 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) } /* delete_data_sets() */ #endif - + /*------------------------------------------------------------------------- * Function: open_hdf5_file() * - * Purpose: If pass is true on entry, create or open the specified HDF5 - * and test to see if it has a metadata cache image superblock - * extension message. + * Purpose: If pass is true on entry, create or open the specified HDF5 + * and test to see if it has a metadata cache image superblock + * extension message. * - * Set pass to FALSE and issue a suitable failure - * message if either the file contains a metadata cache image - * superblock extension and mdci_sbem_expected is TRUE, or - * vise versa. + * Set pass to FALSE and issue a suitable failure + * message if either the file contains a metadata cache image + * superblock extension and mdci_sbem_expected is TRUE, or + * vise versa. * - * If mdci_sbem_expected is TRUE, also verify that the metadata - * cache has been advised of this. + * If mdci_sbem_expected is TRUE, also verify that the metadata + * cache has been advised of this. * - * If read_only is TRUE, open the file read only. Otherwise - * open the file read/write. + * If read_only is TRUE, open the file read only. Otherwise + * open the file read/write. * - * If set_mdci_fapl is TRUE, set the metadata cache image - * FAPL entry when opening the file, and verify that the - * metadata cache is notified. + * If set_mdci_fapl is TRUE, set the metadata cache image + * FAPL entry when opening the file, and verify that the + * metadata cache is notified. * - * If config_fsm is TRUE, setup the persistant free space - * manager. Note that this flag may only be set if - * create_file is also TRUE. + * If config_fsm is TRUE, setup the persistant free space + * manager. Note that this flag may only be set if + * create_file is also TRUE. * * Return pointers to the cache data structure and file data * structures. @@ -893,10 +892,10 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) * Modifications: * * Modified function to handle parallel file creates / opens. - * + * * JRM -- 2/1/17 * - * Modified function to handle + * Modified function to handle * *------------------------------------------------------------------------- */ @@ -904,17 +903,17 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) static void open_hdf5_file(const hbool_t create_file, const hbool_t mdci_sbem_expected, - const hbool_t read_only, - const hbool_t set_mdci_fapl, - const hbool_t config_fsm, + const hbool_t read_only, + const hbool_t set_mdci_fapl, + const hbool_t config_fsm, const hbool_t enable_page_buffer, - const char * hdf_file_name, + const char * hdf_file_name, const unsigned cache_image_flags, hid_t * file_id_ptr, H5F_t ** file_ptr_ptr, H5C_t ** cache_ptr_ptr, - MPI_Comm comm, - MPI_Info info, + MPI_Comm comm, + MPI_Info info, int l_facc_type, const hbool_t all_coll_metadata_ops, const hbool_t coll_metadata_write, @@ -941,8 +940,8 @@ open_hdf5_file(const hbool_t create_file, if ( pass ) { - /* opening the file both read only and with a cache image - * requested is a contradiction. We resolve it by ignoring + /* opening the file both read only and with a cache image + * requested is a contradiction. We resolve it by ignoring * the cache image request silently. */ if ( ( create_file && mdci_sbem_expected ) || @@ -969,7 +968,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create a file access propertly list. */ @@ -984,13 +983,13 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* call H5Pset_libver_bounds() on the fapl_id */ if ( pass ) { - if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) + if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) { pass = FALSE; @@ -998,7 +997,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get metadata cache image config -- verify that it is the default */ @@ -1016,7 +1015,7 @@ open_hdf5_file(const hbool_t create_file, H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( cache_image_config.generate_image != FALSE ) || ( cache_image_config.save_resize_status != FALSE ) || - ( cache_image_config.entry_ageout != + ( cache_image_config.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ) { pass = FALSE; @@ -1024,7 +1023,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* set metadata cache image fapl entry if indicated */ @@ -1044,24 +1043,24 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the persistant free space manager if indicated */ if ( ( pass ) && ( config_fsm ) ) { - fcpl_id = H5Pcreate(H5P_FILE_CREATE); + fcpl_id = H5Pcreate(H5P_FILE_CREATE); - if ( fcpl_id <= 0 ) { + if ( fcpl_id <= 0 ) { - pass = FALSE; - failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; - } + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; + } } if ( ( pass ) && ( config_fsm ) ) { - if ( H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, + if ( H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) == FAIL ) { pass = FALSE; failure_mssg = "H5Pset_file_space_strategy() failed.\n"; @@ -1077,7 +1076,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the page buffer if indicated */ @@ -1087,10 +1086,10 @@ open_hdf5_file(const hbool_t create_file, pass = FALSE; failure_mssg = "H5Pset_page_buffer_size() failed.\n"; - } + } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1098,13 +1097,13 @@ open_hdf5_file(const hbool_t create_file, /* set Parallel access with communicator */ if ( H5Pset_fapl_mpio(fapl_id, comm, info) < 0 ) { - + pass = FALSE; failure_mssg = "H5Pset_fapl_mpio() failed.\n"; } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) { @@ -1116,7 +1115,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) { @@ -1128,7 +1127,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( l_facc_type == FACC_MPIO ) ) { @@ -1137,7 +1136,7 @@ open_hdf5_file(const hbool_t create_file, H5AC_cache_config_t mdc_config; mdc_config.version = H5C__CURR_AUTO_SIZE_CTL_VER; - + if ( H5Pget_mdc_config(fapl_id, &mdc_config) < 0 ) { pass = FALSE; @@ -1153,7 +1152,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* open the file */ @@ -1161,13 +1160,13 @@ open_hdf5_file(const hbool_t create_file, if ( create_file ) { - if ( fcpl_id != -1 ) + if ( fcpl_id != -1 ) - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, - fcpl_id, fapl_id); - else + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + fcpl_id, fapl_id); + else - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); } else { @@ -1202,7 +1201,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -1221,12 +1220,12 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* verify expected page buffer status. At present, page buffering - * must be disabled in parallel -- hopefully this will change in the + /* verify expected page buffer status. At present, page buffering + * must be disabled in parallel -- hopefully this will change in the * future. */ if ( pass ) { @@ -1245,7 +1244,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1265,7 +1264,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1273,26 +1272,26 @@ open_hdf5_file(const hbool_t create_file, if ( set_mdci_fapl ) { - if ( read_only ) { + if ( read_only ) { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { pass = FALSE; failure_mssg = "Unexpected image_ctl values(1).\n"; } - } else { + } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || - ( image_ctl.generate_image != TRUE ) || + ( image_ctl.generate_image != TRUE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -1302,11 +1301,11 @@ open_hdf5_file(const hbool_t create_file, } } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -1316,7 +1315,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( ( pass ) && ( set_mdci_fapl ) ) { @@ -1330,7 +1329,7 @@ open_hdf5_file(const hbool_t create_file, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1359,19 +1358,19 @@ open_hdf5_file(const hbool_t create_file, pass = FALSE; failure_mssg = "mdci sb extension message not present?\n"; } - } + } } else { - if ( ( cache_ptr->load_image == TRUE ) || + if ( ( cache_ptr->load_image == TRUE ) || ( cache_ptr->delete_image == TRUE ) ) { pass = FALSE; failure_mssg = "mdci sb extension message present?\n"; - } + } } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1382,11 +1381,11 @@ open_hdf5_file(const hbool_t create_file, } if ( show_progress ) { - HDfprintf(stdout, "%s: cp = %d, pass = %d -- exiting.\n", + HDfprintf(stdout, "%s: cp = %d, pass = %d -- exiting.\n", fcn_name, cp++, pass); if ( ! pass ) - HDfprintf(stdout, "%s: failure_mssg = %s\n", + HDfprintf(stdout, "%s: failure_mssg = %s\n", fcn_name, failure_mssg); } @@ -1394,11 +1393,11 @@ open_hdf5_file(const hbool_t create_file, } /* open_hdf5_file() */ - + /*------------------------------------------------------------------------- * Function: par_create_dataset() * - * Purpose: Collectively create a chunked dataset, and fill it with + * Purpose: Collectively create a chunked dataset, and fill it with * known values. * * On failure, set pass to FALSE, and set failure_mssg @@ -1469,7 +1468,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* set the dataset creation plist to specify that the raw data is @@ -1487,7 +1486,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1503,7 +1502,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the dataset */ @@ -1520,7 +1519,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get the file space ID */ @@ -1535,7 +1534,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the mem space to be used to read and write chunks */ @@ -1553,7 +1552,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* select in memory hyperslab */ @@ -1575,7 +1574,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the DXPL for collective I/O */ @@ -1590,7 +1589,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -1602,7 +1601,7 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* initialize the dataset with collective writes */ @@ -1613,8 +1612,8 @@ par_create_dataset(int dset_num, while ( ( pass ) && ( j < DSET_SIZE ) ) { - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.0, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.0, pass = %d.\n", fcn_name, cp, pass); /* initialize the slab */ @@ -1628,8 +1627,8 @@ par_create_dataset(int dset_num, } } - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.1, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.1, pass = %d.\n", fcn_name, cp, pass); /* select on disk hyperslab */ @@ -1637,7 +1636,7 @@ par_create_dataset(int dset_num, offset[1] = (hsize_t)i; offset[2] = (hsize_t)j; a_size[0] = (hsize_t)1; /* size of hyperslab */ - a_size[1] = CHUNK_SIZE; + a_size[1] = CHUNK_SIZE; a_size[2] = CHUNK_SIZE; status = H5Sselect_hyperslab(filespace_id, H5S_SELECT_SET, offset, NULL, a_size, NULL); @@ -1648,8 +1647,8 @@ par_create_dataset(int dset_num, failure_mssg = "disk H5Sselect_hyperslab() failed."; } - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.2, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.2, pass = %d.\n", fcn_name, cp, pass); /* write the chunk to file */ @@ -1662,8 +1661,8 @@ par_create_dataset(int dset_num, failure_mssg = "H5Dwrite() failed."; } - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d.3, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d.3, pass = %d.\n", fcn_name, cp, pass); j += CHUNK_SIZE; @@ -1673,7 +1672,7 @@ par_create_dataset(int dset_num, } cp++; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* read data from data sets and validate it */ @@ -1762,7 +1761,7 @@ par_create_dataset(int dset_num, i += CHUNK_SIZE; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* close the data space */ @@ -1807,14 +1806,14 @@ par_create_dataset(int dset_num, failure_mssg = "H5Pclose(dxpl) failed."; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* par_create_dataset() */ - + /*------------------------------------------------------------------------- * Function: par_delete_dataset() * @@ -1862,7 +1861,7 @@ par_delete_dataset(int dset_num, par_verify_dataset(dset_num, file_id, mpi_rank); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* delete the target dataset */ @@ -1875,21 +1874,21 @@ par_delete_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* par_delete_dataset() */ - + /*------------------------------------------------------------------------- * Function: par_insert_cache_image() * * Purpose: Insert a cache image in the supplied file. * - * At present, cache image is not enabled in the parallel - * so we have to insert the cache image with a serial + * At present, cache image is not enabled in the parallel + * so we have to insert the cache image with a serial * process. Do this via a fork and an execv from process 0. * All processes wait until the child process completes, and * then return. @@ -1935,22 +1934,22 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) /* fun and games to shutup the compiler */ char param0[32] = "t_cache_image"; char param1[32] = "ici"; - char * child_argv[] = {param0, - param1, - file_name_idx_str, - mpi_size_str, + char * child_argv[] = {param0, + param1, + file_name_idx_str, + mpi_size_str, NULL}; /* we may need to play with the path here */ if ( execv("t_cache_image", child_argv) == -1 ) { - HDfprintf(stdout, + HDfprintf(stdout, "execl() of ici process failed. errno = %d(%s)\n", errno, strerror(errno)); exit(1); } - } else if ( child_pid != -1 ) { + } else if ( child_pid != -1 ) { /* this is the parent process -- wait until child is done */ if ( -1 == waitpid(child_pid, &child_status, WUNTRACED)) { @@ -1973,7 +1972,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) } } else { /* fork failed */ - HDfprintf(stdout, + HDfprintf(stdout, "can't create process to insert cache image.\n"); pass = FALSE; } @@ -1982,8 +1981,8 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) if ( pass ) { - /* make sure insertion of the cache image is complete - * before proceeding + /* make sure insertion of the cache image is complete + * before proceeding */ MPI_Barrier(MPI_COMM_WORLD); } @@ -1992,7 +1991,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) } /* par_insert_cache_image() */ - + /*------------------------------------------------------------------------- * Function: par_verify_dataset() * @@ -2072,7 +2071,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the mem space to be used to read */ @@ -2090,7 +2089,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* select in memory hyperslab */ @@ -2112,7 +2111,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the DXPL for collective I/O */ @@ -2127,7 +2126,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -2139,7 +2138,7 @@ par_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* read data from data sets and validate it */ @@ -2228,7 +2227,7 @@ par_verify_dataset(int dset_num, i += CHUNK_SIZE; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* close the file space */ @@ -2259,23 +2258,23 @@ par_verify_dataset(int dset_num, failure_mssg = "H5Pclose(dxpl) failed."; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* par_verify_dataset() */ - + /*------------------------------------------------------------------------- * Function: serial_insert_cache_image() * * Purpose: Insert a cache image in the supplied file. * - * To populate the cache image, validate the contents - * of the file before closing. + * To populate the cache image, validate the contents + * of the file before closing. * - * On failure, print an appropriate error message and + * On failure, print an appropriate error message and * return FALSE. * * Return: TRUE if succussful, FALSE otherwise. @@ -2329,7 +2328,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 2) Open the PHDF5 file with the cache image FAPL entry. + /* 2) Open the PHDF5 file with the cache image FAPL entry. */ if ( pass ) { @@ -2388,7 +2387,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size ) } /* serial_insert_cache_image() */ - + /*------------------------------------------------------------------------- * Function: serial_verify_dataset() * @@ -2464,7 +2463,7 @@ serial_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* create the mem space to be used to read */ @@ -2482,7 +2481,7 @@ serial_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* select in memory hyperslab */ @@ -2504,7 +2503,7 @@ serial_verify_dataset(int dset_num, } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -2601,7 +2600,7 @@ serial_verify_dataset(int dset_num, } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* close the file space */ @@ -2625,18 +2624,18 @@ serial_verify_dataset(int dset_num, failure_mssg = "H5Sclose(memspace_id) failed."; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); return; } /* serial_verify_dataset() */ - + /*------------------------------------------------------------------------- * Function: parse_flags * - * Purpose: Parse the flags passed to this program, and load the + * Purpose: Parse the flags passed to this program, and load the * values into the supplied field. * * Return: Success: 1 @@ -2648,7 +2647,7 @@ serial_verify_dataset(int dset_num, *------------------------------------------------------------------------- */ static hbool_t -parse_flags(int argc, char * argv[], hbool_t * setup_ptr, +parse_flags(int argc, char * argv[], hbool_t * setup_ptr, hbool_t * ici_ptr, int * file_idx_ptr, int * mpi_size_ptr, hbool_t display) { const char * fcn_name = "parse_flags()"; @@ -2669,7 +2668,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, } - if ( ( success ) && + if ( ( success ) && ( ( argc != 1 ) && ( argc != 2 ) && ( argc != 4 ) ) ) { success = FALSE; @@ -2716,7 +2715,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, else if ( *ici_ptr ) - HDfprintf(stdout, "t_cache_image ici %d %d\n", + HDfprintf(stdout, "t_cache_image ici %d %d\n", *file_idx_ptr, *mpi_size_ptr); else @@ -2728,7 +2727,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, } /* parse_flags() */ - + /*------------------------------------------------------------------------- * Function: usage * @@ -2738,7 +2737,7 @@ parse_flags(int argc, char * argv[], hbool_t * setup_ptr, * Return: void * * Programmer: John Mainzer - * 4/28/11 + * 4/28/11 * * Modifications: * @@ -2792,17 +2791,17 @@ usage(void) return; } /* usage() */ - + /*------------------------------------------------------------------------- * Function: verify_data_sets() * - * Purpose: If pass is TRUE on entry, verify that the data sets in the - * file exist and contain the expected data. + * Purpose: If pass is TRUE on entry, verify that the data sets in the + * file exist and contain the expected data. * - * Note that these data sets were created by - * create_data_sets() above. Thus any changes in that - * function must be reflected in this function, and - * vise-versa. + * Note that these data sets were created by + * create_data_sets() above. Thus any changes in that + * function must be reflected in this function, and + * vise-versa. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -2816,15 +2815,15 @@ usage(void) * * Modifications: * - * Added min_dset and max_dset parameters and supporting - * code. This allows the caller to specify a range of - * datasets to verify. - * JRM -- 8/20/15 + * Added min_dset and max_dset parameters and supporting + * code. This allows the caller to specify a range of + * datasets to verify. + * JRM -- 8/20/15 * *------------------------------------------------------------------------- */ -static void +static void verify_data_sets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "verify_data_sets()"; @@ -2952,8 +2951,8 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -2978,8 +2977,8 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { - + if ( verbose ) { + HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", k, l, data_chunk[k][l], @@ -2988,7 +2987,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -2998,12 +2997,12 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { - fprintf(stdout, + fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -3054,7 +3053,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) } /* verify_data_sets() */ - + /****************************************************************************/ /******************************* Test Functions *****************************/ /****************************************************************************/ @@ -3062,21 +3061,21 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) /*------------------------------------------------------------------------- * Function: verify_cache_image_RO() * - * Purpose: Verify that a HDF5 file containing a cache image is - * opened R/O and read correctly by PHDF5 with the specified + * Purpose: Verify that a HDF5 file containing a cache image is + * opened R/O and read correctly by PHDF5 with the specified * metadata write strategy. - * + * * Basic cycle of operation is as follows: * - * 1) Open the test file created at the beginning of this - * test read only. + * 1) Open the test file created at the beginning of this + * test read only. * - * Verify that the file contains a cache image. + * Verify that the file contains a cache image. * - * Verify that only process 0 reads the cache image. + * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache - * image block from process 0. + * Verify that all other processes receive the cache + * image block from process 0. * * 2) Verify that the file contains the expected data. * @@ -3096,7 +3095,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3135,14 +3134,14 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) show_progress = ( ( show_progress ) && ( mpi_rank == 0 ) ); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, + if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -3150,7 +3149,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3165,7 +3164,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3180,15 +3179,15 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 2) Verify that the file contains the expected data. + /* 2) Verify that the file contains the expected data. * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3210,14 +3209,14 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -3231,12 +3230,12 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 3) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3247,7 +3246,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3259,7 +3258,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3274,12 +3273,12 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 5) Verify that the file contains the expected data. */ - + if ( pass ) { verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); @@ -3298,7 +3297,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* 6) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3309,7 +3308,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3324,7 +3323,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) H5_FAILED(); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg); } } @@ -3334,32 +3333,32 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) } /* verify_cache_image_RO() */ - + /*------------------------------------------------------------------------- * Function: verify_cache_image_RW() * - * Purpose: Verify that a HDF5 file containing a cache image is - * opened and read correctly by PHDF5 with the specified + * Purpose: Verify that a HDF5 file containing a cache image is + * opened and read correctly by PHDF5 with the specified * metadata write strategy. - * + * * Basic cycle of operation is as follows: * - * 1) Open the test file created at the beginning of this - * test. + * 1) Open the test file created at the beginning of this + * test. * - * Verify that the file contains a cache image. + * Verify that the file contains a cache image. * * 2) Verify that the file contains the expected data. * - * Verify that only process 0 reads the cache image. + * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache - * image block from process 0. + * Verify that all other processes receive the cache + * image block from process 0. * * * 3) Close the file. * - * 4) Open the file, and verify that it doesn't contain + * 4) Open the file, and verify that it doesn't contain * a cache image. * * 5) Verify that the file contains the expected data. @@ -3375,7 +3374,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3414,14 +3413,14 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) show_progress = ( ( show_progress ) && ( mpi_rank == 0 ) ); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, + if ( h5_fixname(FILENAMES[file_name_id], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -3429,7 +3428,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3439,7 +3438,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3449,7 +3448,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3464,7 +3463,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3472,7 +3471,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ if ( pass ) { @@ -3493,14 +3492,14 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -3514,12 +3513,12 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 3) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3530,7 +3529,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3542,7 +3541,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, + /* config_fsm */ FALSE, /* enable_page_buffer */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, @@ -3557,12 +3556,12 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* md_write_strat */ md_write_strat); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 5) Verify that the file contains the expected data. */ - + if ( pass ) { verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); @@ -3581,7 +3580,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) /* 6) Close the file. */ - + if ( pass ) { if ( H5Fclose(file_id) < 0 ) { @@ -3592,7 +3591,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3622,7 +3621,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) H5_FAILED(); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg); } } @@ -3632,20 +3631,20 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) } /* verify_cache_imageRW() */ - + /***************************************************************************** * * Function: smoke_check_1() * - * Purpose: Initial smoke check to verify correct behaviour of cache + * Purpose: Initial smoke check to verify correct behaviour of cache * image in combination with parallel. - * + * * As cache image is currently disabled in the parallel case, * we construct a test file in parallel, verify it in serial * and generate a cache image in passing, and then verify * it again in parallel. * - * In passing, also verify that page buffering is silently + * In passing, also verify that page buffering is silently * disabled in the parallel case. Needless to say, this part * of the test will have to be re-worked when and if page * buffering is supported in parallel. @@ -3700,7 +3699,7 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a PHDF5 file without the cache image FAPL entry. + /* 1) Create a PHDF5 file without the cache image FAPL entry. * * Verify that a cache image is not requested */ @@ -3807,11 +3806,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 7) Verify the datasets in the file backwards + /* 7) Verify the datasets in the file backwards * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3841,11 +3840,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) if ( ( mpi_rank == 0 ) && ( show_progress ) ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -3906,11 +3905,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 10) Verify the datasets in the file + /* 10) Verify the datasets in the file * * Verify that only process 0 reads the cache image. * - * Verify that all other processes receive the cache + * Verify that all other processes receive the cache * image block from process 0. */ @@ -3940,11 +3939,11 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) if ( ( mpi_rank == 0 ) && ( show_progress ) ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block + /* Verify that all other processes receive the cache image block * from process 0. - * - * Since we have alread verified that only process 0 has read the - * image, it is sufficient to verify that the image was loaded on + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on * all processes. */ #if H5C_COLLECT_CACHE_STATS @@ -4047,28 +4046,28 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) H5_FAILED(); - HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", + HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", fcn_name, failure_mssg); } } return !pass; - + } /* smoke_check_1() */ - + /*------------------------------------------------------------------------- * Function: main * * Purpose: Run parallel tests on the cache image feature. - * - * At present, cache image is disabled in parallel, and - * thus these tests are restructed to verifying that a + * + * At present, cache image is disabled in parallel, and + * thus these tests are restructed to verifying that a * file with a cache image can be opened in the parallel - * case, and verifying that instructions to create a + * case, and verifying that instructions to create a * cache image are ignored in the parallel case. * - * WARNING: This test uses fork() and execve(), and + * WARNING: This test uses fork() and execve(), and * therefore will not run on Windows. * * Return: Success: 0 @@ -4106,14 +4105,14 @@ main(int argc, char **argv) HDfflush(stdout); i = 0; - while ( ( FILENAMES[i] != NULL ) && ( i < TEST_FILES_TO_CONSTRUCT ) ) { + while ( ( FILENAMES[i] != NULL ) && ( i < TEST_FILES_TO_CONSTRUCT ) ) { HDfprintf(stdout, " writing %s ... ", FILENAMES[i]); HDfflush(stdout); construct_test_file(i); if ( pass ) { - + printf("done.\n"); HDfflush(stdout); @@ -4194,13 +4193,13 @@ main(int argc, char **argv) /* we may need to play with the path here */ if ( execv("t_cache_image", child_argv) == -1 ) { - HDfprintf(stdout, + HDfprintf(stdout, "execl() of setup process failed. errno = %d(%s)\n", errno, strerror(errno)); exit(1); } - } else if ( child_pid != -1 ) { + } else if ( child_pid != -1 ) { /* this is the parent process -- wait until child is done */ if ( -1 == waitpid(child_pid, &child_status, WUNTRACED)) { @@ -4216,7 +4215,7 @@ main(int argc, char **argv) } else { - HDfprintf(stdout, + HDfprintf(stdout, "testfile construction complete -- proceeding with tests.\n"); } } else { /* fork failed */ @@ -4229,14 +4228,14 @@ main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); - nerrs += verify_cache_image_RO(0, + nerrs += verify_cache_image_RO(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); #if 1 - nerrs += verify_cache_image_RO(1, + nerrs += verify_cache_image_RO(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); - nerrs += verify_cache_image_RW(0, + nerrs += verify_cache_image_RW(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); - nerrs += verify_cache_image_RW(1, + nerrs += verify_cache_image_RW(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); nerrs += smoke_check_1(comm, info, mpi_rank, mpi_size); #endif diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index 0782f3d..4677bfe 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -15,13 +15,12 @@ * Programmer: Leon Arber * Sept. 28, 2006. * - * Purpose: This is the first half of a two-part test that makes sure - * that a file can be read after a parallel application crashes as long - * as the file was flushed first. We simulate a crash by - * calling _exit(0) since this doesn't flush HDF5 caches but - * still exits with success. + * Purpose: This is the first half of a two-part test that makes sure + * that a file can be read after a parallel application crashes as long + * as the file was flushed first. We simulate a crash by + * calling _exit(0) since this doesn't flush HDF5 caches but + * still exits with success. */ -#include #include "h5test.h" const char *FILENAME[] = { @@ -30,18 +29,18 @@ const char *FILENAME[] = { NULL }; -static double the_data[100][100]; +static double the_data[100][100]; /*------------------------------------------------------------------------- - * Function: create_file + * Function: create_file * - * Purpose: Creates file used in part 1 of the test + * Purpose: Creates file used in part 1 of the test * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Leon Arber + * Programmer: Leon Arber * Sept. 26, 2006 * * Modifications: @@ -51,10 +50,10 @@ static double the_data[100][100]; static hid_t create_file(char* name, hid_t fapl) { - hid_t file, dcpl, space, dset, groups, grp, plist; - hsize_t ds_size[2] = {100, 100}; - hsize_t ch_size[2] = {5, 5}; - hsize_t i, j; + hid_t file, dcpl, space, dset, groups, grp, plist; + hsize_t ds_size[2] = {100, 100}; + hsize_t ch_size[2] = {5, 5}; + hsize_t i, j; @@ -65,7 +64,7 @@ create_file(char* name, hid_t fapl) if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error; if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error; if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + goto error; plist = H5Pcreate(H5P_DATASET_XFER); H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE); @@ -73,22 +72,22 @@ create_file(char* name, hid_t fapl) /* Write some data */ for(i = 0; i < ds_size[0]; i++) { - /* - * The extra cast in the following statement is a bug workaround - * for the Win32 version 5.0 compiler. - * 1998-11-06 ptl - */ - for(j = 0; j < ds_size[1]; j++) - the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1); + /* + * The extra cast in the following statement is a bug workaround + * for the Win32 version 5.0 compiler. + * 1998-11-06 ptl + */ + for(j = 0; j < ds_size[1]; j++) + the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1); } if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, plist, the_data) < 0) goto error; /* Create some groups */ if((groups = H5Gcreate2(file, "some_groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; for(i = 0; i < 100; i++) { - sprintf(name, "grp%02u", (unsigned)i); - if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if(H5Gclose(grp) < 0) goto error; + sprintf(name, "grp%02u", (unsigned)i); + if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(grp) < 0) goto error; } return file; @@ -98,20 +97,20 @@ error: } /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Part 1 of a two-part H5Fflush() test. + * Purpose: Part 1 of a two-part H5Fflush() test. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Modifications: - * Leon Arber - * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called. + * Leon Arber + * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called. * * *------------------------------------------------------------------------- @@ -120,8 +119,8 @@ int main(int argc, char* argv[]) { hid_t file1, file2, fapl; - MPI_File *mpifh_p = NULL; - char name[1024]; + MPI_File *mpifh_p = NULL; + char name[1024]; const char *envval = NULL; int mpi_size, mpi_rank; MPI_Comm comm = MPI_COMM_WORLD; @@ -135,26 +134,26 @@ main(int argc, char* argv[]) H5Pset_fapl_mpio(fapl, comm, info); if(mpi_rank == 0) - TESTING("H5Fflush (part1)"); + TESTING("H5Fflush (part1)"); envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) envval = "nomatch"; if(HDstrcmp(envval, "split")) { - /* Create the file */ - h5_fixname(FILENAME[0], fapl, name, sizeof name); - file1 = create_file(name, fapl); - /* Flush and exit without closing the library */ - if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; + /* Create the file */ + h5_fixname(FILENAME[0], fapl, name, sizeof name); + file1 = create_file(name, fapl); + /* Flush and exit without closing the library */ + if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; - /* Create the other file which will not be flushed */ - h5_fixname(FILENAME[1], fapl, name, sizeof name); - file2 = create_file(name, fapl); + /* Create the other file which will not be flushed */ + h5_fixname(FILENAME[1], fapl, name, sizeof name); + file2 = create_file(name, fapl); - if(mpi_rank == 0) - PASSED(); - fflush(stdout); - fflush(stderr); + if(mpi_rank == 0) + PASSED(); + fflush(stdout); + fflush(stderr); } /* end if */ else { SKIPPED(); @@ -171,21 +170,21 @@ main(int argc, char* argv[]) /* close file1 */ if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) { - printf("H5Fget_vfd_handle for file1 failed\n"); - goto error; + printf("H5Fget_vfd_handle for file1 failed\n"); + goto error; } /* end if */ if(MPI_File_close(mpifh_p) != MPI_SUCCESS) { - printf("MPI_File_close for file1 failed\n"); - goto error; + printf("MPI_File_close for file1 failed\n"); + goto error; } /* end if */ /* close file2 */ if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0) { - printf("H5Fget_vfd_handle for file2 failed\n"); - goto error; + printf("H5Fget_vfd_handle for file2 failed\n"); + goto error; } /* end if */ if(MPI_File_close(mpifh_p) != MPI_SUCCESS) { - printf("MPI_File_close for file2 failed\n"); - goto error; + printf("MPI_File_close for file2 failed\n"); + goto error; } /* end if */ fflush(stdout); diff --git a/testpar/t_pread.c b/testpar/t_pread.c index a527503..aac5bee 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -16,7 +16,6 @@ * */ -#include "h5test.h" #include "testpar.h" /* The collection of files is included below to aid @@ -42,7 +41,7 @@ const char *FILENAMES[NFILENAME + 1]={"t_pread_data_file", #define COUNT 1000 hbool_t pass = true; -static const char *random_hdf5_text = +static const char *random_hdf5_text = "Now is the time for all first-time-users of HDF5 to read their \ manual or go thru the tutorials!\n\ While you\'re at it, now is also the time to read up on MPI-IO."; @@ -58,7 +57,7 @@ static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group); static char *test_argv0 = NULL; extern char *dirname(char *path); /* Avoids additional includes */ - + /*------------------------------------------------------------------------- * Function: generate_test_file * @@ -79,7 +78,7 @@ extern char *dirname(char *path); /* Avoids additional includes */ * In the overall scheme of running the test, we'll call * this function twice: first as a collection of all MPI * processes and then a second time with the processes split - * more or less in half. Each sub group will operate + * more or less in half. Each sub group will operate * collectively on their assigned file. This split into * subgroups validates that parallel groups can successfully * open and read data independantly from the other parallel @@ -93,7 +92,7 @@ extern char *dirname(char *path); /* Avoids additional includes */ * 10/1/17 * * Modifications: - * + * *------------------------------------------------------------------------- */ static int @@ -110,14 +109,14 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) int group_size; int group_rank; int local_failure = 0; - int global_failures = 0; + int global_failures = 0; hsize_t count = COUNT; hsize_t i; hsize_t offset; hsize_t dims[1] = {0}; hid_t file_id = -1; - hid_t memspace = -1; - hid_t filespace = -1; + hid_t memspace = -1; + hid_t filespace = -1; hid_t fapl_id = -1; hid_t dxpl_id = -1; hid_t dset_id = -1; @@ -153,7 +152,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( pass ) { if ( comm == MPI_COMM_WORLD ) { /* Test 1 */ file_index = 0; - } + } else if ( group_id == 0 ) { /* Test 2 group 0 */ file_index = 3; } @@ -161,8 +160,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) file_index = 6; } - /* The 'group_filename' is just a temp variable and - * is used to call into the h5_fixname function. No + /* The 'group_filename' is just a temp variable and + * is used to call into the h5_fixname function. No * need to worry that we reassign it for each file! */ group_filename = FILENAMES[file_index]; @@ -234,9 +233,9 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } - /* create the data file */ + /* create the data file */ if ( pass ) { - if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC, + if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0 ) { pass = FALSE; failure_mssg = "H5Fcreate() failed.\n"; @@ -276,7 +275,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( pass ) { offset = (hsize_t)group_rank * (hsize_t)COUNT; - if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, + if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, NULL, &count, NULL)) < 0 ) { pass = FALSE; failure_mssg = "H5Sselect_hyperslab() failed.\n"; @@ -284,8 +283,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - if ( (dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT, - filespace, H5P_DEFAULT, H5P_DEFAULT, + if ( (dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT, + filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) { pass = false; failure_mssg = "H5Dcreate2() failed.\n"; @@ -293,7 +292,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - if ( (H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace, + if ( (H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace, filespace, dxpl_id, data_slice)) < 0 ) { pass = false; failure_mssg = "H5Dwrite() failed.\n"; @@ -344,15 +343,15 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* Add a userblock to the head of the datafile. - * We will use this to for a functional test of the + * We will use this to for a functional test of the * file open optimization. This is superblock * relocation is done by the rank 0 process associated * with the communicator being used. For test 1, we * utilize MPI_COMM_WORLD, so group_rank 0 is the * same as mpi_rank 0. For test 2 which utilizes * two groups resulting from an MPI_Comm_split, we - * will have parallel groups and hence two - * group_rank(0) processes. Each parallel group + * will have parallel groups and hence two + * group_rank(0) processes. Each parallel group * will create a unique file with different text * headers and different data. * @@ -361,7 +360,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( group_rank == 0 ) { const char *text_to_write; - size_t bytes_to_write; + size_t bytes_to_write; if (group_id == 0) text_to_write = random_hdf5_text; @@ -406,7 +405,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * if h5jam is co-located here. Otherwise, the autotools * put things into directories, hence the relative path. */ - if (test_argv0 != NULL) { + if (test_argv0 != NULL) { HDstrncpy(exe_path, test_argv0, sizeof(exe_path)); if ( (exe_dirname = (char *)dirname(exe_path)) != NULL) { HDsprintf(cmd, "%s/h5jam", exe_dirname); @@ -430,13 +429,13 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* collect results from other processes. - * Only overwrite the failure message if no preveious error + * Only overwrite the failure message if no preveious error * has been detected */ local_failure = ( pass ? 0 : 1 ); /* This is a global all reduce (NOT group specific) */ - if ( MPI_Allreduce(&local_failure, &global_failures, 1, + if ( MPI_Allreduce(&local_failure, &global_failures, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) { if ( pass ) { pass = FALSE; @@ -468,7 +467,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* generate_test_file() */ - + /*------------------------------------------------------------------------- * Function: test_parallel_read * @@ -511,7 +510,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) const char *group_filename = NULL; char reloc_data_filename[FILENAME_BUF_SIZE]; int local_failure = 0; - int global_failures = 0; + int global_failures = 0; int group_size; int group_rank; hid_t fapl_id = -1; @@ -597,7 +596,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) /* open the file -- should have user block, exercising the optimization */ if ( pass ) { - if ( (file_id = H5Fopen(reloc_data_filename, + if ( (file_id = H5Fopen(reloc_data_filename, H5F_ACC_RDONLY, fapl_id)) < 0 ) { pass = FALSE; failure_mssg = "H5Fopen() failed\n"; @@ -631,7 +630,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) if ( pass ) { offset = (hsize_t)group_rank * count; - if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, + if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, NULL, &count, NULL)) < 0 ) { pass = FALSE; failure_mssg = "H5Sselect_hyperslab() failed\n"; @@ -640,14 +639,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) /* read this processes section of the data */ if ( pass ) { - if ( (H5Dread(dset_id, H5T_NATIVE_FLOAT, memspace, + if ( (H5Dread(dset_id, H5T_NATIVE_FLOAT, memspace, filespace, H5P_DEFAULT, data_slice)) < 0 ) { pass = FALSE; failure_mssg = "H5Dread() failed\n"; } } - - /* verify the data */ + + /* verify the data */ if ( pass ) { nextValue = (float)((hsize_t)mpi_rank * count); i = 0; @@ -708,7 +707,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) */ local_failure = ( pass ? 0 : 1 ); - if ( MPI_Allreduce( &local_failure, &global_failures, 1, + if ( MPI_Allreduce( &local_failure, &global_failures, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) { if ( pass ) { pass = FALSE; @@ -739,11 +738,11 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) } - return( ! pass ); + return( ! pass ); } /* test_parallel_read() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -830,7 +829,7 @@ main( int argc, char **argv) /* ------ Create two (2) MPI groups ------ * - * We split MPI_COMM_WORLD into 2 more or less equal sized + * We split MPI_COMM_WORLD into 2 more or less equal sized * groups. The resulting communicators will be used to generate * two HDF files which in turn will be opened in parallel and the * contents verified in the second read test below. @@ -858,7 +857,7 @@ main( int argc, char **argv) } goto finish; } - + /* We generate the file used for test 2 */ nerrs += generate_test_file( group_comm, mpi_rank, which_group ); @@ -917,7 +916,7 @@ finish: HDfprintf(stdout, "===================================\n"); if ( nerrs > 0 ) { - + HDfprintf(stdout, "***%s detected %d failures***\n", header, nerrs); } else { diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 1052a69..e695bfc 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -12,7 +12,7 @@ /* This program will test independant and collective reads and writes between - selections of different rank that non-the-less are deemed as having the + selections of different rank that non-the-less are deemed as having the same shape by H5Sselect_shape_same(). */ @@ -22,8 +22,6 @@ #define H5S_TESTING -#include "hdf5.h" -#include "H5private.h" #include "testphdf5.h" #include "H5Spkg.h" /* Dataspaces */ @@ -31,24 +29,24 @@ /* On Lustre (and perhaps other parallel file systems?), we have severe * slow downs if two or more processes attempt to access the same file system * block. To minimize this problem, we set alignment in the shape same tests - * to the default Lustre block size -- which greatly reduces contention in + * to the default Lustre block size -- which greatly reduces contention in * the chunked dataset case. */ -#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024)) +#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024)) -#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */ +#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */ struct hs_dr_pio_test_vars_t { - int mpi_size; + int mpi_size; int mpi_rank; MPI_Comm mpi_comm; - MPI_Info mpi_info; + MPI_Info mpi_info; int test_num; int edge_size; - int checker_edge_size; + int checker_edge_size; int chunk_edge_size; int small_rank; int large_rank; @@ -64,13 +62,13 @@ struct hs_dr_pio_test_vars_t int small_ds_offset; int large_ds_offset; hid_t fid; /* HDF5 file ID */ - hid_t xfer_plist; + hid_t xfer_plist; hid_t full_mem_small_ds_sid; hid_t full_file_small_ds_sid; hid_t mem_small_ds_sid; hid_t file_small_ds_sid_0; hid_t file_small_ds_sid_1; - hid_t small_ds_slice_sid; + hid_t small_ds_slice_sid; hid_t full_mem_large_ds_sid; hid_t full_file_large_ds_sid; hid_t mem_large_ds_sid; @@ -78,7 +76,7 @@ struct hs_dr_pio_test_vars_t hid_t file_large_ds_sid_1; hid_t file_large_ds_process_slice_sid; hid_t mem_large_ds_process_slice_sid; - hid_t large_ds_slice_sid; + hid_t large_ds_slice_sid; hid_t small_dataset; /* Dataset ID */ hid_t large_dataset; /* Dataset ID */ size_t small_ds_size; @@ -96,25 +94,25 @@ struct hs_dr_pio_test_vars_t hsize_t * count_ptr; hsize_t * block_ptr; int skips; - int max_skips; - int64_t total_tests; - int64_t tests_run; - int64_t tests_skipped; + int max_skips; + int64_t total_tests; + int64_t tests_run; + int64_t tests_skipped; }; /*------------------------------------------------------------------------- - * Function: hs_dr_pio_test__setup() + * Function: hs_dr_pio_test__setup() * - * Purpose: Do setup for tests of I/O to/from hyperslab selections of - * different rank in the parallel case. + * Purpose: Do setup for tests of I/O to/from hyperslab selections of + * different rank in the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/9/11 + * Programmer: JRM -- 8/9/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -133,21 +131,21 @@ hs_dr_pio_test__setup(const int test_num, const int express_test, struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG +#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG const char *fcnName = "hs_dr_pio_test__setup()"; #endif /* CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG */ const char *filename; - hbool_t mis_match = FALSE; - int i; + hbool_t mis_match = FALSE; + int i; int mrc; - int mpi_rank; /* needed by the VRFY macro */ - uint32_t expected_value; + int mpi_rank; /* needed by the VRFY macro */ + uint32_t expected_value; uint32_t * ptr_0; uint32_t * ptr_1; - hid_t acc_tpl; /* File access templates */ + hid_t acc_tpl; /* File access templates */ hid_t small_ds_dcpl_id = H5P_DEFAULT; hid_t large_ds_dcpl_id = H5P_DEFAULT; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ HDassert( edge_size >= 6 ); HDassert( edge_size >= chunk_edge_size ); @@ -219,7 +217,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded"); - tv_ptr->small_ds_slice_buf = + tv_ptr->small_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size); VRFY((tv_ptr->small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded"); @@ -232,7 +230,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded"); - tv_ptr->large_ds_slice_buf = + tv_ptr->large_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size); VRFY((tv_ptr->large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded"); @@ -256,21 +254,21 @@ hs_dr_pio_test__setup(const int test_num, filename = (const char *)GetTestParameters(); HDassert( filename != NULL ); -#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG +#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "%d: test num = %d.\n", tv_ptr->mpi_rank, tv_ptr->test_num); HDfprintf(stdout, "%d: mpi_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->mpi_size); - HDfprintf(stdout, + HDfprintf(stdout, "%d: small/large rank = %d/%d, use_collective_io = %d.\n", - tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank, + tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank, (int)use_collective_io); HDfprintf(stdout, "%d: edge_size = %d, chunk_edge_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->edge_size, tv_ptr->chunk_edge_size); HDfprintf(stdout, "%d: checker_edge_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->checker_edge_size); HDfprintf(stdout, "%d: small_ds_size = %d, large_ds_size = %d.\n", - tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size), + tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size), (int)(tv_ptr->large_ds_size)); HDfprintf(stdout, "%d: filename = %s.\n", tv_ptr->mpi_rank, filename); } @@ -305,78 +303,78 @@ hs_dr_pio_test__setup(const int test_num, /* setup dims: */ tv_ptr->dims[0] = (hsize_t)(tv_ptr->mpi_size + 1); - tv_ptr->dims[1] = tv_ptr->dims[2] = + tv_ptr->dims[1] = tv_ptr->dims[2] = tv_ptr->dims[3] = tv_ptr->dims[4] = (hsize_t)(tv_ptr->edge_size); /* Create small ds dataspaces */ - tv_ptr->full_mem_small_ds_sid = + tv_ptr->full_mem_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_mem_small_ds_sid != 0), + VRFY((tv_ptr->full_mem_small_ds_sid != 0), "H5Screate_simple() full_mem_small_ds_sid succeeded"); - tv_ptr->full_file_small_ds_sid = + tv_ptr->full_file_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_file_small_ds_sid != 0), + VRFY((tv_ptr->full_file_small_ds_sid != 0), "H5Screate_simple() full_file_small_ds_sid succeeded"); tv_ptr->mem_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->mem_small_ds_sid != 0), + VRFY((tv_ptr->mem_small_ds_sid != 0), "H5Screate_simple() mem_small_ds_sid succeeded"); tv_ptr->file_small_ds_sid_0 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_small_ds_sid_0 != 0), + VRFY((tv_ptr->file_small_ds_sid_0 != 0), "H5Screate_simple() file_small_ds_sid_0 succeeded"); /* used by checker board tests only */ tv_ptr->file_small_ds_sid_1 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_small_ds_sid_1 != 0), + VRFY((tv_ptr->file_small_ds_sid_1 != 0), "H5Screate_simple() file_small_ds_sid_1 succeeded"); - tv_ptr->small_ds_slice_sid = + tv_ptr->small_ds_slice_sid = H5Screate_simple(tv_ptr->small_rank - 1, &(tv_ptr->dims[1]), NULL); - VRFY((tv_ptr->small_ds_slice_sid != 0), + VRFY((tv_ptr->small_ds_slice_sid != 0), "H5Screate_simple() small_ds_slice_sid succeeded"); /* Create large ds dataspaces */ - tv_ptr->full_mem_large_ds_sid = + tv_ptr->full_mem_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_mem_large_ds_sid != 0), + VRFY((tv_ptr->full_mem_large_ds_sid != 0), "H5Screate_simple() full_mem_large_ds_sid succeeded"); - tv_ptr->full_file_large_ds_sid = + tv_ptr->full_file_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->full_file_large_ds_sid != FAIL), + VRFY((tv_ptr->full_file_large_ds_sid != FAIL), "H5Screate_simple() full_file_large_ds_sid succeeded"); tv_ptr->mem_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->mem_large_ds_sid != FAIL), + VRFY((tv_ptr->mem_large_ds_sid != FAIL), "H5Screate_simple() mem_large_ds_sid succeeded"); tv_ptr->file_large_ds_sid_0 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_large_ds_sid_0 != FAIL), + VRFY((tv_ptr->file_large_ds_sid_0 != FAIL), "H5Screate_simple() file_large_ds_sid_0 succeeded"); /* used by checker board tests only */ tv_ptr->file_large_ds_sid_1 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_large_ds_sid_1 != FAIL), + VRFY((tv_ptr->file_large_ds_sid_1 != FAIL), "H5Screate_simple() file_large_ds_sid_1 succeeded"); - tv_ptr->mem_large_ds_process_slice_sid = + tv_ptr->mem_large_ds_process_slice_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL), + VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL), "H5Screate_simple() mem_large_ds_process_slice_sid succeeded"); - tv_ptr->file_large_ds_process_slice_sid = + tv_ptr->file_large_ds_process_slice_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); - VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL), + VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL), "H5Screate_simple() file_large_ds_process_slice_sid succeeded"); - tv_ptr->large_ds_slice_sid = + tv_ptr->large_ds_slice_sid = H5Screate_simple(tv_ptr->large_rank - 1, &(tv_ptr->dims[1]), NULL); - VRFY((tv_ptr->large_ds_slice_sid != 0), + VRFY((tv_ptr->large_ds_slice_sid != 0), "H5Screate_simple() large_ds_slice_sid succeeded"); @@ -386,18 +384,18 @@ hs_dr_pio_test__setup(const int test_num, */ if ( tv_ptr->chunk_edge_size > 0 ) { - /* Under Lustre (and perhaps other parallel file systems?) we get - * locking delays when two or more processes attempt to access the + /* Under Lustre (and perhaps other parallel file systems?) we get + * locking delays when two or more processes attempt to access the * same file system block. * - * To minimize this problem, I have changed chunk_dims[0] + * To minimize this problem, I have changed chunk_dims[0] * from (mpi_size + 1) to just when any sort of express test is - * selected. Given the structure of the test, and assuming we - * set the alignment large enough, this avoids the contention - * issue by seeing to it that each chunk is only accessed by one + * selected. Given the structure of the test, and assuming we + * set the alignment large enough, this avoids the contention + * issue by seeing to it that each chunk is only accessed by one * process. * - * One can argue as to whether this is a good thing to do in our + * One can argue as to whether this is a good thing to do in our * tests, but for now it is necessary if we want the test to complete * in a reasonable amount of time. * @@ -411,8 +409,8 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->chunk_dims[0] = 1; } - tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = - tv_ptr->chunk_dims[3] = + tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = + tv_ptr->chunk_dims[3] = tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size); small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); @@ -511,7 +509,7 @@ hs_dr_pio_test__setup(const int test_num, /* write the initial value of the small data set to file */ - ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid, + ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid, tv_ptr->file_small_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0); VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded"); @@ -524,8 +522,8 @@ hs_dr_pio_test__setup(const int test_num, VRFY((mrc==MPI_SUCCESS), "Sync after small dataset writes"); } - /* read the small data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the small data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set and verifies it. */ ret = H5Dread(tv_ptr->small_dataset, @@ -574,7 +572,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->count, tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded"); - + /* In passing, setup the process slice data spaces as well */ ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_process_slice_sid, @@ -583,7 +581,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->stride, tv_ptr->count, tv_ptr->block); - VRFY((ret >= 0), + VRFY((ret >= 0), "H5Sselect_hyperslab(mem_large_ds_process_slice_sid, set) suceeded"); ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_process_slice_sid, @@ -592,7 +590,7 @@ hs_dr_pio_test__setup(const int test_num, tv_ptr->stride, tv_ptr->count, tv_ptr->block); - VRFY((ret >= 0), + VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_process_slice_sid, set) suceeded"); if ( MAINPROCESS ) { /* add an additional slice to the selections */ @@ -618,8 +616,8 @@ hs_dr_pio_test__setup(const int test_num, /* write the initial value of the large data set to file */ - ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type, - tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0, + ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type, + tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->large_ds_buf_0); if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr); VRFY((ret >= 0), "H5Dwrite() large_dataset initial write succeeded"); @@ -633,8 +631,8 @@ hs_dr_pio_test__setup(const int test_num, } - /* read the large data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the large data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set. */ ret = H5Dread(tv_ptr->large_dataset, @@ -678,18 +676,18 @@ hs_dr_pio_test__setup(const int test_num, /*------------------------------------------------------------------------- - * Function: hs_dr_pio_test__takedown() + * Function: hs_dr_pio_test__takedown() * - * Purpose: Do takedown after tests of I/O to/from hyperslab selections - * of different rank in the parallel case. + * Purpose: Do takedown after tests of I/O to/from hyperslab selections + * of different rank in the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -699,11 +697,11 @@ hs_dr_pio_test__setup(const int test_num, static void hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr) { -#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG +#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG const char *fcnName = "hs_dr_pio_test__takedown()"; #endif /* HS_DR_PIO_TEST__TAKEDOWN__DEBUG */ - int mpi_rank; /* needed by the VRFY macro */ - herr_t ret; /* Generic return value */ + int mpi_rank; /* needed by the VRFY macro */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -787,27 +785,27 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__d2m_l2s() + * Function: contig_hs_dr_pio_test__d2m_l2s() * - * Purpose: Part one of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part one of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * In this function, we test this by reading small_rank - 1 - * slices from the on disk large cube, and verifying that the - * data read is correct. Verify that H5S_select_shape_same() - * returns true on the memory and file selections. + * In this function, we test this by reading small_rank - 1 + * slices from the on disk large cube, and verifying that the + * data read is correct. Verify that H5S_select_shape_same() + * returns true on the memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/10/11 + * Programmer: JRM -- 9/10/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -817,24 +815,24 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG const char *fcnName = "contig_hs_dr_pio_test__run_test()"; #endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ - uint32_t expected_value; + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* We have already done a H5Sselect_all() on the data space - * small_ds_slice_sid in the initialization phase, so no need to + /* We have already done a H5Sselect_all() on the data space + * small_ds_slice_sid in the initialization phase, so no need to * call H5Sselect_all() again. */ @@ -859,16 +857,16 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* zero out the buffer we will be reading into */ HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size); -#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s reading slices from big cube on disk into small cube slice.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set. However, in the parallel version, each + * of the large data set. However, in the parallel version, each * process only works with that slice of the large cube indicated - * by its rank -- hence we set the most slowly changing index to + * by its rank -- hence we set the most slowly changing index to * mpi_rank, and don't itterate over it. */ @@ -881,9 +879,9 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -907,7 +905,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -921,14 +919,14 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) do { if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ - (tv_ptr->tests_skipped)++; + (tv_ptr->tests_skipped)++; } else { /* run the test */ tv_ptr->skips = 0; /* reset the skips counter */ - /* we know that small_rank - 1 >= 1 and that - * large_rank > small_rank by the assertions at the head + /* we know that small_rank - 1 >= 1 and that + * large_rank > small_rank by the assertions at the head * of this function. Thus no need for another inner loop. */ tv_ptr->start[0] = (hsize_t)i; @@ -943,7 +941,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Sselect_hyperslab(file_large_cube_sid) succeeded"); @@ -956,11 +954,11 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", fcnName, @@ -981,7 +979,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) mis_match = FALSE; ptr_1 = tv_ptr->small_ds_slice_buf; expected_value = (uint32_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -1000,10 +998,10 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) expected_value++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small slice read from large ds data good."); - (tv_ptr->tests_run)++; + (tv_ptr->tests_run)++; } l++; @@ -1028,27 +1026,27 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__d2m_s2l() + * Function: contig_hs_dr_pio_test__d2m_s2l() * - * Purpose: Part two of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part two of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * In this function, we test this by reading slices of the - * on disk small data set into slices through the in memory - * large data set, and verify that the correct data (and - * only the correct data) is read. + * In this function, we test this by reading slices of the + * on disk small data set into slices through the in memory + * large data set, and verify that the correct data (and + * only the correct data) is read. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/10/11 + * Programmer: JRM -- 8/10/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -1058,25 +1056,25 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG const char *fcnName = "contig_hs_dr_pio_test__d2m_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* Read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* Read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ @@ -1102,8 +1100,8 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded"); -#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s reading slices of on disk small data set into slices of big data set.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ @@ -1131,11 +1129,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -1149,9 +1147,9 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -1175,7 +1173,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -1211,7 +1209,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Sselect_hyperslab(mem_large_ds_sid) succeeded"); @@ -1224,11 +1222,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1250,7 +1248,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) expected_value = (uint32_t) ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -1283,7 +1281,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small slice read from large ds data good."); (tv_ptr->tests_run)++; @@ -1311,29 +1309,29 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__m2d_l2s() + * Function: contig_hs_dr_pio_test__m2d_l2s() * - * Purpose: Part three of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part three of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can write from memory to file using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * Do this by writing small_rank - 1 dimensional slices from - * the in memory large data set to the on disk small cube - * dataset. After each write, read the slice of the small - * dataset back from disk, and verify that it contains - * the expected data. Verify that H5S_select_shape_same() - * returns true on the memory and file selections. + * Do this by writing small_rank - 1 dimensional slices from + * the in memory large data set to the on disk small cube + * dataset. After each write, read the slice of the small + * dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() + * returns true on the memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/10/11 + * Programmer: JRM -- 8/10/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -1343,19 +1341,19 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG const char *fcnName = "contig_hs_dr_pio_test__m2d_l2s()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -1365,10 +1363,10 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * from memory to file using selections of different rank that * H5S_select_shape_same() views as being of the same shape. * - * Start by writing small_rank - 1 dimensional slices from the in memory large - * data set to the on disk small cube dataset. After each write, read the - * slice of the small dataset back from disk, and verify that it contains - * the expected data. Verify that H5S_select_shape_same() returns true on + * Start by writing small_rank - 1 dimensional slices from the in memory large + * data set to the on disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ @@ -1424,18 +1422,18 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); -#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s writing slices from big ds to slices of small ds on disk.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -1449,9 +1447,9 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -1476,7 +1474,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -1525,7 +1523,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret >= 0), + VRFY((ret >= 0), "H5Sselect_hyperslab() mem_large_ds_sid succeeded."); @@ -1538,13 +1536,13 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((check == TRUE), "H5S_select_shape_same_test passed."); - /* write the slice from the in memory large data set to the + /* write the slice from the in memory large data set to the * slice of the on disk small dataset. */ -#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1576,7 +1574,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1 = tv_ptr->small_ds_buf_1; expected_value = (uint32_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -1611,7 +1609,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small slice write from large ds data good."); (tv_ptr->tests_run)++; @@ -1639,31 +1637,31 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__m2d_s2l() + * Function: contig_hs_dr_pio_test__m2d_s2l() * - * Purpose: Part four of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part four of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can write from memory to file using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * Do this by writing the contents of the process's slice of - * the in memory small data set to slices of the on disk - * large data set. After each write, read the process's - * slice of the large data set back into memory, and verify - * that it contains the expected data. + * Do this by writing the contents of the process's slice of + * the in memory small data set to slices of the on disk + * large data set. After each write, read the process's + * slice of the large data set back into memory, and verify + * that it contains the expected data. * - * Verify that H5S_select_shape_same() returns true on the - * memory and file selections. + * Verify that H5S_select_shape_same() returns true on the + * memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/10/11 + * Programmer: JRM -- 8/10/11 * * Modifications: * - * None + * None * *------------------------------------------------------------------------- */ @@ -1673,32 +1671,32 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG const char *fcnName = "contig_hs_dr_pio_test__m2d_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ - hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; - int mpi_rank; /* needed by the VRFY macro */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ - /* select the slice of the in memory small data set associated with + /* select the slice of the in memory small data set associated with * the process's mpi rank. */ tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); @@ -1745,8 +1743,8 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* zero out the in memory large ds */ HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s writing process slices of small ds to slices of large ds on disk.\n", fcnName); #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ @@ -1760,9 +1758,9 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -1786,7 +1784,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -1802,18 +1800,18 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) (tv_ptr->tests_skipped)++; -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG tv_ptr->start[0] = (hsize_t)i; tv_ptr->start[1] = (hsize_t)j; tv_ptr->start[2] = (hsize_t)k; tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDfprintf(stdout, - "%s:%d: skipping test with start = %d %d %d %d %d.\n", + HDfprintf(stdout, + "%s:%d: skipping test with start = %d %d %d %d %d.\n", fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1857,7 +1855,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->stride_ptr, tv_ptr->count_ptr, tv_ptr->block_ptr); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Sselect_hyperslab() target large ds slice succeeded"); @@ -1871,14 +1869,14 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - /* write the small data set slice from memory to the - * target slice of the disk data set + /* write the small data set slice from memory to the + * target slice of the disk data set */ -#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, (int)(tv_ptr->mpi_rank), - (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), - (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), (int)(tv_ptr->start[4])); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -1891,11 +1889,11 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dwrite of small ds slice to large ds succeeded"); - /* read this processes slice on the on disk large + /* read this processes slice on the on disk large * data set into memory. */ @@ -1905,7 +1903,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_process_slice_sid, tv_ptr->xfer_plist, tv_ptr->large_ds_buf_1); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dread() of process slice of large ds succeeded"); @@ -1914,12 +1912,12 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) */ ptr_1 = tv_ptr->large_ds_buf_1; expected_value = (uint32_t) - ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); + ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t) - ((i * tv_ptr->edge_size * tv_ptr->edge_size * + ((i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + - (j * tv_ptr->edge_size * tv_ptr->edge_size * + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); @@ -1951,7 +1949,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((mis_match == FALSE), + VRFY((mis_match == FALSE), "small ds slice write to large ds slice data good."); (tv_ptr->tests_run)++; @@ -1979,29 +1977,29 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test__run_test() + * Function: contig_hs_dr_pio_test__run_test() * - * Purpose: Test I/O to/from hyperslab selections of different rank in - * the parallel. + * Purpose: Test I/O to/from hyperslab selections of different rank in + * the parallel. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * JRM -- 9/16/10 - * Added express_test parameter. Use it to control whether - * we set up the chunks so that no chunk is shared between - * processes, and also whether we set an alignment when we - * create the test file. + * JRM -- 9/16/10 + * Added express_test parameter. Use it to control whether + * we set up the chunks so that no chunk is shared between + * processes, and also whether we set an alignment when we + * create the test file. * - * JRM -- 8/11/11 - * Refactored function heavily & broke it into six functions. - * Added the skips_ptr, max_skips, total_tests_ptr, - * tests_run_ptr, and tests_skiped_ptr parameters to support - * skipping portions of the test according to the express - * test value. + * JRM -- 8/11/11 + * Refactored function heavily & broke it into six functions. + * Added the skips_ptr, max_skips, total_tests_ptr, + * tests_run_ptr, and tests_skiped_ptr parameters to support + * skipping portions of the test according to the express + * test value. * *------------------------------------------------------------------------- */ @@ -2023,13 +2021,13 @@ contig_hs_dr_pio_test__run_test(const int test_num, int64_t * tests_run_ptr, int64_t * tests_skipped_ptr) { -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "contig_hs_dr_pio_test__run_test()"; #endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; - struct hs_dr_pio_test_vars_t test_vars = + int mpi_rank; + struct hs_dr_pio_test_vars_t test_vars = { - /* int mpi_size = */ -1, + /* int mpi_size = */ -1, /* int mpi_rank = */ -1, /* MPI_Comm mpi_comm = */ MPI_COMM_NULL, /* MPI_Inf mpi_info = */ MPI_INFO_NULL, @@ -2045,7 +2043,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, /* uint32_t * small_ds_buf_2 = */ NULL, /* uint32_t * small_ds_slice_buf = */ NULL, /* uint32_t * large_ds_buf_0 = */ NULL, - /* uint32_t * large_ds_buf_1 = */ NULL, + /* uint32_t * large_ds_buf_1 = */ NULL, /* uint32_t * large_ds_buf_2 = */ NULL, /* uint32_t * large_ds_slice_buf = */ NULL, /* int small_ds_offset = */ -1, @@ -2082,8 +2080,8 @@ contig_hs_dr_pio_test__run_test(const int test_num, /* hsize_t * stride_ptr = */ NULL, /* hsize_t * count_ptr = */ NULL, /* hsize_t * block_ptr = */ NULL, - /* int skips = */ 0, - /* int max_skips = */ 0, + /* int skips = */ 0, + /* int max_skips = */ 0, /* int64_t total_tests = */ 0, /* int64_t tests_run = */ 0, /* int64_t tests_skipped = */ 0 @@ -2101,7 +2099,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, tv_ptr->skips = *skips_ptr; tv_ptr->max_skips = max_skips; -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: small rank = %d, large rank = %d.\n", test_num, small_rank, large_rank); @@ -2113,12 +2111,12 @@ contig_hs_dr_pio_test__run_test(const int test_num, * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading small_rank - 1 dimensional slice from the on disk - * large cube, and verifying that the data read is correct. Verify that + * Start by reading small_rank - 1 dimensional slice from the on disk + * large cube, and verifying that the data read is correct. Verify that * H5S_select_shape_same() returns true on the memory and file selections. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_l2s.\n", test_num); } @@ -2126,12 +2124,12 @@ contig_hs_dr_pio_test__run_test(const int test_num, contig_hs_dr_pio_test__d2m_l2s(tv_ptr); - /* Second, read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* Second, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_s2l.\n", test_num); } @@ -2144,13 +2142,13 @@ contig_hs_dr_pio_test__run_test(const int test_num, * H5S_select_shape_same() views as being of the same shape. * * Start by writing small_rank - 1 D slices from the in memory large data - * set to the on disk small cube dataset. After each write, read the - * slice of the small dataset back from disk, and verify that it contains - * the expected data. Verify that H5S_select_shape_same() returns true on + * set to the on disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_l2s.\n", test_num); } @@ -2158,25 +2156,25 @@ contig_hs_dr_pio_test__run_test(const int test_num, contig_hs_dr_pio_test__m2d_l2s(tv_ptr); - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_s2l.\n", test_num); } #endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ contig_hs_dr_pio_test__m2d_s2l(tv_ptr); -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { - HDfprintf(stdout, - "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", + HDfprintf(stdout, + "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped), (long long)(tv_ptr->total_tests)); } @@ -2184,7 +2182,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, hs_dr_pio_test__takedown(tv_ptr); -#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { HDfprintf(stdout, "test %d: Takedown complete.\n", test_num); } @@ -2201,28 +2199,28 @@ contig_hs_dr_pio_test__run_test(const int test_num, /*------------------------------------------------------------------------- - * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) + * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) * - * Purpose: Test I/O to/from hyperslab selections of different rank in - * the parallel case. + * Purpose: Test I/O to/from hyperslab selections of different rank in + * the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * Modified function to take a sample of the run times - * of the different tests, and skip some of them if - * run times are too long. + * Modified function to take a sample of the run times + * of the different tests, and skip some of them if + * run times are too long. * - * We need to do this because Lustre runns very slowly - * if two or more processes are banging on the same - * block of memory. - * JRM -- 9/10/10 + * We need to do this because Lustre runns very slowly + * if two or more processes are banging on the same + * block of memory. + * JRM -- 9/10/10 * Break this one big test into 4 smaller tests according * to {independent,collective}x{contigous,chunked} datasets. - * AKC -- 2010/01/14 + * AKC -- 2010/01/14 * *------------------------------------------------------------------------- */ @@ -2236,23 +2234,23 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) int local_express_test; int mpi_rank = -1; int mpi_size; - int test_num = 0; - int edge_size; - int chunk_edge_size = 0; - int small_rank; - int large_rank; - int mpi_result; - int skips = 0; - int max_skips = 0; - /* The following table list the number of sub-tests skipped between - * each test that is actually executed as a function of the express + int test_num = 0; + int edge_size; + int chunk_edge_size = 0; + int small_rank; + int large_rank; + int mpi_result; + int skips = 0; + int max_skips = 0; + /* The following table list the number of sub-tests skipped between + * each test that is actually executed as a function of the express * test level. Note that any value in excess of 4880 will cause all * sub tests to be skipped. */ int max_skips_tbl[4] = {0, 4, 64, 1024}; - hid_t dset_type = H5T_NATIVE_UINT; - int64_t total_tests = 0; - int64_t tests_run = 0; + hid_t dset_type = H5T_NATIVE_UINT; + int64_t total_tests = 0; + int64_t tests_run = 0; int64_t tests_skipped = 0; HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned)); @@ -2295,7 +2293,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - FALSE, + FALSE, dset_type, express_test, &skips, @@ -2316,7 +2314,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - TRUE, + TRUE, dset_type, express_test, &skips, @@ -2337,7 +2335,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - FALSE, + FALSE, dset_type, express_test, &skips, @@ -2358,7 +2356,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) chunk_edge_size, small_rank, large_rank, - TRUE, + TRUE, dset_type, express_test, &skips, @@ -2377,7 +2375,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) } /* end of switch(sstest_type) */ #if CONTIG_HS_DR_PIO_TEST__DEBUG if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { - HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n", + HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n", tests_run, tests_skipped, total_tests); } #endif /* CONTIG_HS_DR_PIO_TEST__DEBUG */ @@ -2385,7 +2383,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) } if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { - HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", + HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", tests_skipped, total_tests); } @@ -2396,24 +2394,24 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) /**************************************************************** ** -** ckrbrd_hs_dr_pio_test__slct_ckrbrd(): -** Given a data space of tgt_rank, and dimensions: +** ckrbrd_hs_dr_pio_test__slct_ckrbrd(): +** Given a data space of tgt_rank, and dimensions: ** -** (mpi_size + 1), edge_size, ... , edge_size +** (mpi_size + 1), edge_size, ... , edge_size ** -** edge_size, and a checker_edge_size, select a checker -** board selection of a sel_rank (sel_rank < tgt_rank) -** dimensional slice through the data space parallel to the +** edge_size, and a checker_edge_size, select a checker +** board selection of a sel_rank (sel_rank < tgt_rank) +** dimensional slice through the data space parallel to the ** sel_rank fastest changing indicies, with origin (in the -** higher indicies) as indicated by the start array. +** higher indicies) as indicated by the start array. ** -** Note that this function, like all its relatives, is -** hard coded to presume a maximum data space rank of 5. -** While this maximum is declared as a constant, increasing -** it will require extensive coding in addition to changing +** Note that this function, like all its relatives, is +** hard coded to presume a maximum data space rank of 5. +** While this maximum is declared as a constant, increasing +** it will require extensive coding in addition to changing ** the value of the constant. ** -** JRM -- 10/8/09 +** JRM -- 10/8/09 ** ****************************************************************/ @@ -2428,22 +2426,22 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, const int sel_rank, hsize_t sel_start[]) { -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG - const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():"; -#endif - hbool_t first_selection = TRUE; +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG + const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():"; +#endif + hbool_t first_selection = TRUE; int i, j, k, l, m; - int n_cube_offset; - int sel_offset; - const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */ + int n_cube_offset; + int sel_offset; + const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */ /* this changes */ - hsize_t base_count; + hsize_t base_count; hsize_t offset_count; - hsize_t start[PAR_SS_DR_MAX_RANK]; - hsize_t stride[PAR_SS_DR_MAX_RANK]; - hsize_t count[PAR_SS_DR_MAX_RANK]; - hsize_t block[PAR_SS_DR_MAX_RANK]; - herr_t ret; /* Generic return value */ + hsize_t start[PAR_SS_DR_MAX_RANK]; + hsize_t stride[PAR_SS_DR_MAX_RANK]; + hsize_t count[PAR_SS_DR_MAX_RANK]; + hsize_t block[PAR_SS_DR_MAX_RANK]; + herr_t ret; /* Generic return value */ HDassert( edge_size >= 6 ); HDassert( 0 < checker_edge_size ); @@ -2460,14 +2458,14 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, HDassert( n_cube_offset >= 0 ); HDassert( n_cube_offset <= sel_offset ); -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s:%d: edge_size/checker_edge_size = %d/%d\n", fcnName, mpi_rank, edge_size, checker_edge_size); - HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", fcnName, mpi_rank, sel_rank, sel_offset); - HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n", fcnName, mpi_rank, tgt_rank, n_cube_offset); -#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* First, compute the base count (which assumes start == 0 * for the associated offset) and offset_count (which @@ -2497,7 +2495,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, } /* Now set up the stride and block arrays, and portions of the start - * and count arrays that will not be altered during the selection of + * and count arrays that will not be altered during the selection of * the checker board. */ i = 0; @@ -2529,7 +2527,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, i++; } - + i = 0; do { if ( 0 >= sel_offset ) { @@ -2548,7 +2546,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, } j = 0; - do { + do { if ( 1 >= sel_offset ) { if ( j == 0 ) { @@ -2617,62 +2615,62 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, if ( ((i + j + k + l + m) % 2) == 0 ) { -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG - HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n", +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG + HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n", fcnName, mpi_rank, (int)first_selection); HDfprintf(stdout, "%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n", fcnName, mpi_rank, i, j, k, l, m); - HDfprintf(stdout, - "%s:%d: start = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)start[0], (int)start[1], + HDfprintf(stdout, + "%s:%d: start = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)start[0], (int)start[1], (int)start[2], (int)start[3], (int)start[4]); - HDfprintf(stdout, - "%s:%d: stride = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)stride[0], (int)stride[1], + HDfprintf(stdout, + "%s:%d: stride = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)stride[0], (int)stride[1], (int)stride[2], (int)stride[3], (int)stride[4]); - HDfprintf(stdout, - "%s:%d: count = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)count[0], (int)count[1], + HDfprintf(stdout, + "%s:%d: count = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)count[0], (int)count[1], (int)count[2], (int)count[3], (int)count[4]); - HDfprintf(stdout, - "%s:%d: block = %d %d %d %d %d.\n", - fcnName, mpi_rank, (int)block[0], (int)block[1], + HDfprintf(stdout, + "%s:%d: block = %d %d %d %d %d.\n", + fcnName, mpi_rank, (int)block[0], (int)block[1], (int)block[2], (int)block[3], (int)block[4]); - HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n", + HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n", fcnName, mpi_rank, H5Sget_simple_extent_ndims(tgt_sid)); - HDfprintf(stdout, "%s:%d: selection rank = %d.\n", + HDfprintf(stdout, "%s:%d: selection rank = %d.\n", fcnName, mpi_rank, sel_rank); #endif if ( first_selection ) { - first_selection = FALSE; + first_selection = FALSE; ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_SET, - &(start[n_cube_offset]), - &(stride[n_cube_offset]), - &(count[n_cube_offset]), + &(start[n_cube_offset]), + &(stride[n_cube_offset]), + &(count[n_cube_offset]), &(block[n_cube_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded"); } else { ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_OR, - &(start[n_cube_offset]), - &(stride[n_cube_offset]), - &(count[n_cube_offset]), + &(start[n_cube_offset]), + &(stride[n_cube_offset]), + &(count[n_cube_offset]), &(block[n_cube_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded"); } @@ -2704,7 +2702,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, } while ( ( i <= 1 ) && ( 0 >= sel_offset ) ); -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); #endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ @@ -2724,7 +2722,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded"); -#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); HDfprintf(stdout, "%s%d: done.\n", fcnName, mpi_rank); @@ -2737,57 +2735,57 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, /**************************************************************** ** -** ckrbrd_hs_dr_pio_test__verify_data(): +** ckrbrd_hs_dr_pio_test__verify_data(): ** -** Examine the supplied buffer to see if it contains the -** expected data. Return TRUE if it does, and FALSE +** Examine the supplied buffer to see if it contains the +** expected data. Return TRUE if it does, and FALSE ** otherwise. ** -** The supplied buffer is presumed to this process's slice -** of the target data set. Each such slice will be an -** n-cube of rank (rank -1) and the supplied edge_size with -** origin (mpi_rank, 0, ... , 0) in the target data set. +** The supplied buffer is presumed to this process's slice +** of the target data set. Each such slice will be an +** n-cube of rank (rank -1) and the supplied edge_size with +** origin (mpi_rank, 0, ... , 0) in the target data set. ** -** Further, the buffer is presumed to be the result of reading -** or writing a checker board selection of an m (1 <= m < +** Further, the buffer is presumed to be the result of reading +** or writing a checker board selection of an m (1 <= m < ** rank) dimensional slice through this processes slice -** of the target data set. Also, this slice must be parallel -** to the fastest changing indicies. +** of the target data set. Also, this slice must be parallel +** to the fastest changing indicies. ** -** It is further presumed that the buffer was zeroed before -** the read/write, and that the full target data set (i.e. -** the buffer/data set for all processes) was initialized -** with the natural numbers listed in order from the origin -** along the fastest changing axis. +** It is further presumed that the buffer was zeroed before +** the read/write, and that the full target data set (i.e. +** the buffer/data set for all processes) was initialized +** with the natural numbers listed in order from the origin +** along the fastest changing axis. ** ** Thus for a 20x10x10 dataset, the value stored in location -** (x, y, z) (assuming that z is the fastest changing index -** and x the slowest) is assumed to be: +** (x, y, z) (assuming that z is the fastest changing index +** and x the slowest) is assumed to be: ** -** (10 * 10 * x) + (10 * y) + z +** (10 * 10 * x) + (10 * y) + z ** -** Further, supposing that this is process 10, this process's -** slice of the dataset would be a 10 x 10 2-cube with origin -** (10, 0, 0) in the data set, and would be initialize (prior -** to the checkerboard selection) as follows: +** Further, supposing that this is process 10, this process's +** slice of the dataset would be a 10 x 10 2-cube with origin +** (10, 0, 0) in the data set, and would be initialize (prior +** to the checkerboard selection) as follows: ** -** 1000, 1001, 1002, ... 1008, 1009 -** 1010, 1011, 1012, ... 1018, 1019 -** . . . . . -** . . . . . -** . . . . . -** 1090, 1091, 1092, ... 1098, 1099 +** 1000, 1001, 1002, ... 1008, 1009 +** 1010, 1011, 1012, ... 1018, 1019 +** . . . . . +** . . . . . +** . . . . . +** 1090, 1091, 1092, ... 1098, 1099 ** -** In the case of a read from the processors slice of another -** data set of different rank, the values expected will have -** to be adjusted accordingly. This is done via the -** first_expected_val parameter. +** In the case of a read from the processors slice of another +** data set of different rank, the values expected will have +** to be adjusted accordingly. This is done via the +** first_expected_val parameter. ** -** Finally, the function presumes that the first element -** of the buffer resides either at the origin of either -** a selected or an unselected checker. (Translation: -** if partial checkers appear in the buffer, they will -** intersect the edges of the n-cube oposite the origin.) +** Finally, the function presumes that the first element +** of the buffer resides either at the origin of either +** a selected or an unselected checker. (Translation: +** if partial checkers appear in the buffer, they will +** intersect the edges of the n-cube oposite the origin.) ** ****************************************************************/ @@ -2802,7 +2800,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, hbool_t buf_starts_in_checker) { #if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG - const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():"; + const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():"; #endif hbool_t good_data = TRUE; hbool_t in_checker; @@ -2821,9 +2819,9 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, HDassert( checker_edge_size <= edge_size ); HDassert( test_max_rank <= PAR_SS_DR_MAX_RANK ); -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG - int mpi_rank; + int mpi_rank; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank); @@ -2875,7 +2873,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, y = 0; start_in_checker[3] = start_in_checker[2]; do - { + { if ( y >= checker_edge_size ) { start_in_checker[3] = ! start_in_checker[3]; @@ -2884,13 +2882,13 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, m = 0; z = 0; -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m); #endif in_checker = start_in_checker[3]; do { -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, " %d", (int)(*val_ptr)); #endif if ( z >= checker_edge_size ) { @@ -2898,21 +2896,21 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, in_checker = ! in_checker; z = 0; } - + if ( in_checker ) { - + if ( *val_ptr != expected_value ) { good_data = FALSE; } - + /* zero out buffer for re-use */ *val_ptr = 0; } else if ( *val_ptr != 0 ) { good_data = FALSE; - + /* zero out buffer for re-use */ *val_ptr = 0; @@ -2922,10 +2920,10 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, expected_value++; m++; z++; - + } while ( ( rank >= (test_max_rank - 4) ) && ( m < edge_size ) ); -#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, "\n"); #endif l++; @@ -2951,28 +2949,28 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__d2m_l2s() + * Function: ckrbrd_hs_dr_pio_test__d2m_l2s() * - * Purpose: Part one of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part one of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using checker - * board selections of different rank that + * Verify that we can read from disk correctly using checker + * board selections of different rank that * H5S_select_shape_same() views as being of the same shape. * - * In this function, we test this by reading small_rank - 1 - * checker board slices from the on disk large cube, and - * verifying that the data read is correct. Verify that - * H5S_select_shape_same() returns true on the memory and - * file selections. + * In this function, we test this by reading small_rank - 1 + * checker board slices from the on disk large cube, and + * verifying that the data read is correct. Verify that + * H5S_select_shape_same() returns true on the memory and + * file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/15/11 + * Programmer: JRM -- 9/15/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -2982,17 +2980,17 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, static void ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_l2s()"; uint32_t * ptr_0; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ - hbool_t data_ok = FALSE; - int i, j, k, l; - uint32_t expected_value; - int mpi_rank; /* needed by VRFY */ + hbool_t data_ok = FALSE; + int i, j, k, l; + uint32_t expected_value; + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -3002,9 +3000,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading a (small_rank - 1)-D checker board slice from this - * processes slice of the on disk large data set, and verifying that the - * data read is correct. Verify that H5S_select_shape_same() returns + * Start by reading a (small_rank - 1)-D checker board slice from this + * processes slice of the on disk large data set, and verifying that the + * data read is correct. Verify that H5S_select_shape_same() returns * true on the memory and file selections. * * The first step is to set up the needed checker board selection in the @@ -3025,7 +3023,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* zero out the buffer we will be reading into */ HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size); -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG HDfprintf(stdout, "%s:%d: initial small_ds_slice_buf = ", fcnName, tv_ptr->mpi_rank); ptr_0 = tv_ptr->small_ds_slice_buf; @@ -3034,7 +3032,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_0++; } HDfprintf(stdout, "\n"); -#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* set up start, stride, count, and block -- note that we will * change start[] so as to read slices of the large cube. @@ -3054,15 +3052,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } } -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: reading slice from big ds on disk into small ds slice.\n", fcnName, tv_ptr->mpi_rank); -#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set. However, in the parallel version, each + * of the large data set. However, in the parallel version, each * process only works with that slice of the large cube indicated - * by its rank -- hence we set the most slowly changing index to + * by its rank -- hence we set the most slowly changing index to * mpi_rank, and don't itterate over it. */ @@ -3075,9 +3073,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -3101,7 +3099,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -3121,8 +3119,8 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->skips = 0; /* reset the skips counter */ - /* we know that small_rank - 1 >= 1 and that - * large_rank > small_rank by the assertions at the head + /* we know that small_rank - 1 >= 1 and that + * large_rank > small_rank by the assertions at the head * of this function. Thus no need for another inner loop. */ tv_ptr->start[0] = (hsize_t)i; @@ -3157,15 +3155,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, - tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1], + tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", fcnName, H5Sget_simple_extent_ndims(tv_ptr->small_ds_slice_sid), H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0)); -#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ ret = H5Dread(tv_ptr->large_dataset, H5T_NATIVE_UINT32, @@ -3175,15 +3173,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->small_ds_slice_buf); VRFY((ret >= 0), "H5Dread() slice from large ds succeeded."); -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG - HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, tv_ptr->mpi_rank); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* verify that expected data is retrieved */ expected_value = (uint32_t) - ((i * tv_ptr->edge_size * tv_ptr->edge_size * + ((i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -3199,7 +3197,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) (hbool_t)TRUE ); - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "small slice read from large ds data good."); (tv_ptr->tests_run)++; @@ -3227,27 +3225,27 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__d2m_s2l() + * Function: ckrbrd_hs_dr_pio_test__d2m_s2l() * - * Purpose: Part two of a series of tests of I/O to/from hyperslab - * selections of different rank in the parallel. + * Purpose: Part two of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. * - * Verify that we can read from disk correctly using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * In this function, we test this by reading checker board - * slices of the on disk small data set into slices through - * the in memory large data set, and verify that the correct - * data (and only the correct data) is read. + * In this function, we test this by reading checker board + * slices of the on disk small data set into slices through + * the in memory large data set, and verify that the correct + * data (and only the correct data) is read. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/15/11 + * Programmer: JRM -- 8/15/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3257,27 +3255,27 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_s2l()"; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ - hbool_t data_ok = FALSE; - int i, j, k, l; + hbool_t data_ok = FALSE; + int i, j, k, l; size_t u; size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; - int mpi_rank; /* needed by VRFY */ + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* similarly, read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* similarly, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ @@ -3292,8 +3290,8 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->small_rank - 1, sel_start); -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s reading slices of on disk small data set into slices of big data set.\n", fcnName); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ @@ -3303,7 +3301,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* set up start, stride, count, and block -- note that we will * change start[] so as to read the slice of the small data set - * into different slices of the process slice of the large data + * into different slices of the process slice of the large data * set. */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { @@ -3322,11 +3320,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -3340,9 +3338,9 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -3366,7 +3364,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -3423,11 +3421,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /* Read selection from disk */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, tv_ptr->mpi_rank, - tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], - tv_ptr->start[3], tv_ptr->start[4]); +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, tv_ptr->mpi_rank, + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, H5Sget_simple_extent_ndims(tv_ptr->large_ds_slice_sid), @@ -3446,21 +3444,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) */ data_ok = TRUE; ptr_1 = tv_ptr->large_ds_buf_1; - expected_value = + expected_value = (uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; -#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG { int m, n; - HDfprintf(stdout, "%s:%d: expected_value = %d.\n", + HDfprintf(stdout, "%s:%d: expected_value = %d.\n", fcnName, tv_ptr->mpi_rank, expected_value); HDfprintf(stdout, "%s:%d: start/stop index = %d/%d.\n", fcnName, tv_ptr->mpi_rank, start_index, stop_index); @@ -3495,7 +3493,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "slice read from small to large ds data good(1)."); data_ok = ckrbrd_hs_dr_pio_test__verify_data @@ -3508,7 +3506,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) (hbool_t)TRUE ); - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "slice read from small to large ds data good(2)."); @@ -3527,7 +3525,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) ptr_1++; } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "slice read from small to large ds data good(3)."); (tv_ptr->tests_run)++; @@ -3555,31 +3553,31 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__m2d_l2s() + * Function: ckrbrd_hs_dr_pio_test__m2d_l2s() * - * Purpose: Part three of a series of tests of I/O to/from checker - * board hyperslab selections of different rank in the - * parallel. + * Purpose: Part three of a series of tests of I/O to/from checker + * board hyperslab selections of different rank in the + * parallel. * - * Verify that we can write from memory to file using checker - * board selections of different rank that - * H5S_select_shape_same() views as being of the same shape. + * Verify that we can write from memory to file using checker + * board selections of different rank that + * H5S_select_shape_same() views as being of the same shape. * - * Do this by writing small_rank - 1 dimensional checker - * board slices from the in memory large data set to the on - * disk small cube dataset. After each write, read the - * slice of the small dataset back from disk, and verify - * that it contains the expected data. Verify that - * H5S_select_shape_same() returns true on the memory and - * file selections. + * Do this by writing small_rank - 1 dimensional checker + * board slices from the in memory large data set to the on + * disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify + * that it contains the expected data. Verify that + * H5S_select_shape_same() returns true on the memory and + * file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/15/11 + * Programmer: JRM -- 8/15/11 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -3589,21 +3587,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) static void ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()"; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ - hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; - int i, j, k, l; + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; + int i, j, k, l; size_t u; size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; - int mpi_rank; /* needed by VRFY */ + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; @@ -3614,9 +3612,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * H5S_select_shape_same() views as being of the same shape. * * Start by writing small_rank - 1 D slices from the in memory large data - * set to the on disk small dataset. After each write, read the slice of - * the small dataset back from disk, and verify that it contains the - * expected data. Verify that H5S_select_shape_same() returns true on + * set to the on disk small dataset. After each write, read the slice of + * the small dataset back from disk, and verify that it contains the + * expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ @@ -3684,18 +3682,18 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s writing checker boards selections of slices from big ds to slices of small ds on disk.\n", fcnName); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions - * of the large data set that don't appear in the small data set. + * of the large data set that don't appear in the small data set. * - * However, in the parallel version, each process only works with that - * slice of the large (and small) data set indicated by its rank -- hence - * we set the most slowly changing index to mpi_rank, and don't itterate + * However, in the parallel version, each process only works with that + * slice of the large (and small) data set indicated by its rank -- hence + * we set the most slowly changing index to mpi_rank, and don't itterate * over it. */ @@ -3709,9 +3707,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -3736,7 +3734,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -3760,7 +3758,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) * by the assertions at the head of this function. Thus no * need for another inner loop. */ - + /* zero out this rank's slice of the on disk small data set */ ret = H5Dwrite(tv_ptr->small_dataset, H5T_NATIVE_UINT32, @@ -3769,7 +3767,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->xfer_plist, tv_ptr->small_ds_buf_2); VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded."); - + /* select the portion of the in memory large cube from which we * are going to write data. */ @@ -3778,13 +3776,13 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->start[2] = (hsize_t)k; tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - + HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1)); HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1)); - + ckrbrd_hs_dr_pio_test__slct_ckrbrd ( tv_ptr->mpi_rank, @@ -3795,26 +3793,26 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->small_rank - 1, tv_ptr->start ); - - + + /* verify that H5S_select_shape_same() reports the in - * memory checkerboard selection of the slice through the + * memory checkerboard selection of the slice through the * large dataset and the checkerboard selection of the process * slice of the small data set as having the same shape. */ check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_1, tv_ptr->mem_large_ds_sid); VRFY((check == TRUE), "H5S_select_shape_same_test passed."); - - - /* write the checker board selection of the slice from the in - * memory large data set to the slice of the on disk small - * dataset. + + + /* write the checker board selection of the slice from the in + * memory large data set to the slice of the on disk small + * dataset. */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, tv_ptr->mpi_rank, - tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -3828,8 +3826,8 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->xfer_plist, tv_ptr->large_ds_buf_0); VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded."); - - + + /* read the on disk process slice of the small dataset into memory */ ret = H5Dread(tv_ptr->small_dataset, H5T_NATIVE_UINT32, @@ -3838,30 +3836,30 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->xfer_plist, tv_ptr->small_ds_buf_1); VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); - - + + /* verify that expected data is retrieved */ - + mis_match = FALSE; - + expected_value = (uint32_t)( - (i * tv_ptr->edge_size * tv_ptr->edge_size * + (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); - + start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - + HDassert( start_index < stop_index ); HDassert( stop_index <= tv_ptr->small_ds_size ); - + data_ok = TRUE; - + ptr_1 = tv_ptr->small_ds_buf_1; for ( u = 0; u < start_index; u++, ptr_1++ ) { - + if ( *ptr_1 != 0 ) { data_ok = FALSE; @@ -3890,7 +3888,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) } } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "large slice write slice to small slice data good."); (tv_ptr->tests_run)++; @@ -3918,31 +3916,31 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__m2d_s2l() + * Function: ckrbrd_hs_dr_pio_test__m2d_s2l() * - * Purpose: Part four of a series of tests of I/O to/from checker - * board hyperslab selections of different rank in the parallel. + * Purpose: Part four of a series of tests of I/O to/from checker + * board hyperslab selections of different rank in the parallel. * - * Verify that we can write from memory to file using - * selections of different rank that H5S_select_shape_same() - * views as being of the same shape. + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. * - * Do this by writing checker board selections of the contents - * of the process's slice of the in memory small data set to - * slices of the on disk large data set. After each write, - * read the process's slice of the large data set back into - * memory, and verify that it contains the expected data. + * Do this by writing checker board selections of the contents + * of the process's slice of the in memory small data set to + * slices of the on disk large data set. After each write, + * read the process's slice of the large data set back into + * memory, and verify that it contains the expected data. * - * Verify that H5S_select_shape_same() returns true on the - * memory and file selections. + * Verify that H5S_select_shape_same() returns true on the + * memory and file selections. * - * Return: void + * Return: void * - * Programmer: JRM -- 8/15/11 + * Programmer: JRM -- 8/15/11 * * Modifications: * - * None + * None * *------------------------------------------------------------------------- */ @@ -3952,31 +3950,31 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) static void ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ - hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; - int i, j, k, l; + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; + int i, j, k, l; size_t u; size_t start_index; size_t stop_index; - uint32_t expected_value; + uint32_t expected_value; uint32_t * ptr_1; - int mpi_rank; /* needed by VRFY */ + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* initialize the local copy of mpi_rank */ mpi_rank = tv_ptr->mpi_rank; - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ @@ -4009,7 +4007,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, set) suceeded"); - /* setup a checkerboard selection of the slice of the in memory small + /* setup a checkerboard selection of the slice of the in memory small * data set associated with the process's mpi rank. */ @@ -4025,7 +4023,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) sel_start); /* set up start, stride, count, and block -- note that we will - * change start[] so as to write checkerboard selections of slices + * change start[] so as to write checkerboard selections of slices * of the small data set to slices of the large data set. */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { @@ -4047,7 +4045,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); #if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, + HDfprintf(stdout, "%s writing process checkerboard selections of slices of small ds to process slices of large ds on disk.\n", fcnName); #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ @@ -4061,9 +4059,9 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) i = 0; } - /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to + /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to * loop over it -- either we are setting i to mpi_rank, or - * we are setting it to zero. It will not change during the + * we are setting it to zero. It will not change during the * test. */ @@ -4087,7 +4085,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } do { - /* since small rank >= 2 and large_rank > small_rank, we + /* since small rank >= 2 and large_rank > small_rank, we * have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5 * (baring major re-orgaization), this gives us: * @@ -4162,13 +4160,13 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - /* write the small data set slice from memory to the - * target slice of the disk data set + /* write the small data set slice from memory to the + * target slice of the disk data set */ -#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, tv_ptr->mpi_rank, - tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]); HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", fcnName, tv_ptr->mpi_rank, @@ -4181,11 +4179,11 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_sid_1, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dwrite of small ds slice to large ds succeeded"); - /* read this processes slice on the on disk large + /* read this processes slice on the on disk large * data set into memory. */ @@ -4195,18 +4193,18 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) tv_ptr->file_large_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->large_ds_buf_1); - VRFY((ret != FAIL), + VRFY((ret != FAIL), "H5Dread() of process slice of large ds succeeded"); /* verify that the expected data and only the * expected data was read. */ - expected_value = + expected_value = (uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); start_index = (size_t) - ((i * tv_ptr->edge_size * tv_ptr->edge_size * + ((i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + (k * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -4252,7 +4250,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) } } - VRFY((data_ok == TRUE), + VRFY((data_ok == TRUE), "small ds cb slice write to large ds slice data good."); (tv_ptr->tests_run)++; @@ -4280,22 +4278,22 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test__run_test() + * Function: ckrbrd_hs_dr_pio_test__run_test() * - * Purpose: Test I/O to/from checkerboard selections of hyperslabs of - * different rank in the parallel. + * Purpose: Test I/O to/from checkerboard selections of hyperslabs of + * different rank in the parallel. * - * Return: void + * Return: void * - * Programmer: JRM -- 10/10/09 + * Programmer: JRM -- 10/10/09 * * Modifications: * - * JRM -- 9/16/10 - * Added the express_test parameter. Use it to control - * whether we set an alignment, and whether we allocate - * chunks such that no two processes will normally touch - * the same chunk. + * JRM -- 9/16/10 + * Added the express_test parameter. Use it to control + * whether we set an alignment, and whether we allocate + * chunks such that no two processes will normally touch + * the same chunk. * *------------------------------------------------------------------------- */ @@ -4322,10 +4320,10 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, #if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()"; #endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; /* needed by VRFY */ - struct hs_dr_pio_test_vars_t test_vars = + int mpi_rank; /* needed by VRFY */ + struct hs_dr_pio_test_vars_t test_vars = { - /* int mpi_size = */ -1, + /* int mpi_size = */ -1, /* int mpi_rank = */ -1, /* MPI_Comm mpi_comm = */ MPI_COMM_NULL, /* MPI_Inf mpi_info = */ MPI_INFO_NULL, @@ -4341,7 +4339,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, /* uint32_t * small_ds_buf_2 = */ NULL, /* uint32_t * small_ds_slice_buf = */ NULL, /* uint32_t * large_ds_buf_0 = */ NULL, - /* uint32_t * large_ds_buf_1 = */ NULL, + /* uint32_t * large_ds_buf_1 = */ NULL, /* uint32_t * large_ds_buf_2 = */ NULL, /* uint32_t * large_ds_slice_buf = */ NULL, /* int small_ds_offset = */ -1, @@ -4378,17 +4376,17 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, /* hsize_t * stride_ptr = */ NULL, /* hsize_t * count_ptr = */ NULL, /* hsize_t * block_ptr = */ NULL, - /* int skips = */ 0, - /* int max_skips = */ 0, + /* int skips = */ 0, + /* int max_skips = */ 0, /* int64_t total_tests = */ 0, /* int64_t tests_run = */ 0, /* int64_t tests_skipped = */ 0 }; struct hs_dr_pio_test_vars_t * tv_ptr = &test_vars; - hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size, - chunk_edge_size, small_rank, large_rank, - use_collective_io, dset_type, express_test, + hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size, + chunk_edge_size, small_rank, large_rank, + use_collective_io, dset_type, express_test, tv_ptr); @@ -4414,9 +4412,9 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading a (small_rank - 1)-D slice from this processes slice - * of the on disk large data set, and verifying that the data read is - * correct. Verify that H5S_select_shape_same() returns true on the + * Start by reading a (small_rank - 1)-D slice from this processes slice + * of the on disk large data set, and verifying that the data read is + * correct. Verify that H5S_select_shape_same() returns true on the * memory and file selections. * * The first step is to set up the needed checker board selection in the @@ -4426,8 +4424,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, ckrbrd_hs_dr_pio_test__d2m_l2s(tv_ptr); - /* similarly, read slices of the on disk small data set into slices - * through the in memory large data set, and verify that the correct + /* similarly, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ @@ -4439,20 +4437,20 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, * H5S_select_shape_same() views as being of the same shape. * * Start by writing small_rank - 1 D slices from the in memory large data - * set to the on disk small dataset. After each write, read the slice of - * the small dataset back from disk, and verify that it contains the - * expected data. Verify that H5S_select_shape_same() returns true on + * set to the on disk small dataset. After each write, read the slice of + * the small dataset back from disk, and verify that it contains the + * expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ ckrbrd_hs_dr_pio_test__m2d_l2s(tv_ptr); - /* Now write the contents of the process's slice of the in memory - * small data set to slices of the on disk large data set. After + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After * each write, read the process's slice of the large data set back - * into memory, and verify that it contains the expected data. - * Verify that H5S_select_shape_same() returns true on the memory + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory * and file selections. */ @@ -4461,8 +4459,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, #if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG if ( MAINPROCESS ) { - HDfprintf(stdout, - "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", + HDfprintf(stdout, + "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped), (long long)(tv_ptr->total_tests)); } @@ -4487,28 +4485,28 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, /*------------------------------------------------------------------------- - * Function: ckrbrd_hs_dr_pio_test() + * Function: ckrbrd_hs_dr_pio_test() * - * Purpose: Test I/O to/from hyperslab selections of different rank in - * the parallel case. + * Purpose: Test I/O to/from hyperslab selections of different rank in + * the parallel case. * - * Return: void + * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 9/18/09 * * Modifications: * - * Modified function to take a sample of the run times - * of the different tests, and skip some of them if - * run times are too long. + * Modified function to take a sample of the run times + * of the different tests, and skip some of them if + * run times are too long. * - * We need to do this because Lustre runns very slowly - * if two or more processes are banging on the same - * block of memory. - * JRM -- 9/10/10 - * Break this one big test into 4 smaller tests according - * to {independent,collective}x{contigous,chunked} datasets. - * AKC -- 2010/01/17 + * We need to do this because Lustre runns very slowly + * if two or more processes are banging on the same + * block of memory. + * JRM -- 9/10/10 + * Break this one big test into 4 smaller tests according + * to {independent,collective}x{contigous,chunked} datasets. + * AKC -- 2010/01/17 * *------------------------------------------------------------------------- */ @@ -4518,16 +4516,16 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) { int express_test; int local_express_test; - int mpi_size = -1; + int mpi_size = -1; int mpi_rank = -1; - int test_num = 0; - int edge_size; + int test_num = 0; + int edge_size; int checker_edge_size = 3; - int chunk_edge_size = 0; - int small_rank = 3; - int large_rank = 4; - int mpi_result; - hid_t dset_type = H5T_NATIVE_UINT; + int chunk_edge_size = 0; + int small_rank = 3; + int large_rank = 4; + int mpi_result; + hid_t dset_type = H5T_NATIVE_UINT; int skips = 0; int max_skips = 0; /* The following table list the number of sub-tests skipped between @@ -4566,13 +4564,13 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) max_skips = max_skips_tbl[local_express_test]; } -#if 0 +#if 0 { int DebugWait = 1; - + while (DebugWait) ; } -#endif +#endif for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) { @@ -4702,15 +4700,15 @@ int dim0; int dim1; int chunkdim0; int chunkdim1; -int nerrors = 0; /* errors count */ -int ndatasets = 300; /* number of datasets to create*/ +int nerrors = 0; /* errors count */ +int ndatasets = 300; /* number of datasets to create*/ int ngroups = 512; /* number of groups to create in root * group. */ -int facc_type = FACC_MPIO; /*Test file access type */ +int facc_type = FACC_MPIO; /*Test file access type */ int dxfer_coll_type = DXFER_COLLECTIVE_IO; -H5E_auto2_t old_func; /* previous error handler */ -void *old_client_data; /* previous error handler arg.*/ +H5E_auto2_t old_func; /* previous error handler */ +void *old_client_data; /* previous error handler arg.*/ /* other option flags */ @@ -4722,10 +4720,10 @@ void *old_client_data; /* previous error handler arg.*/ #define NFILENAME 2 #define PARATESTFILE filenames[0] const char *FILENAME[NFILENAME]={ - "ShapeSameTest", - NULL}; -char filenames[NFILENAME][PATH_MAX]; -hid_t fapl; /* file access property list */ + "ShapeSameTest", + NULL}; +char filenames[NFILENAME][PATH_MAX]; +hid_t fapl; /* file access property list */ #ifdef USE_PAUSE /* pause the process for a moment to allow debugger to attach if desired. */ @@ -4738,7 +4736,7 @@ void pause_proc(void) { int pid; - h5_stat_t statbuf; + h5_stat_t statbuf; char greenlight[] = "go"; int maxloop = 10; int loops = 0; @@ -4755,15 +4753,15 @@ void pause_proc(void) MPI_Get_processor_name(mpi_name, &mpi_namelen); if (MAINPROCESS) - while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){ - if (!loops++){ - printf("Proc %d (%*s, %d): to debug, attach %d\n", - mpi_rank, mpi_namelen, mpi_name, pid, pid); - } - printf("waiting(%ds) for file %s ...\n", time_int, greenlight); - fflush(stdout); + while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){ + if (!loops++){ + printf("Proc %d (%*s, %d): to debug, attach %d\n", + mpi_rank, mpi_namelen, mpi_name, pid, pid); + } + printf("waiting(%ds) for file %s ...\n", time_int, greenlight); + fflush(stdout); HDsleep(time_int); - } + } MPI_Barrier(MPI_COMM_WORLD); } @@ -4775,7 +4773,7 @@ int MPI_Init(int *argc, char ***argv) pause_proc(); return (ret_code); } -#endif /* USE_PAUSE */ +#endif /* USE_PAUSE */ /* @@ -4785,15 +4783,15 @@ static void usage(void) { printf(" [-r] [-w] [-m] [-n] " - "[-o] [-f ] [-d ]\n"); + "[-o] [-f ] [-d ]\n"); printf("\t-m" - "\tset number of datasets for the multiple dataset test\n"); + "\tset number of datasets for the multiple dataset test\n"); printf("\t-n" "\tset number of groups for the multiple group test\n"); printf("\t-f \tfilename prefix\n"); printf("\t-2\t\tuse Split-file together with MPIO\n"); printf("\t-d \tdataset dimensions factors. Defaults (%d,%d)\n", - ROW_FACTOR, COL_FACTOR); + ROW_FACTOR, COL_FACTOR); printf("\t-c \tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n"); printf("\n"); } @@ -4805,7 +4803,7 @@ usage(void) static int parse_options(int argc, char **argv) { - int mpi_size, mpi_rank; /* mpi variables */ + int mpi_size, mpi_rank; /* mpi variables */ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); @@ -4816,107 +4814,107 @@ parse_options(int argc, char **argv) chunkdim1 = (dim1+9)/10; while (--argc){ - if (**(++argv) != '-'){ - break; - }else{ - switch(*(*argv+1)){ - case 'm': ndatasets = atoi((*argv+1)+1); - if (ndatasets < 0){ - nerrors++; - return(1); - } - break; - case 'n': ngroups = atoi((*argv+1)+1); - if (ngroups < 0){ + if (**(++argv) != '-'){ + break; + }else{ + switch(*(*argv+1)){ + case 'm': ndatasets = atoi((*argv+1)+1); + if (ndatasets < 0){ + nerrors++; + return(1); + } + break; + case 'n': ngroups = atoi((*argv+1)+1); + if (ngroups < 0){ nerrors++; return(1); - } + } break; - case 'f': if (--argc < 1) { - nerrors++; - return(1); - } - if (**(++argv) == '-') { - nerrors++; - return(1); - } - paraprefix = *argv; - break; - case 'i': /* Collective MPI-IO access with independent IO */ - dxfer_coll_type = DXFER_INDEPENDENT_IO; - break; - case '2': /* Use the split-file driver with MPIO access */ - /* Can use $HDF5_METAPREFIX to define the */ - /* meta-file-prefix. */ - facc_type = FACC_MPIO | FACC_SPLIT; - break; - case 'd': /* dimensizes */ - if (--argc < 2){ - nerrors++; - return(1); - } - dim0 = atoi(*(++argv))*mpi_size; - argc--; - dim1 = atoi(*(++argv))*mpi_size; - /* set default chunkdim sizes too */ - chunkdim0 = (dim0+9)/10; - chunkdim1 = (dim1+9)/10; - break; - case 'c': /* chunk dimensions */ - if (--argc < 2){ - nerrors++; - return(1); - } - chunkdim0 = atoi(*(++argv)); - argc--; - chunkdim1 = atoi(*(++argv)); - break; - case 'h': /* print help message--return with nerrors set */ - return(1); - default: printf("Illegal option(%s)\n", *argv); - nerrors++; - return(1); - } - } + case 'f': if (--argc < 1) { + nerrors++; + return(1); + } + if (**(++argv) == '-') { + nerrors++; + return(1); + } + paraprefix = *argv; + break; + case 'i': /* Collective MPI-IO access with independent IO */ + dxfer_coll_type = DXFER_INDEPENDENT_IO; + break; + case '2': /* Use the split-file driver with MPIO access */ + /* Can use $HDF5_METAPREFIX to define the */ + /* meta-file-prefix. */ + facc_type = FACC_MPIO | FACC_SPLIT; + break; + case 'd': /* dimensizes */ + if (--argc < 2){ + nerrors++; + return(1); + } + dim0 = atoi(*(++argv))*mpi_size; + argc--; + dim1 = atoi(*(++argv))*mpi_size; + /* set default chunkdim sizes too */ + chunkdim0 = (dim0+9)/10; + chunkdim1 = (dim1+9)/10; + break; + case 'c': /* chunk dimensions */ + if (--argc < 2){ + nerrors++; + return(1); + } + chunkdim0 = atoi(*(++argv)); + argc--; + chunkdim1 = atoi(*(++argv)); + break; + case 'h': /* print help message--return with nerrors set */ + return(1); + default: printf("Illegal option(%s)\n", *argv); + nerrors++; + return(1); + } + } } /*while*/ /* check validity of dimension and chunk sizes */ if (dim0 <= 0 || dim1 <= 0){ - printf("Illegal dim sizes (%d, %d)\n", dim0, dim1); - nerrors++; - return(1); + printf("Illegal dim sizes (%d, %d)\n", dim0, dim1); + nerrors++; + return(1); } if (chunkdim0 <= 0 || chunkdim1 <= 0){ - printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1); - nerrors++; - return(1); + printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1); + nerrors++; + return(1); } /* Make sure datasets can be divided into equal portions by the processes */ if ((dim0 % mpi_size) || (dim1 % mpi_size)){ - if (MAINPROCESS) - printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n", - dim0, dim1, mpi_size); - nerrors++; - return(1); + if (MAINPROCESS) + printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n", + dim0, dim1, mpi_size); + nerrors++; + return(1); } /* compose the test filenames */ { - int i, n; - - n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */ - - for (i=0; i < n; i++) - if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i])) - == NULL){ - printf("h5_fixname failed\n"); - nerrors++; - return(1); - } - printf("Test filenames are:\n"); - for (i=0; i < n; i++) - printf(" %s\n", filenames[i]); + int i, n; + + n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */ + + for (i=0; i < n; i++) + if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i])) + == NULL){ + printf("h5_fixname failed\n"); + nerrors++; + return(1); + } + printf("Test filenames are:\n"); + for (i=0; i < n; i++) + printf(" %s\n", filenames[i]); } return(0); @@ -4931,7 +4929,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { hid_t ret_pl = -1; herr_t ret; /* generic return value */ - int mpi_rank; /* mpi variables */ + int mpi_rank; /* mpi variables */ /* need the rank for error checking macros */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); @@ -4940,36 +4938,36 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) VRFY((ret_pl >= 0), "H5P_FILE_ACCESS"); if (l_facc_type == FACC_DEFAULT) - return (ret_pl); + return (ret_pl); if (l_facc_type == FACC_MPIO){ - /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(ret_pl, comm, info); - VRFY((ret >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_mpio(ret_pl, comm, info); + VRFY((ret >= 0), ""); ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE); - VRFY((ret >= 0), ""); + VRFY((ret >= 0), ""); ret = H5Pset_coll_metadata_write(ret_pl, TRUE); - VRFY((ret >= 0), ""); - return(ret_pl); + VRFY((ret >= 0), ""); + return(ret_pl); } if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){ - hid_t mpio_pl; - - mpio_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((mpio_pl >= 0), ""); - /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(mpio_pl, comm, info); - VRFY((ret >= 0), ""); - - /* setup file access template */ - ret_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((ret_pl >= 0), ""); - /* set Parallel access with communicator */ - ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl); - VRFY((ret >= 0), "H5Pset_fapl_split succeeded"); - H5Pclose(mpio_pl); - return(ret_pl); + hid_t mpio_pl; + + mpio_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((mpio_pl >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_mpio(mpio_pl, comm, info); + VRFY((ret >= 0), ""); + + /* setup file access template */ + ret_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((ret_pl >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl); + VRFY((ret >= 0), "H5Pset_fapl_split succeeded"); + H5Pclose(mpio_pl); + return(ret_pl); } /* unknown file access types */ @@ -5037,7 +5035,7 @@ sschecker4(void) int main(int argc, char **argv) { - int mpi_size, mpi_rank; /* mpi variables */ + int mpi_size, mpi_rank; /* mpi variables */ #ifndef H5_HAVE_WIN32_API /* Un-buffer the stdout and stderr */ @@ -5053,10 +5051,10 @@ int main(int argc, char **argv) dim1 = COL_FACTOR*mpi_size; if (MAINPROCESS){ - printf("===================================\n"); - printf("Shape Same Tests Start\n"); - printf(" express_test = %d.\n", GetTestExpress()); - printf("===================================\n"); + printf("===================================\n"); + printf("Shape Same Tests Start\n"); + printf(" express_test = %d.\n", GetTestExpress()); + printf("===================================\n"); } /* Attempt to turn off atexit post processing so that in case errors @@ -5065,7 +5063,7 @@ int main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank); + printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank); }; H5open(); h5_show_hostname(); @@ -5075,23 +5073,23 @@ int main(int argc, char **argv) /* Shape Same tests using contigous hyperslab */ AddTest("sscontig1", sscontig1, NULL, - "Cntg hslab, ind IO, cntg dsets", PARATESTFILE); + "Cntg hslab, ind IO, cntg dsets", PARATESTFILE); AddTest("sscontig2", sscontig2, NULL, - "Cntg hslab, col IO, cntg dsets", PARATESTFILE); + "Cntg hslab, col IO, cntg dsets", PARATESTFILE); AddTest("sscontig3", sscontig3, NULL, - "Cntg hslab, ind IO, chnk dsets", PARATESTFILE); + "Cntg hslab, ind IO, chnk dsets", PARATESTFILE); AddTest("sscontig4", sscontig4, NULL, - "Cntg hslab, col IO, chnk dsets", PARATESTFILE); + "Cntg hslab, col IO, chnk dsets", PARATESTFILE); /* Shape Same tests using checker board hyperslab */ AddTest("sschecker1", sschecker1, NULL, - "Check hslab, ind IO, cntg dsets", PARATESTFILE); + "Check hslab, ind IO, cntg dsets", PARATESTFILE); AddTest("sschecker2", sschecker2, NULL, - "Check hslab, col IO, cntg dsets", PARATESTFILE); + "Check hslab, col IO, cntg dsets", PARATESTFILE); AddTest("sschecker3", sschecker3, NULL, - "Check hslab, ind IO, chnk dsets", PARATESTFILE); + "Check hslab, ind IO, chnk dsets", PARATESTFILE); AddTest("sschecker4", sschecker4, NULL, - "Check hslab, col IO, chnk dsets", PARATESTFILE); + "Check hslab, col IO, chnk dsets", PARATESTFILE); /* Display testing information */ TestInfo(argv[0]); @@ -5104,9 +5102,9 @@ int main(int argc, char **argv) TestParseCmdLine(argc, argv); if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){ - printf("===================================\n" - " Using Independent I/O with file set view to replace collective I/O \n" - "===================================\n"); + printf("===================================\n" + " Using Independent I/O with file set view to replace collective I/O \n" + "===================================\n"); } @@ -5131,16 +5129,16 @@ int main(int argc, char **argv) { int temp; MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - nerrors=temp; + nerrors=temp; } - if (MAINPROCESS){ /* only process 0 reports */ - printf("===================================\n"); - if (nerrors) - printf("***Shape Same tests detected %d errors***\n", nerrors); - else - printf("Shape Same tests finished with no errors\n"); - printf("===================================\n"); + if (MAINPROCESS){ /* only process 0 reports */ + printf("===================================\n"); + if (nerrors) + printf("***Shape Same tests detected %d errors***\n", nerrors); + else + printf("Shape Same tests finished with no errors\n"); + printf("===================================\n"); } /* close HDF5 library */ diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index a42df95..20bc4ac 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -23,17 +23,15 @@ 2) We will read two datasets with the same hyperslab selection settings, 1. independent read to read independent output, independent read to read collecive output, - Compare the result, - If the result is the same, then collective write succeeds. + Compare the result, + If the result is the same, then collective write succeeds. 2. collective read to read independent output, independent read to read independent output, - Compare the result, - If the result is the same, then collective read succeeds. + Compare the result, + If the result is the same, then collective read succeeds. */ -#include "hdf5.h" -#include "H5private.h" #include "testphdf5.h" @@ -42,17 +40,17 @@ static void coll_read_test(int chunk_factor); /*------------------------------------------------------------------------- - * Function: coll_irregular_cont_write + * Function: coll_irregular_cont_write * - * Purpose: Wrapper to test the collectively irregular hyperslab write in + * Purpose: Wrapper to test the collectively irregular hyperslab write in contiguous storage * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -69,17 +67,17 @@ coll_irregular_cont_write(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_cont_read + * Function: coll_irregular_cont_read * - * Purpose: Wrapper to test the collectively irregular hyperslab read in + * Purpose: Wrapper to test the collectively irregular hyperslab read in contiguous storage * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -95,17 +93,17 @@ coll_irregular_cont_read(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_simple_chunk_write + * Function: coll_irregular_simple_chunk_write * - * Purpose: Wrapper to test the collectively irregular hyperslab write in + * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk storage(1 chunk) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -122,17 +120,17 @@ coll_irregular_simple_chunk_write(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_simple_chunk_read + * Function: coll_irregular_simple_chunk_read * - * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk + * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk storage(1 chunk) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -147,17 +145,17 @@ coll_irregular_simple_chunk_read(void) } /*------------------------------------------------------------------------- - * Function: coll_irregular_complex_chunk_write + * Function: coll_irregular_complex_chunk_write * - * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk + * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk storage(4 chunks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -174,17 +172,17 @@ coll_irregular_complex_chunk_write(void) /*------------------------------------------------------------------------- - * Function: coll_irregular_complex_chunk_read + * Function: coll_irregular_complex_chunk_read * - * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk + * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk storage(1 chunk) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: * @@ -200,18 +198,18 @@ coll_irregular_complex_chunk_read(void) /*------------------------------------------------------------------------- - * Function: coll_write_test + * Function: coll_write_test * - * Purpose: To test the collectively irregular hyperslab write in chunk + * Purpose: To test the collectively irregular hyperslab write in chunk storage * Input: number of chunks on each dimension if number is equal to 0, contiguous storage - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: Oct 18th, 2005 * @@ -229,14 +227,14 @@ void coll_write_test(int chunk_factor) #if 0 hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ + (in memory) */ hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset (on disk) */ hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the - dataset in memory when we - read selection from the - dataset on the disk */ + dataset in memory when we + read selection from the + dataset on the disk */ #endif hsize_t start[2]; /* Start of hyperslab */ @@ -252,7 +250,7 @@ void coll_write_test(int chunk_factor) #if 0 int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the - dataset */ + dataset */ int vector[MSPACE1_DIM]; #endif @@ -616,12 +614,12 @@ void coll_write_test(int chunk_factor) */ ret = H5Dread(datasetc, H5T_NATIVE_INT, mspaceid, fspaceid, - H5P_DEFAULT, matrix_out); + H5P_DEFAULT, matrix_out); VRFY((ret >= 0),"H5D independent read succeed"); ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid, - H5P_DEFAULT, matrix_out1); + H5P_DEFAULT, matrix_out1); VRFY((ret >= 0),"H5D independent read succeed"); ret = 0; @@ -668,18 +666,18 @@ void coll_write_test(int chunk_factor) } /*------------------------------------------------------------------------- - * Function: coll_read_test + * Function: coll_read_test * - * Purpose: To test the collectively irregular hyperslab read in chunk + * Purpose: To test the collectively irregular hyperslab read in chunk storage * Input: number of chunks on each dimension if number is equal to 0, contiguous storage - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * Dec 2nd, 2004 + * Programmer: Unknown + * Dec 2nd, 2004 * * Modifications: Oct 18th, 2005 * Note: This test must be used with the correpsonding @@ -699,9 +697,9 @@ coll_read_test(int chunk_factor) /* Dimension sizes of the dataset (on disk) */ #if 0 hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the - dataset in memory when we - read selection from the - dataset on the disk */ + dataset in memory when we + read selection from the + dataset on the disk */ #endif hsize_t mdim[2]; @@ -718,7 +716,7 @@ coll_read_test(int chunk_factor) #if 0 int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the - dataset */ + dataset */ #endif int mpi_size,mpi_rank; @@ -882,7 +880,7 @@ coll_read_test(int chunk_factor) /* Collective read */ ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1, - dxfer_plist, matrix_out); + dxfer_plist, matrix_out); VRFY((ret >= 0),"H5D collecive read succeed"); ret = H5Pclose(dxfer_plist); @@ -890,7 +888,7 @@ coll_read_test(int chunk_factor) /* Independent read */ ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1, - H5P_DEFAULT, matrix_out1); + H5P_DEFAULT, matrix_out1); VRFY((ret >= 0),"H5D independent read succeed"); ret = 0; @@ -933,30 +931,30 @@ coll_read_test(int chunk_factor) /**************************************************************** ** -** lower_dim_size_comp_test__select_checker_board(): +** lower_dim_size_comp_test__select_checker_board(): ** -** Given a data space of tgt_rank, and dimensions: +** Given a data space of tgt_rank, and dimensions: ** -** (mpi_size + 1), edge_size, ... , edge_size +** (mpi_size + 1), edge_size, ... , edge_size ** -** edge_size, and a checker_edge_size, select a checker -** board selection of a sel_rank (sel_rank < tgt_rank) -** dimensional slice through the data space parallel to the +** edge_size, and a checker_edge_size, select a checker +** board selection of a sel_rank (sel_rank < tgt_rank) +** dimensional slice through the data space parallel to the ** sel_rank fastest changing indicies, with origin (in the -** higher indicies) as indicated by the start array. +** higher indicies) as indicated by the start array. ** -** Note that this function, is hard coded to presume a -** maximum data space rank of 5. +** Note that this function, is hard coded to presume a +** maximum data space rank of 5. ** -** While this maximum is declared as a constant, increasing -** it will require extensive coding in addition to changing +** While this maximum is declared as a constant, increasing +** it will require extensive coding in addition to changing ** the value of the constant. ** -** JRM -- 11/11/09 +** JRM -- 11/11/09 ** ****************************************************************/ -#define LDSCT_DS_RANK 5 +#define LDSCT_DS_RANK 5 #define LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK 0 #define LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG 0 @@ -971,32 +969,32 @@ lower_dim_size_comp_test__select_checker_board( const int sel_rank, hsize_t sel_start[]) { -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG - const char * fcnName = - "lower_dim_size_comp_test__select_checker_board():"; -#endif - hbool_t first_selection = TRUE; +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG + const char * fcnName = + "lower_dim_size_comp_test__select_checker_board():"; +#endif + hbool_t first_selection = TRUE; int i, j, k, l, m; - int ds_offset; - int sel_offset; - const int test_max_rank = LDSCT_DS_RANK; /* must update code if */ + int ds_offset; + int sel_offset; + const int test_max_rank = LDSCT_DS_RANK; /* must update code if */ /* this changes */ - hsize_t base_count; + hsize_t base_count; hsize_t offset_count; - hsize_t start[LDSCT_DS_RANK]; - hsize_t stride[LDSCT_DS_RANK]; - hsize_t count[LDSCT_DS_RANK]; - hsize_t block[LDSCT_DS_RANK]; - herr_t ret; /* Generic return value */ + hsize_t start[LDSCT_DS_RANK]; + hsize_t stride[LDSCT_DS_RANK]; + hsize_t count[LDSCT_DS_RANK]; + hsize_t block[LDSCT_DS_RANK]; + herr_t ret; /* Generic return value */ -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: dims/checker_edge_size = %d %d %d %d %d / %d\n", fcnName, mpi_rank, (int)dims[0], (int)dims[1], (int)dims[2], (int)dims[3], (int)dims[4], checker_edge_size); } -#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ HDassert( 0 < checker_edge_size ); HDassert( 0 < sel_rank ); @@ -1014,14 +1012,14 @@ lower_dim_size_comp_test__select_checker_board( HDassert( (hsize_t)checker_edge_size <= dims[sel_offset] ); HDassert( dims[sel_offset] == 10 ); -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", fcnName, mpi_rank, sel_rank, sel_offset); - HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n", + HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n", fcnName, mpi_rank, tgt_rank, ds_offset); } -#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* First, compute the base count (which assumes start == 0 * for the associated offset) and offset_count (which @@ -1043,25 +1041,25 @@ lower_dim_size_comp_test__select_checker_board( base_count++; } - offset_count = - (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) / + offset_count = + (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) / ((hsize_t)(checker_edge_size * 2))); - if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) % + if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) % ((hsize_t)(checker_edge_size * 2))) > 0 ) { offset_count++; } -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n", + HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n", fcnName, mpi_rank, base_count, offset_count); } -#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* Now set up the stride and block arrays, and portions of the start - * and count arrays that will not be altered during the selection of + * and count arrays that will not be altered during the selection of * the checker board. */ i = 0; @@ -1093,7 +1091,7 @@ lower_dim_size_comp_test__select_checker_board( i++; } - + i = 0; do { if ( 0 >= sel_offset ) { @@ -1112,7 +1110,7 @@ lower_dim_size_comp_test__select_checker_board( } j = 0; - do { + do { if ( 1 >= sel_offset ) { if ( j == 0 ) { @@ -1181,78 +1179,78 @@ lower_dim_size_comp_test__select_checker_board( if ( ((i + j + k + l + m) % 2) == 0 ) { -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s%d: *** first_selection = %d ***\n", + HDfprintf(stdout, + "%s%d: *** first_selection = %d ***\n", fcnName, mpi_rank, (int)first_selection); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n", fcnName, mpi_rank, i, j, k, l, m); - HDfprintf(stdout, - "%s:%d: start = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)start[0], (int)start[1], - (int)start[2], (int)start[3], + HDfprintf(stdout, + "%s:%d: start = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)start[0], (int)start[1], + (int)start[2], (int)start[3], (int)start[4]); - HDfprintf(stdout, - "%s:%d: stride = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)stride[0], (int)stride[1], - (int)stride[2], (int)stride[3], + HDfprintf(stdout, + "%s:%d: stride = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)stride[0], (int)stride[1], + (int)stride[2], (int)stride[3], (int)stride[4]); - HDfprintf(stdout, - "%s:%d: count = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)count[0], (int)count[1], - (int)count[2], (int)count[3], + HDfprintf(stdout, + "%s:%d: count = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)count[0], (int)count[1], + (int)count[2], (int)count[3], (int)count[4]); - HDfprintf(stdout, - "%s:%d: block = %d %d %d %d %d.\n", - fcnName, mpi_rank, - (int)block[0], (int)block[1], - (int)block[2], (int)block[3], + HDfprintf(stdout, + "%s:%d: block = %d %d %d %d %d.\n", + fcnName, mpi_rank, + (int)block[0], (int)block[1], + (int)block[2], (int)block[3], (int)block[4]); - HDfprintf(stdout, - "%s:%d: n-cube extent dims = %d.\n", + HDfprintf(stdout, + "%s:%d: n-cube extent dims = %d.\n", fcnName, mpi_rank, H5Sget_simple_extent_ndims(tgt_sid)); - HDfprintf(stdout, - "%s:%d: selection rank = %d.\n", + HDfprintf(stdout, + "%s:%d: selection rank = %d.\n", fcnName, mpi_rank, sel_rank); } #endif if ( first_selection ) { - first_selection = FALSE; + first_selection = FALSE; ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_SET, - &(start[ds_offset]), - &(stride[ds_offset]), - &(count[ds_offset]), + &(start[ds_offset]), + &(stride[ds_offset]), + &(count[ds_offset]), &(block[ds_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded"); } else { ret = H5Sselect_hyperslab ( - tgt_sid, + tgt_sid, H5S_SELECT_OR, - &(start[ds_offset]), - &(stride[ds_offset]), - &(count[ds_offset]), + &(start[ds_offset]), + &(stride[ds_offset]), + &(count[ds_offset]), &(block[ds_offset]) ); - + VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded"); } @@ -1284,7 +1282,7 @@ lower_dim_size_comp_test__select_checker_board( } while ( ( i <= 1 ) && ( 0 >= sel_offset ) ); -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); @@ -1306,7 +1304,7 @@ lower_dim_size_comp_test__select_checker_board( VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded"); -#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); @@ -1321,57 +1319,57 @@ lower_dim_size_comp_test__select_checker_board( /**************************************************************** ** -** lower_dim_size_comp_test__verify_data(): +** lower_dim_size_comp_test__verify_data(): ** -** Examine the supplied buffer to see if it contains the -** expected data. Return TRUE if it does, and FALSE +** Examine the supplied buffer to see if it contains the +** expected data. Return TRUE if it does, and FALSE ** otherwise. ** -** The supplied buffer is presumed to this process's slice -** of the target data set. Each such slice will be an -** n-cube of rank (rank -1) and the supplied edge_size with -** origin (mpi_rank, 0, ... , 0) in the target data set. +** The supplied buffer is presumed to this process's slice +** of the target data set. Each such slice will be an +** n-cube of rank (rank -1) and the supplied edge_size with +** origin (mpi_rank, 0, ... , 0) in the target data set. ** -** Further, the buffer is presumed to be the result of reading -** or writing a checker board selection of an m (1 <= m < +** Further, the buffer is presumed to be the result of reading +** or writing a checker board selection of an m (1 <= m < ** rank) dimensional slice through this processes slice -** of the target data set. Also, this slice must be parallel -** to the fastest changing indicies. +** of the target data set. Also, this slice must be parallel +** to the fastest changing indicies. ** -** It is further presumed that the buffer was zeroed before -** the read/write, and that the full target data set (i.e. -** the buffer/data set for all processes) was initialized -** with the natural numbers listed in order from the origin -** along the fastest changing axis. +** It is further presumed that the buffer was zeroed before +** the read/write, and that the full target data set (i.e. +** the buffer/data set for all processes) was initialized +** with the natural numbers listed in order from the origin +** along the fastest changing axis. ** ** Thus for a 20x10x10 dataset, the value stored in location -** (x, y, z) (assuming that z is the fastest changing index -** and x the slowest) is assumed to be: +** (x, y, z) (assuming that z is the fastest changing index +** and x the slowest) is assumed to be: ** -** (10 * 10 * x) + (10 * y) + z +** (10 * 10 * x) + (10 * y) + z ** -** Further, supposing that this is process 10, this process's -** slice of the dataset would be a 10 x 10 2-cube with origin -** (10, 0, 0) in the data set, and would be initialize (prior -** to the checkerboard selection) as follows: +** Further, supposing that this is process 10, this process's +** slice of the dataset would be a 10 x 10 2-cube with origin +** (10, 0, 0) in the data set, and would be initialize (prior +** to the checkerboard selection) as follows: ** -** 1000, 1001, 1002, ... 1008, 1009 -** 1010, 1011, 1012, ... 1018, 1019 -** . . . . . -** . . . . . -** . . . . . -** 1090, 1091, 1092, ... 1098, 1099 +** 1000, 1001, 1002, ... 1008, 1009 +** 1010, 1011, 1012, ... 1018, 1019 +** . . . . . +** . . . . . +** . . . . . +** 1090, 1091, 1092, ... 1098, 1099 ** -** In the case of a read from the processors slice of another -** data set of different rank, the values expected will have -** to be adjusted accordingly. This is done via the -** first_expected_val parameter. +** In the case of a read from the processors slice of another +** data set of different rank, the values expected will have +** to be adjusted accordingly. This is done via the +** first_expected_val parameter. ** -** Finally, the function presumes that the first element -** of the buffer resides either at the origin of either -** a selected or an unselected checker. (Translation: -** if partial checkers appear in the buffer, they will -** intersect the edges of the n-cube oposite the origin.) +** Finally, the function presumes that the first element +** of the buffer resides either at the origin of either +** a selected or an unselected checker. (Translation: +** if partial checkers appear in the buffer, they will +** intersect the edges of the n-cube oposite the origin.) ** ****************************************************************/ @@ -1379,7 +1377,7 @@ lower_dim_size_comp_test__select_checker_board( static hbool_t lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG const int mpi_rank, #endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */ const int rank, @@ -1389,8 +1387,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, hbool_t buf_starts_in_checker) { #if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - const char * fcnName = - "lower_dim_size_comp_test__verify_data():"; + const char * fcnName = + "lower_dim_size_comp_test__verify_data():"; #endif hbool_t good_data = TRUE; hbool_t in_checker; @@ -1409,16 +1407,16 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, HDassert( checker_edge_size <= edge_size ); HDassert( test_max_rank <= LDSCT_DS_RANK ); -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s rank = %d.\n", fcnName, rank); HDfprintf(stdout, "%s edge_size = %d.\n", fcnName, edge_size); - HDfprintf(stdout, "%s checker_edge_size = %d.\n", + HDfprintf(stdout, "%s checker_edge_size = %d.\n", fcnName, checker_edge_size); - HDfprintf(stdout, "%s first_expected_val = %d.\n", + HDfprintf(stdout, "%s first_expected_val = %d.\n", fcnName, (int)first_expected_val); - HDfprintf(stdout, "%s starts_in_checker = %d.\n", + HDfprintf(stdout, "%s starts_in_checker = %d.\n", fcnName, (int)buf_starts_in_checker); } #endif @@ -1463,7 +1461,7 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, y = 0; start_in_checker[3] = start_in_checker[2]; do - { + { if ( y >= checker_edge_size ) { start_in_checker[3] = ! start_in_checker[3]; @@ -1472,8 +1470,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, m = 0; z = 0; -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m); } @@ -1481,8 +1479,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, in_checker = start_in_checker[3]; do { -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, " %d", (int)(*val_ptr)); } @@ -1492,21 +1490,21 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, in_checker = ! in_checker; z = 0; } - + if ( in_checker ) { - + if ( *val_ptr != expected_value ) { good_data = FALSE; } - + /* zero out buffer for re-use */ *val_ptr = 0; } else if ( *val_ptr != 0 ) { good_data = FALSE; - + /* zero out buffer for re-use */ *val_ptr = 0; @@ -1516,11 +1514,11 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, expected_value++; m++; z++; - + } while ( ( rank >= (test_max_rank - 4) ) && ( m < edge_size ) ); -#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG - if ( mpi_rank == +#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "\n"); } @@ -1548,22 +1546,22 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, /*------------------------------------------------------------------------- - * Function: lower_dim_size_comp_test__run_test() + * Function: lower_dim_size_comp_test__run_test() * - * Purpose: Verify that a bug in the computation of the size of the - * lower dimensions of a data space in H5S_obtain_datatype() - * has been corrected. + * Purpose: Verify that a bug in the computation of the size of the + * lower dimensions of a data space in H5S_obtain_datatype() + * has been corrected. * - * Return: void + * Return: void * - * Programmer: JRM -- 11/11/09 + * Programmer: JRM -- 11/11/09 * * Modifications: * *------------------------------------------------------------------------- */ -#define LDSCT_DS_RANK 5 +#define LDSCT_DS_RANK 5 #define LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG 0 static void @@ -1571,21 +1569,21 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_collective_io, const hid_t dset_type) { -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG const char *fcnName = "lower_dim_size_comp_test__run_test()"; - int rank; - hsize_t dims[32]; - hsize_t max_dims[32]; + int rank; + hsize_t dims[32]; + hsize_t max_dims[32]; #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ const char *filename; - hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; int i; int start_index; int stop_index; - int mrc; - int mpi_rank; - int mpi_size; + int mrc; + int mpi_rank; + int mpi_size; MPI_Comm mpi_comm = MPI_COMM_NULL; MPI_Info mpi_info = MPI_INFO_NULL; hid_t fid; /* HDF5 file ID */ @@ -1635,7 +1633,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: chunk_edge_size = %d.\n", fcnName, mpi_rank, (int)chunk_edge_size); @@ -1650,13 +1648,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_ds_size = (size_t)((mpi_size + 1) * 10 * 10 * 10 * 10); large_ds_slice_size = (size_t) (10 * 10 * 10 * 10); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: small ds size / slice size = %d / %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)small_ds_size, (int)small_ds_slice_size); HDfprintf(stdout, "%s:%d: large ds size / slice size = %d / %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)large_ds_size, (int)large_ds_slice_size); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -1739,7 +1737,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_dims[3] = 10; large_dims[4] = 10; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: small_dims[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)small_dims[0], (int)small_dims[1], @@ -1748,41 +1746,41 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, fcnName, mpi_rank, (int)large_dims[0], (int)large_dims[1], (int)large_dims[2], (int)large_dims[3], (int)large_dims[4]); } -#endif +#endif /* create data spaces */ full_mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((full_mem_small_ds_sid != 0), + VRFY((full_mem_small_ds_sid != 0), "H5Screate_simple() full_mem_small_ds_sid succeeded"); full_file_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((full_file_small_ds_sid != 0), + VRFY((full_file_small_ds_sid != 0), "H5Screate_simple() full_file_small_ds_sid succeeded"); mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((mem_small_ds_sid != 0), + VRFY((mem_small_ds_sid != 0), "H5Screate_simple() mem_small_ds_sid succeeded"); file_small_ds_sid = H5Screate_simple(5, small_dims, NULL); - VRFY((file_small_ds_sid != 0), + VRFY((file_small_ds_sid != 0), "H5Screate_simple() file_small_ds_sid succeeded"); full_mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((full_mem_large_ds_sid != 0), + VRFY((full_mem_large_ds_sid != 0), "H5Screate_simple() full_mem_large_ds_sid succeeded"); full_file_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((full_file_large_ds_sid != 0), + VRFY((full_file_large_ds_sid != 0), "H5Screate_simple() full_file_large_ds_sid succeeded"); mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((mem_large_ds_sid != 0), + VRFY((mem_large_ds_sid != 0), "H5Screate_simple() mem_large_ds_sid succeeded"); file_large_ds_sid = H5Screate_simple(5, large_dims, NULL); - VRFY((file_large_ds_sid != 0), + VRFY((file_large_ds_sid != 0), "H5Screate_simple() file_large_ds_sid succeeded"); @@ -1812,14 +1810,14 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, small_chunk_dims[1] = small_chunk_dims[2] = (hsize_t)1; small_chunk_dims[3] = small_chunk_dims[4] = (hsize_t)chunk_edge_size; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: small chunk dims[] = %d %d %d %d %d\n", - fcnName, mpi_rank, (int)small_chunk_dims[0], - (int)small_chunk_dims[1], (int)small_chunk_dims[2], + fcnName, mpi_rank, (int)small_chunk_dims[0], + (int)small_chunk_dims[1], (int)small_chunk_dims[2], (int)small_chunk_dims[3], (int)small_chunk_dims[4]); } -#endif +#endif small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); VRFY((ret != FAIL), "H5Pcreate() small_ds_dcpl_id succeeded"); @@ -1831,18 +1829,18 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, VRFY((ret != FAIL), "H5Pset_chunk() small_ds_dcpl_id succeeded"); large_chunk_dims[0] = (hsize_t)(1); - large_chunk_dims[1] = large_chunk_dims[2] = - large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size; + large_chunk_dims[1] = large_chunk_dims[2] = + large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: large chunk dims[] = %d %d %d %d %d\n", - fcnName, mpi_rank, (int)large_chunk_dims[0], - (int)large_chunk_dims[1], (int)large_chunk_dims[2], + fcnName, mpi_rank, (int)large_chunk_dims[0], + (int)large_chunk_dims[1], (int)large_chunk_dims[2], (int)large_chunk_dims[3], (int)large_chunk_dims[4]); } -#endif +#endif large_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); VRFY((ret != FAIL), "H5Pcreate() large_ds_dcpl_id succeeded"); @@ -1868,11 +1866,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_ds_dcpl_id, H5P_DEFAULT); VRFY((ret >= 0), "H5Dcreate2() large_dataset succeeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: small/large ds id = %d / %d.\n", - fcnName, mpi_rank, (int)small_dataset, + HDfprintf(stdout, + "%s:%d: small/large ds id = %d / %d.\n", + fcnName, mpi_rank, (int)small_dataset, (int)large_dataset); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -1906,10 +1904,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block[0] = block[1] = block[2] = 1; block[3] = block[4] = 10; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: settings for small data set initialization.\n", + HDfprintf(stdout, + "%s:%d: settings for small data set initialization.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -1947,10 +1945,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, start[0] = 0; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: added settings for main process.\n", + HDfprintf(stdout, + "%s:%d: added settings for main process.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -1992,23 +1990,23 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /* write the initial value of the small data set to file */ -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: writing init value of small ds to file.\n", fcnName, mpi_rank); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ - ret = H5Dwrite(small_dataset, - dset_type, - mem_small_ds_sid, + ret = H5Dwrite(small_dataset, + dset_type, + mem_small_ds_sid, file_small_ds_sid, - xfer_plist, + xfer_plist, small_ds_buf_0); VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded"); - /* read the small data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the small data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set and verifies it. */ ret = H5Dread(small_dataset, @@ -2061,10 +2059,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block[0] = (hsize_t)1; block[1] = block[2] = block[3] = block[4] = (hsize_t)10; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: settings for large data set initialization.\n", + HDfprintf(stdout, + "%s:%d: settings for large data set initialization.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -2097,15 +2095,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block); VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid, set) suceeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(mem_large_ds_sid)); - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(file_large_ds_sid)); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -2114,10 +2112,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, start[0] = (hsize_t)0; -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, - "%s:%d: added settings for main process.\n", + HDfprintf(stdout, + "%s:%d: added settings for main process.\n", fcnName, mpi_rank); HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n", fcnName, mpi_rank, (int)start[0], (int)start[1], @@ -2150,15 +2148,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, block); VRFY((ret>= 0), "H5Sselect_hyperslab(file_large_ds_sid, or) suceeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(mem_large_ds_sid)); - HDfprintf(stdout, + HDfprintf(stdout, "%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)H5Sget_select_npoints(file_large_ds_sid)); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -2183,19 +2181,19 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, start, stride, count, block); VRFY((ret != FAIL),"H5Sselect_hyperslab(file_large_ds_sid, and) succeeded"); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG - if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { rank = H5Sget_simple_extent_dims(mem_large_ds_sid, dims, max_dims); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: mem_large_ds_sid dims[%d] = %d %d %d %d %d\n", - fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], + fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], (int)dims[2], (int)dims[3], (int)dims[4]); rank = H5Sget_simple_extent_dims(file_large_ds_sid, dims, max_dims); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: file_large_ds_sid dims[%d] = %d %d %d %d %d\n", - fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], + fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1], (int)dims[2], (int)dims[3], (int)dims[4]); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ @@ -2208,26 +2206,26 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /* write the initial value of the large data set to file */ -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG - if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: writing init value of large ds to file.\n", fcnName, mpi_rank); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: large_dataset = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)large_dataset); - HDfprintf(stdout, + HDfprintf(stdout, "%s:%d: mem_large_ds_sid = %d, file_large_ds_sid = %d.\n", - fcnName, mpi_rank, + fcnName, mpi_rank, (int)mem_large_ds_sid, (int)file_large_ds_sid); } #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ - ret = H5Dwrite(large_dataset, - dset_type, - mem_large_ds_sid, + ret = H5Dwrite(large_dataset, + dset_type, + mem_large_ds_sid, file_large_ds_sid, - xfer_plist, + xfer_plist, large_ds_buf_0); if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr); @@ -2238,8 +2236,8 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc==MPI_SUCCESS), "Sync after large dataset writes"); - /* read the large data set back to verify that it contains the - * expected data. Note that each process reads in the entire + /* read the large data set back to verify that it contains the + * expected data. Note that each process reads in the entire * data set. */ ret = H5Dread(large_dataset, @@ -2278,13 +2276,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /***********************************/ - /* read a checkerboard selection of the process slice of the - * small on disk data set into the process slice of the large + /* read a checkerboard selection of the process slice of the + * small on disk data set into the process slice of the large * in memory data set, and verify the data read. */ small_sel_start[0] = (hsize_t)(mpi_rank + 1); - small_sel_start[1] = small_sel_start[2] = + small_sel_start[1] = small_sel_start[2] = small_sel_start[3] = small_sel_start[4] = 0; lower_dim_size_comp_test__select_checker_board(mpi_rank, @@ -2296,9 +2294,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, small_sel_start); expected_value = (uint32_t) - ((small_sel_start[0] * small_dims[1] * small_dims[2] * + ((small_sel_start[0] * small_dims[1] * small_dims[2] * small_dims[3] * small_dims[4]) + - (small_sel_start[1] * small_dims[2] * small_dims[3] * + (small_sel_start[1] * small_dims[2] * small_dims[3] * small_dims[4]) + (small_sel_start[2] * small_dims[3] * small_dims[4]) + (small_sel_start[3] * small_dims[4]) + @@ -2335,7 +2333,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, VRFY((ret >= 0), "H5Sread() slice from small ds succeeded."); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank); } @@ -2345,9 +2343,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, data_ok = TRUE; - start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] * + start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] * large_dims[3] * large_dims[4]) + - (large_sel_start[1] * large_dims[2] * large_dims[3] * + (large_sel_start[1] * large_dims[2] * large_dims[3] * large_dims[4]) + (large_sel_start[2] * large_dims[3] * large_dims[4]) + (large_sel_start[3] * large_dims[4]) + @@ -2409,13 +2407,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, - /* read a checkerboard selection of a slice of the process slice of - * the large on disk data set into the process slice of the small + /* read a checkerboard selection of a slice of the process slice of + * the large on disk data set into the process slice of the small * in memory data set, and verify the data read. */ small_sel_start[0] = (hsize_t)(mpi_rank + 1); - small_sel_start[1] = small_sel_start[2] = + small_sel_start[1] = small_sel_start[2] = small_sel_start[3] = small_sel_start[4] = 0; lower_dim_size_comp_test__select_checker_board(mpi_rank, @@ -2456,7 +2454,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, VRFY((ret >= 0), "H5Sread() slice from large ds succeeded."); -#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank); } @@ -2467,9 +2465,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, data_ok = TRUE; expected_value = (uint32_t) - ((large_sel_start[0] * large_dims[1] * large_dims[2] * + ((large_sel_start[0] * large_dims[1] * large_dims[2] * large_dims[3] * large_dims[4]) + - (large_sel_start[1] * large_dims[2] * large_dims[3] * + (large_sel_start[1] * large_dims[2] * large_dims[3] * large_dims[4]) + (large_sel_start[2] * large_dims[3] * large_dims[4]) + (large_sel_start[3] * large_dims[4]) + @@ -2522,7 +2520,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, #if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { - HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n", + HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n", fcnName, mpi_rank, (int)i, (int)(*ptr_1)); } #endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */ @@ -2590,15 +2588,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, /*------------------------------------------------------------------------- - * Function: lower_dim_size_comp_test() + * Function: lower_dim_size_comp_test() * - * Purpose: Test to see if an error in the computation of the size - * of the lower dimensions in H5S_obtain_datatype() has - * been corrected. + * Purpose: Test to see if an error in the computation of the size + * of the lower dimensions in H5S_obtain_datatype() has + * been corrected. * - * Return: void + * Return: void * - * Programmer: JRM -- 11/11/09 + * Programmer: JRM -- 11/11/09 * * Modifications: * @@ -2609,15 +2607,15 @@ void lower_dim_size_comp_test(void) { /* const char *fcnName = "lower_dim_size_comp_test()"; */ - int chunk_edge_size = 0; - int use_collective_io = 1; - hid_t dset_type = H5T_NATIVE_UINT; + int chunk_edge_size = 0; + int use_collective_io = 1; + hid_t dset_type = H5T_NATIVE_UINT; #if 0 HDsleep(60); #endif HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned)); - for ( use_collective_io = (hbool_t)0; - (int)use_collective_io <= 1; + for ( use_collective_io = (hbool_t)0; + (int)use_collective_io <= 1; (hbool_t)(use_collective_io++) ) { chunk_edge_size = 0; @@ -2638,37 +2636,37 @@ lower_dim_size_comp_test(void) /*------------------------------------------------------------------------- - * Function: link_chunk_collective_io_test() + * Function: link_chunk_collective_io_test() * - * Purpose: Test to verify that an error in MPI type management in - * H5D_link_chunk_collective_io() has been corrected. - * In this bug, we used to free MPI types regardless of - * whether they were basic or derived. + * Purpose: Test to verify that an error in MPI type management in + * H5D_link_chunk_collective_io() has been corrected. + * In this bug, we used to free MPI types regardless of + * whether they were basic or derived. * - * This test is based on a bug report kindly provided by - * Rob Latham of the MPICH team and ANL. + * This test is based on a bug report kindly provided by + * Rob Latham of the MPICH team and ANL. * - * The basic thrust of the test is to cause a process - * to participate in a collective I/O in which it: + * The basic thrust of the test is to cause a process + * to participate in a collective I/O in which it: * - * 1) Reads or writes exactly one chunk, + * 1) Reads or writes exactly one chunk, * - * 2) Has no in memory buffer for any other chunk. + * 2) Has no in memory buffer for any other chunk. * - * The test differers from Rob Latham's bug report in - * that is runs with an arbitrary number of proceeses, - * and uses a 1 dimensional dataset. + * The test differers from Rob Latham's bug report in + * that is runs with an arbitrary number of proceeses, + * and uses a 1 dimensional dataset. * - * Return: void + * Return: void * - * Programmer: JRM -- 12/16/09 + * Programmer: JRM -- 12/16/09 * * Modifications: * *------------------------------------------------------------------------- */ -#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16 +#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16 void link_chunk_collective_io_test(void) @@ -2676,8 +2674,8 @@ link_chunk_collective_io_test(void) /* const char *fcnName = "link_chunk_collective_io_test()"; */ const char *filename; hbool_t mis_match = FALSE; - int i; - int mrc; + int i; + int mrc; int mpi_rank; int mpi_size; MPI_Comm mpi_comm = MPI_COMM_WORLD; @@ -2767,8 +2765,8 @@ link_chunk_collective_io_test(void) for ( i = 0; i < LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE; i++ ) { local_data_written[i] = expected_value; - local_data_read[i] = 0.0; - expected_value += 1.0; + local_data_read[i] = 0.0; + expected_value += 1.0; } /* select the file and mem spaces */ @@ -2794,15 +2792,15 @@ link_chunk_collective_io_test(void) VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* write the data set */ - ret = H5Dwrite(dset_id, - H5T_NATIVE_DOUBLE, - write_mem_ds_sid, + ret = H5Dwrite(dset_id, + H5T_NATIVE_DOUBLE, + write_mem_ds_sid, file_ds_sid, - xfer_plist, + xfer_plist, local_data_written); VRFY((ret >= 0), "H5Dwrite() dataset initial write succeeded"); - + /* sync with the other processes before checking data */ mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc==MPI_SUCCESS), "Sync after dataset write"); @@ -2830,7 +2828,7 @@ link_chunk_collective_io_test(void) if ( diff >= 0.001 ) { mis_match = TRUE; - } + } } VRFY( (mis_match == FALSE), "dataset data good."); diff --git a/tools/test/perform/pio_perf.h b/tools/test/perform/pio_perf.h index b595c90..7605f20 100644 --- a/tools/test/perform/pio_perf.h +++ b/tools/test/perform/pio_perf.h @@ -15,7 +15,6 @@ #include "io_timer.h" #ifndef STANDALONE -#include "H5private.h" #include "h5test.h" #include "h5tools.h" #include "h5tools_utils.h" @@ -36,22 +35,22 @@ typedef enum iotype_ { } iotype; typedef struct parameters_ { - iotype io_type; /* The type of IO test to perform */ - int num_procs; /* Maximum number of processes to use */ - long num_files; /* Number of files to create */ - long num_dsets; /* Number of datasets to create */ - off_t num_bytes; /* Number of bytes in each dset */ + iotype io_type; /* The type of IO test to perform */ + int num_procs; /* Maximum number of processes to use */ + long num_files; /* Number of files to create */ + long num_dsets; /* Number of datasets to create */ + off_t num_bytes; /* Number of bytes in each dset */ int num_iters; /* Number of times to loop doing the IO */ - size_t buf_size; /* Buffer size */ - size_t blk_size; /* Block size */ + size_t buf_size; /* Buffer size */ + size_t blk_size; /* Block size */ unsigned interleaved; /* Interleaved vs. contiguous blocks */ unsigned collective; /* Collective vs. independent I/O */ unsigned dim2d; /* 1D vs. 2D */ - hsize_t h5_align; /* HDF5 object alignment */ - hsize_t h5_thresh; /* HDF5 object alignment threshold */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int verify; /* Verify data correctness */ + hsize_t h5_align; /* HDF5 object alignment */ + hsize_t h5_thresh; /* HDF5 object alignment threshold */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int verify; /* Verify data correctness */ } parameters; typedef struct results_ { diff --git a/tools/test/perform/sio_perf.h b/tools/test/perform/sio_perf.h index 366b791..83caf54 100644 --- a/tools/test/perform/sio_perf.h +++ b/tools/test/perform/sio_perf.h @@ -15,7 +15,6 @@ #include "io_timer.h" #ifndef STANDALONE -#include "H5private.h" #include "h5test.h" #include "h5tools.h" #include "h5tools_utils.h" -- cgit v0.12 From 41d541f1c21389702014ccaf8a1546b9673d5981 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Feb 2018 11:14:26 -0600 Subject: More includes cleanup --- test/dsets.c | 155 +++--- test/objcopy.c | 1623 +++++++++++++++++++++++++++---------------------------- test/tarray.c | 40 +- test/tconfig.c | 57 +- test/tfile.c | 827 ++++++++++++++-------------- test/tgenprop.c | 154 +++--- test/tid.c | 273 +++++----- test/titerate.c | 44 +- test/tmisc.c | 103 ++-- test/trefer.c | 178 +++--- test/ttime.c | 14 +- test/tvlstr.c | 58 +- test/tvltypes.c | 137 +++-- 13 files changed, 1823 insertions(+), 1840 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 09f553e..17cf23c 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -24,7 +24,6 @@ #define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -316,7 +315,7 @@ const H5Z_class2_t H5Z_COUNT[1] = {{ filter_count, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: filter_count * @@ -341,7 +340,7 @@ filter_count(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, return nbytes; } - + /*------------------------------------------------------------------------- * Function: test_create * @@ -488,7 +487,7 @@ test_create(hid_t file) return -1; } - + /*------------------------------------------------------------------------- * Function: test_simple_io * @@ -624,7 +623,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_userblock_offset * @@ -730,7 +729,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_compact_io * @@ -823,7 +822,7 @@ test_compact_io(hid_t fapl) if(H5Fclose(file) < 0) TEST_ERROR /************************************** - * Additional test for version bounds * + * Additional test for version bounds * **************************************/ /* Create a copy of file access property list */ @@ -923,7 +922,7 @@ test_compact_io(hid_t fapl) return -1; } - + /*------------------------------------------------------------------------- * Function: test_max_compact * @@ -1076,7 +1075,7 @@ error: return -1; } /* end test_max_compact() */ - + /*------------------------------------------------------------------------- * Function: test_layout_extend * @@ -1199,7 +1198,7 @@ error: return -1; } /* end test_layout_extend() */ - + /*------------------------------------------------------------------------- * Function: test_conv_buffer * @@ -1338,7 +1337,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_tconv * @@ -1433,7 +1432,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: can_apply_bogus * @@ -1455,7 +1454,7 @@ can_apply_bogus(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSE return -1; } - + /*------------------------------------------------------------------------- * Function: filter_bogus * @@ -1473,7 +1472,7 @@ filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, return nbytes; } - + /*------------------------------------------------------------------------- * Function: set_local_bogus2 * @@ -1519,7 +1518,7 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) return(SUCCEED); } /* end set_local_bogus2() */ - + /*------------------------------------------------------------------------- * Function: filter_bogus2 * @@ -1573,7 +1572,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts, return(nbytes); } - + /*------------------------------------------------------------------------- * Function: filter_bogus3 * @@ -1602,7 +1601,7 @@ const H5Z_class2_t H5Z_CORRUPT[1] = {{ filter_corrupt, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: filter_corrupt * @@ -1661,7 +1660,7 @@ error: return ret_value; } /* end filter_corrupt() */ - + /*------------------------------------------------------------------------- * Function: filter_cb_cont * @@ -1680,7 +1679,7 @@ filter_cb_cont(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU return H5Z_CB_FAIL; } - + /*------------------------------------------------------------------------- * Function: filter_cb_fail * @@ -1699,7 +1698,7 @@ filter_cb_fail(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU return H5Z_CB_CONT; } - + /*------------------------------------------------------------------------- * Function: test_filter_internal * @@ -2510,7 +2509,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_missing_filter * @@ -2838,7 +2837,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_int * @@ -2956,7 +2955,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_float * @@ -3074,7 +3073,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_double * @@ -3206,7 +3205,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_array * @@ -3333,7 +3332,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound * @@ -3550,7 +3549,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound_2 * @@ -3895,7 +3894,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound_3 * @@ -4075,7 +4074,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_int_size * @@ -4242,7 +4241,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_flt_size * @@ -4438,7 +4437,7 @@ test_nbit_flt_size(hid_t file) error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_int * @@ -4550,7 +4549,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_int_2 * @@ -4678,7 +4677,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_float * @@ -4791,7 +4790,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_float_2 * @@ -4920,7 +4919,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_double * @@ -5033,7 +5032,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_double_2 * @@ -5163,7 +5162,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_multiopen * @@ -5230,7 +5229,7 @@ test_multiopen (hid_t file) return -1; } - + /*------------------------------------------------------------------------- * Function: test_types * @@ -5337,7 +5336,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_can_apply * @@ -5518,7 +5517,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST2[1] = {{ filter_bogus3, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_can_apply2 * @@ -5667,7 +5666,7 @@ error: } /* end test_can_apply2() */ - + /*------------------------------------------------------------------------- * Function: test_can_apply_szip * @@ -5872,7 +5871,7 @@ const H5Z_class2_t H5Z_SET_LOCAL_TEST[1] = {{ filter_bogus2, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_set_local * @@ -6137,7 +6136,7 @@ error: return -1; } /* end test_set_local() */ - + /*------------------------------------------------------------------------- * Function: test_compare_dcpl * @@ -6222,7 +6221,7 @@ error: return -1; } /* end test_compare_dcpl() */ - + /*------------------------------------------------------------------------- * Function: test_copy_dcpl * @@ -6354,7 +6353,7 @@ error: return -1; } /* end test_copy_dcpl() */ - + /*------------------------------------------------------------------------- * Function: test_filter_delete * @@ -6481,7 +6480,7 @@ error: } /* end test_filter_delete() */ - + /*------------------------------------------------------------------------- * Function: auxread_fdata * @@ -6565,7 +6564,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_filters_endianess * @@ -6635,7 +6634,7 @@ error: return -1; } /* end test_filters_endianess() */ - + /*------------------------------------------------------------------------- * Function: test_zero_dims * @@ -6799,7 +6798,7 @@ error: return -1; } /* end test_zero_dims() */ - + /*------------------------------------------------------------------------- * Function: test_missing_chunk * @@ -6991,7 +6990,7 @@ error: return -1; } /* end test_missing_chunk() */ - + /*------------------------------------------------------------------------- * Function: test_random_chunks_real * @@ -7359,7 +7358,7 @@ error: return -1; } /* end test_random_chunks_real() */ - + /*------------------------------------------------------------------------- * Function: test_random_chunks * @@ -7419,7 +7418,7 @@ const H5Z_class1_t H5Z_DEPREC[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_deprec * @@ -7610,7 +7609,7 @@ test_deprec(hid_t file) } /* end test_deprec() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: test_huge_chunks * @@ -7722,7 +7721,7 @@ error: return -1; } /* end test_huge_chunks() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_cache * @@ -7930,7 +7929,7 @@ error: return -1; } /* end test_chunk_cache() */ - + /*------------------------------------------------------------------------- * Function: test_big_chunks_bypass_cache * @@ -8223,7 +8222,7 @@ error: return -1; } /* end test_big_chunks_bypass_cache() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_fast * @@ -8570,7 +8569,7 @@ error: return -1; } /* end test_chunk_fast() */ - + /*------------------------------------------------------------------------- * Function: test_reopen_chunk_fast * @@ -8693,7 +8692,7 @@ error: return -1; } /* end test_reopen_chunk_fast() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_fast_bug1 * @@ -8815,7 +8814,7 @@ const H5Z_class2_t H5Z_EXPAND[1] = {{ /* Global "expansion factor" for filter_expand() routine */ static size_t filter_expand_factor_g = 0; - + /*------------------------------------------------------------------------- * Function: filter_expand * @@ -8864,7 +8863,7 @@ filter_expand(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, return ret_value; } /* end filter_expand() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_expand * @@ -9260,7 +9259,7 @@ error: return -1; } /* end test_chunk_expand() */ - + /*------------------------------------------------------------------------- * Function: test_fixed_array * @@ -9679,7 +9678,7 @@ error: return -1; } /* end test_fixed_array() */ - + /*------------------------------------------------------------------------- * Function: test_single_chunk * @@ -9943,7 +9942,7 @@ error: return -1; } /* end test_single_chunk() */ - + /*------------------------------------------------------------------------- * * test_idx_compatible(): @@ -10156,7 +10155,7 @@ error: return -1; } /* test_unfiltered_edge_chunks */ - + /*------------------------------------------------------------------------- * Function: test_large_chunk_shrink * @@ -10271,7 +10270,7 @@ error: return -1; } /* end test_large_chunk_shrink() */ - + /*------------------------------------------------------------------------- * Function: test_zero_dim_dset * @@ -10364,7 +10363,7 @@ error: return -1; } /* end test_zero_dim_dset() */ - + /*------------------------------------------------------------------------- * Function: test_swmr_non_latest * @@ -10613,7 +10612,7 @@ error: return -1; } /* test_swmr_non_latest() */ - + /*------------------------------------------------------------------------- * Function: test_earray_hdr_fd * @@ -10733,7 +10732,7 @@ error: return -1; } /* test_earray_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_farray_hdr_fd * @@ -10853,7 +10852,7 @@ error: return -1; } /* test_farray_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_bt2_hdr_fd * @@ -10973,7 +10972,7 @@ error: return -1; } /* test_bt2_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_storage_size * @@ -11367,7 +11366,7 @@ error: return -1; } /* end test_storage_size() */ - + /*------------------------------------------------------------------------- * Function: test_power2up * @@ -11458,7 +11457,7 @@ error: return -1; } /* end test_power2up() */ - + /*------------------------------------------------------------------------- * Function: test_scatter * @@ -11776,7 +11775,7 @@ error: return -1; } /* end test_scatter() */ - + /*------------------------------------------------------------------------- * Function: test_gather * @@ -12138,7 +12137,7 @@ error: return -1; } /* end test_gather() */ - + /*------------------------------------------------------------------------- * Function: test_scatter_error * @@ -12341,7 +12340,7 @@ error: return -1; } /* end test_scatter_error() */ - + /*------------------------------------------------------------------------- * Function: test_gather_error * @@ -12868,7 +12867,7 @@ error: return -1; } /* test_compact_open_close_dirty() */ - + /*------------------------------------------------------------------------- * Function: test_versionbounds * @@ -12940,7 +12939,7 @@ test_versionbounds() /* Loop through all the combinations of low/high library format bounds */ /* Create a source file and a dataset in it. Create a virtual file and - virtual dataset. Creation of virtual dataset should only succeed in + virtual dataset. Creation of virtual dataset should only succeed in H5F_LIBVER_V110 */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { @@ -13021,7 +13020,7 @@ test_versionbounds() return -1; } /* test_versionbounds() */ - + /*------------------------------------------------------------------------- * Function: main * diff --git a/test/objcopy.c b/test/objcopy.c index c4bcbf3..5d9d426 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12,13 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Peter X. Cao - * May 01, 2005 + * Programmer: Peter X. Cao + * May 01, 2005 * - * Purpose: Test H5Ocopy(). + * Purpose: Test H5Ocopy(). */ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -34,33 +33,33 @@ * This file needs to access private information from the H5S package. * This file also needs to access the dataspace testing code. */ -#define H5S_FRIEND /*suppress error about including H5Spkg */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ #define H5S_TESTING -#include "H5Spkg.h" /* Dataspaces */ +#include "H5Spkg.h" /* Dataspaces */ /* * This file needs to access private information from the H5P package. * This file also needs to access the property list testing code. */ -#define H5P_FRIEND /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ #define H5P_TESTING -#include "H5Ppkg.h" /* Property Lists */ +#include "H5Ppkg.h" /* Property Lists */ /* * This file needs to access private information from the H5D package. * This file also needs to access the dataset testing code. */ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING -#include "H5Dpkg.h" /* Datasets */ +#include "H5Dpkg.h" /* Datasets */ /* * This file needs to access private information from the H5O package. * This file also needs to access the dataspace testing code. */ -#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ #define H5O_TESTING -#include "H5Opkg.h" /* Object header */ +#include "H5Opkg.h" /* Object header */ const char *FILENAME[] = { @@ -83,77 +82,77 @@ const char *FILENAME[] = { #define CONFIG_DENSE 16 #define MAX_CONFIGURATION 31 -#define FILE_EXT "objcopy_ext.dat" +#define FILE_EXT "objcopy_ext.dat" /* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory * for version 1.4(after 1.4.3). To get this data file, simply compile * gen_old_fill.c with HDF5 library (before v1.5) and run it. */ #define FILE_OLD_LAYOUT "fill_old.h5" -#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" -#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" -#define NAME_DATATYPE_VL "vlen of int" -#define NAME_DATATYPE_VL_VL "vlen of vlen of int" -#define NAME_DATASET_SIMPLE "dataset_simple" +#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" +#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" +#define NAME_DATATYPE_VL "vlen of int" +#define NAME_DATATYPE_VL_VL "vlen of vlen of int" +#define NAME_DATASET_SIMPLE "dataset_simple" #define NAME_DATASET_SIMPLE2 "dataset_simple_copy" #define NAME_DATASET_SIMPLE3 "dataset_simple_another_copy" -#define NAME_DATASET_COMPOUND "dataset_compound" -#define NAME_DATASET_CHUNKED "dataset_chunked" -#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single" -#define NAME_DATASET_CHUNKED2 "dataset_chunked2" -#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single" -#define NAME_DATASET_CHUNKED3 "dataset_chunked3" -#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single" -#define NAME_DATASET_CHUNKED4 "dataset_chunked4" -#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single" -#define NAME_DATASET_COMPACT "dataset_compact" -#define NAME_DATASET_EXTERNAL "dataset_ext" -#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" -#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" -#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" -#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" -#define NAME_DATASET_VL "dataset_vl" -#define NAME_DATASET_VL2 "dataset_vl2" -#define NAME_DATASET_VL_VL "dataset_vl_vl" -#define NAME_DATASET_VL_VL2 "dataset_vl_vl2" -#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" -#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" -#define NAME_GROUP_UNCOPIED "/uncopied" -#define NAME_GROUP_EMPTY "/empty" -#define NAME_GROUP_TOP "/g0" +#define NAME_DATASET_COMPOUND "dataset_compound" +#define NAME_DATASET_CHUNKED "dataset_chunked" +#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single" +#define NAME_DATASET_CHUNKED2 "dataset_chunked2" +#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single" +#define NAME_DATASET_CHUNKED3 "dataset_chunked3" +#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single" +#define NAME_DATASET_CHUNKED4 "dataset_chunked4" +#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single" +#define NAME_DATASET_COMPACT "dataset_compact" +#define NAME_DATASET_EXTERNAL "dataset_ext" +#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" +#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" +#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" +#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" +#define NAME_DATASET_VL "dataset_vl" +#define NAME_DATASET_VL2 "dataset_vl2" +#define NAME_DATASET_VL_VL "dataset_vl_vl" +#define NAME_DATASET_VL_VL2 "dataset_vl_vl2" +#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" +#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" +#define NAME_GROUP_UNCOPIED "/uncopied" +#define NAME_GROUP_EMPTY "/empty" +#define NAME_GROUP_TOP "/g0" #define NAME_GROUP_TOP2 "/g1" #define NAME_GROUP_TOP3 "/g2" #define NAME_GROUP_TOP4 "/g3" -#define NAME_GROUP_SUB "/g0/g00" -#define NAME_GROUP_SUB_2 "/g0/g01" -#define NAME_GROUP_SUB_SUB "/g0/g00/g000" -#define NAME_GROUP_SUB_SUB2 "g000" -#define NAME_GROUP_DATASET "/g0/dataset_simple" -#define NAME_GROUP_LINK "/g_links" -#define NAME_GROUP_LINK2 "/g_links2" -#define NAME_GROUP_LOOP "g_loop" -#define NAME_GROUP_LOOP2 "g_loop2" -#define NAME_GROUP_LOOP3 "g_loop3" -#define NAME_GROUP_REF "ref_grp" -#define NAME_LINK_DATASET "/g_links/dataset_simple" -#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" -#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" -#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" -#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" +#define NAME_GROUP_SUB "/g0/g00" +#define NAME_GROUP_SUB_2 "/g0/g01" +#define NAME_GROUP_SUB_SUB "/g0/g00/g000" +#define NAME_GROUP_SUB_SUB2 "g000" +#define NAME_GROUP_DATASET "/g0/dataset_simple" +#define NAME_GROUP_LINK "/g_links" +#define NAME_GROUP_LINK2 "/g_links2" +#define NAME_GROUP_LOOP "g_loop" +#define NAME_GROUP_LOOP2 "g_loop2" +#define NAME_GROUP_LOOP3 "g_loop3" +#define NAME_GROUP_REF "ref_grp" +#define NAME_LINK_DATASET "/g_links/dataset_simple" +#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" +#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" +#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" +#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" #define NAME_LINK_EXTERN2 "/g_links2/external_link_to_dataset_simple" -#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" -#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere" -#define NAME_OLD_FORMAT "/dset1" +#define NAME_OLD_FORMAT "/dset1" #define NAME_DSET_NULL "DSET_NULL" #define NAME_BUF_SIZE 1024 #define ATTR_NAME_LEN 80 #define DIM_SIZE_1 12 #define DIM_SIZE_2 6 -#define MAX_DIM_SIZE_1 100 -#define MAX_DIM_SIZE_2 80 +#define MAX_DIM_SIZE_1 100 +#define MAX_DIM_SIZE_2 80 #define CHUNK_SIZE_1 5 /* Not an even fraction of dimension sizes, so we test copying partial chunks */ #define CHUNK_SIZE_2 5 #define NUM_SUB_GROUPS 20 @@ -180,7 +179,7 @@ static int compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf); static int compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags); -static int +static int compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type); static int @@ -190,7 +189,7 @@ attach_attribute_compound_vlstr(hid_t loc_id); static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2); - + /*------------------------------------------------------------------------- * Function: addr_insert * @@ -224,7 +223,7 @@ addr_insert(H5O_info_t *oi) idtab_g.obj[n] = oi->addr; } /* end addr_insert() */ - + /*------------------------------------------------------------------------- * Function: addr_lookup * @@ -253,7 +252,7 @@ addr_lookup(H5O_info_t *oi) return FALSE; } /* end addr_lookup() */ - + /*------------------------------------------------------------------------- * Function: addr_reset * @@ -275,7 +274,7 @@ addr_reset(void) idtab_g.nalloc = idtab_g.nobjs = 0; } /* end addr_reset() */ - + /*------------------------------------------------------------------------- * Function: attach_ref_attr * @@ -336,7 +335,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_reg_ref_attr * @@ -413,7 +412,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: create_reg_ref_dataset * @@ -508,7 +507,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_attribute_vl * @@ -570,13 +569,13 @@ done: } /* end of attach_attribute_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_attach_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to the object to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Peter Cao * Friday, September 30, 2005 @@ -644,13 +643,13 @@ done: return ret_value; } - + /*------------------------------------------------------------------------- * Function: test_copy_attach_paired_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to a pair of objects to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, November 1, 2005 @@ -713,7 +712,7 @@ done: return -1; } /* end test_copy_attach_paired_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_attribute * @@ -844,18 +843,18 @@ error: return FALSE; } /* end compare_attribute() */ - + /*------------------------------------------------------------------------- * Function: compare_std_attributes * * Purpose: Compare "standard" attributes on two objects to check that they are equal * - * Return: TRUE if objects have same attributes/FALSE if they are different + * Return: TRUE if objects have same attributes/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 * - * Note: This isn't very general, the attributes are assumed to be + * Note: This isn't very general, the attributes are assumed to be * those written in test_copy_attach_attributes(). * * Modifier: Peter Cao @@ -916,19 +915,19 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid) error: H5E_BEGIN_TRY { - H5Aclose(aid2); - H5Aclose(aid); + H5Aclose(aid2); + H5Aclose(aid); } H5E_END_TRY; return FALSE; } /* end compare_std_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_data * * Purpose: Compare two buffers of data to check that they are equal * - * Return: TRUE if buffer are equal/FALSE if they are different + * Return: TRUE if buffer are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, November 21, 2005 @@ -1189,13 +1188,13 @@ error: return FALSE; } /* end compare_data() */ - + /*------------------------------------------------------------------------- * Function: compare_datasets * * Purpose: Compare two datasets to check that they are equal * - * Return: TRUE if datasets are equal/FALSE if they are different + * Return: TRUE if datasets are equal/FALSE if they are different * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -1352,23 +1351,23 @@ error: HDfree(rbuf); if(rbuf2) HDfree(rbuf2); - H5Pclose(dcpl2); - H5Pclose(dcpl); - H5Sclose(sid2); - H5Sclose(sid); - H5Tclose(tid2); - H5Tclose(tid); + H5Pclose(dcpl2); + H5Pclose(dcpl); + H5Sclose(sid2); + H5Sclose(sid); + H5Tclose(tid2); + H5Tclose(tid); } H5E_END_TRY; return FALSE; } /* end compare_datasets() */ - + /*------------------------------------------------------------------------- * Function: compare_groups * * Purpose: Compare two groups to check that they are "equal" * - * Return: TRUE if group are equal/FALSE if they are different + * Return: TRUE if group are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 @@ -1518,48 +1517,48 @@ error: return FALSE; } /* end compare_groups() */ - + /*------------------------------------------------------------------------- * Function: compare_idx_type * * Purpose: If using new format, the index array type should be NEW_TYPE - * If not, the index array type should be OLD_TYPE + * If not, the index array type should be OLD_TYPE * - * Return: TRUE if the index type retrieved for the dataset DID is - * as expected - * FALSE if not + * Return: TRUE if the index type retrieved for the dataset DID is + * as expected + * FALSE if not * * Programmer: Vailin Choi; August 2009 * *------------------------------------------------------------------------- */ -static int +static int compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type) { H5D_chunk_index_t idx_type; /* Dataset chunk index type */ H5F_libver_t low; /* File format low bound */ /* Get the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) - FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(did, &idx_type) < 0) + FAIL_STACK_ERROR /* Check if we are using the latest version of the format */ - if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) - FAIL_STACK_ERROR + if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) + FAIL_STACK_ERROR /* Verify index type */ if(low == H5F_LIBVER_LATEST) { - if(idx_type != new_type) - TEST_ERROR - } else if(idx_type != old_type) - TEST_ERROR + if(idx_type != new_type) + TEST_ERROR + } else if(idx_type != old_type) + TEST_ERROR return TRUE; error: return FALSE; } /* compare_idx_type() */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype * @@ -1580,8 +1579,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named datatype"); @@ -1646,15 +1645,15 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl * @@ -1673,8 +1672,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named vlen datatype"); @@ -1739,15 +1738,15 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl_vl * @@ -1766,8 +1765,8 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named nested vlen datatype"); @@ -1838,15 +1837,15 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_attr_self * @@ -1989,7 +1988,7 @@ error: return 1; } /* end test_copy_named_datatype_attr_self */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple * @@ -2098,16 +2097,16 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_versionbounds * @@ -2274,18 +2273,18 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) error: H5E_BEGIN_TRY { - H5Dclose(did_dst); - H5Dclose(did_src); - H5Sclose(sid); - H5Pclose(fapl_dst); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did_dst); + H5Dclose(did_src); + H5Sclose(sid); + H5Pclose(fapl_dst); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_versionbounds */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_samefile * @@ -2383,22 +2382,22 @@ test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_samefile */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_empty * * Purpose: Create a simple dataset in SRC file and copy it to DST file * (Note: dataset has no data) * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -2501,16 +2500,16 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compound * @@ -2632,17 +2631,17 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compound */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked * @@ -2724,10 +2723,10 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 1-D dataset: chunked, non-filterd, with data - * dims=max dims=chunk dims - * H5D_ALLOC_TIME_INC (default) + * dims=max dims=chunk dims + * H5D_ALLOC_TIME_INC (default) */ /* create 1-D dataspace */ if((sid = H5Screate_simple(1, dim1d, dim1d)) < 0) TEST_ERROR @@ -2799,9 +2798,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims, - * H5D_ALLOC_TIME_INC (default) + * H5D_ALLOC_TIME_INC (default) */ /* create 2-D dataspace */ @@ -2823,9 +2822,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims, - * H5D_ALLOC_TIME_EARLY + * H5D_ALLOC_TIME_EARLY */ if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR @@ -2847,9 +2846,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=max dims=chunk dims, - * H5D_ALLOC_TIME_LATE + * H5D_ALLOC_TIME_LATE */ /* create 2-D dataspace */ if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR @@ -2908,7 +2907,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR @@ -2928,7 +2927,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR @@ -2947,7 +2946,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -2967,7 +2966,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -2986,7 +2985,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3005,7 +3004,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3024,7 +3023,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3046,17 +3045,17 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_empty * @@ -3124,9 +3123,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 1-D dataset: chunked, empty, non-filtered, - * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) + * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) */ /* Set 1-D dataspace dimensions */ @@ -3194,9 +3193,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, empty, non-filtered, - * dims=chunk dims, H5D_ALLOC_TIME_INC (default) + * dims=chunk dims, H5D_ALLOC_TIME_INC (default) */ /* Set 2-D dataspace dimensions */ @@ -3219,9 +3218,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, empty, non-filtered, dims=chunk dims - * H5D_ALLOC_TIME_EARLY + * H5D_ALLOC_TIME_EARLY */ /* Set allocation time to early */ if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR @@ -3241,9 +3240,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* - * create 2-D dataset: chunked, empty, non-filtered, - * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE + /* + * create 2-D dataset: chunked, empty, non-filtered, + * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE */ /* Set 2-D dataspace dimensions */ @@ -3305,7 +3304,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3324,7 +3323,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3343,7 +3342,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3362,7 +3361,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3382,7 +3381,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3402,7 +3401,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3421,7 +3420,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3443,17 +3442,17 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_sparse * @@ -3677,7 +3676,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3697,7 +3696,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_BT2, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3717,7 +3716,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3737,7 +3736,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3760,17 +3759,17 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_sparse */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed * @@ -3867,9 +3866,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) + * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR @@ -3891,9 +3890,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=chunk dims, H5D_ALLOC_TIME_EARLY + * dims=chunk dims, H5D_ALLOC_TIME_EARLY */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR @@ -3919,9 +3918,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=chunk dims, H5D_ALLOC_TIME_LATE + * dims=chunk dims, H5D_ALLOC_TIME_LATE */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR @@ -3986,7 +3985,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4005,7 +4004,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4023,7 +4022,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4041,7 +4040,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4059,7 +4058,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED4_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4083,24 +4082,24 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid #ifdef H5_HAVE_FILTER_DEFLATE error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_no_edge_filt * * Purpose: Create a compressed, chunked dataset in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -4251,13 +4250,13 @@ error: #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_no_edge_filt */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact * * Purpose: Create a compact dataset in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -4377,17 +4376,17 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_external * @@ -4504,17 +4503,17 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_external */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype * @@ -4625,17 +4624,17 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype_hier * @@ -4762,18 +4761,18 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype_hier */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype_hier_outside * @@ -4901,18 +4900,18 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype_hier_outside */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_multi_ohdr_chunks * @@ -5023,7 +5022,7 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa /* close the second dataset */ if(H5Dclose(did2) < 0) TEST_ERROR - } else + } else /* open the group for copy */ if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -5050,18 +5049,18 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_multi_ohdr_chunks */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_attr_named_dtype * @@ -5191,19 +5190,19 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_attr_named_dtype */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_vl * @@ -5327,19 +5326,19 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_vl * @@ -5510,20 +5509,20 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_vl * @@ -5655,19 +5654,19 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_attribute_vl * @@ -5773,11 +5772,11 @@ error: H5E_BEGIN_TRY { H5Aclose(aid2); H5Aclose(aid); - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_empty */ @@ -5796,18 +5795,18 @@ error: static int attach_attribute_compound_vlstr(hid_t loc_id) { - hid_t aid = -1; /* Attribute ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t vl_str_tid = -1; /* Variable length string datatype ID */ - hid_t cmpd_tid = -1; /* Compound datatype ID */ - hsize_t dim1 = 1; /* Dimension size */ - typedef struct { /* Compound structure for the attribute */ + hid_t aid = -1; /* Attribute ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t vl_str_tid = -1; /* Variable length string datatype ID */ + hid_t cmpd_tid = -1; /* Compound datatype ID */ + hsize_t dim1 = 1; /* Dimension size */ + typedef struct { /* Compound structure for the attribute */ int i; char *v; } s1; s1 buf; /* Buffer */ - int ret_value = -1; /* Return value */ + int ret_value = -1; /* Return value */ /* Create dataspace */ if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 ) @@ -5861,7 +5860,7 @@ done: * Function: compare_attribute_compound_vlstr * * Purpose: Compare data of the attributes attached to the two objects. - * The attribute is a compound datatype with a variable length string. + * The attribute is a compound datatype with a variable length string. * * Return: Non-negative on success/Negative on failure * @@ -5872,46 +5871,46 @@ done: static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2) { - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - typedef struct { /* Compound structure for the attribute */ - int i; - char *v; + hid_t aid = -1, aid2 = -1; /* Attribute IDs */ + hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + typedef struct { /* Compound structure for the attribute */ + int i; + char *v; } s1; - s1 rbuf; /* Buffer for data read */ - s1 rbuf2; /* Buffer for data read */ - + s1 rbuf; /* Buffer for data read */ + s1 rbuf2; /* Buffer for data read */ + /* Open the attributes attached to the objects */ if((aid = H5Aopen_by_idx(loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if((aid2 = H5Aopen_by_idx(loc2, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Get the attributes' datatypes */ - if((tid = H5Aget_type(aid)) < 0) - FAIL_STACK_ERROR + if((tid = H5Aget_type(aid)) < 0) + FAIL_STACK_ERROR if((tid2 = H5Aget_type(aid2)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Read the attributes */ if(H5Aread(aid, tid, &rbuf) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Aread(aid2, tid2, &rbuf2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Compare the attributes' data */ if(rbuf.i != rbuf2.i) - FAIL_STACK_ERROR - if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v)) - FAIL_STACK_ERROR - if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v))) - FAIL_STACK_ERROR + FAIL_STACK_ERROR + if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v)) + FAIL_STACK_ERROR + if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v))) + FAIL_STACK_ERROR /* Close the attributes */ if(H5Aclose(aid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Aclose(aid2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR return TRUE; error: @@ -5929,15 +5928,15 @@ error: * Function: test_copy_attribute_compound_vlstr * * Purpose: Create a simple dataset and a group in SRC file. - * Both has an attribute with a compound datatype consisting + * Both has an attribute with a compound datatype consisting * of a variable length string * Copy the dataset and the group to DST file - * This is for HDFFV-7991 + * This is for HDFFV-7991 * * Return: Success: 0 * Failure: number of errors * - * Programmer: + * Programmer: * *------------------------------------------------------------------------- */ @@ -5948,10 +5947,10 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap hid_t sid = -1; /* Dataspace ID */ hid_t did = -1, did2 = -1; /* Dataset IDs */ hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ hsize_t dim2d[2]; /* Dataset dimensions */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ TESTING("H5Ocopy(): attribute with compound datatype consisting of variable length string"); @@ -5964,7 +5963,7 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* set dataspace dimensions */ dim2d[0] = DIM_SIZE_1; @@ -5972,103 +5971,103 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create 2D dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create 2D int dataset at SRC file */ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close dataspace */ if(H5Sclose(sid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* attach an attribute to the dataset */ if(attach_attribute_compound_vlstr(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the dataset */ if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create a group */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* attach attribute to the group */ if(attach_attribute_compound_vlstr(gid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the group */ if(H5Gclose(gid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the SRC file */ if(H5Fclose(fid_src) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* copy the dataset from SRC to DST */ if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the src dataset */ if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* compare the data of the attributes attached to the two datasets */ if(compare_attribute_compound_vlstr(did, did2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the datasets */ if(H5Dclose(did2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Copy the group */ if(H5Ocopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Open the src group */ if((gid = H5Gopen2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Open the destination group */ if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* compare the data of the attributes attached to the two groups */ if(compare_attribute_compound_vlstr(gid, gid2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the groups */ - if(H5Gclose(gid) < 0) - FAIL_STACK_ERROR - if(H5Gclose(gid2) < 0) - FAIL_STACK_ERROR + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if(H5Gclose(gid2) < 0) + FAIL_STACK_ERROR /* close the SRC file */ if(H5Fclose(fid_src) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the DST file */ if(H5Fclose(fid_dst) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR PASSED(); return 0; @@ -6077,18 +6076,18 @@ error: H5E_BEGIN_TRY { H5Aclose(aid2); H5Aclose(aid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Gclose(gid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Gclose(gid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_attribute_compound_vlstr() */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_vl * @@ -6232,21 +6231,21 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, #ifdef H5_HAVE_FILTER_DEFLATE error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_empty * @@ -6333,15 +6332,15 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_root_group * @@ -6474,7 +6473,7 @@ error: return 1; } /* end test_copy_root_group */ - + /*------------------------------------------------------------------------- * Function: test_copy_group * @@ -6597,18 +6596,18 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_deep * @@ -6739,18 +6738,18 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_deep */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_loop * @@ -6850,17 +6849,17 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f error: H5E_BEGIN_TRY { - H5Gclose(gid_sub2); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid_sub2); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_loop */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_wide_loop * @@ -6979,17 +6978,17 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Gclose(gid_sub2); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid_sub2); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_wide_loop */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_links * @@ -7237,20 +7236,20 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_ext); - H5Fclose(fid_dst); - H5Fclose(fid_src); - H5Pclose(plid); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_ext); + H5Fclose(fid_dst); + H5Fclose(fid_src); + H5Pclose(plid); } H5E_END_TRY; return 1; } /* end test_copy_group_links */ - + /*------------------------------------------------------------------------- * Function: test_copy_soft_link * @@ -7376,17 +7375,17 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_soft_link */ - + /*------------------------------------------------------------------------- * Function: test_copy_ext_link * @@ -7510,17 +7509,17 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_ext_link */ - + /*------------------------------------------------------------------------- * Function: test_copy_exist * @@ -7620,15 +7619,15 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_exist */ - + /*------------------------------------------------------------------------- * Function: test_copy_path * @@ -7754,17 +7753,17 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_path */ - + /*------------------------------------------------------------------------- * Function: test_copy_same_file_named_datatype * @@ -7826,21 +7825,21 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end test_copy_same_file_named_datatype */ - + /*------------------------------------------------------------------------- * Function: test_copy_old_layout * * Purpose: Copy dataset that uses the "old" layout version (pre version 3) * format. * - * Note: This test uses the "fill_old.h5" file for convenience, since it + * Note: This test uses the "fill_old.h5" file for convenience, since it * has a dataset with the old layout format. * * Return: Success: 0 @@ -7916,15 +7915,15 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_old_layout */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_named_vl * @@ -8065,21 +8064,21 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_named_vl * @@ -8212,27 +8211,27 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_named_vl * * Purpose: Create a dataset that uses a named variable length datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -8379,21 +8378,21 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_named_vl * @@ -8536,21 +8535,21 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_ error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compressed_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_vl_vl * @@ -8699,28 +8698,28 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_vl_vl * * Purpose: Create a compact dataset w/nested VLEN datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -8872,21 +8871,21 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_vl_vl * @@ -8905,7 +8904,7 @@ static int test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2=-1; /* Datatype ID */ + hid_t tid = -1, tid2=-1; /* Datatype ID */ hid_t sid = -1; /* Dataspace ID */ hid_t pid = -1; /* Dataset creation property list ID */ hid_t did = -1, did2 = -1; /* Dataset IDs */ @@ -9073,28 +9072,28 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_vl_vl * * Purpose: Create a dataset that uses a named variable length datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -9196,7 +9195,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR } - + /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -9249,16 +9248,16 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compressed_vl_vl */ @@ -9272,7 +9271,7 @@ typedef struct cmpd_vl_t { double c; } cmpd_vl_t; - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_cmpd_vl * @@ -9405,20 +9404,20 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); H5Pclose(dxpl_id); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_cmpd_vl * @@ -9558,21 +9557,21 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); H5Pclose(dxpl_id); H5Pclose(pid); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_cmpd_vl * @@ -9711,21 +9710,21 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); + H5Pclose(dxpl_id); + H5Pclose(pid); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_null_ref * @@ -9887,7 +9886,7 @@ error: return 1; } /* end test_copy_null_ref */ - + /*------------------------------------------------------------------------- * Function: test_copy_null_ref_open * @@ -10070,7 +10069,7 @@ error: return 1; } /* end test_copy_null_ref_open */ - + /*------------------------------------------------------------------------- * Function: test_copy_attr_crt_order * @@ -10192,7 +10191,7 @@ error: return 1; } /* end test_copy_attr_crt_order */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_datatype_merge * @@ -10429,7 +10428,7 @@ error: return 1; } /* end test_copy_committed_datatype_merge */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_datatype_merge_same_file * @@ -10701,7 +10700,7 @@ error: } /* end test_copy_committed_datatype_merge_same_file */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_dt_merge_sugg * @@ -10930,7 +10929,7 @@ error: return 1; } /* end test_copy_committed_dt_merge_sugg */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_dt_merge_attr * @@ -11123,27 +11122,27 @@ error: #define ROOT_NDT_INT "root_ndt_int" #define GROUP_NDT_SHORT "group_ndt_short" -#define SRC_GRP "src_grp" -#define DST_GRP "dst_grp" -#define DST_GRP2 "dst_grp2" +#define SRC_GRP "src_grp" +#define DST_GRP "dst_grp" +#define DST_GRP2 "dst_grp2" -#define SRC_NDT_SHORT "src_ndt_short" -#define SRC_NDT_INT "src_ndt_int" -#define SRC_NDT_INT2 "src_ndt_int2" -#define SRC_NDT_FLOAT "src_ndt_float" -#define SRC_NDT_DOUBLE "src_ndt_double" +#define SRC_NDT_SHORT "src_ndt_short" +#define SRC_NDT_INT "src_ndt_int" +#define SRC_NDT_INT2 "src_ndt_int2" +#define SRC_NDT_FLOAT "src_ndt_float" +#define SRC_NDT_DOUBLE "src_ndt_double" -#define DST_NDT_SHORT "dst_ndt_short" -#define DST_NDT_INT "dst_ndt_int" -#define DST_NDT_FLOAT "dst_ndt_float" -#define DST_NDT_DOUBLE "dst_ndt_double" +#define DST_NDT_SHORT "dst_ndt_short" +#define DST_NDT_INT "dst_ndt_int" +#define DST_NDT_FLOAT "dst_ndt_float" +#define DST_NDT_DOUBLE "dst_ndt_double" -#define SRC_NDT_DSET "src_ndt_dset" -#define SRC_NDT_DSET2 "src_ndt_dset2" -#define SRC_NDT_DSET3 "src_ndt_dset3" +#define SRC_NDT_DSET "src_ndt_dset" +#define SRC_NDT_DSET2 "src_ndt_dset2" +#define SRC_NDT_DSET3 "src_ndt_dset3" -#define SRC_DSET "src_dset" -#define SRC_DSET1 "src_dset1" +#define SRC_DSET "src_dset" +#define SRC_DSET1 "src_dset1" #define SRC_ATTR "src_attr" @@ -11152,21 +11151,21 @@ error: #define DST_ATTR "dst_attr" #define DST_ATTR2 "dst_attr2" - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_hier_merge * * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy: - * SRC file: - * Create committed datatypes at / and /g0 - * Create datasets with native type and committed datatypes at /g0 - * DST file: - * Create attributes with anonymous committed datatypes at /uncopied + * SRC file: + * Create committed datatypes at / and /g0 + * Create datasets with native type and committed datatypes at /g0 + * DST file: + * Create attributes with anonymous committed datatypes at /uncopied * - * Copy / at SRC to DST - * Copy /g0 at SRC to DST - * Copy the datasets in /g0 at SRC to DST /uncopied - * Verify that committed datatypes are copied and merged correctly + * Copy / at SRC to DST + * Copy /g0 at SRC to DST + * Copy the datasets in /g0 at SRC to DST /uncopied + * Verify that committed datatypes are copied and merged correctly * * Return: Success: 0 * Failure: number of errors @@ -11182,19 +11181,19 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d hid_t tid = -1; /* Datatype ID */ hid_t sid = -1; /* Dataspace ID */ hid_t did = -1; /* Dataset ID */ - hid_t gid = -1; /* Group IDs */ - hid_t f_tid = -1; /* Datatype ID for root group */ - hid_t g_tid = -1; /* Datatype ID for group */ - hid_t anon_tid = -1; /* Anonymous datatype */ - hid_t aid = -1; /* Attribute ID */ + hid_t gid = -1; /* Group IDs */ + hid_t f_tid = -1; /* Datatype ID for root group */ + hid_t g_tid = -1; /* Datatype ID for group */ + hid_t anon_tid = -1; /* Anonymous datatype */ + hid_t aid = -1; /* Attribute ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ - int i; /* Local index variable */ - hsize_t dim1d[1]; /* dimension sizes */ - int buf[DIM_SIZE_1]; /* Buffer for data */ - haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */ + int i; /* Local index variable */ + hsize_t dim1d[1]; /* dimension sizes */ + int buf[DIM_SIZE_1]; /* Buffer for data */ + haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */ H5O_info_t oinfo; /* Object info */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ if(reopen) TESTING("H5Ocopy(): hier. of committed datatypes and merging with reopen") @@ -11212,8 +11211,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* Reset file address checking info */ addr_reset(); - /* - * Populate source file + /* + * Populate source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR @@ -11271,8 +11270,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* close the SRC file */ if(H5Fclose(fid_src) < 0) TEST_ERROR - /* - * Populate destination file + /* + * Populate destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -11285,7 +11284,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* create attribute of anon ndt (short) in /uncopied */ if((aid = H5Acreate2(gid, DST_ATTR_ANON_SHORT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR /* close the attribute */ if(H5Aclose(aid) < 0) TEST_ERROR @@ -11299,7 +11298,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* create attribute of anon ndt (int) in /uncopied */ if((aid = H5Acreate2(gid, DST_ATTR_ANON_INT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR /* close the attribute */ if(H5Aclose(aid) < 0) TEST_ERROR @@ -11460,17 +11459,17 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Tclose(tid); - H5Tclose(f_tid); - H5Tclose(g_tid); - H5Tclose(anon_tid); - H5Pclose(ocpypl_id); - H5Aclose(aid); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Tclose(f_tid); + H5Tclose(g_tid); + H5Tclose(anon_tid); + H5Pclose(ocpypl_id); + H5Aclose(aid); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_cdt_hier_merge */ @@ -11480,22 +11479,22 @@ error: * Function: test_copy_cdt_merge_cdt * * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy: - * SRC file: - * Create committed datatype (short) - * Create committed datatype (float) - * Create committed datatype (int), with attribute of ndt int - * Create committed datatype (double), with attribute of anon ndt short - * DST file: - * Create committed datatype (int) - * Create committed datatype (float), with attribute of native int - * Create committed datatype (double), with attribute of anon ndt short - * - * Copy / at SRC to DST - * Verify that committed datatypes are copied and merged correctly - * - * NOTE: - * Comparison of attributes are not implemented yet. - * Further tests will be added in the future. + * SRC file: + * Create committed datatype (short) + * Create committed datatype (float) + * Create committed datatype (int), with attribute of ndt int + * Create committed datatype (double), with attribute of anon ndt short + * DST file: + * Create committed datatype (int) + * Create committed datatype (float), with attribute of native int + * Create committed datatype (double), with attribute of anon ndt short + * + * Copy / at SRC to DST + * Verify that committed datatypes are copied and merged correctly + * + * NOTE: + * Comparison of attributes are not implemented yet. + * Further tests will be added in the future. * * Return: Success: 0 * Failure: number of errors @@ -11510,15 +11509,15 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ hid_t tid3 = -1, tid4 = -1; /* Datatype IDs */ - hid_t tid5 = -1, tid = -1; /* Datatype IDs */ + hid_t tid5 = -1, tid = -1; /* Datatype IDs */ hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ + hid_t aid = -1; /* Attribute ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ - hsize_t dim1d[1]; /* dimension sizes */ + hsize_t dim1d[1]; /* dimension sizes */ H5O_info_t oinfo; /* Object info */ - haddr_t exp_addr; /* Expected object addresses */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + haddr_t exp_addr; /* Expected object addresses */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ if(reopen) TESTING("H5Ocopy(): merging various committed datatypes with reopen") @@ -11532,8 +11531,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* Reset file address checking info */ addr_reset(); - /* - * Populate source file + /* + * Populate source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR @@ -11583,8 +11582,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* close the SRC file */ if(H5Fclose(fid_src) < 0) TEST_ERROR - /* - * Populate destination file + /* + * Populate destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -11639,8 +11638,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* copy everything in SRC to DST */ if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - /* - * Verification + /* + * Verification */ /* get address of committed datatype: /src_root/src_ndt_double */ if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -11704,29 +11703,29 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds error: H5E_BEGIN_TRY { - H5Pclose(ocpypl_id); - H5Tclose(tid); - H5Tclose(tid1); - H5Tclose(tid2); - H5Tclose(tid3); - H5Tclose(tid4); - H5Tclose(tid5); - H5Aclose(aid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(ocpypl_id); + H5Tclose(tid); + H5Tclose(tid1); + H5Tclose(tid2); + H5Tclose(tid3); + H5Tclose(tid4); + H5Tclose(tid5); + H5Aclose(aid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_cdt_merge_cdt */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_suggs * * Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path) - * is correctly applied in merging the committed datatypes. - * + * is correctly applied in merging the committed datatypes. + * * Return: Success: 0 * Failure: number of errors * @@ -11795,7 +11794,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR /* - * Test 1 + * Test 1 */ /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR @@ -11831,8 +11830,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 2 + /* + * Test 2 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -11864,14 +11863,14 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 3 + /* + * Test 3 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR /* remove "/uncopied/src_ndt_int" from DST file */ - if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR /* copy "/src_ndt_int" from SRC file to "/uncopied/src_ndt_int" at DST file */ /* use default ocpypl_id -- without merging and suggestion */ @@ -11880,7 +11879,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* copy "/src_ndt_int" from SRC file to "/src_ndt_int2" at DST file */ /* copy with merging and search suggestion: "/uncopied/src_ndt_int" */ if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, SRC_NDT_INT2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - + if(reopen) { /* Reopen file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR @@ -11902,8 +11901,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 4 + /* + * Test 4 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -11955,13 +11954,13 @@ error: return 1; } /* end test_copy_cdt_merge_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_dset_suggs * * Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path) - * is correctly applied in merging the committed datatypes of datasets. - * + * is correctly applied in merging the committed datatypes of datasets. + * * Return: Success: 0 * Failure: number of errors * @@ -12056,7 +12055,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Sclose(sid) < 0) TEST_ERROR /* - * Test 1 + * Test 1 */ /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR @@ -12094,8 +12093,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 2 + /* + * Test 2 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12131,14 +12130,14 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 3 + /* + * Test 3 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR /* remove "/uncopied/src_ndt_dset" */ - if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR /* copy "src_ndt_dset" from SRC file to "/uncopied/src_ndt_dset" at DST file */ /* use default ocpypl_id -- without merging and suggestion */ @@ -12147,7 +12146,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* copy "src_ndt_dset" from SRC file to "/src_ndt_dset2" at DST file */ /* use merging and suggested searching path: "/uncopied/src_ndt_dset" */ if(H5Ocopy(fid_src, SRC_NDT_DSET, fid_dst, SRC_NDT_DSET2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - + if(reopen) { /* Reopen file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR @@ -12173,8 +12172,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 4 + /* + * Test 4 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12232,12 +12231,12 @@ error: return 1; } /* end test_copy_cdt_merge_dset_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_all_suggs * * Purpose: Tests the merging committed datatype + search suggestion feature. - * + * * Return: Success: 0 * Failure: number of errors * @@ -12256,8 +12255,8 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t aid = -1; /* Attribute ID */ hid_t did = -1; /* Dataset ID */ hid_t exp_did = -1; /* Dataset ID */ - hid_t tid_short = -1; /* Datatype ID */ - hid_t exp_tid = -1; /* Expected datatype ID */ + hid_t tid_short = -1; /* Datatype ID */ + hid_t exp_tid = -1; /* Expected datatype ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ hsize_t dim1d[1]; /* Dataset dimensions */ char src_filename[NAME_BUF_SIZE]; @@ -12313,7 +12312,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create third dataset in group */ if((did = H5Dcreate2(gid, SRC_DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - + /* get datatype */ if((tid_short = H5Topen2(fid_src, "/" SRC_GRP "/" SRC_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -12442,7 +12441,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 1 */ /* open the source file with read-only */ @@ -12483,7 +12482,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 2 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12520,7 +12519,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 3 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12555,7 +12554,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 4 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12608,7 +12607,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 5 */ /* open destination file */ @@ -12646,7 +12645,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 6 */ /* open destination file */ @@ -12707,7 +12706,7 @@ error: return 1; } /* end test_copy_cdt_merge_all_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_set_mcdt_search_cb * @@ -12892,7 +12891,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Continue the global search */ if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cb, &cb_udata) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12927,7 +12926,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Stop the search, default action is to create an anonymous committed datatype */ cb_udata.search_action = H5O_MCDT_SEARCH_STOP; @@ -13063,7 +13062,7 @@ error: return 1; } /* end test_copy_set_mcdt_search_cb */ - + /*------------------------------------------------------------------------- * Function: test_copy_set_get_mcdt_cb * @@ -13109,10 +13108,10 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, int buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ - H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */ - H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */ - H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */ + H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ + H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */ + H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */ + H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */ if(reopen) TESTING("H5Ocopy(): H5Pset/get_mcdt_search_cb and reopen") @@ -13242,7 +13241,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Continue the global search */ if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataA) < 0) - TEST_ERROR + TEST_ERROR /* open the destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13275,7 +13274,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, mcdt_udataB = H5O_MCDT_SEARCH_STOP; if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataB) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13305,7 +13304,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbB, &mcdt_udataB) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13358,7 +13357,7 @@ error: return 1; } /* end test_copy_set_get_mcdt_search_cb */ - + /*------------------------------------------------------------------------- * Function: test_copy_iterate * @@ -13456,7 +13455,7 @@ error: return 1; } /* end test_copy_iterate */ - + /*------------------------------------------------------------------------- * Function: test_copy_option * @@ -13481,7 +13480,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hid_t did = -1; /* Dataset ID */ hid_t gid=-1, gid2=-1, gid_ref=-1; /* Group IDs */ hid_t gid_sub=-1, gid_sub_sub=-1; /* Sub-group ID */ - hid_t pid=-1, lcpl_id=-1; /* Property IDs */ + hid_t pid=-1, lcpl_id=-1; /* Property IDs */ unsigned cpy_flags; /* Object copy flags */ int depth = -1; /* Copy depth */ hsize_t dim2d[2]; @@ -13734,51 +13733,51 @@ error: H5E_BEGIN_TRY { H5Pclose(lcpl_id); H5Pclose(pid); - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_ref); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); - H5Fclose(fid_ext); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_ref); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); + H5Fclose(fid_ext); } H5E_END_TRY; return 1; } /* end test_copy_option */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_open * * Purpose: To ensure that H5Ocopy() copies data of opened dataset correctly. - * This is for bug fix HDFFV-7853. - * - * Test Case 1: - * Create a dataset with attributes in SRC file - * Copy the opened dataset to another location in the same file - * Copy the opened dataset to DST file - * Close the dataset - * - * Test Case 2: - * Reopen the dataset, write new data to the dataset - * Copy the opened dataset to another location in the same file - * Copy the opened dataset to to DST file - * Close the dataset - * - * Test Case 3: - * Create a committed datatype - * Create a dataset with the committed datatype in SRC file - * Open the committed datatype - * Copy the opened dataset (with the opened committed datatype) to another location in the same file - * Copy the opened dataset (with the opened committed datatype) to DST file - * Close the dataset and the committed datatype - * - * Test Case 4: - * Create a group with attributes, create a dataset in the group - * Copy the opened group (together with the opened dataset) to another location in the same file - * Copy the opened group (together with the opened dataset) to DST file - * Close the group and the dataset + * This is for bug fix HDFFV-7853. + * + * Test Case 1: + * Create a dataset with attributes in SRC file + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to DST file + * Close the dataset + * + * Test Case 2: + * Reopen the dataset, write new data to the dataset + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to to DST file + * Close the dataset + * + * Test Case 3: + * Create a committed datatype + * Create a dataset with the committed datatype in SRC file + * Open the committed datatype + * Copy the opened dataset (with the opened committed datatype) to another location in the same file + * Copy the opened dataset (with the opened committed datatype) to DST file + * Close the dataset and the committed datatype + * + * Test Case 4: + * Create a group with attributes, create a dataset in the group + * Copy the opened group (together with the opened dataset) to another location in the same file + * Copy the opened group (together with the opened dataset) to DST file + * Close the group and the dataset * * Return: Success: 0 * Failure: number of errors @@ -13856,16 +13855,16 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - + /* attach attributes to the dataset */ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR if(test_copy_attach_attributes(did2, H5T_NATIVE_INT) < 0) TEST_ERROR - /* - * Test case 1 + /* + * Test case 1 */ - /* + /* * Copy within the same file */ /* copy the opened dataset to another location in SRC file */ @@ -13884,7 +13883,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did3) < 0) TEST_ERROR if(H5Dclose(did4) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset from SRC to DST */ @@ -13907,8 +13906,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did) < 0) TEST_ERROR if(H5Dclose(did2) < 0) TEST_ERROR - /* - * Test case 2 + /* + * Test case 2 */ /* reopen the dataset in SRC file */ if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -13918,7 +13917,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened dataset to another location in SRC file */ @@ -13936,7 +13935,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the copied dataset in SRC file */ if(H5Dclose(did3) < 0) TEST_ERROR if(H5Dclose(did4) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset from SRC to DST */ @@ -13959,8 +13958,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did) < 0) TEST_ERROR if(H5Dclose(did2) < 0) TEST_ERROR - /* - * Test case 3 + /* + * Test case 3 */ /* make a copy of the datatype */ @@ -13981,7 +13980,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened dataset (with the opened committed datatype) to another location in SRC file */ @@ -13996,7 +13995,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the copied dataset in SRC file */ if(H5Dclose(did2) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset (with the opened committed datatype) from SRC to DST */ @@ -14017,8 +14016,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the committed datatype at SRC file */ if(H5Tclose(tid) < 0) TEST_ERROR - /* - * Test case 4 + /* + * Test case 4 */ /* create a group in SRC file */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -14031,7 +14030,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened group (together with opened dataset) to another location in SRC file */ @@ -14046,7 +14045,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the DST dataset */ if(H5Gclose(gid2) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened group (together with opened dataset) to DST file */ @@ -14081,20 +14080,20 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Dclose(did2); - H5Sclose(sid); - H5Gclose(gid); - H5Gclose(gid2); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Dclose(did2); + H5Sclose(sid); + H5Gclose(gid); + H5Gclose(gid2); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_open */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: Test H5Ocopy() * @@ -14115,11 +14114,11 @@ int main(void) { int nerrors = 0; - hid_t fapl, fapl2; + hid_t fapl, fapl2; hid_t fcpl_shared, ocpl; unsigned max_compact, min_dense; int configuration; /* Configuration of tests. */ - int ExpressMode; + int ExpressMode; hbool_t same_file; /* Whether to run tests that only use one file */ /* Setup */ @@ -14197,7 +14196,7 @@ main(void) } } /* end if */ else { - puts("Testing with oldest file format for source file:"); + puts("Testing with oldest file format for source file:"); src_fapl = fapl; num_attributes_g = 4; } /* end else */ diff --git a/test/tarray.c b/test/tarray.c index b2e0ee7..99f7bf8 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tarray +* Test program: tarray * * Test the Array Datatype functionality * @@ -22,13 +22,11 @@ #include "testhdf5.h" #include "H5srcdir.h" -#include "hdf5.h" - #define FILENAME "tarray1.h5" #define TESTFILE "tarrold.h5" /* 1-D array datatype */ -#define ARRAY1_RANK 1 +#define ARRAY1_RANK 1 #define ARRAY1_DIM1 4 /* 3-D array datatype */ @@ -67,7 +65,7 @@ typedef struct void *test_array_alloc_custom(size_t size, void *info); void test_array_free_custom(void *mem, void *info); - + /*------------------------------------------------------------------------- * Function: test_array_atomic_1d * @@ -191,7 +189,7 @@ test_array_atomic_1d(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_atomic_1d() */ - + /*------------------------------------------------------------------------- * Function: test_array_funcs * @@ -254,7 +252,7 @@ test_array_funcs(void) CHECK(ret, FAIL, "H5Tclose"); } /* end test_array_funcs() */ - + /*------------------------------------------------------------------------- * Function: test_array_atomic_3d * @@ -383,7 +381,7 @@ test_array_atomic_3d(void) } /* end test_array_atomic_3d() */ - + /*------------------------------------------------------------------------- * Function: test_array_array_atomic * @@ -542,7 +540,7 @@ test_array_array_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_array_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_atomic * @@ -749,7 +747,7 @@ test_array_compound_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_compound_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_array * @@ -1008,7 +1006,7 @@ test_array_compound_array(void) ** allocated. ** ****************************************************************/ - + /*------------------------------------------------------------------------- * Function: test_array_alloc_custom * @@ -1047,7 +1045,7 @@ test_array_alloc_custom(size_t size, void *info) return ret_value; } /* end test_array_alloc_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_free_custom * @@ -1083,7 +1081,7 @@ test_array_free_custom(void *_mem, void *info) return; } /* end test_array_free_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_atomic * @@ -1298,7 +1296,7 @@ test_array_vlen_atomic(void) } /* end test_array_vlen_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_array * @@ -1553,7 +1551,7 @@ test_array_vlen_array(void) } /* end test_array_vlen_array() */ - + /*------------------------------------------------------------------------- * Function: test_array_bkg * @@ -1582,9 +1580,9 @@ test_array_bkg(void) unsigned ndims[3] = {1,1,1}; typedef struct { - int a[ALEN]; - float b[ALEN]; - double c[ALEN]; + int a[ALEN]; + float b[ALEN]; + double c[ALEN]; } CmpField; CmpField cf[LENGTH]; @@ -1857,7 +1855,7 @@ test_array_bkg(void) HDfree(dtsinfo); } /* end test_array_bkg() */ - + /*------------------------------------------------------------------------- * Function: test_compat * @@ -2152,7 +2150,7 @@ test_compat(void) } /* end test_compat() */ - + /*------------------------------------------------------------------------- * Function: test_array * @@ -2185,7 +2183,7 @@ test_array(void) } /* end test_array() */ - + /*------------------------------------------------------------------------- * Function: cleanup_array * diff --git a/test/tconfig.c b/test/tconfig.c index a9f3378..b652ca4 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -19,7 +19,6 @@ * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" /* macros definitions */ @@ -40,22 +39,22 @@ /* Needs this extra step so that we can print the macro name. */ #define vrfy_macrosize(type, macro, macroname) \ if (sizeof(type) != macro) \ - TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \ - #type, sizeof(type), macroname, (int)macro); + TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \ + #type, sizeof(type), macroname, (int)macro); /* local routine prototypes */ void test_config_ctypes(void); void test_exit_definitions(void); - + /*------------------------------------------------------------------------- - * Function: test_configure + * Function: test_configure * - * Purpose: Main configure definitions testing routine + * Purpose: Main configure definitions testing routine * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * *------------------------------------------------------------------------- @@ -69,15 +68,15 @@ test_configure(void) test_exit_definitions(); } - + /*------------------------------------------------------------------------- - * Function: cleanup_configure + * Function: cleanup_configure * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * * Modifications: @@ -90,20 +89,20 @@ cleanup_configure(void) /* no file to clean */ } - + /*------------------------------------------------------------------------- - * Function: test_config_ctypes + * Function: test_config_ctypes * - * Purpose: test C language data type sizes + * Purpose: test C language data type sizes * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * * Modifications: - * Albert Cheng, 2004/10/14 - * Verified both signed and unsigned int types. + * Albert Cheng, 2004/10/14 + * Verified both signed and unsigned int types. * *------------------------------------------------------------------------- */ @@ -201,15 +200,15 @@ test_config_ctypes(void) } - + /*------------------------------------------------------------------------- - * Function: test_exit_definitions + * Function: test_exit_definitions * - * Purpose: test the exit macros values + * Purpose: test the exit macros values * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * October 12, 2009 * * Modifications: @@ -222,9 +221,9 @@ test_exit_definitions(void) /* Verify the EXIT_SUCCESS and EXIT_FAILURE are 0 and 1 respectively. */ /* This should be true for POSIX compliant systems. */ if (EXIT_SUCCESS != 0) \ - TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \ - EXIT_SUCCESS, 0); + TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \ + EXIT_SUCCESS, 0); if (EXIT_FAILURE != 1) \ - TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \ - EXIT_FAILURE, 1); + TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \ + EXIT_FAILURE, 1); } diff --git a/test/tfile.c b/test/tfile.c index 8b66603..8869ba8 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -13,13 +13,12 @@ /*********************************************************** * -* Test program: tfile +* Test program: tfile * * Test the low-level file I/O features. * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -31,9 +30,9 @@ * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ #define H5D_FRIEND /*suppress error about including H5Dpkg */ #include "H5Dpkg.h" /* Dataset access */ @@ -59,46 +58,46 @@ #define BAD_USERBLOCK_SIZE7 (hsize_t)6144 #define F1_USERBLOCK_SIZE (hsize_t)0 -#define F1_OFFSET_SIZE sizeof(haddr_t) -#define F1_LENGTH_SIZE sizeof(hsize_t) -#define F1_SYM_LEAF_K 4 -#define F1_SYM_INTERN_K 16 -#define FILE1 "tfile1.h5" -#define SFILE1 "sys_file1" +#define F1_OFFSET_SIZE sizeof(haddr_t) +#define F1_LENGTH_SIZE sizeof(hsize_t) +#define F1_SYM_LEAF_K 4 +#define F1_SYM_INTERN_K 16 +#define FILE1 "tfile1.h5" +#define SFILE1 "sys_file1" #define REOPEN_FILE "tfile_reopen.h5" #define REOPEN_DSET "dset" #define F2_USERBLOCK_SIZE (hsize_t)512 -#define F2_OFFSET_SIZE 8 -#define F2_LENGTH_SIZE 8 -#define F2_SYM_LEAF_K 8 -#define F2_SYM_INTERN_K 32 +#define F2_OFFSET_SIZE 8 +#define F2_LENGTH_SIZE 8 +#define F2_SYM_LEAF_K 8 +#define F2_SYM_INTERN_K 32 #define F2_RANK 2 #define F2_DIM0 4 #define F2_DIM1 6 #define F2_DSET "dset" -#define FILE2 "tfile2.h5" +#define FILE2 "tfile2.h5" #define F3_USERBLOCK_SIZE (hsize_t)0 -#define F3_OFFSET_SIZE F2_OFFSET_SIZE -#define F3_LENGTH_SIZE F2_LENGTH_SIZE -#define F3_SYM_LEAF_K F2_SYM_LEAF_K -#define F3_SYM_INTERN_K F2_SYM_INTERN_K -#define FILE3 "tfile3.h5" +#define F3_OFFSET_SIZE F2_OFFSET_SIZE +#define F3_LENGTH_SIZE F2_LENGTH_SIZE +#define F3_SYM_LEAF_K F2_SYM_LEAF_K +#define F3_SYM_INTERN_K F2_SYM_INTERN_K +#define FILE3 "tfile3.h5" #define GRP_NAME "/group" #define DSET_NAME "dataset" #define ATTR_NAME "attr" #define TYPE_NAME "type" -#define FILE4 "tfile4.h5" +#define FILE4 "tfile4.h5" #define OBJ_ID_COUNT_0 0 #define OBJ_ID_COUNT_1 1 #define OBJ_ID_COUNT_2 2 #define OBJ_ID_COUNT_3 3 #define OBJ_ID_COUNT_4 4 -#define OBJ_ID_COUNT_6 6 +#define OBJ_ID_COUNT_6 6 #define OBJ_ID_COUNT_8 8 #define GROUP1 "Group1" @@ -128,22 +127,22 @@ #define FSP_SIZE1G 1024*1024*1024 /* File space page size */ /* Declaration for test_libver_macros2() */ -#define FILE6 "tfile6.h5" /* Test file */ +#define FILE6 "tfile6.h5" /* Test file */ /* Declaration for test_get_obj_ids() */ -#define FILE7 "tfile7.h5" /* Test file */ -#define NGROUPS 2 -#define NDSETS 4 +#define FILE7 "tfile7.h5" /* Test file */ +#define NGROUPS 2 +#define NDSETS 4 /* Files created under 1.6 branch and 1.8 branch--used in test_filespace_compatible() */ -const char *OLD_FILENAME[] = { - "filespace_1_6.h5", /* 1.6 HDF5 file */ - "filespace_1_8.h5" /* 1.8 HDF5 file */ +const char *OLD_FILENAME[] = { + "filespace_1_6.h5", /* 1.6 HDF5 file */ + "filespace_1_8.h5" /* 1.8 HDF5 file */ }; /* Files created in 1.10.0 release --used in test_filespace_1.10.0_compatible() */ /* These files are copied from release 1.10.0 tools/h5format_convert/testfiles */ -const char *OLD_1_10_0_FILENAME[] = { +const char *OLD_1_10_0_FILENAME[] = { "h5fc_ext1_i.h5", /* 0 */ "h5fc_ext1_f.h5", /* 1 */ "h5fc_ext2_if.h5", /* 2 */ @@ -179,13 +178,13 @@ static void test_libver_bounds_datatype(hid_t fapl); static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid); static void test_libver_bounds_attributes(hid_t fapl); -#define FILE8 "tfile8.h5" /* Test file */ +#define FILE8 "tfile8.h5" /* Test file */ -#define DSET_NULL "DSET_NULL" -#define DSET "DSET" -#define DSETA "DSETA" -#define DSETB "DSETB" -#define DSETC "DSETC" +#define DSET_NULL "DSET_NULL" +#define DSET "DSET" +#define DSETA "DSETA" +#define DSETB "DSETB" +#define DSETC "DSETC" static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *); @@ -207,14 +206,14 @@ static void test_rw_noupdate(void); static void test_file_create(void) { - hid_t fid1, fid2, fid3; /* HDF5 File IDs */ - hid_t tmpl1, tmpl2; /*file creation templates */ - hsize_t ublock; /*sizeof userblock */ - size_t parm; /*file-creation parameters */ - size_t parm2; /*file-creation parameters */ - unsigned iparm; - unsigned iparm2; - herr_t ret; /*generic return value */ + hid_t fid1, fid2, fid3; /* HDF5 File IDs */ + hid_t tmpl1, tmpl2; /*file creation templates */ + hsize_t ublock; /*sizeof userblock */ + size_t parm; /*file-creation parameters */ + size_t parm2; /*file-creation parameters */ + unsigned iparm; + unsigned iparm2; + herr_t ret; /*generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File Creation I/O\n")); @@ -466,7 +465,7 @@ test_file_create(void) /* Close third file */ ret = H5Fclose(fid3); CHECK(ret, FAIL, "H5Fclose"); -} /* test_file_create() */ +} /* test_file_create() */ /**************************************************************** ** @@ -476,17 +475,17 @@ test_file_create(void) static void test_file_open(void) { - hid_t fid1, fid2; /*HDF5 File IDs */ + hid_t fid1, fid2; /*HDF5 File IDs */ hid_t did; /*dataset ID */ hid_t fapl_id; /*file access property list ID */ - hid_t tmpl1; /*file creation templates */ - hsize_t ublock; /*sizeof user block */ - size_t parm; /*file-creation parameters */ - size_t parm2; /*file-creation parameters */ - unsigned iparm; - unsigned iparm2; - unsigned intent; - herr_t ret; /*generic return value */ + hid_t tmpl1; /*file creation templates */ + hsize_t ublock; /*sizeof user block */ + size_t parm; /*file-creation parameters */ + size_t parm2; /*file-creation parameters */ + unsigned iparm; + unsigned iparm2; + unsigned intent; + herr_t ret; /*generic return value */ /* * Test single file open @@ -650,7 +649,7 @@ test_file_close(void) { hid_t fid1, fid2; hid_t fapl_id, access_id; - hid_t dataset_id, group_id1, group_id2, group_id3; + hid_t dataset_id, group_id1, group_id2, group_id3; H5F_close_degree_t fc_degree; herr_t ret; @@ -840,7 +839,7 @@ test_file_close(void) /* Create more new files and test object count and ID list functions */ test_obj_count_and_id(fid1, fid2, dataset_id, group_id1, - group_id2, group_id3); + group_id2, group_id3); /* Close first open */ ret = H5Fclose(fid1); @@ -896,22 +895,22 @@ test_file_close(void) CHECK(ret, FAIL, "H5Pget_fclose_degree"); switch(fc_degree) { - case H5F_CLOSE_STRONG: - /* Close first open */ - ret = H5Fclose(fid1); - CHECK(ret, FAIL, "H5Fclose"); - /* Close second open */ - ret = H5Fclose(fid2); - CHECK(ret, FAIL, "H5Fclose"); - break; - case H5F_CLOSE_SEMI: + case H5F_CLOSE_STRONG: /* Close first open */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - ret = H5Dclose(dataset_id); + /* Close second open */ + ret = H5Fclose(fid2); + CHECK(ret, FAIL, "H5Fclose"); + break; + case H5F_CLOSE_SEMI: + /* Close first open */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Dclose(dataset_id); CHECK(ret, FAIL, "H5Dclose"); ret = H5Gclose(group_id1); - CHECK(ret, FAIL, "H5Gclose"); + CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id2); CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id3); @@ -919,8 +918,8 @@ test_file_close(void) /* Close second open */ ret = H5Fclose(fid2); CHECK(ret, FAIL, "H5Fclose"); - break; - case H5F_CLOSE_WEAK: + break; + case H5F_CLOSE_WEAK: /* Close first open */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -935,7 +934,7 @@ test_file_close(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); - break; + break; case H5F_CLOSE_DEFAULT: default: CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree"); @@ -957,10 +956,10 @@ test_file_close(void) ****************************************************************/ static void create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, - hid_t *ret_gid2, hid_t *ret_gid3) + hid_t *ret_gid2, hid_t *ret_gid3) { - ssize_t oid_count; - herr_t ret; + ssize_t oid_count; + herr_t ret; /* Check reference counts of file IDs and opened object IDs. * The verification is hard-coded. If in any case, this testing @@ -1062,7 +1061,7 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, /**************************************************************** ** ** test_get_obj_ids(): Test the bug and the fix for Jira 8528. -** H5Fget_obj_ids overfilled the list of +** H5Fget_obj_ids overfilled the list of ** object IDs by one. This is an enhancement ** for test_obj_count_and_id(). ** @@ -1109,14 +1108,14 @@ test_get_obj_ids(void) oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); CHECK_PTR(oid_list, "HDcalloc"); - /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. - * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in + /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. + * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in * (oid_list_size) */ ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, oid_list_size, "H5Fget_obj_count"); - /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according + /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according * to the library design */ for(i = 0; i< ret_count; i++) { if(fid != oid_list[i]) { @@ -1131,7 +1130,7 @@ test_get_obj_ids(void) CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, NGROUPS + 2, "H5Fget_obj_count"); - /* Get the IDs of the left opend objects */ + /* Get the IDs of the left opend objects */ ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, oid_list_size, "H5Fget_obj_count"); @@ -1143,14 +1142,14 @@ test_get_obj_ids(void) CHECK(ret, FAIL, "H5Oclose"); } } - + H5Sclose(filespace); H5Fclose(fid); HDfree(oid_list); - /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works - * when the file is closed first */ + /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works + * when the file is closed first */ fid = H5Fopen(FILE7, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -1193,7 +1192,7 @@ static void test_get_file_id(void) { hid_t fid, fid2, fid3; - hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id; + hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id; hid_t plist; hsize_t dims[F2_RANK]; unsigned intent; @@ -1351,7 +1350,7 @@ check_file_id(hid_t fid, hid_t object_id) ****************************************************************/ static void test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, - hid_t gid2, hid_t gid3) + hid_t gid2, hid_t gid3) { hid_t fid3, fid4; ssize_t oid_count, ret_count; @@ -1392,7 +1391,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count"); - + if(oid_count > 0) { hid_t *oid_list; @@ -1400,8 +1399,8 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, if(oid_list != NULL) { int i; - ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); - CHECK(ret_count, FAIL, "H5Fget_obj_ids"); + ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); + CHECK(ret_count, FAIL, "H5Fget_obj_ids"); for(i = 0; i < oid_count; i++) { H5I_type_t id_type; @@ -1515,11 +1514,11 @@ test_file_perm(void) /**************************************************************** ** ** test_file_perm2(): low-level file test routine. -** This test verifies that no object can be created in a +** This test verifies that no object can be created in a ** file that is opened for read-only. ** *****************************************************************/ -static void +static void test_file_perm2(void) { hid_t file; /* File opened with read-write permission */ @@ -1529,7 +1528,7 @@ test_file_perm2(void) hid_t dset; /* Dataset ID */ hid_t type; /* Datatype ID */ hid_t attr; /* Attribute ID */ - herr_t ret; + herr_t ret; /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File Permissions again\n")); @@ -2121,35 +2120,35 @@ test_file_double_dataset_open(void) /**************************************************************** ** ** test_file_double_file_dataset_open(): -** This test checks multi-opens of files & datasets: -** It simulates the multi-thread test program from DLS -** which exposes the file pointer segmentation fault failure. -** NOTE: The order on when the files and datasets are open/close -** is important. +** This test checks multi-opens of files & datasets: +** It simulates the multi-thread test program from DLS +** which exposes the file pointer segmentation fault failure. +** NOTE: The order on when the files and datasets are open/close +** is important. ** *****************************************************************/ static void test_file_double_file_dataset_open(hbool_t new_format) { - hid_t fapl = -1; /* File access property list */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t did1 = -1, did2 = -1; /* Dataset IDs */ - hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ - hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ - hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ - hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ - hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ - hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ - hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */ - hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */ + hid_t fapl = -1; /* File access property list */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t fid1 = -1, fid2 = -1; /* File IDs */ + hid_t did1 = -1, did2 = -1; /* Dataset IDs */ + hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */ + hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ + hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ + hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ + hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ + hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ + hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */ + hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */ hsize_t size; /* File size */ - const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */ - const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */ - char* buffer[5]; /* Output buffer */ - int wbuf[4] = {1, 2, 3, 4}; /* Input data */ - herr_t ret; /* Generic return value */ + const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */ + const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */ + char* buffer[5]; /* Output buffer */ + int wbuf[4] = {1, 2, 3, 4}; /* Input data */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing double file and dataset open/close\n")); @@ -2252,8 +2251,8 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - /* - * Scenario 1 + /* + * Scenario 1 */ /* First file open */ @@ -2308,8 +2307,8 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); - /* - * Scenario 2 + /* + * Scenario 2 */ /* First file open */ @@ -2373,7 +2372,7 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); - /* + /* * Scenario 3 */ @@ -2417,10 +2416,10 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Fclose(fid2); CHECK(ret, FAIL, "H5Fclose"); - /* + /* * Scenario 4 * --trigger H5AC_protect: Assertion `f->shared' failed - * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect + * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect */ /* First file open */ fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); @@ -2729,9 +2728,9 @@ cal_chksum(const char *file, uint32_t *chksum) ** This test checks to ensure that opening and closing a file ** with read/write permissions does not write anything to the ** file if the file does not change. -** Due to the implementation of file locking (status_flags in -** the superblock is used), this test is changed to use checksum -** instead of timestamp to verify the file is not changed. +** Due to the implementation of file locking (status_flags in +** the superblock is used), this test is changed to use checksum +** instead of timestamp to verify the file is not changed. ** ** Programmer: Vailin Choi; July 2013 ** @@ -2740,8 +2739,8 @@ static void test_rw_noupdate(void) { herr_t ret; /* Generic return value */ - hid_t fid; /* File ID */ - uint32_t chksum1, chksum2; /* Checksum value */ + hid_t fid; /* File ID */ + uint32_t chksum1, chksum2; /* Checksum value */ /* Output message about test being performed */ MESSAGE(5, ("Testing to verify that nothing is written if nothing is changed.\n")); @@ -3130,8 +3129,8 @@ test_userblock_alignment(void) ** test_userblock_alignment_paged(): low-level file test routine. ** This test checks to ensure that files with both a userblock and ** alignment interact properly: -** -- alignment via H5Pset_alignment -** -- alignment via paged aggregation +** -- alignment via H5Pset_alignment +** -- alignment via paged aggregation ** ** Programmer: Vailin Choi; March 2013 ** @@ -3147,14 +3146,14 @@ test_userblock_alignment_paged(void) /* Output message about test being performed */ MESSAGE(5, ("Testing interaction between userblock and alignment (via paged aggregation and H5Pset_alignment)\n")); - /* + /* * Case 1: * Userblock size = 0 * Alignment in use = 4096 * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 4096 * Outcome: - * Should succeed: - * userblock is 0 and alignment != 0 + * Should succeed: + * userblock is 0 and alignment != 0 */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3185,14 +3184,14 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 2a: * Userblock size = 1024 * Alignment in use = 512 - * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 + * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 * Outcome: - * Should succeed: + * Should succeed: * userblock (1024) is integral mult. of alignment (512) */ /* Create file creation property list with user block */ @@ -3221,16 +3220,16 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 2b: * Userblock size = 1024 * Alignment in use = 3 - * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512 - * (via default file creation property) + * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512 + * (via default file creation property) * H5Pset_alignment() is 3 * Outcome: - * Should fail at file creation: - * userblock (1024) is non-integral mult. of alignment (3) + * Should fail at file creation: + * userblock (1024) is non-integral mult. of alignment (3) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3257,15 +3256,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 3a: * Userblock size = 512 * Alignment in use = 512 - * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 + * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 * Outcome: - * Should succeed: - * userblock (512) is equal to alignment (512) + * Should succeed: + * userblock (512) is equal to alignment (512) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3295,15 +3294,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 3b: * Userblock size = 512 * Alignment in use = 3 - * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512 + * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512 * H5Pset_alignment() is 3 * Outcome: - * Should fail at file creation: - * userblock (512) is non-integral mult. of alignment (3) + * Should fail at file creation: + * userblock (512) is non-integral mult. of alignment (3) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3333,15 +3332,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 4a: * Userblock size = 1024 * Alignment in use = 1023 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1023 * H5Pset_alignment() is 16 * Outcome: - * Should fail at file creation: - * userblock (1024) is non-integral multiple of alignment (1023) + * Should fail at file creation: + * userblock (1024) is non-integral multiple of alignment (1023) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3371,15 +3370,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 4b: * Userblock size = 1024 * Alignment in use = 16 * Strategy is H5F_FILE_SPACE_FSM_AGGR; fsp_size = 1023 * H5Pset_alignment() is 16 * Outcome: - * Should succeed: - * userblock (512) is integral multiple of alignment (16) + * Should succeed: + * userblock (512) is integral multiple of alignment (16) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3409,15 +3408,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 5a: * Userblock size = 512 * Alignment in use = 1024 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1024 * H5Pset_alignment() is 16 * Outcome: - * Should fail at file creation: - * userblock (512) is less than alignment (1024) + * Should fail at file creation: + * userblock (512) is less than alignment (1024) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3447,7 +3446,7 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 5b: * Userblock size = 512 * Alignment in use = 16 @@ -3455,7 +3454,7 @@ test_userblock_alignment_paged(void) * H5Pset_alignment() is 16 * Outcome: * Should succed: - * userblock (512) is integral multiple of alignment (16) + * userblock (512) is integral multiple of alignment (16) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3485,16 +3484,16 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 6: * Userblock size = 512 * Alignment in use = 512 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 - * Reopen the file; H5Pset_alignment() is 1024 + * Reopen the file; H5Pset_alignment() is 1024 * Outcome: * Should succed: - * Userblock (512) is the same as alignment (512); + * Userblock (512) is the same as alignment (512); * The H5Pset_alignment() calls have no effect */ /* Create file creation property list with user block */ @@ -3538,19 +3537,19 @@ test_userblock_alignment_paged(void) /**************************************************************** ** ** test_filespace_info(): -** Verify the following public routines retrieve and set file space -** information correctly: -** (1) H5Pget/set_file_space_strategy(): -** Retrieve and set file space strategy, persisting free-space, -** and free-space section threshold as specified -** (2) H5Pget/set_file_space_page_size(): -** Retrieve and set the page size for paged aggregation +** Verify the following public routines retrieve and set file space +** information correctly: +** (1) H5Pget/set_file_space_strategy(): +** Retrieve and set file space strategy, persisting free-space, +** and free-space section threshold as specified +** (2) H5Pget/set_file_space_page_size(): +** Retrieve and set the page size for paged aggregation ** ****************************************************************/ static void test_filespace_info(const char *env_h5_drvr) { - hid_t fid; /* File IDs */ + hid_t fid; /* File IDs */ hid_t fapl, new_fapl; /* File access property lists */ hid_t fcpl, fcpl1, fcpl2; /* File creation property lists */ H5F_fspace_strategy_t strategy; /* File space strategy */ @@ -3563,7 +3562,7 @@ test_filespace_info(const char *env_h5_drvr) hsize_t fsp_size; /* File space page size */ char filename[FILENAME_LEN]; /* Filename to use */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing file creation public routines: H5Pget/set_file_space_strategy & H5Pget/set_file_space_page_size\n")); @@ -3581,14 +3580,14 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); CHECK(ret, FAIL, "H5Pset_libver_bounds"); - /* + /* * Case (1) * Check file space information from a default file creation property list. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create file creation property list template */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3611,7 +3610,7 @@ test_filespace_info(const char *env_h5_drvr) /* Close property list */ H5Pclose(fcpl); - /* + /* * Case (2) * File space page size has a minimum size of 512. * Setting value less than 512 will return an error; @@ -3660,14 +3659,14 @@ test_filespace_info(const char *env_h5_drvr) /* Close property list */ H5Pclose(fcpl); - /* + /* * Case (3) * Check file space information when creating a file with default properties. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create a file with default file creation and access property lists */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3697,15 +3696,15 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pclose(fcpl1); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case (4) * Check file space information when creating a file with the * latest library format and default properties. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create a file with the latest library format */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl); @@ -3735,21 +3734,21 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pclose(fcpl1); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case (5) * Check file space information with the following combinations: - * Create file with -- - * New or old format - * Persist or not persist free-space - * Different sizes for free-space section threshold (0 to 10) - * The four file space strategies: - * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE, + * Create file with -- + * New or old format + * Persist or not persist free-space + * Different sizes for free-space section threshold (0 to 10) + * The four file space strategies: + * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE, * H5F_FSPACE_STRATEGY_AGGR, H5F_FSPACE_STRATEGY_NONE - * File space page size: set to 512 - * + * File space page size: set to 512 + * */ for(new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t my_fapl; + hid_t my_fapl; /* Set the FAPL for the type of format */ if(new_format) { @@ -3783,7 +3782,7 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE512); CHECK(ret, FAIL, "H5Pset_file_space_strategy"); - + /* Retrieve file space information */ ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); CHECK(ret, FAIL, "H5Pget_file_space_strategy"); @@ -3942,13 +3941,13 @@ error: ** returned by the public routine H5Fget_freespace(). ** ** Modifications: -** Vailin Choi; July 2012 -** Remove datasets in reverse order so that all file spaces are shrunk. -** (A change due to H5FD_FLMAP_DICHOTOMY.) +** Vailin Choi; July 2012 +** Remove datasets in reverse order so that all file spaces are shrunk. +** (A change due to H5FD_FLMAP_DICHOTOMY.) ** -** Vailin Choi; Dec 2012 -** Add changes due to paged aggregation via new format: -** the amount of freespace is different. +** Vailin Choi; Dec 2012 +** Add changes due to paged aggregation via new format: +** the amount of freespace is different. ** *****************************************************************/ static void @@ -4088,9 +4087,9 @@ test_file_freespace(const char *env_h5_drvr) /* Check that there is the right amount of free space in the file */ free_space = H5Fget_freespace(file); CHECK(free_space, FAIL, "H5Fget_freespace"); - if(new_format) + if(new_format) VERIFY(free_space, expected_fs_del, "H5Fget_freespace"); - else + else VERIFY(free_space, expected_fs_del, "H5Fget_freespace"); /* Close file */ @@ -4114,7 +4113,7 @@ test_file_freespace(const char *env_h5_drvr) ** ** test_sects_freespace(): ** This routine checks free-space section information for the -** file as returned by the public routine H5Fget_free_sections(). +** file as returned by the public routine H5Fget_free_sections(). ** *****************************************************************/ static void @@ -4136,9 +4135,9 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) H5F_sect_info_t all_sect_info[15]; /* Array to hold free-space information for all types of data */ H5F_sect_info_t meta_sect_info[15]; /* Array to hold free-space information for metadata */ H5F_sect_info_t raw_sect_info[15]; /* Array to hold free-space information for raw data */ - hsize_t total = 0; /* sum of the free-space section sizes */ + hsize_t total = 0; /* sum of the free-space section sizes */ hsize_t tmp_tot = 0; /* Sum of the free-space section sizes */ - hsize_t last_size; /* Size of last free-space section */ + hsize_t last_size; /* Size of last free-space section */ hsize_t dims[1]; /* Dimension sizes */ unsigned u; /* Local index variable */ H5FD_mem_t type; @@ -4177,7 +4176,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) } else { ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1); CHECK(ret, FAIL, "H5Pget_file_space_strategy"); - } + } /* Create the file */ file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); @@ -4301,7 +4300,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) HDmemset(meta_sect_info, 0, sizeof(meta_sect_info)); if(multi_vfd) { - hssize_t ntmp; + hssize_t ntmp; for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) @@ -4353,7 +4352,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) CHECK(fcpl, FAIL, "H5Pclose"); h5_clean_files(FILESPACE_NAME, fapl); - } + } } /* end test_sects_freespace() */ @@ -4361,29 +4360,29 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) /**************************************************************** ** ** test_filespace_compatible(): -** Verify that the trunk with the latest file space management -** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file. -** Also verify the correct file space handling information -** and the amount of free space. +** Verify that the trunk with the latest file space management +** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file. +** Also verify the correct file space handling information +** and the amount of free space. ** ****************************************************************/ static void test_filespace_compatible(void) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ - hid_t fcpl; /* File creation property list template */ - int check[100]; /* Temporary buffer for verifying dataset data */ - int rdbuf[100]; /* Temporary buffer for reading in dataset data */ - uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */ - ssize_t nread; /* Number of bytes read in */ - unsigned i, j; /* Local index variable */ - hssize_t free_space; /* Amount of free-space in the file */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - H5F_fspace_strategy_t strategy; /* File space handling strategy */ - herr_t ret; /* Return value */ + hid_t fid = -1; /* File id */ + hid_t did = -1; /* Dataset id */ + hid_t fcpl; /* File creation property list template */ + int check[100]; /* Temporary buffer for verifying dataset data */ + int rdbuf[100]; /* Temporary buffer for reading in dataset data */ + uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */ + ssize_t nread; /* Number of bytes read in */ + unsigned i, j; /* Local index variable */ + hssize_t free_space; /* Amount of free-space in the file */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + H5F_fspace_strategy_t strategy; /* File space handling strategy */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for 1.6 and 1.8 files\n")); @@ -4392,31 +4391,31 @@ test_filespace_compatible(void) const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */ /* Open and copy the test file into a temporary file */ - fd_old = HDopen(filename, O_RDONLY); - CHECK(fd_old, FAIL, "HDopen"); - fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); - CHECK(fd_new, FAIL, "HDopen"); + fd_old = HDopen(filename, O_RDONLY); + CHECK(fd_old, FAIL, "HDopen"); + fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); + CHECK(fd_new, FAIL, "HDopen"); - /* Copy data */ + /* Copy data */ while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) { ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread); CHECK(write_err, -1, "HDwrite"); } /* end while */ - /* Close the files */ - ret = HDclose(fd_old); - CHECK(ret, FAIL, "HDclose"); - ret = HDclose(fd_new); - CHECK(ret, FAIL, "HDclose"); + /* Close the files */ + ret = HDclose(fd_old); + CHECK(ret, FAIL, "HDclose"); + ret = HDclose(fd_new); + CHECK(ret, FAIL, "HDclose"); /* Open the temporary test file */ - fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); + fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); /* Get the file's file creation property list */ fcpl = H5Fget_create_plist(fid); @@ -4433,27 +4432,27 @@ test_filespace_compatible(void) VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); VERIFY(threshold, 1, "H5Pget_file_space_strategy"); - /* Generate raw data */ - for(i = 0; i < 100; i++) - check[i] = (int)i; + /* Generate raw data */ + for(i = 0; i < 100; i++) + check[i] = (int)i; - /* Open and read the dataset */ - did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); - ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf); - CHECK(ret, FAIL, "H5Dread"); + /* Open and read the dataset */ + did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dopen"); + ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf); + CHECK(ret, FAIL, "H5Dread"); - /* Verify the data read is correct */ - for(i = 0; i < 100; i++) - VERIFY(rdbuf[i], check[i], "test_compatible"); + /* Verify the data read is correct */ + for(i = 0; i < 100; i++) + VERIFY(rdbuf[i], check[i], "test_compatible"); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); - /* Remove the dataset */ - ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Ldelete"); + /* Remove the dataset */ + ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); /* Close the plist */ ret = H5Pclose(fcpl); @@ -4463,30 +4462,30 @@ test_filespace_compatible(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Re-Open the file */ - fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); + /* Re-Open the file */ + fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); - /* The dataset should not be there */ - did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); - VERIFY(did, FAIL, "H5Dopen"); + /* The dataset should not be there */ + did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); + VERIFY(did, FAIL, "H5Dopen"); - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); } /* end for */ } /* test_filespace_compatible */ /**************************************************************** ** ** test_filespace_1.10.0_compatible(): -** Verify that the latest file space management can open, read and -** modify 1.10.0 HDF5 files : +** Verify that the latest file space management can open, read and +** modify 1.10.0 HDF5 files : ** h5fc_ext1_i.h5: H5F_FILE_SPACE_ALL, default threshold; has superblock extension but no fsinfo message ** h5fc_ext1_f.h5: H5F_FILE_SPACE_ALL_PERSIST, default threshold; has superblock extension with fsinfo message ** h5fc_ext2_if.h5: H5F_FILE_SPACE_ALL, non-default threshold; has superblock extension with fsinfo message @@ -4500,16 +4499,16 @@ static void test_filespace_1_10_0_compatible(void) { hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ + hid_t did = -1; /* Dataset id */ hid_t fcpl; /* File creation property list */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ H5F_fspace_strategy_t strategy; /* File space handling strategy */ - int wbuf[24]; /* Buffer for dataset data */ - int rdbuf[24]; /* Buffer for dataset data */ + int wbuf[24]; /* Buffer for dataset data */ + int rdbuf[24]; /* Buffer for dataset data */ int status; /* Status from copying the existing file */ unsigned i, j; /* Local index variable */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for 1.10.0 files\n")); @@ -4517,7 +4516,7 @@ test_filespace_1_10_0_compatible(void) for(j = 0; j < NELMTS(OLD_1_10_0_FILENAME); j++) { /* Make a copy of the test file */ status = h5_make_local_copy(OLD_1_10_0_FILENAME[j], FILE5); - CHECK(status, FAIL, "h5_make_local_copy"); + CHECK(status, FAIL, "h5_make_local_copy"); /* Open the temporary test file */ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); @@ -4551,7 +4550,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 1: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); @@ -4572,7 +4571,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 2: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); @@ -4593,7 +4592,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 3: VERIFY(strategy, H5F_FSPACE_STRATEGY_NONE, "H5Pget_file_space_strategy"); @@ -4614,7 +4613,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 4: VERIFY(strategy, H5F_FSPACE_STRATEGY_AGGR, "H5Pget_file_space_strategy"); @@ -4635,7 +4634,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 5: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); VERIFY(persist, H5F_FREE_SPACE_PERSIST_DEF, "H5Pget_file_space_strategy"); @@ -4655,10 +4654,10 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; default: - break; + break; } /* Close the plist */ @@ -4689,7 +4688,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 1: /* Open and read the dataset */ @@ -4706,7 +4705,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 2: /* Open and read the dataset */ @@ -4723,7 +4722,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 3: /* Open and read the dataset */ @@ -4740,7 +4739,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 4: @@ -4758,7 +4757,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 5: @@ -4776,10 +4775,10 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; default: - break; + break; } /* Close the file */ @@ -4792,36 +4791,36 @@ test_filespace_1_10_0_compatible(void) /**************************************************************** ** ** test_filespace_round_compatible(): -** Verify that the trunk can open, read and modify these files-- -** 1) They are initially created (via gen_filespace.c) in the trunk -** with combinations of file space strategies, default/non-default -** threshold, and file spacing paging enabled/disbled. -** The library creates the file space info message with -** "mark if unknown" in these files. -** 2) They are copied to the 1.8 branch, and are opened/read/modified -** there via test_filespace_compatible() in test/tfile.c. -** The 1.8 library marks the file space info message as "unknown" -** in these files. -** 3) They are then copied back from the 1.8 branch to the trunk for -** compatibility testing via this routine. -** 4) Upon encountering the file space info message which is marked -** as "unknown", the library will use the default file space management -** from then on: non-persistent free-space managers, default threshold, -** and non-paging file space. +** Verify that the trunk can open, read and modify these files-- +** 1) They are initially created (via gen_filespace.c) in the trunk +** with combinations of file space strategies, default/non-default +** threshold, and file spacing paging enabled/disbled. +** The library creates the file space info message with +** "mark if unknown" in these files. +** 2) They are copied to the 1.8 branch, and are opened/read/modified +** there via test_filespace_compatible() in test/tfile.c. +** The 1.8 library marks the file space info message as "unknown" +** in these files. +** 3) They are then copied back from the 1.8 branch to the trunk for +** compatibility testing via this routine. +** 4) Upon encountering the file space info message which is marked +** as "unknown", the library will use the default file space management +** from then on: non-persistent free-space managers, default threshold, +** and non-paging file space. ** ****************************************************************/ static void test_filespace_round_compatible(void) { - hid_t fid = -1; /* File id */ - hid_t fcpl = -1; /* File creation property list ID */ - unsigned j; /* Local index variable */ - H5F_fspace_strategy_t strategy; /* File space strategy */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - hssize_t free_space; /* Amount of free space in the file */ + hid_t fid = -1; /* File id */ + hid_t fcpl = -1; /* File creation property list ID */ + unsigned j; /* Local index variable */ + H5F_fspace_strategy_t strategy; /* File space strategy */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + hssize_t free_space; /* Amount of free space in the file */ int status; /* Status from copying the existing file */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for files from trunk to 1_8 to trunk\n")); @@ -4829,31 +4828,31 @@ test_filespace_round_compatible(void) for(j = 0; j < NELMTS(FSPACE_FILENAMES); j++) { /* Make a copy of the test file */ status = h5_make_local_copy(FSPACE_FILENAMES[j], FILE5); - CHECK(status, FAIL, "h5_make_local_copy"); - - /* Open the temporary test file */ - fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); - - /* Get the file's creation property list */ - fcpl = H5Fget_create_plist(fid); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); - - ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); - CHECK(ret, FAIL, "H5Pget_file_space_strategy"); - VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); - VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); - VERIFY(threshold, 1, "H5Pget_file_space_strategy"); - - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - - /* Closing */ - ret = H5Fclose(fid); - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Fclose"); + CHECK(status, FAIL, "h5_make_local_copy"); + + /* Open the temporary test file */ + fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* Get the file's creation property list */ + fcpl = H5Fget_create_plist(fid); + CHECK(fcpl, FAIL, "H5Fget_create_plist"); + + ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space_strategy"); + VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); + VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); + VERIFY(threshold, 1, "H5Pget_file_space_strategy"); + + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + + /* Closing */ + ret = H5Fclose(fid); + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Fclose"); } /* end for */ } /* test_filespace_round_compatible */ @@ -4953,14 +4952,14 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_real() */ - + /*------------------------------------------------------------------------- * Function: test_libver_bounds_open * * Purpose: Tests opening latest file with various low/high bounds. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * *------------------------------------------------------------------------- */ @@ -5065,22 +5064,22 @@ test_libver_bounds_open(void) CHECK(ret, FAIL, "H5Pget_libver_bounds"); VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST"); - ret = H5Pclose(new_fapl); + ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Fclose(file); + ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); } /* for low */ /* Close dataspace and property lists */ ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret = H5Pclose(dcpl); + ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_open() */ - + /**************************************************************** ** ** test_libver_bounds(): @@ -5112,7 +5111,7 @@ test_libver_bounds(void) ** (4) (v18, v110) ** (5) (v110, v110) ** -** For each pair of setting in fapl, verify format versions with the following +** For each pair of setting in fapl, verify format versions with the following ** six tests: ** (1) test_libver_bounds_super(fapl): superblock versions ** (2) test_libver_bounds_obj(fapl): object header versions @@ -5139,7 +5138,7 @@ test_libver_bounds_low_high(void) /* Loop through all the combinations of low/high version bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - + H5E_BEGIN_TRY { /* Set the low/high version bounds */ ret = H5Pset_libver_bounds(fapl, low, high); @@ -5179,15 +5178,15 @@ test_libver_bounds_low_high(void) ** ** test_libver_bounds_super(): ** Verify superblock version with the following two tests: -** (1) test_libver_bounds_super_create(): -** --when creating a file with the input fapl and the fcpl +** (1) test_libver_bounds_super_create(): +** --when creating a file with the input fapl and the fcpl ** that has the following feature enabled: ** (A) default fcpl ** (B) fcpl with v1-btee K value enabled ** (C) fcpl with shared messages enabled ** (D) fcpl with persistent free-space manager enabled ** -** (2) test_libver_bounds_super_open(): +** (2) test_libver_bounds_super_open(): ** --when opening a file which is created with the input fapl ** and the fcpl setting as #A to #D above. ** @@ -5205,7 +5204,7 @@ test_libver_bounds_super(hid_t fapl) fcpl = H5Pcreate(H5P_FILE_CREATE); CHECK(fcpl, FAIL, "H5Pcreate"); - /* Verify superblock version when creating a file with input fapl, + /* Verify superblock version when creating a file with input fapl, fcpl #A and with/without SWMR access */ test_libver_bounds_super_create(fapl, fcpl, TRUE); test_libver_bounds_super_create(fapl, fcpl, FALSE); @@ -5249,7 +5248,7 @@ test_libver_bounds_super(hid_t fapl) ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Verify superblock version when creating a file with input fapl, + /* Verify superblock version when creating a file with input fapl, fcpl #C and with/without SWMR access */ test_libver_bounds_super_create(fapl, fcpl, TRUE); test_libver_bounds_super_create(fapl, fcpl, FALSE); @@ -5329,11 +5328,11 @@ test_libver_bounds_super(hid_t fapl) static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) { - hid_t fid = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file pointer */ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ H5F_libver_t low, high; /* Low and high bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* The return value */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* The return value */ /* Try to create the file */ H5E_BEGIN_TRY { @@ -5477,13 +5476,13 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) { - hid_t fid = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file pointer */ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ hid_t new_fapl = -1; /* File access property list */ - unsigned super_vers; /* Superblock version */ + unsigned super_vers; /* Superblock version */ H5F_libver_t low, high; /* Low and high bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* Return value */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* Return value */ /* Create the file with the input fcpl and fapl */ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); @@ -5594,7 +5593,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) ** Close the file. ** ** (c) Reopen the same file in (b) with a new fapl. -** The new fapl is set to the 5 pairs of low/high +** The new fapl is set to the 5 pairs of low/high ** bounds in a "for" loop. For each setting in fapl: ** --Create a group in the file ** --Verify the group's object header version @@ -5670,7 +5669,7 @@ test_libver_bounds_obj(hid_t fapl) CHECK(new_fapl, FAIL, "H5Pcreate"); /* Loop through all the combinations of low/high bounds in new_fapl */ - /* Open the file with the fapl; create a group and verify the + /* Open the file with the fapl; create a group and verify the object header version, then delete the group and close the file.*/ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { @@ -5746,13 +5745,13 @@ test_libver_bounds_obj(hid_t fapl) ** Create the following two datasets: ** --A contiguous dataset ** --A chunked dataset with "no filter edge chunks" -** For both datasets, verify the versions for the layout, +** For both datasets, verify the versions for the layout, ** fill value and filter pipeline messages. ** Close the file. ** -** (b) Create a new fapl that is set to the 5 pairs of low/high -** bounds in a "for" loop. For each pair of setting in the -** new fapl: +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in the +** new fapl: ** --Open the same file in (a) with the fapl ** --Create a chunked dataset with 2 unlimited ** dimensions @@ -5803,7 +5802,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Verify version for layout and fill value messages */ if(low == H5F_LIBVER_EARLIEST) { /* For layout message: the earliest version the library will set is 3 */ - /* For fill value message: the earliest version the library will set is 2 */ + /* For fill value message: the earliest version the library will set is 2 */ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); } else { @@ -5823,7 +5822,7 @@ test_libver_bounds_dataset(hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Set up dataspace and dcpl for creating a chunked dataset - with "no filter edge chunks" enabled. + with "no filter edge chunks" enabled. This will result in a version 4 layout message */ sid = H5Screate_simple(2, fix_dims2, NULL); CHECK(sid, FAIL, "H5Screate_simple"); @@ -5866,12 +5865,12 @@ test_libver_bounds_dataset(hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Create a default file access property list which is used + /* Create a default file access property list which is used to open the file in the 'for' loop */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Set up dataspace and dcpl for creating a chunked dataset with + /* Set up dataspace and dcpl for creating a chunked dataset with 2 unlimited dimensions in the 'for' loop */ sid = H5Screate_simple(2, dims2, max_dims2); CHECK(sid, FAIL, "H5Screate_simple"); @@ -5915,7 +5914,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Also verify the chunk indexing type */ if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { /* For layout message: the earliest version the library will set is 3 */ - /* For fill value message: the earliest version the library will set is 2 */ + /* For fill value message: the earliest version the library will set is 2 */ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); } else { @@ -5975,7 +5974,7 @@ test_libver_bounds_dataset(hid_t fapl) ** Close the file. ** ** (b) Create a new fapl that is set to the 5 pairs of low/high -** bounds in a "for" loop. For each pair of setting in the +** bounds in a "for" loop. For each pair of setting in the ** new fapl: ** --Open the same file in (a) with the fapl ** --Create a chunked dataset, a compact dataset and @@ -6228,7 +6227,7 @@ static void test_libver_bounds_datatype(hid_t fapl) { hid_t tid = -1, tid_enum = -1, tid_array = -1; /* Datatype IDs */ - hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ + hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ int enum_value; /* Value for enum datatype */ typedef struct s1 { /* Data structure for compound datatype */ char c; @@ -6296,12 +6295,12 @@ test_libver_bounds_datatype(hid_t fapl) ** test_libver_bounds_datatype_check(): ** Helper routine called by test_libver_bounds_datatype() ** to verify the datatype message version for the input tid: -** +** ** (a) Create a file with default fcpl and the input fapl. ** Create a contiguous dataset with the input tid. -** Verify the datatype message version. +** Verify the datatype message version. ** Create a committed datatype of string to be -** used later. +** used later. ** Close the file. ** ** (b) Create a new fapl that is set to the 5 pairs of low/high @@ -6319,13 +6318,13 @@ test_libver_bounds_datatype(hid_t fapl) static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) { - hid_t fid = -1; /* File ID */ + hid_t fid = -1; /* File ID */ hid_t new_fapl = -1; /* File acess property list */ hid_t dcpl = -1; /* Dataset creation property list */ hid_t dtid = -1; /* Datatype ID for the dataset */ hid_t str_tid = -1; /* String datatype ID */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ hsize_t dims[1] = {1}; /* Dimension sizes */ hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ @@ -6336,7 +6335,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the low/high version bounds from the input fapl */ + /* Retrieve the low/high version bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); @@ -6373,14 +6372,14 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Verify the datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: - * --the library will set version according to low_bound - * --H5T_ARRAY: the earliest version the library will set is 2 + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: - * --the library will only use basic version + * --the library will only use basic version */ - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); @@ -6469,15 +6468,15 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Verify the dataset's datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: - * --the library will set version according to low_bound - * --H5T_ARRAY: the earliest version the library will set is 2 + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: - * --the library will only use basic version + * --the library will only use basic version */ - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { - if(dtype->shared->type == H5T_ARRAY && + if(dtype->shared->type == H5T_ARRAY && f->shared->low_bound == H5F_LIBVER_EARLIEST) VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); else @@ -6525,7 +6524,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ** Verify the attribute message versions: ** ** (a) Create a file with default fcpl and the input fapl. -** Create a group and attach the following three attributes +** Create a group and attach the following three attributes ** to the group: ** (1) Attribute with a committed datatype ** (2) Attribute with integer type @@ -6535,7 +6534,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ** ** (b) Create a fcpl that has shared datatype message enabled. ** Create a file with the fcpl and the input fapl. -** Create a group and attach an attribute with shared +** Create a group and attach an attribute with shared ** integer type to the group. ** Verify the attribute message version. ** Close the file @@ -6567,7 +6566,7 @@ test_libver_bounds_attributes(hid_t fapl) H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the low/high bounds from the input fapl */ + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); @@ -6810,7 +6809,7 @@ test_libver_bounds_attributes(hid_t fapl) /**************************************************************** ** ** test_libver_macros(): -** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. +** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. ** ****************************************************************/ static void @@ -6859,7 +6858,7 @@ test_libver_macros(void) /**************************************************************** ** ** test_libver_macros2(): -** Verify that H5_VERSION_GE works correactly and show how +** Verify that H5_VERSION_GE works correactly and show how ** to use it. ** ****************************************************************/ @@ -6892,9 +6891,9 @@ test_libver_macros2(void) ret = H5Gclose(grp); CHECK(ret, FAIL, "H5Gclose"); - /* + /* * Delete the group using different function based on the library version. - * And verify the action. + * And verify the action. */ #if H5_VERSION_GE(1,8,0) ret = H5Ldelete(file, "Group", H5P_DEFAULT); @@ -6923,7 +6922,7 @@ test_libver_macros2(void) /**************************************************************** ** ** test_deprec(): -** Test deprecated functionality. +** Test deprecated functionality. ** ****************************************************************/ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -6939,7 +6938,7 @@ test_deprec(void) unsigned freelist; /* Free list version # */ unsigned stab; /* Symbol table entry version # */ unsigned shhdr; /* Shared object header version # */ - H5F_info1_t finfo; /* global information about file */ + H5F_info1_t finfo; /* global information about file */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -7155,7 +7154,7 @@ test_deprec(void) void test_file(void) { - const char *env_h5_drvr; /* File Driver value from environment */ + const char *env_h5_drvr; /* File Driver value from environment */ /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File I/O\n")); @@ -7211,15 +7210,15 @@ test_file(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_file() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_file + * Function: cleanup_file * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/test/tgenprop.c b/test/tgenprop.c index 0e6b5c9..5031846 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -13,21 +13,21 @@ /*********************************************************** * -* Test program: tgenprop +* Test program: tgenprop * * Test the Generic Property functionality * *************************************************************/ -#define H5P_FRIEND /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5P_TESTING #include "testhdf5.h" -#include "hdf5.h" + #include "H5Dprivate.h" /* For Dataset creation property list names */ -#include "H5Ppkg.h" /* Generic Properties */ +#include "H5Ppkg.h" /* Generic Properties */ #define FILENAME "tgenprop.h5" @@ -80,11 +80,11 @@ typedef struct count_data_t { static void test_genprop_basic_class(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n")); @@ -169,10 +169,10 @@ test_genprop_basic_class(void) static void test_genprop_basic_class_prop(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n")); @@ -311,8 +311,8 @@ test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_class_iter(void) { - hid_t cid1; /* Generic Property class ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + size_t nprops; /* Number of properties in class */ int idx; /* Index to start iteration at */ struct { /* Struct for iterations */ int iter_count; @@ -323,7 +323,7 @@ test_genprop_class_iter(void) PROP2_NAME, PROP3_NAME, PROP4_NAME}; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n")); @@ -417,17 +417,17 @@ test_genprop_cls_cls_cb1(hid_t list_id, void *create_data) static void test_genprop_class_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ - hid_t lid3; /* Generic Property list ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ + hid_t lid3; /* Generic Property list ID */ + size_t nprops; /* Number of properties in class */ struct { /* Struct for callbacks */ int count; hid_t id; } crt_cb_struct, cpy_cb_struct, cls_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n")); @@ -596,14 +596,14 @@ test_genprop_class_callback(void) static void test_genprop_basic_list(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ - size_t size; /* Size of property */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ + size_t size; /* Size of property */ int prop1_value; /* Value for property #1 */ float prop2_value; /* Value for property #2 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n")); @@ -678,8 +678,8 @@ test_genprop_basic_list(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Close list */ @@ -702,14 +702,14 @@ test_genprop_basic_list(void) static void test_genprop_basic_list_prop(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ int prop1_value; /* Value for property #1 */ float prop2_value; /* Value for property #2 */ char prop3_value[10];/* Property #3 value */ double prop4_value; /* Property #4 value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n")); @@ -770,8 +770,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ @@ -783,8 +783,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Delete permanent property */ ret = H5Premove(lid1, PROP2_NAME); @@ -820,8 +820,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Close list */ ret = H5Pclose(lid1); @@ -856,9 +856,9 @@ test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_list_iter(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ int idx; /* Index to start iteration at */ struct { /* Struct for iterations */ int iter_count; @@ -870,7 +870,7 @@ test_genprop_list_iter(void) PROP1_NAME, PROP2_NAME }; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n")); @@ -1144,10 +1144,10 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v static void test_genprop_list_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* 2nd Generic Property list ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* 2nd Generic Property list ID */ + size_t nprops; /* Number of properties in class */ int prop1_value; /* Value for property #1 */ int prop1_new_value=20; /* Property #1 new value */ float prop2_value; /* Value for property #2 */ @@ -1158,7 +1158,7 @@ test_genprop_list_callback(void) int count; hid_t id; } cop_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n")); @@ -1225,8 +1225,8 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ ret = H5Pget(lid1, PROP3_NAME,&prop3_value); @@ -1240,8 +1240,8 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Verify get callback information for properties tracked */ VERIFY(prop1_cb_info.get_count, 1, "H5Pget"); @@ -1373,7 +1373,7 @@ test_genprop_list_addprop(void) hid_t sid; /* Dataspace ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1448,7 +1448,7 @@ test_genprop_class_addprop(void) hid_t cid; /* Property Class ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1570,7 +1570,7 @@ static void test_genprop_list_add_remove_prop(void) { hid_t pid; /* Property List ID */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create a dataset creation property list */ pid = H5Pcreate(H5P_DATASET_CREATE); @@ -1607,11 +1607,11 @@ test_genprop_list_add_remove_prop(void) static void test_genprop_equal(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ int prop1_new_value = 20; /* Property #1 new value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Equal Functionality\n")); @@ -1756,11 +1756,11 @@ test_genprop_equal(void) static void test_genprop_path(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ char *path; /* Class path */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Class Path Functionality\n")); @@ -1828,10 +1828,10 @@ test_genprop_path(void) static void test_genprop_refcount(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property class ID */ char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Reference Count Functionality\n")); @@ -1901,10 +1901,10 @@ test_genprop_refcount(void) static void test_genprop_deprec_class(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Generic Property List Functions\n")); @@ -2034,7 +2034,7 @@ test_genprop_deprec_list(void) hid_t sid; /* Dataspace ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2130,15 +2130,15 @@ test_genprop(void) } /* test_genprop() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_genprop + * Function: cleanup_genprop * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June 8, 1999 * * Modifications: diff --git a/test/tid.c b/test/tid.c index 7d6757f..ba8af03 100644 --- a/test/tid.c +++ b/test/tid.c @@ -14,10 +14,9 @@ /* Test user-created identifiers (hid_t's) and identifier types. */ #include "testhdf5.h" -#include "hdf5.h" /* Include H5Ipkg.h to calculate max number of groups */ -#define H5I_FRIEND /*suppress error about including H5Ipkg */ +#define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" /* Test basic functionality of registering and deleting types and IDs */ @@ -238,97 +237,97 @@ out: } - /* A dummy search function for the next test */ + /* A dummy search function for the next test */ static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; } - /* Ensure that public functions cannot access "predefined" ID types */ + /* Ensure that public functions cannot access "predefined" ID types */ static int id_predefined_test(void ) { - void * testObj; - hid_t testID; - hid_t typeID = H5I_INVALID_HID; - void * testPtr; - herr_t testErr; + void * testObj; + hid_t testID; + hid_t typeID = H5I_INVALID_HID; + void * testPtr; + herr_t testErr; - testObj = HDmalloc(sizeof(int)); + testObj = HDmalloc(sizeof(int)); - /* Try to perform illegal functions on various predefined types */ - H5E_BEGIN_TRY - testID = H5Iregister(H5I_FILE, testObj); - H5E_END_TRY + /* Try to perform illegal functions on various predefined types */ + H5E_BEGIN_TRY + testID = H5Iregister(H5I_FILE, testObj); + H5E_END_TRY - VERIFY(testID, H5I_INVALID_HID, "H5Iregister"); - if(testID != H5I_INVALID_HID) - goto out; + VERIFY(testID, H5I_INVALID_HID, "H5Iregister"); + if(testID != H5I_INVALID_HID) + goto out; - H5E_BEGIN_TRY - testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Isearch"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Isearch"); + if(testPtr != NULL) + goto out; - H5E_BEGIN_TRY - testErr = H5Inmembers(H5I_ERROR_STACK, NULL); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Inmembers(H5I_ERROR_STACK, NULL); + H5E_END_TRY - VERIFY(testErr, -1, "H5Inmembers"); - if(testErr != -1) - goto out; + VERIFY(testErr, -1, "H5Inmembers"); + if(testErr != -1) + goto out; - H5E_BEGIN_TRY - testErr = H5Iclear_type(H5I_FILE, 0); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Iclear_type(H5I_FILE, 0); + H5E_END_TRY - VERIFY((testErr >= 0), 0, "H5Iclear_type"); - if(testErr >= 0) - goto out; + VERIFY((testErr >= 0), 0, "H5Iclear_type"); + if(testErr >= 0) + goto out; - H5E_BEGIN_TRY - testErr = H5Idestroy_type(H5I_DATASET); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Idestroy_type(H5I_DATASET); + H5E_END_TRY - VERIFY((testErr >= 0), 0, "H5Idestroy_type"); - if(testErr >= 0) - goto out; + VERIFY((testErr >= 0), 0, "H5Idestroy_type"); + if(testErr >= 0) + goto out; - /* Create a datatype ID and try to perform illegal functions on it */ - typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); - CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); - if(typeID == H5I_INVALID_HID) - goto out; + /* Create a datatype ID and try to perform illegal functions on it */ + typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); + CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); + if(typeID == H5I_INVALID_HID) + goto out; - H5E_BEGIN_TRY - testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - H5E_BEGIN_TRY - testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - H5Tclose(typeID); + H5Tclose(typeID); - /* testObj was never registered as an atom, so it will not be + /* testObj was never registered as an atom, so it will not be * automatically freed. */ - HDfree(testObj); - return 0; + HDfree(testObj); + return 0; out: - if(typeID != H5I_INVALID_HID) - H5Tclose(typeID); + if(typeID != H5I_INVALID_HID) + H5Tclose(typeID); if(testObj != NULL) - HDfree(testObj); + HDfree(testObj); - return -1; + return -1; } @@ -444,12 +443,12 @@ static int test_get_type(void) out: if(dtype != H5I_INVALID_HID) - H5Tclose(dtype); + H5Tclose(dtype); return -1; } - /* Test boundary cases with lots of types */ + /* Test boundary cases with lots of types */ /* Type IDs range from H5I_NTYPES to H5I_MAX_NUM_TYPES. The system will assign */ /* IDs in sequential order until H5I_MAX_NUM_TYPES IDs have been given out, at which */ @@ -459,78 +458,78 @@ out: /* to low values successfully, ensure that an error is thrown when all possible */ /* type IDs are taken, then ensure that deleting types frees up their IDs. */ /* Note that this test depends on the implementation of IDs, so may break */ -/* if the implementation changes. */ +/* if the implementation changes. */ /* Also note that if someone else registered a user-defined type and forgot to */ /* destroy it, this test will mysteriously fail (because it will expect there to */ /* be one more "free" type ID than there is). */ /* H5I_NTYPES is defined in h5public.h, H5I_MAX_NUM_TYPES is defined in h5pkg.h */ static int test_id_type_list(void) { - H5I_type_t startType; /* The first type ID we were assigned in this test */ - H5I_type_t currentType; - H5I_type_t testType; - int i; /* Just a counter variable */ - - startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(startType, H5I_BADID, "H5Iregister_type"); - if(startType == H5I_BADID) - goto out; - - /* Sanity check */ - if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) - { - /* Error condition, throw an error */ - CHECK(1, 1, "H5Iregister_type"); - goto out; - } - /* Create types up to H5I_MAX_NUM_TYPES */ - for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) - { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(currentType, H5I_BADID, "H5Iregister_type"); - if(currentType == H5I_BADID) - goto out; - } - - /* Wrap around to low type ID numbers */ - for(i = H5I_NTYPES; i < startType; i++) - { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(currentType, H5I_BADID, "H5Iregister_type"); - if(currentType == H5I_BADID) - goto out; - } - - /* There should be no room at the inn for a new ID type*/ - H5E_BEGIN_TRY - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - H5E_END_TRY - - VERIFY(testType, H5I_BADID, "H5Iregister_type"); - if(testType != H5I_BADID) - goto out; - - /* Now delete a type and try to insert again */ - H5Idestroy_type(H5I_NTYPES); - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - - VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); - if(testType != H5I_NTYPES) - goto out; - - /* Cleanup. Destroy all types. */ - for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) - H5Idestroy_type((H5I_type_t) i); - - return 0; + H5I_type_t startType; /* The first type ID we were assigned in this test */ + H5I_type_t currentType; + H5I_type_t testType; + int i; /* Just a counter variable */ + + startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(startType, H5I_BADID, "H5Iregister_type"); + if(startType == H5I_BADID) + goto out; + + /* Sanity check */ + if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) + { + /* Error condition, throw an error */ + CHECK(1, 1, "H5Iregister_type"); + goto out; + } + /* Create types up to H5I_MAX_NUM_TYPES */ + for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) + { + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(currentType, H5I_BADID, "H5Iregister_type"); + if(currentType == H5I_BADID) + goto out; + } + + /* Wrap around to low type ID numbers */ + for(i = H5I_NTYPES; i < startType; i++) + { + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(currentType, H5I_BADID, "H5Iregister_type"); + if(currentType == H5I_BADID) + goto out; + } + + /* There should be no room at the inn for a new ID type*/ + H5E_BEGIN_TRY + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + H5E_END_TRY + + VERIFY(testType, H5I_BADID, "H5Iregister_type"); + if(testType != H5I_BADID) + goto out; + + /* Now delete a type and try to insert again */ + H5Idestroy_type(H5I_NTYPES); + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + + VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); + if(testType != H5I_NTYPES) + goto out; + + /* Cleanup. Destroy all types. */ + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) + H5Idestroy_type((H5I_type_t) i); + + return 0; out: /* Cleanup. For simplicity, just destroy all types and ignore errors. */ - H5E_BEGIN_TRY - for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) - H5Idestroy_type((H5I_type_t) i); - H5E_END_TRY - return -1; + H5E_BEGIN_TRY + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) + H5Idestroy_type((H5I_type_t) i); + H5E_END_TRY + return -1; } /* Test removing ids in callback for H5Iclear_type */ @@ -733,11 +732,11 @@ void test_ids(void) /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); - if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); - if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n"); - if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n"); - if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n"); - if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n"); - if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n"); + if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); + if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n"); + if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n"); + if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n"); + if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n"); + if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n"); } diff --git a/test/titerate.c b/test/titerate.c index 231bd2e..82c26eb 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: titerate +* Test program: titerate * * Test the Group & Attribute functionality * @@ -21,8 +21,6 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "titerate.h5" /* Number of datasets for group iteration test */ @@ -38,8 +36,8 @@ #define NAMELEN 80 /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 typedef enum { RET_ZERO, @@ -131,7 +129,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) char dataset_name[NAMELEN]; /* dataset name */ iter_info info; /* Custom iteration information */ H5G_info_t ginfo; /* Buffer for querying object's info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Group Iteration Functionality\n")); @@ -390,7 +388,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) char name[NAMELEN]; /* temporary name buffer */ char *anames[NATTR]; /* Names of the attributes created */ iter_info info; /* Custom iteration information */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Iteration Functionality\n")); @@ -545,7 +543,7 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_ { const iter_info *test_info = (const iter_info *)opdata; H5O_info_t oinfo; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ if(HDstrcmp(name, test_info->name)) { TestErrPrintf("name = '%s', test_info = '%s'\n", name, test_info->name); @@ -575,13 +573,13 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_ static void test_iter_group_large(hid_t fapl) { - hid_t file; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {SPACE1_DIM1}; - herr_t ret; /* Generic return value */ + hid_t file; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {SPACE1_DIM1}; + herr_t ret; /* Generic return value */ char gname[20]; /* Temporary group name */ iter_info *names; /* Names of objects in the root group */ iter_info *curr_name; /* Pointer to the current name in the root group */ @@ -711,7 +709,7 @@ static void test_grp_memb_funcs(hid_t fapl) char dataset_name[NAMELEN]; /* dataset name */ ssize_t name_len; /* Length of object's name */ H5G_info_t ginfo; /* Buffer for querying object's info */ - herr_t ret = SUCCEED; /* Generic return value */ + herr_t ret = SUCCEED; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Group Member Information Functionality\n")); @@ -851,7 +849,7 @@ static void test_links(hid_t fapl) hid_t gid, gid1; H5G_info_t ginfo; /* Buffer for querying object's info */ hsize_t i; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Soft and Hard Link Iteration Functionality\n")); @@ -927,7 +925,7 @@ test_iterate(void) { hid_t fapl, fapl2; /* File access property lists */ unsigned new_format; /* Whether to use the new format or not */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Iteration Operations\n")); @@ -960,15 +958,15 @@ test_iterate(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_iterate() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_iterate + * Function: cleanup_iterate * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 5, 2000 * * Modifications: diff --git a/test/tmisc.c b/test/tmisc.c index f0e595b..4a77b51 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -21,12 +21,11 @@ * *************************************************************/ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5D_TESTING -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" #include "H5Dpkg.h" /* Datasets */ @@ -1816,11 +1815,11 @@ test_misc11(void) unsigned sym_ik; /* Symbol table B-tree initial 'K' value */ unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */ unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */ - unsigned nindexes; /* Shared message number of indexes */ + unsigned nindexes; /* Shared message number of indexes */ H5F_info2_t finfo; /* global information about file */ H5F_fspace_strategy_t strategy; /* File space strategy */ - hsize_t threshold; /* Free-space section threshold */ - hbool_t persist; /* To persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + hbool_t persist; /* To persist free-space or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1859,7 +1858,7 @@ test_misc11(void) /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ H5E_BEGIN_TRY { - ret=H5Pset_sym_k(fcpl, 32770, 0); + ret=H5Pset_sym_k(fcpl, 32770, 0); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_sym_k"); @@ -1868,7 +1867,7 @@ test_misc11(void) /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ H5E_BEGIN_TRY { - ret=H5Pset_istore_k(fcpl, 32770); + ret=H5Pset_istore_k(fcpl, 32770); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_istore_k"); @@ -1980,19 +1979,19 @@ test_misc12(void) "las palabras del que murio en la cruz." }; char *rdata [MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE]; /* Information read in */ - hid_t fid1; - hid_t dataset; - hid_t sid1, space, memspace; - hid_t tid1, cparms; - hsize_t dims1[] = {MISC12_SPACE1_DIM1}; - hsize_t dimsn[] = {MISC12_APPEND_SIZE}; - hsize_t maxdims1[1] = {H5S_UNLIMITED}; - hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; + hid_t fid1; + hid_t dataset; + hid_t sid1, space, memspace; + hid_t tid1, cparms; + hsize_t dims1[] = {MISC12_SPACE1_DIM1}; + hsize_t dimsn[] = {MISC12_APPEND_SIZE}; + hsize_t maxdims1[1] = {H5S_UNLIMITED}; + hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE}; - hsize_t offset[1] = {MISC12_SPACE1_DIM1}; + hsize_t offset[1] = {MISC12_SPACE1_DIM1}; hsize_t count[1] = {MISC12_APPEND_SIZE}; int i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL-type in chunked dataset\n")); @@ -2746,10 +2745,10 @@ test_misc16(void) herr_t ret; /* Generic return value */ char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {MISC16_SPACE_DIM}; + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {MISC16_SPACE_DIM}; int i; /* Initialize the data */ @@ -2831,10 +2830,10 @@ test_misc17(void) herr_t ret; /* Generic return value */ char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2}; + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2}; int i; /* Initialize the data */ @@ -3798,13 +3797,13 @@ test_misc22(void) /* compute the correct PPB that should be set by SZIP */ if(offsets[k] == 0) - correct = prec[j]; + correct = prec[j]; else correct = H5Tget_size(idts[i]) * 8; if(correct > 24) { - if(correct <= 32) + if(correct <= 32) correct = 32; - else if(correct <= 64) + else if(correct <= 64) correct = 64; } /* end if */ @@ -4757,7 +4756,7 @@ test_misc25b(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25b() */ - + /**************************************************************** ** ** test_misc25c(): Exercise another null object header message merge bug. @@ -4891,7 +4890,7 @@ test_misc25c(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25c() */ - + /**************************************************************** ** ** test_misc26(): Regression test: ensure that copying filter @@ -4977,7 +4976,7 @@ test_misc26(void) CHECK_I(ret, "H5Pclose"); } - + /**************************************************************** ** ** test_misc27(): Ensure that objects with incorrect # of object @@ -5022,7 +5021,7 @@ test_misc27(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc27() */ - + /**************************************************************** ** ** test_misc28(): Ensure that the dataset chunk cache will hold @@ -5199,7 +5198,7 @@ test_misc28(void) CHECK_I(ret, "H5Pclose"); } /* end test_misc28() */ - + /**************************************************************** ** ** test_misc29(): Ensure that speculative metadata reads don't @@ -5239,7 +5238,7 @@ test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR { H5O_info_t object_info; - return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); + return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); } static int @@ -5248,7 +5247,7 @@ test_misc30_get_info(hid_t loc_id) return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL); } - + /**************************************************************** ** ** test_misc30(): Exercise local heap code that loads prefix @@ -5280,15 +5279,15 @@ test_misc30(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - + for(i = 0; i < 20; i++) { char gname[32]; fid = H5Fopen(MISC30_FILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); - + if(get_info) { - ret = test_misc30_get_info(fid); + ret = test_misc30_get_info(fid); CHECK(ret, FAIL, "test_misc30_get_info"); } @@ -5300,20 +5299,20 @@ test_misc30(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - } - + } + fid = H5Fopen(MISC30_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); ret = H5Fget_filesize(fid, &file_size[get_info]); CHECK(fid, FAIL, "H5Fget_filesize"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - } - + } + VERIFY(file_size[0], file_size[1], "test_misc30"); } /* end test_misc30() */ - + /**************************************************************** ** ** test_misc31(): Test reentering library through deprecated @@ -5404,14 +5403,14 @@ test_misc31(void) CHECK(ret, FAIL, "H5Fclose"); ret = H5Tclose(dtype_id); CHECK(ret, FAIL, "H5Tclose"); - + #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Output message about test being skipped */ MESSAGE(5, (" ...Skipped")); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end test_misc31() */ - + /**************************************************************** * * test_misc32(): Simple test of filter memory allocation @@ -5475,7 +5474,7 @@ test_misc32(void) resized = H5resize_memory(NULL, 0); CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/ #endif /* NDEBUG */ - + } /* end test_misc32() */ /**************************************************************** @@ -5585,7 +5584,7 @@ test_misc34(void) } /* end test_misc34() */ - + /**************************************************************** ** ** test_misc(): Main misc. test routine. @@ -5638,15 +5637,15 @@ test_misc(void) } /* test_misc() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_misc + * Function: cleanup_misc * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/test/trefer.c b/test/trefer.c index 05c0130..7cbb77f 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: trefer +* Test program: trefer * * Test the Reference functionality * @@ -21,24 +21,22 @@ #include "testhdf5.h" -#include "hdf5.h" - #define FILE1 "trefer1.h5" -#define FILE2 "trefer2.h5" -#define FILE3 "trefer3.h5" +#define FILE2 "trefer2.h5" +#define FILE3 "trefer3.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 /* 2-D dataset with fixed dimensions */ -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 +#define SPACE2_RANK 2 +#define SPACE2_DIM1 10 +#define SPACE2_DIM2 10 /* Larger 1-D dataset with fixed dimensions */ -#define SPACE3_RANK 1 -#define SPACE3_DIM1 100 +#define SPACE3_RANK 1 +#define SPACE3_DIM1 100 /* Element selection information */ #define POINT1_NPOINTS 10 @@ -81,7 +79,7 @@ test_reference_params(void) unsigned *tu32; /* Temporary pointer to uint32 data */ int i; /* counting variables */ const char *write_comment = "Foo!"; /* Comments for group */ - hid_t ret_id; /* Generic hid_t return value */ + hid_t ret_id; /* Generic hid_t return value */ ssize_t name_size; /* Size of reference name */ herr_t ret; /* Generic return value */ @@ -104,7 +102,7 @@ test_reference_params(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -247,13 +245,13 @@ test_reference_params(void) static void test_reference_obj(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ dset2; /* Dereferenced dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; hid_t dapl_id; /* Dataset access property list */ hobj_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ @@ -265,7 +263,7 @@ test_reference_obj(void) char read_comment[10]; H5O_type_t obj_type; /* Object type */ ssize_t size; /* Comment length */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Object Reference Functions\n")); @@ -286,7 +284,7 @@ test_reference_obj(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -496,23 +494,23 @@ test_reference_obj(void) static void test_reference_region(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid2; /* Dataspace ID #2 */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dset1, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid2; /* Dataspace ID #2 */ hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE2_RANK]; /* Selection bounds */ - hsize_t high[SPACE2_RANK]; /* Selection bounds */ - hdset_reg_ref_t *wbuf, /* buffer to write to disk */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t * coords; /* Coordinate buffer */ + hsize_t low[SPACE2_RANK]; /* Selection bounds */ + hsize_t high[SPACE2_RANK]; /* Selection bounds */ + hdset_reg_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ @@ -522,7 +520,7 @@ test_reference_region(void) int i, j; /* counting variables */ hssize_t hssize_ret; /* hssize_t return value */ htri_t tri_ret; /* htri_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ hid_t dset_NA; /* Dataset id for undefined reference */ hid_t space_NA; /* Dataspace id for undefined reference */ @@ -550,7 +548,7 @@ test_reference_region(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a dataset */ dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset2, FAIL, "H5Dcreate2"); @@ -659,7 +657,7 @@ test_reference_region(void) /* Close and release resources for undefined region reference tests */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - ret = H5Sclose(space_NA); + ret = H5Sclose(space_NA); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ @@ -682,10 +680,10 @@ test_reference_region(void) fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fopen"); - /* - * Start the test of an undefined reference + /* + * Start the test of an undefined reference */ - + /* Open the dataset of the undefined references */ dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT); CHECK(dset_NA, FAIL, "H5Dopen2"); @@ -693,28 +691,28 @@ test_reference_region(void) /* Read the data */ ret = H5Dread(dset_NA, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA); CHECK(ret, FAIL, "H5Dread"); - + /* * Dereference an undefined reference (should fail) */ H5E_BEGIN_TRY { dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]); - } H5E_END_TRY; - VERIFY(dset2, FAIL, "H5Rdereference2"); + } H5E_END_TRY; + VERIFY(dset2, FAIL, "H5Rdereference2"); /* Close and release resources. */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - /* This close should fail since H5Rdereference2 never created + /* This close should fail since H5Rdereference2 never created * the id of the referenced object. */ H5E_BEGIN_TRY { ret = H5Dclose(dset2); - } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Dclose"); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Dclose"); - /* - * End the test of an undefined reference + /* + * End the test of an undefined reference */ /* Open the dataset */ @@ -893,22 +891,22 @@ test_reference_region(void) static void test_reference_region_1D(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dset1, /* Dataset ID */ dset3; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid3; /* Dataspace ID #3 */ + hid_t sid1, /* Dataspace ID #1 */ + sid3; /* Dataspace ID #3 */ hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims3[] = {SPACE3_DIM1}; - hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims3[] = {SPACE3_DIM1}; + hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE3_RANK]; /* Selection bounds */ - hsize_t high[SPACE3_RANK]; /* Selection bounds */ + hsize_t low[SPACE3_RANK]; /* Selection bounds */ + hsize_t high[SPACE3_RANK]; /* Selection bounds */ hdset_reg_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ @@ -916,7 +914,7 @@ test_reference_region_1D(void) uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Object type */ int i; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); @@ -938,7 +936,7 @@ test_reference_region_1D(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a dataset */ dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset3, FAIL, "H5Dcreate2"); @@ -1178,14 +1176,14 @@ test_reference_region_1D(void) static void test_reference_obj_deleted(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ dset2; /* Dereferenced dataset ID */ - hid_t sid1; /* Dataspace ID */ + hid_t sid1; /* Dataspace ID */ hobj_ref_t oref; /* Object Reference to test */ H5O_type_t obj_type; /* Object type */ - haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ - herr_t ret; /* Generic return value */ + haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ + herr_t ret; /* Generic return value */ /* Create file */ fid1 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1444,25 +1442,25 @@ test_reference_group(void) static void test_reference_compat(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, dset2; /* Dataset ID */ - hid_t group, group2; /* Group ID */ - hid_t sid1, /* Dataspace IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, dset2; /* Dataset ID */ + hid_t group, group2; /* Group ID */ + hid_t sid1, /* Dataspace IDs */ sid2; - hid_t tid1, tid2; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hid_t tid1, tid2; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ hobj_ref_t *wbuf_obj, /* Buffer to write to disk */ *rbuf_obj; /* Buffer read from disk */ hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */ *rbuf_reg; /* Buffer read from disk */ H5G_obj_t obj_type; /* Object type */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); @@ -1750,15 +1748,15 @@ test_reference(void) } /* test_reference() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_reference + * Function: cleanup_reference * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * September 8, 1998 * * Modifications: diff --git a/test/ttime.c b/test/ttime.c index 2eb2117..48c9ba8 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: ttime +* Test program: ttime * * Test the Time Datatype functionality * @@ -21,8 +21,6 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "ttime.h5" #ifdef NOT_YET #define DATASETNAME "Dataset" @@ -215,15 +213,15 @@ test_time(void) } /* test_time() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_time + * Function: cleanup_time * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * October 19, 2000 * * Modifications: diff --git a/test/tvlstr.c b/test/tvlstr.c index 7b520f2..3315d68 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tvlstr +* Test program: tvlstr * * Test the Variable-Length String functionality * @@ -21,14 +21,12 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "tvlstr.h5" #define DATAFILE2 "tvlstr2.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 #define VLSTR_TYPE "vl_string_type" @@ -115,17 +113,17 @@ test_vlstrings_basic(void) char *rdata[SPACE1_DIM1]; /* Information read in */ char *wdata2; hid_t dataspace, dataset2; - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i; /* counting variable */ size_t str_used; /* String data in memory */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic VL String Functionality\n")); @@ -247,14 +245,14 @@ test_vlstrings_special(void) const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL}; char *rdata[SPACE1_DIM1]; /* Information read in */ char *fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hid_t dcpl; /* Dataset creation property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hid_t dcpl; /* Dataset creation property list ID */ + hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Special VL Strings\n")); @@ -477,14 +475,14 @@ test_compact_vlstring(void) { const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"}; char *rdata[SPACE1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hid_t plist; /* Dataset creation property list */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hid_t plist; /* Dataset creation property list */ + hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Strings in compact dataset\n")); @@ -873,15 +871,15 @@ test_vlstrings(void) test_vl_rewrite(); } /* test_vlstrings() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_vlstrings + * Function: cleanup_vlstrings * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * September 10, 1999 * * Modifications: diff --git a/test/tvltypes.c b/test/tvltypes.c index 0c4cb9d..e5a3d34 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tvltypes +* Test program: tvltypes * * Test the Variable-Length Datatype functionality * @@ -21,24 +21,23 @@ #include "testhdf5.h" -#include "hdf5.h" #include "H5Dprivate.h" #define FILENAME "tvltypes.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 +#define SPACE1_RANK 1 #define SPACE1_DIM1 4 /* 1-D dataset with fixed dimensions */ -#define SPACE3_RANK 1 +#define SPACE3_RANK 1 #define SPACE3_DIM1 128 #define L1_INCM 16 #define L2_INCM 8 #define L3_INCM 3 /* 1-D dataset with fixed dimensions */ -#define SPACE4_RANK 1 +#define SPACE4_RANK 1 #define SPACE4_DIM_SMALL 128 #define SPACE4_DIM_LARGE (H5D_TEMP_BUF_SIZE / 64) @@ -104,7 +103,7 @@ static void test_vltypes_dataset_create(void) { hid_t fid1; /* HDF5 File IDs */ - hid_t dcpl; /* Dataset Property list */ + hid_t dcpl; /* Dataset Property list */ hid_t dataset; /* Dataset ID */ hsize_t dims1[] = {SPACE1_DIM1}; hid_t sid1; /* Dataspace ID */ @@ -136,7 +135,7 @@ test_vltypes_dataset_create(void) /* Create a dataset, supposed to fail */ H5E_BEGIN_TRY { - dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; VERIFY(dataset, FAIL, "H5Dcreate2"); @@ -230,18 +229,18 @@ test_vltypes_vlen_atomic(void) hvl_t wdata2[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ hvl_t fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ hid_t sid2; /* ID of bad dataspace (no extent set) */ - hid_t tid1; /* Datatype ID */ + hid_t tid1; /* Datatype ID */ hid_t dcpl_pid; /* Dataset creation property list ID */ hid_t xfer_pid; /* Dataset transfer property list ID */ hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Atomic VL Datatype Functionality\n")); @@ -556,7 +555,7 @@ rewrite_vltypes_vlen_atomic(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -709,16 +708,16 @@ test_vltypes_vlen_compound(void) } s1; hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Compound VL Datatype Functionality\n")); @@ -863,7 +862,7 @@ rewrite_vltypes_vlen_compound(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1001,14 +1000,14 @@ test_vltypes_compound_vlen_vlen(void) } s1; s1 *wdata; /* data to write */ s1 *rdata; /* data to read */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2, tid3; /* Datatype IDs */ - hsize_t dims1[] = {SPACE3_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2, tid3; /* Datatype IDs */ + hsize_t dims1[] = {SPACE3_DIM1}; unsigned i,j,k; /* counting variables */ hvl_t *t1, *t2; /* Temporary pointer to VL information */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -1182,21 +1181,21 @@ test_vltypes_compound_vlstr(void) s1 wdata2[SPACE1_DIM1]; /* data to write */ s1 rdata[SPACE1_DIM1]; /* data to read */ s1 rdata2[SPACE1_DIM1]; /* data to read */ - char str[64] = "a\0"; - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, dset2; /* Dataset ID */ - hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */ - hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */ - hid_t cparms; - hsize_t dims1[] = {SPACE1_DIM1}; - hsize_t chunk_dims[] = {SPACE1_DIM1/2}; - hsize_t maxdims[] = {H5S_UNLIMITED}; - hsize_t size[] = {SPACE1_DIM1}; - hsize_t offset[] = {0}; + char str[64] = "a\0"; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, dset2; /* Dataset ID */ + hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */ + hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */ + hid_t cparms; + hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t chunk_dims[] = {SPACE1_DIM1/2}; + hsize_t maxdims[] = {H5S_UNLIMITED}; + hsize_t size[] = {SPACE1_DIM1}; + hsize_t offset[] = {0}; unsigned i,j; /* counting variables */ s2 *t1, *t2; /* Temporary pointer to VL information */ - int val; - herr_t ret; /* Generic return value */ + int val; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Datatype of Compound Datatype with VL String Functionality\n")); @@ -1374,10 +1373,10 @@ test_vltypes_compound_vlstr(void) wdata2[i].v.p=(s2*)HDmalloc((i+1)*sizeof(s2)); wdata2[i].v.len=i+1; for(t1=(s2*)(wdata2[i].v).p, j=0; jstring = (char*)HDmalloc(strlen(str)*sizeof(char)+1); + strcat(str, "pp"); + t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1); strcpy(t1->string, str); - t1->color = green; + t1->color = green; } } /* end for */ @@ -1467,17 +1466,17 @@ test_vltypes_compound_vlen_atomic(void) s1 wdata[SPACE1_DIM1]; /* Information to write */ s1 rdata[SPACE1_DIM1]; /* Information read in */ s1 fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ hid_t dcpl_pid; /* Dataset creation property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -1671,9 +1670,9 @@ test_vltypes_compound_vlen_atomic(void) /**************************************************************** ** ** rewrite_vltypes_compound_vlen_atomic(): Check memory leak for -** basic VL datatype code. +** basic VL datatype code. ** Check memory leak for compound datatypes with VL datatypes -** of atomic datatypes. +** of atomic datatypes. ** ****************************************************************/ static void @@ -1694,7 +1693,7 @@ rewrite_vltypes_compound_vlen_atomic(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1855,16 +1854,16 @@ test_vltypes_vlen_vlen_atomic(void) hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ hvl_t *t1, *t2; /* Temporary pointer to VL information */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j,k; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -2049,12 +2048,12 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1; /* Dataspace ID */ - hid_t tid2; /* Datatype IDs */ + hid_t tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ hsize_t size; /* Number of bytes which will be used */ unsigned i,j,k; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=1; + unsigned increment=1; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -3171,15 +3170,15 @@ test_vltypes(void) /* These next tests use the same file */ test_vltypes_dataset_create(); /* Check dataset of VL when fill value - * won't be rewritten to it.*/ + * won't be rewritten to it.*/ test_vltypes_funcs(); /* Test functions with VL types */ test_vltypes_vlen_atomic(); /* Test VL atomic datatypes */ - rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */ + rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */ test_vltypes_vlen_compound(); /* Test VL compound datatypes */ - rewrite_vltypes_vlen_compound(); /* Check VL memory leak */ + rewrite_vltypes_vlen_compound(); /* Check VL memory leak */ test_vltypes_compound_vlen_atomic(); /* Test compound datatypes with VL atomic components */ - rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */ - test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ + rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */ + test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ rewrite_longer_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of longer sequence*/ rewrite_shorter_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of shorted sequence*/ test_vltypes_compound_vlen_vlen();/* Test compound datatypes with VL atomic components */ @@ -3187,15 +3186,15 @@ test_vltypes(void) test_vltypes_fill_value(); /* Test fill value for VL data */ } /* test_vltypes() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_vltypes + * Function: cleanup_vltypes * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June 8, 1999 * * Modifications: -- cgit v0.12 From 2ee6908b6ab3e497b54cd2c739f78c222f1c27eb Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Feb 2018 12:03:32 -0600 Subject: Fix for daily test failure for configuration with --disable-deprecated-symbols --- test/tfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tfile.c b/test/tfile.c index 8b66603..f1a4a1d 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5267,7 +5267,7 @@ test_libver_bounds_super(hid_t fapl) /* This will result in superblock version 2 */ fcpl = H5Pcreate(H5P_FILE_CREATE); CHECK(fcpl, FAIL, "H5Pcreate"); - ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); + ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 1, (hsize_t)1); CHECK(ret, FAIL, "H5Pset_file_space"); /* Verify superblock version when creating a file with input fapl, -- cgit v0.12 From e277d537d2ab99e2294b8312a40d162cb38ba0b7 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Feb 2018 14:30:51 -0600 Subject: Fix for daily test failures Move the declarations for the three arrays of versions from H5Opkg.h: (1) H5O_layout_vers_bounds to H5Dpkg.h (2) H5O_dtype_ver_bounds to H5Tpkg.h (3) H5O_sdspace_ver_bounds to H5Spkg.h This is to fix Windows' complaint for unresolved symbols. --- src/H5Dpkg.h | 3 +++ src/H5Opkg.h | 6 ++---- src/H5Spkg.h | 3 +++ src/H5Tpkg.h | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 45f2d3a..78705c7 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -562,6 +562,9 @@ H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_BT2[1]; H5_DLLVAR const H5B2_class_t H5D_BT2[1]; H5_DLLVAR const H5B2_class_t H5D_BT2_FILT[1]; +/* Array of versions for Layout */ +H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS]; + /******************************/ /* Package Private Prototypes */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 498938a..649ee3b 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -642,14 +642,12 @@ H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs); /* Arrays of versions for: - Object header, Layout/Attribute/Datatype/Fill value/Filter pipeline/Dataspace messages */ + Object header, Attribute/Fill value/Filter pipeline messages */ +/* Layout/Datatype/Dataspace arrays of versions are in H5Dpkg.h, H5Tpkg.h and H5Spkg.h */ H5_DLLVAR const unsigned H5O_obj_ver_bounds[H5F_LIBVER_NBOUNDS]; -H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_attr_ver_bounds[H5F_LIBVER_NBOUNDS]; -H5_DLLVAR const unsigned H5O_dtype_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_fill_ver_bounds[H5F_LIBVER_NBOUNDS]; H5_DLLVAR const unsigned H5O_pline_ver_bounds[H5F_LIBVER_NBOUNDS]; -H5_DLLVAR const unsigned H5O_sdspace_ver_bounds[H5F_LIBVER_NBOUNDS]; /* Testing functions */ #ifdef H5O_TESTING diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 315af29..5312ce7 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -262,6 +262,9 @@ H5_DLLVAR const H5S_select_class_t H5S_sel_none[1]; */ H5_DLLVAR const H5S_select_class_t H5S_sel_point[1]; +/* Array of versions for Dataspace */ +H5_DLLVAR const unsigned H5O_sdspace_ver_bounds[H5F_LIBVER_NBOUNDS]; + /* Extent functions */ H5_DLL herr_t H5S_extent_release(H5S_extent_t *extent); H5_DLL herr_t H5S_extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index d075127..f05c021 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -332,6 +332,9 @@ typedef struct { /* Typedef for datatype iteration operations */ typedef herr_t (*H5T_operator_t)(H5T_t *dt, void *op_data/*in,out*/); +/* Array of versions for Datatype */ +H5_DLLVAR const unsigned H5O_dtype_ver_bounds[H5F_LIBVER_NBOUNDS]; + /* * Alignment information for native types. A value of N indicates that the * data must be aligned on an address ADDR such that 0 == ADDR mod N. When -- cgit v0.12 From 76d70073c60163e97db98d3adfb745f2c561fdb2 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Feb 2018 16:11:12 -0600 Subject: Fix for daily test failure Fix for test/testhdf5.sh for configuration with --enable-using-memchecker. --- test/tfile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/tfile.c b/test/tfile.c index 1678fb6..de1f362 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5518,7 +5518,12 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) H5E_BEGIN_TRY { fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl); } H5E_END_TRY; - ok = fid >= 0; + + /* Get the internal file pointer if the open succeeds */ + if((ok = fid >= 0)) { + f = (H5F_t *)H5I_object(fid); + CHECK(f, NULL, "H5I_object"); + } /* Verify the file open succeeds or fails */ switch(super_vers) { -- cgit v0.12 From a77a08b02fb31e87f451a39640e4376e49878097 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Feb 2018 16:14:48 -0600 Subject: HDFFV-10384 Add optional arg to enable-error-stack --- tools/lib/h5tools.c | 22 +++++++++++++---- tools/lib/h5tools.h | 2 +- tools/src/h5copy/h5copy.c | 4 ++-- tools/src/h5diff/h5diff_common.c | 2 +- tools/src/h5diff/h5diff_main.c | 2 +- tools/src/h5dump/h5dump.c | 49 ++++++++++++++++++++------------------ tools/src/h5repack/h5repack_main.c | 4 ++-- 7 files changed, 50 insertions(+), 35 deletions(-) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 89cb524..11888bc 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -43,7 +43,7 @@ unsigned packed_bits_num; /* number of packed bits to display */ unsigned packed_data_offset; /* offset of packed bits to display */ unsigned packed_data_length; /* length of packed bits to display */ unsigned long long packed_data_mask; /* mask in which packed bits to display */ -int enable_error_stack= FALSE; /* re-enable error stack */ +int enable_error_stack = 0; /* re-enable error stack; disable=0 enable=1 */ /* sort parameters */ H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ @@ -548,9 +548,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, if ((my_fapl = h5tools_get_fapl(fapl, driver, &drivernum)) < 0) goto done; - H5E_BEGIN_TRY { + /* allow error stack display if enable-error-stack has optional arg number */ + if (enable_error_stack > 1) { fid = H5Fopen(fname, flags, my_fapl); - } H5E_END_TRY; + } + else { + H5E_BEGIN_TRY { + fid = H5Fopen(fname, flags, my_fapl); + } H5E_END_TRY; + } if (fid == FAIL) goto done; @@ -563,9 +569,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, if((my_fapl = h5tools_get_fapl(fapl, drivernames[drivernum], NULL)) < 0) goto done; - H5E_BEGIN_TRY { + /* allow error stack display if enable-error-stack has optional arg number */ + if (enable_error_stack > 1) { fid = H5Fopen(fname, flags, my_fapl); - } H5E_END_TRY; + } + else { + H5E_BEGIN_TRY { + fid = H5Fopen(fname, flags, my_fapl); + } H5E_END_TRY; + } if (fid != FAIL) break; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 6383df5..c360230 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -573,7 +573,7 @@ H5TOOLS_DLLVAR H5_index_t sort_by; /*sort_by [creation_order | name] * H5TOOLS_DLLVAR H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ /* things to display or which are set via command line parameters */ -H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack */ +H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack; disable=0 enable=1 */ /* Strings for output */ #define H5_TOOLS_GROUP "GROUP" diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 1d15d12..1800810 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -293,7 +293,7 @@ main (int argc, const char *argv[]) break; case 'E': - enable_error_stack = TRUE; + enable_error_stack = 1; break; default: @@ -330,7 +330,7 @@ main (int argc, const char *argv[]) leave(EXIT_FAILURE); } - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index ce5df78..8f09c81 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -178,7 +178,7 @@ void parse_command_line(int argc, break; case 'S': - enable_error_stack = TRUE; + enable_error_stack = 1; break; case 'E': diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index ad488a4..c5a0cbf 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -100,7 +100,7 @@ int main(int argc, const char *argv[]) */ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index b90d60f..62f0ed0 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -67,7 +67,7 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*N:vG:"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RE*CM:O*N:vG:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -181,7 +181,7 @@ static struct long_options l_opts[] = { { "sort_order", require_arg, 'z' }, { "format", require_arg, 'm' }, { "region", no_arg, 'R' }, - { "enable-error-stack", no_arg, 'E' }, + { "enable-error-stack", optional_arg, 'E' }, { "packed-bits", require_arg, 'M' }, { "no-compact-subset", no_arg, 'C' }, { "ddl", optional_arg, 'O' }, @@ -191,7 +191,7 @@ static struct long_options l_opts[] = { { NULL, 0, '\0' } }; - + /*------------------------------------------------------------------------- * Function: leave * @@ -214,7 +214,7 @@ leave(int ret) HDexit(ret); } - + /*------------------------------------------------------------------------- * Function: usage * @@ -366,7 +366,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, "\n"); } - + /*------------------------------------------------------------------------- * Function: table_list_add * @@ -419,7 +419,7 @@ table_list_add(hid_t oid, unsigned long file_no) return((ssize_t) idx); } /* end table_list_add() */ - + /*------------------------------------------------------------------------- * Function: table_list_visited * @@ -449,7 +449,7 @@ table_list_visited(unsigned long file_no) return(-1); } /* end table_list_visited() */ - + /*------------------------------------------------------------------------- * Function: table_list_free * @@ -817,7 +817,7 @@ parse_mask_list(const char *h_list) } } - + /*------------------------------------------------------------------------- * Function: free_handler * @@ -865,7 +865,7 @@ free_handler(struct handler_t *hand, int len) } } - + /*------------------------------------------------------------------------- * Function: parse_command_line * @@ -920,9 +920,8 @@ parse_start: case 'n': display_fi = TRUE; last_was_dset = FALSE; - if ( opt_arg != NULL) { + if (opt_arg != NULL) h5trav_set_verbose(HDatoi(opt_arg)); - } break; case 'p': display_dcpl = TRUE; @@ -939,8 +938,9 @@ parse_start: last_was_dset = FALSE; break; case 'A': - if ( opt_arg != NULL) { - if(0 == HDatoi(opt_arg)) include_attrs = FALSE; + if (opt_arg != NULL) { + if(0 == HDatoi(opt_arg)) + include_attrs = FALSE; } else { display_data = FALSE; @@ -1059,7 +1059,7 @@ parse_start: break; case 'o': - if ( bin_output ) { + if (bin_output) { if (h5tools_set_data_output_file(opt_arg, 1) < 0) { usage(h5tools_getprogname()); goto error; @@ -1086,8 +1086,8 @@ parse_start: break; case 'b': - if ( opt_arg != NULL) { - if ( ( bin_form = set_binary_form(opt_arg)) < 0) { + if (opt_arg != NULL) { + if ((bin_form = set_binary_form(opt_arg)) < 0) { /* failed to set binary form */ usage(h5tools_getprogname()); goto error; @@ -1106,7 +1106,7 @@ parse_start: break; case 'q': - if ( ( sort_by = set_sort_by(opt_arg)) < 0) { + if ((sort_by = set_sort_by(opt_arg)) < 0) { /* failed to set "sort by" form */ usage(h5tools_getprogname()); goto error; @@ -1114,7 +1114,7 @@ parse_start: break; case 'z': - if ( ( sort_order = set_sort_order(opt_arg)) < 0) { + if ((sort_order = set_sort_order(opt_arg)) < 0) { /* failed to set "sort order" form */ usage(h5tools_getprogname()); goto error; @@ -1268,7 +1268,10 @@ end_collect: /** end subsetting parameters **/ case 'E': - enable_error_stack = TRUE; + if (opt_arg != NULL) + enable_error_stack = HDatoi(opt_arg); + else + enable_error_stack = 1; break; case 'C': disable_compact_subset = TRUE; @@ -1306,7 +1309,7 @@ error: return hand; } - + /*------------------------------------------------------------------------- * Function: main * @@ -1388,7 +1391,7 @@ main(int argc, const char *argv[]) goto done; } - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } @@ -1764,7 +1767,7 @@ h5_fileaccess(void) return fapl; } - + /*------------------------------------------------------------------------- * Function: init_prefix * @@ -1785,7 +1788,7 @@ init_prefix(char **prfx, size_t prfx_len) error_msg("unable to allocate prefix buffer\n"); } - + /*------------------------------------------------------------------------- * Function: add_prefix * diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 0fa268e..226f58e 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -667,7 +667,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'E': - enable_error_stack = TRUE; + enable_error_stack = 1; break; default: @@ -760,7 +760,7 @@ int main(int argc, const char **argv) } } - if (enable_error_stack) { + if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } -- cgit v0.12 From ebb3bb0cfc08f3674606d78ec8c18cb7132650cd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Feb 2018 16:58:51 -0600 Subject: HDFFV-10384 Add opt arg to help --- release_docs/RELEASE.txt | 12 ++++++++++++ tools/src/h5dump/h5dump.c | 4 ++-- tools/testfiles/h5dump-help.txt | 4 ++-- tools/testfiles/pbits/tnofilename-with-packed-bits.ddl | 4 ++-- tools/testfiles/pbits/tpbitsIncomplete.ddl | 4 ++-- tools/testfiles/pbits/tpbitsLengthExceeded.ddl | 4 ++-- tools/testfiles/pbits/tpbitsLengthPositive.ddl | 4 ++-- tools/testfiles/pbits/tpbitsMaxExceeded.ddl | 4 ++-- tools/testfiles/pbits/tpbitsOffsetExceeded.ddl | 4 ++-- tools/testfiles/pbits/tpbitsOffsetNegative.ddl | 4 ++-- 10 files changed, 30 insertions(+), 18 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c13b247..e7186c5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -312,6 +312,18 @@ Bug Fixes since HDF5-1.10.1 release ----- - h5dump + the tools library will hide the error stack during file open. + + While this is preferable almost always, there are reasons to enable + display of the error stack when a tool will not open a file. Adding an + optional argument to the --enable-error-stack will provide this use case. + As an optional argument it will not affect the operation of the + --enable-error-stack. h5dump is the only tool to implement this change. + + (ADB - 2018/02/15, HDFFV-10384) + + - h5dump + h5dump would output an indented blank line in the filters section. h5dump overused the h5tools_simple_prefix function, which is a diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 62f0ed0..25e4858 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -273,8 +273,8 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " -m T, --format=T Set the floating point output format\n"); PRINTVALSTREAM(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); - PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - PRINTVALSTREAM(rawoutstream, " occur.\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, " Optional value 2 also prints file open errors.\n"); PRINTVALSTREAM(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); PRINTVALSTREAM(rawoutstream, " of \"[\" in dataset names.\n"); PRINTVALSTREAM(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index fe22a1b..19de76f 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl index 767cbbf..0a3beb0 100644 --- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl index d791b41..b353065 100644 --- a/tools/testfiles/pbits/tpbitsIncomplete.ddl +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl index 5235aa7..ffe0da9 100644 --- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl index 697bff8..4502143 100644 --- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl index 900c0b5..011f6c9 100644 --- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl index 65123d0..857fe62 100644 --- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl index d352e34..9ac1160 100644 --- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -44,8 +44,8 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) -- cgit v0.12 From b65ec9d05b9301ec639fac03b26c6ec06e463888 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 16 Feb 2018 22:55:42 -0600 Subject: Fixed daily test failure Description: Added missing H5Pclose that caused daily test failure. Platforms tested: Linux/64 (jelly) Linux/64 (moohan) Darwin (osx1010test) --- test/set_extent.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/set_extent.c b/test/set_extent.c index 0467073..5d11819 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -427,6 +427,7 @@ error: */ static int do_layouts( hid_t fapl ) { + hid_t new_fapl = -1; H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Generic return value */ @@ -435,8 +436,6 @@ static int do_layouts( hid_t fapl ) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - hid_t new_fapl; - /* Copy plist to use locally to avoid modifying the original */ new_fapl = H5Pcopy(fapl); @@ -446,7 +445,11 @@ static int do_layouts( hid_t fapl ) } H5E_END_TRY; if (ret < 0) /* Invalid low/high combinations */ + { + if (H5Pclose(new_fapl) < 0) + goto error; continue; + } if (test_layouts( H5D_COMPACT, new_fapl ) < 0) goto error; @@ -454,6 +457,8 @@ static int do_layouts( hid_t fapl ) if (test_layouts( H5D_CONTIGUOUS, new_fapl ) < 0) goto error; + if (H5Pclose(new_fapl) < 0) + goto error; } /* end for high */ } /* end for low */ @@ -462,6 +467,10 @@ static int do_layouts( hid_t fapl ) return 0; error: + H5E_BEGIN_TRY + { + H5Pclose(new_fapl); + } H5E_END_TRY; return -1; } -- cgit v0.12 From 39e3da756333d5c0e5f024d9067edbadea4a018b Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sat, 17 Feb 2018 16:18:37 -0600 Subject: Improving tests Description: - Added test for version bounds with nested datatypes - Added script for additional version bound test in h5repack - Cleaned up tests for consistency - Removed extra included header files Platforms tested: Linux/64 (jelly) Linux/64 (moohan) Darwin (osx1010test) --- test/dsets.c | 8 +- test/dtypes.c | 655 +++++++++++++++++++++++++++++-------- test/objcopy.c | 4 +- test/th5s.c | 4 - tools/test/h5repack/h5repack.sh.in | 96 +++++- 5 files changed, 616 insertions(+), 151 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 17cf23c..0788bc8 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -750,10 +750,10 @@ test_compact_io(hid_t fapl) hsize_t dims[2]; int wbuf[16][8], rbuf[16][8]; char filename[FILENAME_BUF_SIZE]; - H5F_libver_t low, high; /* File format bounds */ - H5F_t *fp; /* Internal file pointer */ - H5D_t *dsetp; /* Internal dataset pointer */ - int i, j, n; + H5F_libver_t low, high; /* File format bounds */ + H5F_t *fp; /* Internal file pointer */ + H5D_t *dsetp; /* Internal dataset pointer */ + int i, j, n; /* Indices */ herr_t ret; /* Generic return value */ TESTING("compact dataset I/O"); diff --git a/test/dtypes.c b/test/dtypes.c index 7e8047d..e480682 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -19,6 +19,7 @@ */ #include "h5test.h" +#include "testhdf5.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ @@ -46,6 +47,16 @@ #define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #endif + +/* Use in version bound test */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_TESTING +#include "H5Fpkg.h" /* File access */ + +/* Use in version bound test */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Opkg.h" /* Object headers */ + #define SET_ALIGNMENT(TYPE,VAL) \ H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL) @@ -92,7 +103,15 @@ typedef enum dtype_t { INT_SCHAR, INT_UCHAR, INT_SHORT, INT_USHORT, INT_INT, INT_UINT, INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, FLT_FLOAT, FLT_DOUBLE, FLT_LDOUBLE, OTHER -} dtype_t; +} dtype_t; /* This doesn't seem to be used anywhere... -BMR */ + +typedef enum { + E1_RED, + E1_GREEN, + E1_BLUE, + E1_ORANGE, + E1_YELLOW +} color_t; /* Constant for size of conversion buffer for int <-> float exception test */ #define CONVERT_SIZE 4 @@ -1678,7 +1697,7 @@ test_compound_9(void) { typedef struct cmpd_struct { int i1; - char* str; + const char* str; int i2; } cmpd_struct; @@ -2526,7 +2545,7 @@ test_compound_14(void) typedef struct cmpd_struct_1 { char c1; char c2; - char* str; + const char* str; } cmpd_struct_1; typedef struct cmpd_struct_2 { @@ -3299,7 +3318,7 @@ test_compound_18(void) /* Create compound datatype, but don't insert fields */ tid = H5Tcreate(H5T_COMPOUND, (size_t)8); - assert(tid > 0); + HDassert(tid > 0); /* Attempt to create file with compound datatype that has no fields */ /* Create File */ @@ -3308,7 +3327,7 @@ test_compound_18(void) /* Create a dataspace to use */ sid = H5Screate_simple(1, &dim, NULL); - assert(sid > 0); + HDassert(sid > 0); /* Create a dataset with the bad compound datatype */ H5E_BEGIN_TRY { @@ -3321,7 +3340,7 @@ test_compound_18(void) /* Create a group */ gid = H5Gcreate2(file, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(gid > 0); + HDassert(gid > 0); /* Create an attribute with the bad compound datatype */ H5E_BEGIN_TRY { @@ -4672,7 +4691,7 @@ test_conv_enum_2(void) /* Destination enum type */ dsttype = H5Tenum_create(H5T_NATIVE_INT); - assert(H5Tget_size(dsttype) > H5Tget_size(srctype)); + HDassert(H5Tget_size(dsttype) > H5Tget_size(srctype)); for (i=0; i<8; i++) H5Tenum_insert(dsttype, mname[i], &i); @@ -6682,7 +6701,7 @@ error: } /* end test_named_indirect_reopen() */ static void create_del_obj_named_test_file(const char *filename, hid_t fapl, - hbool_t new_format) + H5F_libver_t low, H5F_libver_t high) { hid_t file; /* File ID */ hid_t type; /* Datatype ID */ @@ -6692,93 +6711,97 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl, hid_t fcpl; /* File creation property list ID */ hid_t my_fapl; /* Copy of file access property list ID */ hid_t dcpl; /* Dataset creation property list ID */ + unsigned use_at_least_v18;/* Whether to use old or new format */ herr_t status; /* Generic return value */ /* Make copy of FAPL */ my_fapl = H5Pcopy(fapl); - assert(my_fapl > 0); + HDassert(my_fapl > 0); - if(new_format) { - /* Use latest version of file format */ - status = H5Pset_libver_bounds(my_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - assert(status >= 0); - } /* end if */ + /* Use low/high version of file format */ + status = H5Pset_libver_bounds(my_fapl, low, high); + HDassert(status >= 0); + + /* Set new format flag. Note: the case high < low should be caught in the caller */ + use_at_least_v18 = 0; + if (low >= H5F_LIBVER_V18) + use_at_least_v18 = 1; /* Create a file creation property list (used for the root group's creation property list) */ fcpl = H5Pcreate(H5P_FILE_CREATE); - assert(fcpl > 0); + HDassert(fcpl > 0); - if(new_format) { + if(use_at_least_v18) { /* Use dense link storage for all links in root group */ status = H5Pset_link_phase_change(fcpl, 0, 0); - assert(status >= 0); + HDassert(status >= 0); } /* end if */ /* Create file with attribute that uses committed datatype */ file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, my_fapl); - assert(file > 0); + HDassert(file > 0); /* Close FCPL */ status = H5Pclose(fcpl); - assert(status >= 0); + HDassert(status >= 0); /* Close FAPL */ status = H5Pclose(my_fapl); - assert(status >= 0); + HDassert(status >= 0); /* Create datatype to commit */ type = H5Tvlen_create(H5T_NATIVE_INT); - assert(type > 0); + HDassert(type > 0); /* Commit datatype */ status = H5Tcommit2(file, DEL_OBJ_NAMED_NAMED_DTYPE, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(status >= 0); + HDassert(status >= 0); /* Create scalar dataspace */ space = H5Screate(H5S_SCALAR); - assert(space > 0); + HDassert(space > 0); /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - assert(dcpl > 0); + HDassert(dcpl > 0); - if(new_format) { + if(use_at_least_v18) { /* Use dense attribute storage for all attributes on dataset */ status = H5Pset_attr_phase_change(dcpl, 0, 0); - assert(status >= 0); + HDassert(status >= 0); } /* end if */ /* Create dataset */ dset = H5Dcreate2(file, DEL_OBJ_NAMED_DATASET, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); - assert(dset > 0); + HDassert(dset > 0); /* Close DCPL */ status = H5Pclose(dcpl); - assert(status >= 0); + HDassert(status >= 0); /* Close dataset */ status = H5Dclose(dset); - assert(status >= 0); + HDassert(status >= 0); /* Create attribute */ attr = H5Acreate_by_name(file, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(attr > 0); + HDassert(attr > 0); /* Close dataspace */ status = H5Sclose(space); - assert(status >= 0); + HDassert(status >= 0); /* Close datatype */ status = H5Tclose(type); - assert(status >= 0); + HDassert(status >= 0); /* Close attribute */ status = H5Aclose(attr); - assert(status >= 0); + HDassert(status >= 0); /* Close file */ status = H5Fclose(file); - assert(status >= 0); + HDassert(status >= 0); } /* end create_del_obj_named_test_file() */ @@ -6803,7 +6826,7 @@ test_delete_obj_named(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - unsigned new_format; /* Whether to use old or new format */ + H5F_libver_t low, high; /* File format bounds */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -6813,47 +6836,54 @@ test_delete_obj_named(hid_t fapl) h5_fixname(FILENAME[8], fapl, filename, sizeof filename); h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2); - /* Loop over old & new format files */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + /* Loop through all valid the combinations of low/high library format bounds, + to test delete objects that use named datatypes through different file IDs */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { -/* Test deleting dataset opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Skip invalid low/high combination */ + if ((high == H5F_LIBVER_EARLIEST) || (low > high)) + continue; - if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + /* Test deleting dataset opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR - if(H5Ldelete(filea2, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Ldelete(filea2, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT) < 0) FAIL_STACK_ERROR - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR -/* Test deleting attribute opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + /* Test deleting attribute opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Adelete_by_name(filea2, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR - } /* end for */ + if(H5Adelete_by_name(filea2, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + } /* end high */ + } /* end low */ if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR @@ -6898,7 +6928,7 @@ test_delete_obj_named_fileid(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - unsigned new_format; /* Whether to use old or new format */ + H5F_libver_t low, high; /* File format bounds */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -6908,108 +6938,115 @@ test_delete_obj_named_fileid(hid_t fapl) h5_fixname(FILENAME[8], fapl, filename, sizeof filename); h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2); - /* Loop over old & new format files */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + /* Loop through all the combinations of low/high library format bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { -/* Test getting file ID for dataset opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Skip invalid low/high combination */ + if ((high == H5F_LIBVER_EARLIEST) || (low > high)) + continue; - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + /* Test getting file ID for dataset opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from dataset matches correct file */ - dset_fid = H5Iget_file_id(dset); - if(dset_fid != filea1) TEST_ERROR - H5Fclose(dset_fid); + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Dget_type(dset); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + dset_fid = H5Iget_file_id(dset); + if(dset_fid != filea1) TEST_ERROR + H5Fclose(dset_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Dget_type(dset); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR - /* Verify file ID from dataset matches correct file */ - dset_fid = H5Iget_file_id(dset); - if(dset_fid != filea1) TEST_ERROR - H5Fclose(dset_fid); + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Dget_type(dset); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + dset_fid = H5Iget_file_id(dset); + if(dset_fid != filea1) TEST_ERROR + H5Fclose(dset_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Dget_type(dset); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR - /* Create test file, with attribute that uses committed datatype */ - create_del_obj_named_test_file(filename, fapl, new_format); + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR -/* Test getting file ID for attribute opened through different file ID */ - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, low, high); - /* Verify file ID from dataset matches correct file */ - attr_fid = H5Iget_file_id(attr); - if(attr_fid != filea1) TEST_ERROR - H5Fclose(attr_fid); + /* Test getting file ID for attribute opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Aget_type(attr); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + attr_fid = H5Iget_file_id(attr); + if(attr_fid != filea1) TEST_ERROR + H5Fclose(attr_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Aget_type(attr); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); - if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR - if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR - /* Verify file ID from dataset matches correct file */ - attr_fid = H5Iget_file_id(attr); - if(attr_fid != filea1) TEST_ERROR - H5Fclose(attr_fid); + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - /* Verify file ID from datatype (from dataset) matches correct file */ - type = H5Aget_type(attr); - type_fid = H5Iget_file_id(type); - if(type_fid != filea1) TEST_ERROR - H5Fclose(type_fid); - H5Tclose(type); + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + /* Verify file ID from dataset matches correct file */ + attr_fid = H5Iget_file_id(attr); + if(attr_fid != filea1) TEST_ERROR + H5Fclose(attr_fid); - if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR - if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR - if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR - } /* end for */ + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Aget_type(attr); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + } /* end high */ + } /* end low */ if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR @@ -7018,12 +7055,15 @@ test_delete_obj_named_fileid(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(attr); + H5Aclose(attr); + H5Tclose(type); H5Dclose(dset); H5Pclose(fapl2); H5Fclose(filea1); H5Fclose(filea2); H5Fclose(fileb); + H5Fclose(attr_fid); + H5Fclose(type_fid); } H5E_END_TRY; return 1; } /* end test_delete_obj_named_fileid() */ @@ -7388,7 +7428,344 @@ error: return 1; } +/*------------------------------------------------------------------------- + * Function: verify_version + * + * Purpose: Utility function to verify the datatype versions of nested + * datatype. + * + * Description: + * Verify the datatype message version + * --H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: + * the library will set version according to low_bound + * --H5T_ARRAY: + * the earliest version the library will set is 2 + * --H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, + * H5T_OPAQUE, H5T_REFERENCE: + * the library will only use basic version + * + *************************************************************************/ +static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_shared_low_bound, unsigned *highest_version) +{ + H5T_t *dtypep = NULL; /* Internal structure of a datatype */ + H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */ + hid_t base_dtype = -1; + hid_t mem_dtype = -1; + int nmembers = 0; + unsigned i; + H5F_libver_t highest = H5F_LIBVER_EARLIEST; + herr_t ret = SUCCEED; /* Generic return value */ + + dtypep = (H5T_t *)H5I_object(dtype); + if (dtypep == NULL) TEST_ERROR + + /* Carry out the verification according to the class of the datatype. + For compound datatype, its members will be verified, recursively. + For array datatype, its element datatype will be verified, recursively.*/ + type_cls = dtypep->shared->type; + switch (type_cls) + { + case H5T_ARRAY: + + if (low == H5F_LIBVER_EARLIEST) + VERIFY(dtypep->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); + else + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "H5O_dtype_ver_bounds"); + + /* Get the base datatype of this array type */ + base_dtype = H5Tget_super(dtype); + CHECK(base_dtype, FAIL, "H5Tget_super"); + + /* Verify the base datatype recursively */ + ret = verify_version(base_dtype, low, f_shared_low_bound, highest_version); + + /* Close the member datatype before checking for failure */ + if ((H5Tclose(base_dtype)) < 0) TEST_ERROR + + /* Check if verify_version fails */ + if (ret < 0) TEST_ERROR + + break; + case H5T_COMPOUND: + /* Get the number of members of this compound type */ + if ((nmembers = H5Tget_nmembers(dtype)) < 0) TEST_ERROR + + /* Go through all its member datatypes */ + for (i = 0; i < (unsigned)nmembers; i++) + { + /* Get the member datatype and verify it recursively */ + mem_dtype = H5Tget_member_type(dtype, i); + if (mem_dtype < 0) TEST_ERROR + ret = verify_version(mem_dtype, low, f_shared_low_bound, highest_version); + + /* Close the member datatype before checking for failure */ + if ((H5Tclose(mem_dtype)) < 0) TEST_ERROR + + /* Check if verify_version fails */ + if (ret < 0) TEST_ERROR + } + /* If this compound datatype contains a datatype of higher version, it + will be promoted to that version */ + if (*highest_version > H5O_dtype_ver_bounds[low]) + VERIFY(dtypep->shared->version, *highest_version, "verify_version"); + else + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); + break; + case H5T_ENUM: + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); + break; + case H5T_VLEN: + case H5T_FLOAT: + case H5T_INTEGER: + VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "verify_version"); + break; + case H5T_NCLASSES: + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + default: + TEST_ERROR + } /* end switch */ + +error: + H5E_BEGIN_TRY { + H5Tclose(base_dtype); + H5Tclose(mem_dtype); + } H5E_END_TRY; + return ret; +} /* end of verify_version */ + + +/*------------------------------------------------------------------------- + * Function: test_versionbounds + * + * Purpose: Tests version bounds. + * + * Description: + * This function creates a datatype for a dataset as followed: + * outer_arr_type + * outer_cmp_type + * inner_cmp_type + * inner_arr_type + * simple_cmp_type + * H5T_NATIVE_INT + * H5T_ARRAY of H5T_NATIVE_CHAR + * vlen_floattype + * enum_type + * It then loops through all valid combination of the library version + * bounds to verify each datatype's version. + * + * Return: Success: 0 + * Failure: number of errors + * + *------------------------------------------------------------------------- + */ +#define VERFNAME "tverbounds_dtype.h5" +#define VERDSNAME "dataset 1" +#define ARRAY_RANK 1 +#define ARRAY_LEN 10 +static int +test_versionbounds(void) +{ + typedef struct { /* Struct for the simple compound type */ + int single_int; + char char_arr[ARRAY_LEN]; + } simple_cmp_t; + + typedef struct { /* Struct for the inner compound type */ + simple_cmp_t inner_arr[ARRAY_LEN]; + hvl_t vlen_float; + } inner_cmp_t; + + typedef struct { /* Struct for the outer compound type */ + inner_cmp_t inner_cmp; + color_t enum_color; + } outer_cmp_t; + + hid_t file = -1; /* File ID */ + hid_t space = -1; /* Dataspace ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t fapl = -1; /* Copy of file access property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t dset_dtype = -1; /* Dataset's datatype */ + hid_t arr_chartype = -1; /* Array of characters datatype */ + hid_t vlen_floattype = -1; /* Vlen of float datatype */ + hid_t enum_type = -1; /* Enumeration datatype */ + hid_t outer_cmp_type = -1; /* Outer compound datatype */ + hid_t inner_cmp_type = -1; /* Inner compound datatype */ + hid_t simple_cmp_type = -1;/* Simple cmpd dtype, contains no other cmpd */ + hid_t outer_arr_type = -1; /* Outermost array datatype */ + hid_t inner_arr_type = -1; /* Inner array datatype */ + H5F_t *filep = NULL; /* Pointer to internal structure of a file */ + H5T_t *dtypep = NULL; /* Pointer to internal structure of a datatype */ + hsize_t arr_dim[] = {ARRAY_LEN}; /* Length of the array */ + H5F_libver_t low, high; /* File format bounds */ + unsigned highest_version; /* Highest version in nested datatypes */ + color_t enum_val; /* Enum type index */ + herr_t ret = 0; /* Generic return value */ + + TESTING("version bounds with nested datatypes"); + + /* Create a file access property list */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR + + /* Create a file creation property list */ + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR + + /* Create a scalar dataspace */ + if ((space = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR + + /* Create a dataset creation property list */ + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR + + /* Create an array datatype of chars */ + arr_chartype = H5Tarray_create2(H5T_NATIVE_CHAR, ARRAY_RANK, arr_dim); + if (arr_chartype < 0) TEST_ERROR + + /* Create the simple compound datatype that has an integer and an + array of chars */ + simple_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(simple_cmp_t)); + if (simple_cmp_type < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(simple_cmp_type, "single_int", HOFFSET(simple_cmp_t, single_int), H5T_NATIVE_INT); + if (ret < 0) TEST_ERROR + /* Insert array field */ + ret = H5Tinsert(simple_cmp_type, "char_arr", HOFFSET(simple_cmp_t, char_arr), arr_chartype); + if (ret < 0) TEST_ERROR + + /* Create an array datatype containing simple compound datatype */ + inner_arr_type = H5Tarray_create2(simple_cmp_type, ARRAY_RANK, arr_dim); + if (inner_arr_type < 0) TEST_ERROR + + /* Create a VL datatype of floats */ + vlen_floattype = H5Tvlen_create(H5T_NATIVE_FLOAT); + if (vlen_floattype < 0) TEST_ERROR + + /* Create the innermost compound datatype that houses inner_arr_type and vlen_floattype */ + inner_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(inner_cmp_t)); + if (inner_cmp_type < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(inner_cmp_type, "inner_arr", HOFFSET(inner_cmp_t, inner_arr), inner_arr_type); + if (ret < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(inner_cmp_type, "vlen_float", HOFFSET(inner_cmp_t, vlen_float), vlen_floattype); + if (ret < 0) TEST_ERROR + + /* Create a enumerate datatype */ + enum_type = H5Tcreate(H5T_ENUM, sizeof(short)); + if (enum_type < 0) TEST_ERROR + + enum_val = E1_RED; + ret = H5Tenum_insert(enum_type, "RED", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "GREEN", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "BLUE", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "ORANGE", &enum_val); + if (ret < 0) TEST_ERROR + + enum_val++; + ret = H5Tenum_insert(enum_type, "YELLOW", &enum_val); + if (ret < 0) TEST_ERROR + + /* Create the outer compound datatype that contains the inner compound datatype and the enum datatype */ + outer_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(outer_cmp_t)); + if (ret < 0) TEST_ERROR + + /* Insert integer field */ + ret = H5Tinsert(outer_cmp_type, "inner_cmp", HOFFSET(outer_cmp_t, inner_cmp), inner_cmp_type); + if (ret < 0) TEST_ERROR + + /* Insert enum field */ + ret = H5Tinsert(outer_cmp_type, "enum_color", HOFFSET(outer_cmp_t, enum_color), enum_type); + if (ret < 0) TEST_ERROR + + /* Create an array datatype containing the outer compound datatype */ + if ((outer_arr_type = H5Tarray_create2(outer_cmp_type, ARRAY_RANK, arr_dim)) < 0) + TEST_ERROR + + /* Loop through all the combinations of low/high library format bounds, + skipping invalid combinations */ + /* Create the file, create and write to a dataset with compound datatype */ + /* Verify the dataset's datatype and its members */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Set version bounds */ + H5E_BEGIN_TRY { + ret = H5Pset_libver_bounds(fapl, low, high); + } H5E_END_TRY; + + if (ret < 0) /* Invalid low/high combinations */ + continue; + + /* Create a file */ + file = H5Fcreate(VERFNAME, H5F_ACC_TRUNC, fcpl, fapl); + if (file < 0) TEST_ERROR + + /* Get the internal file pointer if the create succeeds */ + if ((filep = (H5F_t *)H5I_object(file)) == NULL) TEST_ERROR + + /* Create dataset using the array type */ + dset = H5Dcreate2(file, VERDSNAME, outer_arr_type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (dset < 0) TEST_ERROR + + /* Get the dataset's datatype */ + if ((dset_dtype = H5Dget_type(dset)) < 0) TEST_ERROR + + /* Get the version of this datatype */ + dtypep = (H5T_t *)H5I_object(dset_dtype); + if (dtypep == NULL) TEST_ERROR + highest_version = dtypep->shared->version; + + /* Verify version of the datatype recursevily */ + ret = verify_version(dset_dtype, low, filep->shared->low_bound, &highest_version); + + /* Close the dataset's datatype */ + if (H5Tclose(dset_dtype) < 0) TEST_ERROR + + /* Close dataset and file */ + if (H5Dclose(dset) < 0) TEST_ERROR + if (H5Fclose(file) < 0) TEST_ERROR + + } /* for high */ + } /* for low */ + + /* Close dataspace and property lists */ + if (H5Sclose(space) < 0) TEST_ERROR + if (H5Pclose(fcpl) < 0) TEST_ERROR + if (H5Pclose(fapl) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(dset); + H5Sclose(space); + H5Tclose(dset_dtype); + H5Pclose(dcpl); + H5Pclose(fcpl); + H5Pclose(fapl); + H5Fclose(file); + } H5E_END_TRY; + return 1; +} /* end test_versionbounds() */ /*------------------------------------------------------------------------- @@ -7411,7 +7788,7 @@ int main(void) { long nerrors = 0; - hid_t fapl = -1; + hid_t fapl = -1; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -7428,7 +7805,6 @@ main(void) nerrors += test_detect(); nerrors += test_compound_1(); nerrors += test_query(); - nerrors += test_transient(fapl); nerrors += test_named(fapl); nerrors += test_encode(); @@ -7473,6 +7849,7 @@ main(void) nerrors += test_opaque(); nerrors += test_set_order(); nerrors += test_utf_ascii_conv(); + nerrors += test_versionbounds(); if(nerrors) { printf("***** %lu FAILURE%s! *****\n", diff --git a/test/objcopy.c b/test/objcopy.c index 5d9d426..e88d508 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -14271,10 +14271,10 @@ main(void) FALSE, "H5Ocopy(): expand soft link"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_EXT_LINK_FLAG, - FALSE, "H5Ocopy: expand external link"); + FALSE, "H5Ocopy(): expand external link"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_SOFT_LINK_FLAG | H5O_COPY_EXPAND_EXT_LINK_FLAG, - FALSE, "H5Ocopy: expand soft and external links"); + FALSE, "H5Ocopy(): expand soft and external links"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_SHALLOW_HIERARCHY_FLAG, FALSE, "H5Ocopy(): shallow group copy"); diff --git a/test/th5s.c b/test/th5s.c index 0b0a2e7..0619571 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -41,10 +41,6 @@ #define H5O_TESTING #include "H5Opkg.h" /* Object header */ -#include "H5Bprivate.h" -#include "H5Sprivate.h" -#include "H5Pprivate.h" - #define TESTFILE "th5s.h5" #define DATAFILE "th5s1.h5" #define NULLFILE "th5s2.h5" diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index e474bc3..a34b75c 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -340,8 +340,8 @@ VERIFY_LAYOUT_DSET() fi # clean up tmp files - rm -f $outfile - rm -f $layoutfile +# rm -f $outfile +# rm -f $layoutfile } #------------------------------------------ @@ -513,6 +513,86 @@ VERIFY_LAYOUT_ALL() rm -f $layoutfile } +#-------------------------------------------------------------- +# Verifying superblock of a file with different version bounds +VERIFY_SUPERBLOCK() +{ + lowbound=$1 + highbound=$2 + superblock=$3 + infile=$4 + layoutfile=verbounds-low$lowbound-high$highbound.$4 + outfile=out-verbounds-low$lowbound-high$highbound.$infile + expectedsuperblock="SUPERBLOCK_VERSION $superblock" + + shift + shift + shift + shift + + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile +echo "$RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile" + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi + + #--------------------------------- + # check the layout from a dataset + VERIFY "superblock" + ( + cd $TESTDIR + $RUNSERIAL $H5DUMP_BIN -H -B $outfile > $layoutfile + ) + $GREP "$expectedsuperblock" $TESTDIR/$layoutfile > /dev/null + if [ $? -eq 0 ]; then + echo " PASSED" + else + echo " FAILED" + nerrors="`expr $nerrors + 1`" + fi + + # clean up tmp files + rm -f $outfile + rm -f $layoutfile + +} # end of VERIFY_SUPERBLOCK + +#------------------------------------------------------------------ +# Verifying that a latest file cannot be opened with earlier bounds +VERIFY_INVALIDBOUNDS() +{ + lowbound=$1 + highbound=$2 + infile=$3 + outfile=out-verbounds-low$lowbound-high$highbound.$infile + + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + fi + + # clean up tmp files + rm -f $outfile + +} # end of VERIFY_INVALIDBOUNDS + # same as TOOLTEST, but it uses the old syntax -i input_file -o output_file # TOOLTEST0() @@ -1365,6 +1445,18 @@ else VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI fi +######################################################### +# Testing version bounds +######################################################### +# -j 0 -k 2, superblock will be 0 +VERIFY_SUPERBLOCK 0 2 0 h5repack_layout.h5 -j 0 -k 2 h5repack_layout.h5 +# -j 1 -k 2, superblock will be 2 +VERIFY_SUPERBLOCK 1 2 2 h5repack_layout.h5 -j 1 -k 2 h5repack_layout.h5 +# -j 2 -k 2, superblock will be 3 +VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5 +# -j 0 -k 1, file cannot be opened +VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR -- cgit v0.12 From 2fb0b8c3538df641deca73a8a694996bb5e61cdd Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Sun, 18 Feb 2018 20:24:15 -0600 Subject: Fix for daily test failure for test/fheap.c The failure occurs when HDF5TestExpress is set to 0. The check for file size check fails due to persisting free-space when creating the file. The fix is to set libver bounds (v18, latest) when creating the test file. --- test/fheap.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/fheap.c b/test/fheap.c index 6c3a8ac..1be952f 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16458,6 +16458,33 @@ main(void) if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) TEST_ERROR fapl = def_fapl; + /* This is a fix for the daily test failure from the checkin for libver bounds. */ + /* + * Many tests failed the file size check when comparing (a) and (b) as below: + * --Create a file and close the file. Got the initial file size (a). + * --Reopen the file, perform fractal heap operations, and close the file. + * Got the file size (b). + * The cause for the file size differences: + * When the file is initially created with persisting free-space and with + * (earliest, latest) libver bounds, the file will have version 2 superblock + * due to non-default free-space handling. As the low bound is earliest, + * the library uses version 1 object header when creating the superblock + * extension message. + * When the file is reopened with the same libver bounds, the file's low + * bound is upgraded to v18 because the file has version 2 superblock. + * When the library creates the superblock extension message on file close, + * the library uses version 2 object header for the superblock extension + * message since the low bound is v18. + * This leads to the discrepancy in file sizes as the file is persisting + * free-space and there is object header version differences. + * The fix: + * Set libver bounds in fapl to (v18, latest) so that the file created in the + * test routines will have low bound set to v18. This will cause the + * library to use version 2 object header for the superblock extension + * message. + */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + TEST_ERROR break; case 2: if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0) -- cgit v0.12 From 30166fed18a9b0754d56b3454176e3a5111a1e21 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Feb 2018 08:32:15 -0600 Subject: Fix indentation --- tools/src/h5repack/h5repack_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 226f58e..8f0178f 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -667,8 +667,8 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'E': - enable_error_stack = 1; - break; + enable_error_stack = 1; + break; default: break; -- cgit v0.12 From 0d912d463206762d8dfe5fa46fd2318b1ee50123 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Feb 2018 16:23:07 -0600 Subject: HDFFV-10412 moved check back into normal path --- release_docs/RELEASE.txt | 12 +++++++++++ tools/src/h5repack/h5repack_filters.c | 40 +++++++++++++++++------------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e7186c5..4675423 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -310,6 +310,18 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5repack + + h5repack changes the chunk parameters when a change of layout is not + specified and a filter is applied. + + HDFFV-10297, HDFFV-10319 reworked code for h5repack and h5diff code + in the tools library. The check for an existing layout was incorrectly + placed into an if block and not executed. The check was moved into + the normal path of the function. + + (ADB - 2018/02/21, HDFFV-10412) + - h5dump the tools library will hide the error stack during file open. diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index ae0bfd5..253be6d 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -280,33 +280,33 @@ int apply_filters(const char* name, /* object name from traverse list */ *has_filter = 1; if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); - - /*------------------------------------------------------------------------- - * check if there is an existent chunk - * read it only if there is not a requested layout - *------------------------------------------------------------------------- - */ - if (obj.layout == -1) { - if ((layout = H5Pget_layout(dcpl_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); - - if (layout == H5D_CHUNKED) { - if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); - obj.layout = H5D_CHUNKED; - obj.chunk.rank = rank; - for (i = 0; i < rank; i++) - obj.chunk.chunk_lengths[i] = chsize[i]; - } - } } else if(nfilters) { - *has_filter = 1; + *has_filter = 1; if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed"); } /*------------------------------------------------------------------------- + * check if there is an existent chunk + * read it only if there is not a requested layout + *------------------------------------------------------------------------- + */ + if (obj.layout == -1) { + if ((layout = H5Pget_layout(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); + obj.layout = H5D_CHUNKED; + obj.chunk.rank = rank; + for (i = 0; i < rank; i++) + obj.chunk.chunk_lengths[i] = chsize[i]; + } + } + + /*------------------------------------------------------------------------- * the type of filter and additional parameter * type can be one of the filters * H5Z_FILTER_NONE 0 , uncompress if compressed -- cgit v0.12 From b996ee29726b820869776620c6a9f496c4823762 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Feb 2018 16:29:41 -0600 Subject: HDFFV-10412 fix typo --- tools/src/h5repack/h5repack_filters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 253be6d..0092abc 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -282,7 +282,7 @@ int apply_filters(const char* name, /* object name from traverse list */ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); } else if(nfilters) { - *has_filter = 1; + *has_filter = 1; if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed"); } -- cgit v0.12 From 76a0003f96f8e1336062089380adc95f8b3dee56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Feb 2018 10:18:17 -0600 Subject: HDFFV-10412 update test ref files --- tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl | 4 ++-- tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl | 2 +- .../h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl b/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl index 1dcc742..75f54fa 100644 --- a/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl +++ b/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl @@ -76,8 +76,8 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 40, 20 ) - SIZE 1150 (2.783:1 COMPRESSION) + CHUNKED ( 20, 10 ) + SIZE 1283 (2.494:1 COMPRESSION) } FILTERS { COMPRESSION DEFLATE { LEVEL 1 } diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl index 4856f84..a8b4562 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 40, 20 ) + CHUNKED ( 20, 10 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 5a1ebe7..a1fc0cb 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 40, 20 ) + CHUNKED ( 20, 10 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { -- cgit v0.12 From 1e5b67c1dc8672206f2489854188f43a590aea14 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 26 Feb 2018 12:22:32 -0800 Subject: Fix for HDFFV-10354 (CVE-2017-17505). --- release_docs/RELEASE.txt | 23 +++++++++++++++++++++++ src/H5Opline.c | 44 +++++++++++++++++++++++++++++--------------- 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4675423..1917fb2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -232,6 +232,29 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2017/11/21, HDFFV-10330) + - If an HDF5 file contains a filter pipeline message with a 'number of + filters' field that exceeds the maximum number of allowed filters, + the error handling code will attempt to dereference a NULL pointer. + + This issue was reported to The HDF Group as issue #CVE-2017-17505. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + This problem arose because the error handling code assumed that + the 'number of filters' field implied that a dynamic array of that + size had already been created and that the cleanup code should + iterate over that array and clean up each element's resources. If + an error occurred before the array has been allocated, this will + not be true. + + This has been changed so that the number of filters is set to + zero on errors. Additionally, the filter array traversal in the + error handling code now requires that the filter array not be NULL. + + (DER - 2018/02/06, HDFFV-10354) + Configuration ------------- - CMake diff --git a/src/H5Opline.c b/src/H5Opline.c index e817f9a..5e2f9b6 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -139,8 +139,15 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* Number of filters */ pline->nused = *p++; - if(pline->nused > H5Z_MAX_NFILTERS) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") + if(pline->nused > H5Z_MAX_NFILTERS) { + + /* Reset the number of filters used to avoid array traversal in error + * handling code. + */ + pline->nused = 0; + + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") + } /* Reserved */ if(pline->version == H5O_PLINE_VERSION_1) @@ -502,23 +509,30 @@ H5O_pline_reset(void *mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR + /* NOTE: This function can be called during error processing from + * other API calls so DO NOT ASSUME THAT ANY VALUES ARE SANE. + */ + HDassert(pline); - /* Free information for each filter */ - for(i = 0; i < pline->nused; i++) { - if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name) - HDassert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN); - if(pline->filter[i].name != pline->filter[i]._name) - pline->filter[i].name = (char *)H5MM_xfree(pline->filter[i].name); - if(pline->filter[i].cd_values && pline->filter[i].cd_values != pline->filter[i]._cd_values) - HDassert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES); - if(pline->filter[i].cd_values != pline->filter[i]._cd_values) - pline->filter[i].cd_values = (unsigned *)H5MM_xfree(pline->filter[i].cd_values); - } /* end for */ + /* Free the filter information and array */ + if (pline->filter) { + + /* Free information for each filter */ + for(i = 0; i < pline->nused; i++) { + if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name) + HDassert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN); + if(pline->filter[i].name != pline->filter[i]._name) + pline->filter[i].name = (char *)H5MM_xfree(pline->filter[i].name); + if(pline->filter[i].cd_values && pline->filter[i].cd_values != pline->filter[i]._cd_values) + HDassert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES); + if(pline->filter[i].cd_values != pline->filter[i]._cd_values) + pline->filter[i].cd_values = (unsigned *)H5MM_xfree(pline->filter[i].cd_values); + } /* end for */ - /* Free filter array */ - if(pline->filter) + /* Free filter array */ pline->filter = (H5Z_filter_info_t *)H5MM_xfree(pline->filter); + } /* Reset # of filters */ pline->nused = pline->nalloc = 0; -- cgit v0.12 From a4f0666ecdd0f48081e43eef2e792d791044e549 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 26 Feb 2018 16:13:25 -0600 Subject: Update list --- release_docs/INSTALL_CMake.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 8c72685..64eb1d2 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -564,7 +564,6 @@ HDF5_BUILD_TOOLS "Build HDF5 Tools" ON ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF -HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF @@ -584,6 +583,8 @@ HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF HDF5_PACK_MACOSX_FRAMEWORK "Package the HDF5 Library in a Frameworks" OFF +HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, + FALSE to build according to BUILD_SHARED_LIBS" FALSE HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF HDF_TEST_EXPRESS "Control testing framework (0-3)" "0" @@ -597,7 +598,7 @@ HDF5_ENABLE_THREADSAFE "Enable Threadsafety" if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF if (CMAKE_BUILD_TYPE MATCHES Debug) - HDF5_ENABLE_TRACE "Enable API tracing capability" ON + HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF if (HDF5_TEST_VFD) HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON -- cgit v0.12 From 302053f978e38a8d4306a7c1233cdf8fd2ec28dd Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 26 Feb 2018 18:31:40 -0800 Subject: Fix for HDFFV-10355 (CVE-2017-17506). --- release_docs/RELEASE.txt | 19 ++++++++++++++++++ src/H5Abtree2.c | 4 ++-- src/H5Adense.c | 4 ++-- src/H5Gbtree2.c | 4 ++-- src/H5Gdense.c | 20 +++++++++---------- src/H5HFcache.c | 2 +- src/H5Oainfo.c | 5 +++-- src/H5Oattr.c | 8 ++++---- src/H5Obogus.c | 5 +++-- src/H5Obtreek.c | 5 +++-- src/H5Ocache.c | 4 ++-- src/H5Ocache_image.c | 4 ++-- src/H5Ocont.c | 5 +++-- src/H5Odrvinfo.c | 5 +++-- src/H5Odtype.c | 4 ++-- src/H5Oefl.c | 5 +++-- src/H5Ofill.c | 10 ++++++---- src/H5Ofsinfo.c | 6 ++++-- src/H5Oginfo.c | 5 +++-- src/H5Olayout.c | 5 +++-- src/H5Olinfo.c | 5 +++-- src/H5Olink.c | 5 +++-- src/H5Omessage.c | 4 ++-- src/H5Omtime.c | 10 ++++++---- src/H5Oname.c | 5 +++-- src/H5Opkg.h | 4 ++-- src/H5Opline.c | 51 +++++++++++++++++++++++++++--------------------- src/H5Oprivate.h | 2 +- src/H5Orefcount.c | 5 +++-- src/H5Osdspace.c | 5 +++-- src/H5Oshared.c | 2 +- src/H5Oshared.h | 8 ++++---- src/H5Oshmesg.c | 5 +++-- src/H5Ostab.c | 5 +++-- src/H5Pdcpl.c | 2 +- src/H5S.c | 4 ++-- src/H5SM.c | 16 +++++++++------ src/H5T.c | 13 ++++++++---- src/H5Tprivate.h | 2 +- 39 files changed, 169 insertions(+), 113 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4675423..d52f6a5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -232,6 +232,25 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2017/11/21, HDFFV-10330) + - If an HDF5 file contains a filter pipeline message which contains + a 'number of filters' field that exceeds the actual number of + filters in the message, the HDF5 C library will read off the end of + the read buffer. + + This issue was reported to The HDF Group as issue #CVE-2017-17506. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + The problem was fixed by passing the buffer size with the buffer + and ensuring that the pointer cannot be incremented off the end + of the buffer. A mismatch between the number of filters declared + and the actual number of filters will now invoke normal HDF5 + error handling. + + (DER - 2018/02/26, HDFFV-10355) + Configuration ------------- - CMake diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index ed67e0f..8b79aa5 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -158,7 +158,7 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */ *------------------------------------------------------------------------- */ static herr_t -H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5A__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5A_fh_ud_cmp_t *udata = (H5A_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5A_t *attr = NULL; /* Pointer to attribute created from heap object */ @@ -168,7 +168,7 @@ H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_STATIC /* Decode attribute information */ - if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Compare the string values */ diff --git a/src/H5Adense.c b/src/H5Adense.c index b1903a4..ba0578e 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -843,7 +843,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5A__dense_copy_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5A_fh_ud_cp_t *udata = (H5A_fh_ud_cp_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -857,7 +857,7 @@ H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail) */ - if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Set the creation order index for the attribute */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 71d15e5..4702c46 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -155,7 +155,7 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ @@ -164,7 +164,7 @@ H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Compare the string values */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 4ae6800..de11541 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -599,7 +599,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *tmp_lnk = NULL; /* Temporary pointer to link */ @@ -608,7 +608,7 @@ H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information & keep a copy */ - if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Copy link information */ @@ -889,7 +889,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -903,7 +903,7 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_u * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail - QAK) */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") done: @@ -1101,7 +1101,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ @@ -1110,7 +1110,7 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Get the length of the name */ @@ -1308,7 +1308,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk = NULL; /* Pointer to link created from heap object */ @@ -1318,7 +1318,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Check for removing the link from the creation order index */ @@ -1485,7 +1485,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata) +H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1493,7 +1493,7 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, H5_ITER_ERROR, "can't decode link") /* Can't operate on link here because the fractal heap block is locked */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 069bf17..c940161 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -572,7 +572,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, UINT32DECODE(image, hdr->pline_root_direct_filter_mask); /* Decode I/O filter information */ - if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, image))) + if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, len, image))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't decode I/O pipeline filters") /* Advance past filter info to checksum */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index d8298a4..b85337a 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -35,7 +35,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_ainfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ainfo_copy(const void *_mesg, void *_dest); static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -105,7 +105,8 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); */ static void * H5O_ainfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_ainfo_t *ainfo = NULL; /* Attribute info */ unsigned char flags; /* Flags for encoding attribute info */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 773a16b..79a0a52 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -26,7 +26,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static void *H5O_attr_copy(const void *_mesg, void *_dest); static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); static herr_t H5O_attr_free(void *mesg); @@ -121,7 +121,7 @@ H5FL_EXTERN(H5S_extent_t); --------------------------------------------------------------------------*/ static void * H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned *ioflags, const uint8_t *p) + unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5A_t *attr = NULL; H5S_extent_t *extent; /*extent dimensionality information */ @@ -185,7 +185,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED /* Decode the attribute's datatype */ if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, open_oh, - ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) + ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->dt_size, p))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype") if(attr->shared->version < H5O_ATTR_VERSION_2) p += H5O_ALIGN_OLD(attr->shared->dt_size); @@ -200,7 +200,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED /* Decode attribute's dataspace extent */ if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, open_oh, - ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL) + ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->ds_size, p)) == NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace") /* Copy the extent information to the dataspace */ diff --git a/src/H5Obogus.c b/src/H5Obogus.c index a3531ed..02e0e6a 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -38,7 +38,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, @@ -111,7 +111,8 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ */ static void * H5O_bogus_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_bogus_t *mesg = NULL; void *ret_value; /* Return value */ diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 4fd0577..1d2b607 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -28,7 +28,7 @@ #include "H5MMprivate.h" /* Memory management */ static void *H5O_btreek_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_btreek_copy(const void *_mesg, void *_dest); static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -79,7 +79,8 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ */ static void * H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 8f4c155..94049ef 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -1515,7 +1515,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image H5O_cont_t *cont; /* Decode continuation message */ - cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw_size, mesg->raw); H5_CHECKED_ASSIGN(cont->chunkno, unsigned, udata->cont_msg_info->nmsgs + 1, size_t); /* the next continuation message/chunk */ /* Save 'native' form of continuation message */ @@ -1531,7 +1531,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image /* Decode ref. count message */ HDassert(oh->version > H5O_VERSION_1); - refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw_size, mesg->raw); /* Save 'native' form of ref. count message */ mesg->native = refcount; diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index a427b49..d2b65bb 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -38,7 +38,7 @@ /* Callbacks for message class */ static void *H5O__mdci_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__mdci_copy(const void *_mesg, void *_dest); @@ -99,7 +99,7 @@ H5FL_DEFINE(H5O_mdci_t); static void * H5O__mdci_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_mdci_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index b002a32..f9a9768 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -37,7 +37,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_cont_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_cont_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_cont_free(void *mesg); @@ -90,7 +90,8 @@ H5FL_DEFINE(H5O_cont_t); */ static void * H5O_cont_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_cont_t *cont = NULL; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index b9dea26..5921be3 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -28,7 +28,7 @@ #include "H5MMprivate.h" /* Memory management */ static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_drvinfo_copy(const void *_mesg, void *_dest); static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -80,7 +80,8 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ */ static void * H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c51e31d..c557b5c 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -30,7 +30,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static void *H5O_dtype_copy(const void *_mesg, void *_dest); static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); static herr_t H5O_dtype_reset(void *_mesg); @@ -1094,7 +1094,7 @@ done: --------------------------------------------------------------------------*/ static void * H5O_dtype_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned *ioflags/*in,out*/, const uint8_t *p) + unsigned *ioflags/*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index ba7a6ee..f066964 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -28,7 +28,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_efl_copy(const void *_mesg, void *_dest); static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -88,7 +88,8 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ */ static void * H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_efl_t *mesg = NULL; int version; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 74f69d1..849435c 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -33,11 +33,11 @@ static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg); static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); static void *H5O_fill_copy(const void *_mesg, void *_dest); @@ -193,7 +193,8 @@ H5FL_BLK_EXTERN(type_conv); */ static void * H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_fill_t *fill = NULL; void *ret_value = NULL; /* Return value */ @@ -307,7 +308,8 @@ done: */ static void * H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_fill_t *fill = NULL; /* Decoded fill value message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 4d62f49..8369ae1 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -32,7 +32,8 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_fsinfo_copy(const void *_mesg, void *_dest); static size_t H5O_fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -86,7 +87,8 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); */ static void * H5O_fsinfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_fsinfo_t *fsinfo = NULL; /* File space info message */ H5F_mem_page_t ptype; /* Memory type for iteration */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 468e07a..e551f28 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -33,7 +33,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ginfo_copy(const void *_mesg, void *_dest); static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -95,7 +95,8 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); */ static void * H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 85d7791..553013c 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -39,7 +39,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O__layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O__layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__layout_copy(const void *_mesg, void *_dest); static size_t H5O__layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -101,7 +101,8 @@ H5FL_DEFINE(H5O_layout_t); */ static void * H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_layout_t *mesg = NULL; uint8_t *heap_block = NULL; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index cac4ed1..9917927 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -37,7 +37,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_linfo_copy(const void *_mesg, void *_dest); static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -114,7 +114,8 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); */ static void * H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_linfo_t *linfo = NULL; /* Link info */ unsigned char index_flags; /* Flags for encoding link index info */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 77872ad..7e7885c 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -39,7 +39,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_link_copy(const void *_mesg, void *_dest); static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -118,7 +118,8 @@ H5FL_DEFINE_STATIC(H5O_link_t); */ static void * H5O_link_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_link_t *lnk = NULL; /* Pointer to link message */ size_t len = 0; /* Length of a string in the message */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 158701b..809c6e9 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1811,7 +1811,7 @@ done: */ void * H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, - const unsigned char *buf) + size_t buf_size, const unsigned char *buf) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned ioflags = 0; /* Flags for decode routine */ @@ -1826,7 +1826,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, HDassert(type); /* decode */ - if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf)) == NULL) + if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf_size, buf)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message") done: diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 7e7baea..47bc0b1 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -28,12 +28,12 @@ static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_mtime_copy(const void *_mesg, void *_dest); static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -119,7 +119,8 @@ H5FL_DEFINE(time_t); */ static void * H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ @@ -175,7 +176,8 @@ done: */ static void * H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { time_t *mesg, the_time; struct tm tm; diff --git a/src/H5Oname.c b/src/H5Oname.c index 6292883..627a0f5 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -33,7 +33,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_name_copy(const void *_mesg, void *_dest); static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -84,7 +84,8 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ */ static void * H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_name_t *mesg; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 649ee3b..e970406 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -186,7 +186,7 @@ \ /* Decode the message */ \ HDassert(msg_type->decode); \ - if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \ + if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, (MSG)->raw))) \ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ \ /* Mark the message dirty if it was changed by decoding */ \ @@ -228,7 +228,7 @@ struct H5O_msg_class_t { const char *name; /*for debugging */ size_t native_size; /*size of native message */ unsigned share_flags; /* Message sharing settings */ - void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *); + void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, size_t, const uint8_t *); herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *); void *(*copy)(const void *, void *); /*copy native value */ size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */ diff --git a/src/H5Opline.c b/src/H5Opline.c index e817f9a..7bc8f19 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -34,7 +34,7 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static void *H5O_pline_copy(const void *_mesg, void *_dest); static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); static herr_t H5O_pline_reset(void *_mesg); @@ -115,12 +115,14 @@ H5FL_DEFINE(H5O_pline_t); */ static void * H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t p_size, const uint8_t *p) { H5O_pline_t *pline = NULL; /* Pipeline message */ H5Z_filter_info_t *filter; /* Filter to decode */ size_t name_length; /* Length of filter name */ size_t i; /* Local index variable */ + const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -130,17 +132,17 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* Allocate space for I/O pipeline message */ if(NULL == (pline = H5FL_CALLOC(H5O_pline_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Version */ pline->version = *p++; if(pline->version < H5O_PLINE_VERSION_1 || pline->version > H5O_PLINE_VERSION_LATEST) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "bad version number for filter pipeline message") + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "bad version number for filter pipeline message") /* Number of filters */ pline->nused = *p++; if(pline->nused > H5Z_MAX_NFILTERS) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters") /* Reserved */ if(pline->version == H5O_PLINE_VERSION_1) @@ -149,12 +151,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* Allocate array for filters */ pline->nalloc = pline->nused; if(NULL == (pline->filter = (H5Z_filter_info_t *)H5MM_calloc(pline->nalloc * sizeof(pline->filter[0])))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Decode filters */ for(i = 0, filter = &pline->filter[0]; i < pline->nused; i++, filter++) { /* Filter ID */ - UINT16DECODE(p, filter->id); + UINT16DECODE(p, filter->id); /* Length of filter name */ if(pline->version > H5O_PLINE_VERSION_1 && filter->id < H5Z_FILTER_RESERVED) @@ -166,18 +168,18 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 } /* end if */ /* Filter flags */ - UINT16DECODE(p, filter->flags); + UINT16DECODE(p, filter->flags); /* Number of filter parameters ("client data elements") */ - UINT16DECODE(p, filter->cd_nelmts); + UINT16DECODE(p, filter->cd_nelmts); /* Filter name, if there is one */ - if(name_length) { + if(name_length) { size_t actual_name_length; /* Actual length of name */ /* Determine actual name length (without padding, but with null terminator) */ - actual_name_length = HDstrlen((const char *)p) + 1; - HDassert(actual_name_length <= name_length); + actual_name_length = HDstrlen((const char *)p) + 1; + HDassert(actual_name_length <= name_length); /* Allocate space for the filter name, or use the internal buffer */ if(actual_name_length > H5Z_COMMON_NAME_LEN) { @@ -188,12 +190,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 else filter->name = filter->_name; - HDstrncpy(filter->name, (const char *)p, actual_name_length); - p += name_length; - } /* end if */ + HDstrncpy(filter->name, (const char *)p, actual_name_length); + p += name_length; + } /* end if */ /* Filter parameters */ - if(filter->cd_nelmts) { + if(filter->cd_nelmts) { size_t j; /* Local index variable */ /* Allocate space for the client data elements, or use the internal buffer */ @@ -205,15 +207,20 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 else filter->cd_values = filter->_cd_values; - /* - * Read the client data values and the padding - */ - for(j = 0; j < filter->cd_nelmts; j++) - UINT32DECODE(p, filter->cd_values[j]); + /* + * Read the client data values and the padding + */ + for (j = 0; j < filter->cd_nelmts; j++) { + if (p + 4 - 1 <= p_end) + UINT32DECODE(p, filter->cd_values[j]) + else + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", p, p_size, p_end) + } + if(pline->version == H5O_PLINE_VERSION_1) if(filter->cd_nelmts % 2) p += 4; /*padding*/ - } /* end if */ + } /* end if */ } /* end for */ /* Set return value */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 2253bb2..9f01a9a 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -935,7 +935,7 @@ H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char *buf, const void *obj); H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned type_id, const unsigned char *buf); + unsigned type_id, size_t buf_size, const unsigned char *buf); H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, void *mesg); H5_DLL herr_t H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags); diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index af68417..6f052ce 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -33,7 +33,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_refcount_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_refcount_copy(const void *_mesg, void *_dest); static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -90,7 +90,8 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); */ static void * H5O_refcount_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_refcount_t *refcount = NULL; /* Reference count */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 12a9bb6..f5d3c61 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -26,7 +26,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_sdspace_copy(const void *_mesg, void *_dest); static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); @@ -110,7 +110,8 @@ H5FL_ARR_EXTERN(hsize_t); --------------------------------------------------------------------------*/ static void * H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ unsigned flags, version; diff --git a/src/H5Oshared.c b/src/H5Oshared.c index db2d0cc..9217d3d 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -156,7 +156,7 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "can't read message from fractal heap.") /* Decode the message */ - if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_ptr))) + if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_size, mesg_ptr))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode shared message.") } /* end if */ else { diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 2465e65..93cc11f 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -47,7 +47,7 @@ */ static H5_INLINE void * H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p) + unsigned *ioflags, size_t p_size, const uint8_t *p) { void *ret_value = NULL; /* Return value */ @@ -67,7 +67,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, if(mesg_flags & H5O_MSG_FLAG_SHARED) { /* Retrieve native message info indirectly through shared message */ if(NULL == (ret_value = H5O_shared_decode(f, dxpl_id, open_oh, ioflags, p, H5O_SHARED_TYPE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") /* We currently do not support automatically fixing shared messages */ #ifdef H5_STRICT_FORMAT_CHECKS @@ -79,8 +79,8 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, } /* end if */ else { /* Decode native message directly */ - if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") + if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p_size, p))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") } /* end else */ done: diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 1cbfb05..f3fe9d1 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -28,7 +28,7 @@ #include "H5MMprivate.h" /* Memory management */ static void *H5O_shmesg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_shmesg_copy(const void *_mesg, void *_dest); static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -76,7 +76,8 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ */ static void * H5O_shmesg_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_shmesg_table_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 5c840a6..6f02d72 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -36,7 +36,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); + unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_stab_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_stab_copy(const void *_mesg, void *_dest); static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -97,7 +97,8 @@ H5FL_DEFINE_STATIC(H5O_stab_t); */ static void * H5O_stab_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_stab_t *stab = NULL; void *ret_value = NULL; /* Return value */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3b4c159..894f6cb 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1115,7 +1115,7 @@ H5P__dcrt_fill_value_dec(const void **_pp, void *_value) dt_size = (size_t)enc_value; /* Decode type */ - if(NULL == (fill->type = H5T_decode(*pp))) + if(NULL == (fill->type = H5T_decode(dt_size, *pp))) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "can't decode fill value datatype") *pp += dt_size; } /* end if */ diff --git a/src/H5S.c b/src/H5S.c index 8f3e132..c2f7d3f 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1730,8 +1730,8 @@ H5S_decode(const unsigned char **p) /* Decode the extent part of dataspace */ /* (pass mostly bogus file pointer and bogus DXPL) */ - if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, pp))==NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") + if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, extent_size, pp)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") pp += extent_size; /* Copy the extent into dataspace structure */ diff --git a/src/H5SM.c b/src/H5SM.c index d5ede7e..8e28529 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -70,7 +70,7 @@ static herr_t H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, static herr_t H5SM_decr_ref(void *record, void *op_data, hbool_t *changed); static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5SM_index_header_t *header, const H5O_shared_t * mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg); + unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg); static herr_t H5SM_type_to_flag(unsigned type_id, unsigned *type_flag); static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, unsigned *oh_modified, void *_udata); @@ -1549,6 +1549,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) unsigned cache_flags = H5AC__NO_FLAGS_SET; H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; + size_t mesg_size = 0; void *mesg_buf = NULL; void *native_mesg = NULL; unsigned type_id; /* Message type ID to operate on */ @@ -1578,8 +1579,8 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * zero and any file space it uses needs to be freed. mesg_buf holds the * serialized form of the message. */ - if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") + if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_size, &mesg_buf) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") /* Release the master SOHM table */ if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) @@ -1591,7 +1592,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * master table needs to be unprotected when we do this. */ if(mesg_buf) { - if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, (const unsigned char *)mesg_buf))) + if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, mesg_size, (const unsigned char *)mesg_buf))) HGOTO_ERROR(H5E_SOHM, H5E_CANTDECODE, FAIL, "can't decode shared message.") if(H5O_msg_delete(f, dxpl_id, open_oh, type_id, native_mesg) < 0) @@ -1778,7 +1779,7 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5SM_index_header_t *header, const H5O_shared_t *mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg) + unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg) { H5SM_list_t *list = NULL; H5SM_mesg_key_t key; @@ -1910,6 +1911,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Return the message's encoding so anything it references can be freed */ *encoded_mesg = encoding_buf; + *mesg_size = buf_size; /* If there are no messages left in the index, delete it */ if(header->num_messages == 0) { @@ -1951,8 +1953,10 @@ done: /* Free the message encoding, if we're not returning it in encoded_mesg * or if there's been an error. */ - if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0)) + if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0)) { encoding_buf = H5MM_xfree(encoding_buf); + *mesg_size = 0; + } FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5SM_delete_from_index() */ diff --git a/src/H5T.c b/src/H5T.c index eca0132..f06ac18 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -2822,8 +2822,13 @@ H5Tdecode(const void *buf) if(buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer") - /* Create datatype by decoding buffer */ - if(NULL == (dt = H5T_decode((const unsigned char *)buf))) + /* Create datatype by decoding buffer + * There is no way to get the size of the buffer, so we pass in + * SIZE_MAX and assume the caller knows what they are doing. + * Really fixing this will require an H5Tdecode2() call that + * takes a size parameter. + */ + if(NULL == (dt = H5T_decode(SIZE_MAX, (const unsigned char *)buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") /* Register the type and return the ID */ @@ -2912,7 +2917,7 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_decode(const unsigned char *buf) +H5T_decode(size_t buf_size, const unsigned char *buf) { H5F_t *f = NULL; /* Fake file structure*/ H5T_t *ret_value = NULL; /* Return value */ @@ -2932,7 +2937,7 @@ H5T_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") /* Decode the serialized datatype message */ - if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_noio_dxpl_id, NULL, H5O_DTYPE_ID, buf))) + if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_noio_dxpl_id, NULL, H5O_DTYPE_ID, buf_size, buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 5272361..61e7c79 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -114,7 +114,7 @@ H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_ap H5_DLL size_t H5T_get_size(const H5T_t *dt); H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset); H5_DLL herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc); -H5_DLL H5T_t *H5T_decode(const unsigned char *buf); +H5_DLL H5T_t *H5T_decode(size_t buf_size, const unsigned char *buf); H5_DLL herr_t H5T_debug(const H5T_t *dt, FILE * stream); H5_DLL struct H5O_loc_t *H5T_oloc(H5T_t *dt); H5_DLL H5G_name_t *H5T_nameof(H5T_t *dt); -- cgit v0.12 From ce005900d6ad539cc7556ab225b771d24632f4f1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 26 Feb 2018 20:16:13 -0800 Subject: Fix for HDFFV-10357 (CVE-2017-17508). --- release_docs/RELEASE.txt | 15 +++++++++++++++ src/H5T.c | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4675423..480bb14 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -232,6 +232,21 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2017/11/21, HDFFV-10330) + - If an HDF5 file contains a malformed compound type which contains + a member of size zero, a division by zero error will occur while + processing the type. + + This issue was reported to The HDF Group as issue #CVE-2017-17508. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Checking for zero before dividing fixes the problem. Instead of the + division by zero, the normal HDF5 error handling is invoked. + + (DER - 2018/02/26, HDFFV-10357) + Configuration ------------- - CMake diff --git a/src/H5T.c b/src/H5T.c index eca0132..ffa7bcb 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5211,6 +5211,11 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) /* Check if the field changed size */ if(old_size != memb_type->shared->size) { + + /* Fail if the old_size is zero */ + if (0 == old_size) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "old_size of zero would cause division by zero"); + /* Adjust the size of the member */ dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size; -- cgit v0.12 From b36bad53d9d5930ef1339d0db1bd7152c0e9b75d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 12:57:07 -0600 Subject: Inc CMake min, Add new tests, rework test CMake files --- CMakeLists.txt | 2 +- MANIFEST | 1 + c++/CMakeLists.txt | 2 +- c++/examples/CMakeLists.txt | 2 +- c++/examples/CMakeTests.cmake | 4 +- c++/src/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 2 +- config/cmake/CTestScript.cmake | 2 +- config/cmake/HDF518_Examples.cmake.in | 2 +- config/cmake/HDF5_Examples.cmake.in | 2 +- config/cmake/scripts/CTestScript.cmake | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- examples/CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 2 +- fortran/examples/CMakeLists.txt | 2 +- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 2 +- fortran/testpar/CMakeLists.txt | 2 +- hl/CMakeLists.txt | 2 +- hl/c++/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/test/CMakeLists.txt | 2 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 +- hl/test/CMakeLists.txt | 2 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 2 +- hl/tools/h5watch/CMakeLists.txt | 2 +- java/CMakeLists.txt | 2 +- java/examples/CMakeLists.txt | 2 +- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/CMakeLists.txt | 2 +- java/src/hdf/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- java/test/TestH5Pfapl.java | 7 + release_docs/INSTALL_CMake.txt | 2 +- release_docs/USING_HDF5_CMake.txt | 2 +- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 225 ++++++----- test/CMakeTests.cmake | 578 ++++++----------------------- test/CMakeVFDTests.cmake | 303 +++++++++++++++ testpar/CMakeLists.txt | 3 +- tools/CMakeLists.txt | 2 +- tools/lib/CMakeLists.txt | 2 +- tools/src/CMakeLists.txt | 2 +- tools/src/h5copy/CMakeLists.txt | 2 +- tools/src/h5diff/CMakeLists.txt | 2 +- tools/src/h5dump/CMakeLists.txt | 2 +- tools/src/h5format_convert/CMakeLists.txt | 2 +- tools/src/h5import/CMakeLists.txt | 2 +- tools/src/h5jam/CMakeLists.txt | 2 +- tools/src/h5ls/CMakeLists.txt | 2 +- tools/src/h5repack/CMakeLists.txt | 2 +- tools/src/h5stat/CMakeLists.txt | 2 +- tools/src/misc/CMakeLists.txt | 2 +- tools/test/CMakeLists.txt | 2 +- tools/test/h5copy/CMakeLists.txt | 2 +- tools/test/h5diff/CMakeLists.txt | 2 +- tools/test/h5dump/CMakeLists.txt | 2 +- tools/test/h5format_convert/CMakeLists.txt | 2 +- tools/test/h5import/CMakeLists.txt | 2 +- tools/test/h5jam/CMakeLists.txt | 2 +- tools/test/h5ls/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeTests.cmake | 161 +++++--- tools/test/h5stat/CMakeLists.txt | 2 +- tools/test/misc/CMakeLists.txt | 2 +- tools/test/misc/vds/CMakeLists.txt | 2 +- tools/test/perform/CMakeLists.txt | 2 +- 79 files changed, 729 insertions(+), 695 deletions(-) create mode 100644 test/CMakeVFDTests.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c7bb38..e7dda17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- diff --git a/MANIFEST b/MANIFEST index 8e79458..f365884 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3176,6 +3176,7 @@ ./src/CMakeLists.txt ./test/CMakeLists.txt ./test/CMakeTests.cmake +./test/CMakeVFDTests.cmake ./testpar/CMakeLists.txt ./testpar/CMakeTests.cmake ./tools/CMakeLists.txt diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index adbf1a4..2d3ab0f 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 300f6bc..397c300 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_CPP_EXAMPLES) # -------------------------------------------------------------------- diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 264a7e7..bd1f95b 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -51,7 +51,7 @@ endif () set (last_test "CPP_ex_${example}") endforeach () -#the following dependicies are handled by the order of the files +#the following dependencies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create) # SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds) @@ -91,7 +91,7 @@ endif () set (last_test "CPP_ex_${example}") endforeach () -#the following dependicies are handled by the order of the files +#the following dependencies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtatt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_rdwt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtgrpd PROPERTIES DEPENDS CPP_ex_h5tutr_crtgrpar) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 3b9a0c3..921497f 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 4930626..5194865 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index a8b7bbc..27ae3a0 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ######################################################## # For any comments please contact cdashhelp@hdfgroup.org # diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 6af0b09..0e81217 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index bede701..6453b16 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index f826e31..cfad6f1 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 33d7868..88843fa 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -15,7 +15,7 @@ ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 43c6d63..e9430d9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index a0f92d3..7864f2d 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index a48b3bd..9adf8bd 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 5446616..9bf1719 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 86f7a12..67d377f 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index ed9d28c..b1cf9d2 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index d80b4f9..eac6df0 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 9a1d059..c5b4a72 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 8c48795..bf96fba 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 70f0a79..0f187c5 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 54afd7c..28b5eb8 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 68f0128..dd94da0 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 00d7517..37c5cc9 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index d920d64..ff0403a 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 5ad441c..7a2eff1 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index b264d5f..1ec4b93 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 3dd6ce8..d21a3ea 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 82a3c1b..1f2ea17 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 43229e8..ab71a7e 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_TOOLS C CXX) add_subdirectory (gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 34d7074..b50bbf7 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_TOOLS_GIF2H5) #----------------------------------------------------------------------------- diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index d0764c9..a1697cd 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_HL_TOOLS_H5WATCH) #----------------------------------------------------------------------------- diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 9a5692f..d8cd358 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT ( HDF5_JAVA C Java ) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index 3073918..d43b49f 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDFJAVA_EXAMPLES) add_subdirectory (datasets) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 3e8bc8b..ed4559c 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index b79ba64..71cf83e 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 56c92fe..dc5d834 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 495ec5e..59fe48b 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 9bdab4b..7075d32 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index 649f7d0..35b436d 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_JAVA_HDF) add_subdirectory (hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index c856c04..1f2587e 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index ea9665b..8ab275e 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_JAVA_JNI C CXX) set (HDF5_JAVA_JNI_CSRCS diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 49cda32..329c602 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 48a5986..ac54405 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1385,6 +1385,13 @@ public class TestH5Pfapl { ret_val_id = H5.H5Pget_evict_on_close(fapl_id); assertTrue("H5P_evict_on_close", ret_val_id); } + catch (HDF5PropertyListInterfaceException err) { + // parallel is not supported + if (err.getMinorErrorNumber() != HDF5Constants.H5E_CANTSET) { + err.printStackTrace(); + fail("H5P_evict_on_close: " + err); + } + } catch (Throwable err) { err.printStackTrace(); fail("H5P_evict_on_close: " + err); diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 64eb1d2..99efb6a 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -648,7 +648,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index fc62b75..8dd47c2 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -229,7 +229,7 @@ your application with an installed HDF5 binary. ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake ======================================================================== -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aaedfda..bf7fb07 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5e0c990..cdab4f5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- @@ -13,9 +13,9 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) -#----------------------------------------------------------------------------- +################################################################################# # Define Test Library Sources -#----------------------------------------------------------------------------- +################################################################################# set (TEST_LIB_SOURCES ${HDF5_TEST_SOURCE_DIR}/h5test.c ${HDF5_TEST_SOURCE_DIR}/testframe.c @@ -71,9 +71,9 @@ if (BUILD_SHARED_LIBS) endif () endif () -#----------------------------------------------------------------------------- +################################################################################# # If filter plugin tests can be tested -#----------------------------------------------------------------------------- +################################################################################# # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir1") file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir2") @@ -116,7 +116,7 @@ endif () ) endforeach () - foreach ( plugin_name ${FILTER_PLUGINS_FOR_DIR2}) + foreach (plugin_name ${FILTER_PLUGINS_FOR_DIR2}) set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) @@ -142,6 +142,10 @@ endif () ) endforeach () +################################################################################# +# Test program sources +################################################################################# + set (testhdf5_SOURCES ${HDF5_TEST_SOURCE_DIR}/testhdf5.c ${HDF5_TEST_SOURCE_DIR}/tarray.c @@ -170,34 +174,24 @@ set (testhdf5_SOURCES ${HDF5_TEST_SOURCE_DIR}/tvlstr.c ) -#-- Adding test for testhdf5 -add_executable (testhdf5 ${testhdf5_SOURCES}) -TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") -target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) -set_target_properties (testhdf5 PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (testhdf5-shared ${testhdf5_SOURCES}) - TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") - target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) - set_target_properties (testhdf5-shared PROPERTIES FOLDER test) -endif () +set (cache_image_SOURCES + ${HDF5_TEST_SOURCE_DIR}/cache_image.c + ${HDF5_TEST_SOURCE_DIR}/genall5.c +) -MACRO (ADD_H5_EXE file) - add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) - set_target_properties (${file} PROPERTIES FOLDER test) - if (BUILD_SHARED_LIBS) - add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") - target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) - set_target_properties (${file}-shared PROPERTIES FOLDER test) - endif () -ENDMACRO () +set (ttsafe_SOURCES + ${HDF5_TEST_SOURCE_DIR}/ttsafe.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c +) set (H5_TESTS + testhdf5 # multiple source cache cache_api + cache_image # multiple source cache_tagging lheap ohdr @@ -210,9 +204,11 @@ set (H5_TESTS fheap pool accum + hyperslab istore bittests dt_arith + page_buffer dtypes dsets cmpd_dset @@ -233,6 +229,7 @@ set (H5_TESTS app_ref enum set_extent + ttsafe # multiple source enc_dec_plist enc_dec_plist_cross_platform getname @@ -244,7 +241,6 @@ set (H5_TESTS cross_read freespace mf - page_buffer vds file_image unregister @@ -253,98 +249,66 @@ set (H5_TESTS swmr ) -foreach (test ${H5_TESTS}) - ADD_H5_EXE(${test}) -endforeach () - -set (H5_SWMR_TESTS - swmr_addrem_writer - swmr_check_compat_vfd - swmr_generator - swmr_reader - swmr_remove_reader - swmr_remove_writer - swmr_sparse_reader - swmr_sparse_writer - swmr_start_write - swmr_writer -) - -foreach (test ${H5_SWMR_TESTS}) - ADD_H5_EXE(${test}) -endforeach () +macro (ADD_H5_EXE file) + add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + TARGET_C_PROPERTIES (${file} STATIC " " " ") + target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) + set_target_properties (${file} PROPERTIES FOLDER test) + if (BUILD_SHARED_LIBS) + add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) + TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") + target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) + set_target_properties (${file}-shared PROPERTIES FOLDER test) + endif () +endmacro () -set (H5_VDS_SWMR_TESTS - vds_swmr_gen - vds_swmr_reader - vds_swmr_writer +set (H5_TESTS_MULTIPLE + testhdf5 + cache_image + ttsafe ) - -foreach (test ${H5_VDS_SWMR_TESTS}) - ADD_H5_EXE(${test}) +# Only build single source tests here +foreach (test ${H5_TESTS}) + if (NOT "${test}" IN_LIST ${H5_TESTS_MULTIPLE}) + ADD_H5_EXE(${test}) + endif () endforeach () ############################################################################## +### M U L T I P L E S O U R C E T E S T S ### ############################################################################## -### A D D I T I O N A L T E S T S ### -############################################################################## -############################################################################## + +#-- Adding test for testhdf5 +add_executable (testhdf5 ${testhdf5_SOURCES}) +TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") +target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) +set_target_properties (testhdf5 PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (testhdf5-shared ${testhdf5_SOURCES}) + TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") + target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) + set_target_properties (testhdf5-shared PROPERTIES FOLDER test) +endif () #-- Adding test for cache_image -add_executable (cache_image - ${HDF5_TEST_SOURCE_DIR}/cache_image.c - ${HDF5_TEST_SOURCE_DIR}/genall5.c -) +add_executable (cache_image ${cache_image_SOURCES}) TARGET_C_PROPERTIES (cache_image STATIC " " " ") target_link_libraries (cache_image ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache_image PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) - add_executable (cache_image-shared - ${HDF5_TEST_SOURCE_DIR}/cache_image.c - ${HDF5_TEST_SOURCE_DIR}/genall5.c - ) + add_executable (cache_image-shared ${cache_image_SOURCES}) TARGET_C_PROPERTIES (cache_image-shared SHARED " " " ") target_link_libraries (cache_image-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (cache_image-shared PROPERTIES FOLDER test) endif () -#-- Adding test for hyperslab -add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) -TARGET_C_PROPERTIES (hyperslab STATIC " " " ") -target_link_libraries (hyperslab ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (hyperslab PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (hyperslab-shared ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) - TARGET_C_PROPERTIES (hyperslab-shared SHARED " " " ") - target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (hyperslab-shared PROPERTIES FOLDER test) - if (HDF5_ENABLE_THREADSAFE) - set_property (TARGET hyperslab-shared - APPEND PROPERTY COMPILE_DEFINITIONS - "H5_HAVE_THREADSAFE" - ) - endif () -endif () - #-- Adding test for ttsafe -add_executable (ttsafe - ${HDF5_TEST_SOURCE_DIR}/ttsafe.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c -) +add_executable (ttsafe ${ttsafe_SOURCES}) TARGET_C_PROPERTIES (ttsafe STATIC " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) - add_executable (ttsafe-shared - ${HDF5_TEST_SOURCE_DIR}/ttsafe.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c - ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c - ) + add_executable (ttsafe-shared ${ttsafe_SOURCES}) TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) @@ -356,6 +320,10 @@ if (BUILD_SHARED_LIBS) endif () endif () +############################################################################## +### A D D I T I O N A L T E S T S ### +############################################################################## + set (H5_CHECK_TESTS error_test err_compat @@ -364,14 +332,57 @@ set (H5_CHECK_TESTS atomic_writer atomic_reader links_env - flushrefresh filenotclosed + flushrefresh ) foreach (test ${H5_CHECK_TESTS}) ADD_H5_EXE(${test}) endforeach () +#-- Adding test for libinfo +set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) +file (WRITE ${GREP_RUNNER} + "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") +if (\${TEST_RESULT} STREQUAL \"0\") + message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") +else () + message (STATUS \"COMMAND Result: \${TEST_RESULT}\") +endif () +" +) + +############################################################################## +### S W I M M E R T E S T S ### +############################################################################## + +set (H5_SWMR_TESTS + swmr_addrem_writer + swmr_check_compat_vfd + swmr_generator + swmr_reader + swmr_remove_reader + swmr_remove_writer + swmr_sparse_reader + swmr_sparse_writer + swmr_start_write + swmr_writer +) + +foreach (test ${H5_SWMR_TESTS}) + ADD_H5_EXE(${test}) +endforeach () + +set (H5_VDS_SWMR_TESTS + vds_swmr_gen + vds_swmr_reader + vds_swmr_writer +) + +foreach (test ${H5_VDS_SWMR_TESTS}) + ADD_H5_EXE(${test}) +endforeach () + #-- Adding test for accum_swmr_reader # This has to be copied to the test directory for execve() to find it # and it can't be renamed (i.e., no -shared). @@ -386,18 +397,6 @@ if (BUILD_SHARED_LIBS) set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader) endif () -#-- Adding test for libinfo -set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -file (WRITE ${GREP_RUNNER} - "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") -if (\${TEST_RESULT} STREQUAL \"0\") - message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -else () - message (STATUS \"COMMAND Result: \${TEST_RESULT}\") -endif () -" -) - ############################################################################## ### P L U G I N T E S T S ############################################################################## diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 06bbd06..9b1ea6b 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -26,27 +26,6 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") endif () -if (HDF5_TEST_VFD) - set (VFD_LIST - sec2 - stdio - core - core_paged - split - multi - family - ) - if (DIRECT_VFD) - set (VFD_LIST ${VFD_LIST} direct) - endif () - foreach (vfdtest ${VFD_LIST}) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") - #if (BUILD_SHARED_LIBS) - # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") - #endif () - endforeach () -endif () - # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- @@ -75,16 +54,6 @@ foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") endif () endforeach () -if (HDF5_TEST_VFD) - foreach (vfdtest ${VFD_LIST}) - foreach (h5_tfile ${HDF5_TEST_FILES}) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () - endforeach () -endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -103,16 +72,6 @@ foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files") endif () endforeach () -if (HDF5_TEST_VFD) - foreach (vfdtest ${VFD_LIST}) - foreach (ref_file ${HDF5_REFERENCE_FILES}) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () - endforeach () -endif () # -------------------------------------------------------------------- # Copy test files from test/testfiles/plist_files dir to test dir @@ -238,16 +197,7 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files") endif () endforeach () -if (HDF5_TEST_VFD) - foreach (vfdtest ${VFD_LIST}) - foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_TEST_LIB_files") - if (BUILD_SHARED_LIBS) - HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () - endforeach () -endif () + add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) if (BUILD_SHARED_LIBS) add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) @@ -593,97 +543,42 @@ add_test (NAME H5TEST-clear-objects ${HDF5_TEST_BINARY_DIR}/H5TEST ) -set (H5TEST_TESTS - #testhdf5 - #cache - cache_api - cache_tagging - lheap - ohdr - stab - gheap - evict_on_close - farray - earray - btree2 - fheap - pool - accum - #hyperslab - istore - bittests - dt_arith - dtypes - dsets - cmpd_dset - filter_fail - extend - external - efc - objcopy - links - unlink - twriteorder - big - mtime - fillval - mount - flush1 - flush2 - app_ref - enum - set_extent - ttsafe - enc_dec_plist - enc_dec_plist_cross_platform - getname - vfd - ntypes - dangle - dtransform - reserved - cross_read - freespace - mf - page_buffer - vds - file_image - unregister - cache_logging - cork - swmr +set (H5TEST_SEPARATE_TESTS + cache + cache_image ) - foreach (test ${H5TEST_TESTS}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-${test} COMMAND $) - set_tests_properties (H5TEST-${test} PROPERTIES - DEPENDS H5TEST-clear-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) - else () - if ("${test}" STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-${test} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" + if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_TESTS}) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-${test} COMMAND $) + set_tests_properties (H5TEST-${test} PROPERTIES + DEPENDS H5TEST-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) else () - add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=${test}.txt" - #-D "TEST_REFERENCE=${test}.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + if ("${test}" STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-${test} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" + ) + else () + add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5TEST-${test} PROPERTIES + DEPENDS H5TEST-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) endif () - set_tests_properties (H5TEST-${test} PROPERTIES - DEPENDS H5TEST-clear-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) endif () endforeach () @@ -704,27 +599,29 @@ if (BUILD_SHARED_LIBS) ) foreach (test ${H5TEST_TESTS}) - if ("${test}" STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-shared-${test} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" - ) - else () - add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=${test}.txt" - #-D "TEST_REFERENCE=${test}.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_TESTS}) + if ("${test}" STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-shared-${test} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" + ) + else () + add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5TEST-shared-${test} PROPERTIES + DEPENDS H5TEST-shared-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) endif () - set_tests_properties (H5TEST-shared-${test} PROPERTIES - DEPENDS H5TEST-shared-clear-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) endforeach () set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) @@ -734,12 +631,6 @@ if (BUILD_SHARED_LIBS) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 1800) endif () -############################################################################## -############################################################################## -### A D D I T I O N A L T E S T S ### -############################################################################## -############################################################################## - #-- Adding test for cache if (NOT CYGWIN) add_test (NAME H5TEST-clear-cache-objects @@ -787,6 +678,73 @@ set_tests_properties (H5TEST-cache_image PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) +if (BUILD_SHARED_LIBS) + #-- Adding test for cache + if (NOT CYGWIN AND NOT WIN32) + add_test (NAME H5TEST-shared-clear-cache-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_test.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-shared-cache COMMAND $) + else () + add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cache-shared.txt" + #-D "TEST_REFERENCE=cache-shared.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5TEST-shared-cache PROPERTIES + DEPENDS H5TEST-shared-clear-cache-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 1800) + endif () +endif () + + +############################################################################## +############################################################################## +### A D D I T I O N A L T E S T S ### +############################################################################## +############################################################################## +# H5_CHECK_TESTS +#--------------- +# error_test +# err_compat +# tcheck_version +# testmeta +# atomic_writer +# atomic_reader +# links_env +# filenotclosed +# flushrefresh +############################################################################## +# autotools script tests +# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. +# NOT CONVERTED tcheck_version is used by testcheck_version.sh. +# NOT CONVERTED accum_swmr_reader is used by accum.c. +# NOT CONVERTED atomic_writer and atomic_reader are standalone programs. +# links_env is used by testlinks_env.sh +# filenotclosed is used by test_filenotclosed.sh +# NOT CONVERTED flushrefresh is used by testflushrefresh.sh. +# NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh +# NOT CONVERTED swmr_* files (besides swmr.c) are used by testswmr.sh. +# NOT CONVERTED vds_swmr_* files are used by testvdsswmr.sh +# NOT CONVERTED 'make check' doesn't run them directly, so they are not included in TEST_PROG. +# NOT CONVERTED Also build testmeta, which is used for timings test. It builds quickly, +# NOT CONVERTED and this lets automake keep all its test programs in one place. +############################################################################## + #-- Adding test for filenotclosed add_test ( NAME H5TEST-clear-filenotclosed-objects @@ -899,37 +857,6 @@ add_test (NAME H5TEST-testlibinfo ) if (BUILD_SHARED_LIBS) - #-- Adding test for cache - if (NOT CYGWIN AND NOT WIN32) - add_test (NAME H5TEST-shared-clear-cache-objects - COMMAND ${CMAKE_COMMAND} - -E remove - cache_test.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-shared-cache COMMAND $) - else () - add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cache-shared.txt" - #-D "TEST_REFERENCE=cache-shared.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (H5TEST-shared-cache PROPERTIES - DEPENDS H5TEST-shared-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared - ) - set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 1800) - endif () - #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_test (NAME H5TEST-shared-clear-err_compat-objects @@ -1068,272 +995,7 @@ set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES ############################################################################## if (HDF5_TEST_VFD) - - set (H5_VFD_TESTS - testhdf5 -# cache - cache_api - cache_tagging - lheap - ohdr - stab - gheap - evict_on_close - pool -# accum - farray - earray - btree2 -# fheap - hyperslab - istore - bittests - dt_arith - dtypes - dsets - cmpd_dset - filter_fail - extend - external - efc - objcopy - links - unlink -# big - mtime - fillval - mount - flush1 - flush2 - app_ref - enum - set_extent - ttsafe - getname -# vfd - ntypes - dangle - dtransform - reserved - cross_read - freespace - mf -# error_test -# err_compat - #tcheck_version -# testmeta -# links_env - unregister - ) - if (NOT CYGWIN) - set (H5_VFD_TESTS ${H5_VFD_TESTS} big cache) - endif () - - # Windows only macro - macro (CHECK_VFD_TEST vfdtest vfdname resultcode) - if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") - if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") - if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug") - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - else () - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" - ) - endif () - endif () - else () - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - endif () - else () - add_test (NAME VFD-${vfdname}-${vfdtest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache") - add_test (NAME VFD-${vfdname}-${vfdtest}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - endif () - endmacro () - - macro (ADD_VFD_TEST vfdname resultcode) - foreach (test ${H5_VFD_TESTS}) - if (WIN32) - CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) - else () - add_test (NAME VFD-${vfdname}-${test} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${test}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${test} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-${test}-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-${test}-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - endif () - endforeach () - set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) - set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) - if (NOT CYGWIN) - set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) - endif () - if (BUILD_SHARED_LIBS) - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) - set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) - if (NOT CYGWIN AND NOT WIN32) - set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - endif () - endif () - if (HDF5_TEST_FHEAP_VFD) - add_test (NAME VFD-${vfdname}-fheap - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-fheap PROPERTIES - TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} - ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-fheap-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES - TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () - endif () - endmacro () - - # Run test with different Virtual File Driver - foreach (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - endforeach () - + include (CMakeVFDTests.cmake) endif () ############################################################################## diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake new file mode 100644 index 0000000..9897f3f --- /dev/null +++ b/test/CMakeVFDTests.cmake @@ -0,0 +1,303 @@ + +# Copyright by The HDF Group. +# All rights reserved. +# +# 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. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## +# included from CMakeTEsts.cmake + +set (VFD_LIST + sec2 + stdio + core + core_paged + split + multi + family +) +if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) +endif () + +foreach (vfdtest ${VFD_LIST}) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") + if (BUILD_SHARED_LIBS) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") + endif () +endforeach () + +foreach (vfdtest ${VFD_LIST}) + foreach (h5_tfile ${HDF5_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +foreach (vfdtest ${VFD_LIST}) + foreach (ref_file ${HDF5_REFERENCE_FILES}) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +foreach (vfdtest ${VFD_LIST}) + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIB tests" DEPENDS ${HDF5_VFDTEST_LIB_files_list}) +if (BUILD_SHARED_LIBS) + add_custom_target(HDF5_VFDTEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIBSH tests" DEPENDS ${HDF5_VFDTEST_LIBSH_files_list}) +endif () + +############################################################################## +############################################################################## +### V F D T E S T S ### +############################################################################## +############################################################################## + + set (H5_VFD_SKIP_TESTS + cache + accum + fheap + big + vfd + error_test + err_compat + tcheck_version + testmeta + links_env + ) + if (NOT CYGWIN) + list(REMOVE_ITEM ${H5_VFD_SKIP_TESTS} big cache) + endif () + + # Windows only macro + macro (CHECK_VFD_TEST vfdtest vfdname resultcode) + if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") + if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") + if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug") + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + else () + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" + ) + endif () + endif () + else () + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endif () + else () + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache") + add_test (NAME VFD-${vfdname}-${vfdtest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endif () + endmacro () + + macro (DO_VFD_TEST vfdtest vfdname resultcode) + add_test (NAME VFD-${vfdname}-${vfdtest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-${vfdtest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endmacro () + + macro (ADD_VFD_TEST vfdname resultcode) + foreach (test ${H5_TESTS}) + if (NOT "${test}" IN_LIST ${H5_VFD_SKIP_TESTS}) + if (WIN32) + CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) + else () + DO_VFD_TEST (${test} ${vfdname} ${resultcode}) + endif () + endforeach () + set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) + set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) + if (NOT CYGWIN) + set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) + endif () + if (BUILD_SHARED_LIBS) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) + set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) + if (NOT CYGWIN AND NOT WIN32) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + endif () + endif () + if (HDF5_TEST_FHEAP_VFD) + add_test (NAME VFD-${vfdname}-fheap + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VFD-${vfdname}-fheap-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif () + endif () + endif () + endmacro () + + # Run test with different Virtual File Driver + foreach (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + endforeach () diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index d0b74b0..3cee808 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- @@ -49,6 +49,7 @@ set (H5P_TESTS t_mpi t_bigio t_cache + t_cache_image t_pflush1 t_pflush2 t_pread diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 41a9fdc..e02d3eb 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 0fc1981..addaf2e 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 24e682a..5a25f76 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 1d9c11e..606516f 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index a485de7..2ff5817 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index bcfa89c..491ec4b 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 0f6d8d9..712dd87 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index 4aa8938..efb0ad2 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index fbd4250..9035ed9 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 703e55e..71b3d1d 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index a646819..3fefd24 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index cde81ee..cc8bee2 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 313760f..78ba238 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_SRC_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index 6877bfc..54dd5a2 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST) #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 35aee35..2f5f314 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index def2e6d..cedc932 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index c4f2b95..1941764 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 497f463..5287ae0 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 36bfbdc..5492363 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index dbac14b..17dda3c 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index c21ca92..e92533f 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 5996fff..a606ac6 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 13ebd17..17081a7 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -76,6 +76,7 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5 @@ -464,60 +465,52 @@ endif () endmacro () - macro (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) - if ("${testtype}" STREQUAL "SKIP") - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" - ) + macro (ADD_H5_VERIFY_TEST testname resultcode testfile testdset testfilter) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () - else () - if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects) + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) + if ("${resultcode}" STREQUAL "0") add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - testfiles/${testfile}-${testname}-v.out - testfiles/${testfile}-${testname}-v.out.err + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + else () + if ("${testfilter}" STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") endif () - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects) - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - if ("${resultcode}" STREQUAL "0") - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - else () - if ("${testfilter}" STREQUAL "CHUNKED") - set (nottestfilter "(CONTIGUOUS|COMPACT)") - endif () - if ("${testfilter}" STREQUAL "CONTIGUOUS") - set (nottestfilter "(CHUNK|COMPACT)") - endif () - if ("${testfilter}" STREQUAL "COMPACT") - set (nottestfilter "(CONTIGUOUS|CHUNK)") + if ("${testfilter}" STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif () + if ("${testfilter}" STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") endif () add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP @@ -582,6 +575,62 @@ endif () endmacro () + macro (ADD_H5_VERIFY_SUPERBLOCK testname testfile lowbound highbound superblock) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=SUPERBLOCK_VERSION ${superblock}" + -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) + endif () + endmacro () + + macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties ( + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES + DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + WILL_FAIL "true" + ) + endif () + endmacro () + macro (ADD_H5_TEST_META testname testfile) # Remove any output file left over from previous test run add_test ( @@ -1371,6 +1420,18 @@ ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## +# -j 0 -k 2, superblock will be 0 +ADD_H5_VERIFY_SUPERBLOCK SB_IS_0 h5repack_layout.h5 0 2 0 +# -j 1 -k 2, superblock will be 2 +ADD_H5_VERIFY_SUPERBLOCK SB_IS_2 h5repack_layout.h5 1 2 2 +# -j 2 -k 2, superblock will be 3 +ADD_H5_VERIFY_SUPERBLOCK SB_IS_3 h5repack_layout.h5 2 2 3 +# -j 0 -k 1, file cannot be opened +ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 + +############################################################################## ### P L U G I N T E S T S ############################################################################## ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index d2a1de2..0d07753 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index c014fad..178767a 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 9092079..5b34c43 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) #----------------------------------------------------------------------------- diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 581a85e..b7452e0 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.3.2) PROJECT (HDF5_TOOLS_TEST_PERFORM ) #----------------------------------------------------------------------------- -- cgit v0.12 From 90f01d5b160e0cbf950a9378d0a2625918a6eeb8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 13:33:38 -0600 Subject: Fix IN_LIST usage --- test/CMakeLists.txt | 2 +- test/CMakeTests.cmake | 4 ++-- test/CMakeVFDTests.cmake | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cdab4f5..fd16f20 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -269,7 +269,7 @@ set (H5_TESTS_MULTIPLE ) # Only build single source tests here foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST ${H5_TESTS_MULTIPLE}) + if (NOT "${test}" IN_LIST H5_TESTS_MULTIPLE) ADD_H5_EXE(${test}) endif () endforeach () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 9b1ea6b..67bb502 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -548,7 +548,7 @@ set (H5TEST_SEPARATE_TESTS cache_image ) foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_TESTS}) + if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-${test} COMMAND $) set_tests_properties (H5TEST-${test} PROPERTIES @@ -599,7 +599,7 @@ if (BUILD_SHARED_LIBS) ) foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST ${H5TEST_SEPARATE_TESTS}) + if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 9897f3f..20020f8 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -237,7 +237,7 @@ endif () macro (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST ${H5_VFD_SKIP_TESTS}) + if (NOT "${test}" IN_LIST H5_VFD_SKIP_TESTS) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) else () -- cgit v0.12 From 93744615f930324c04cef2543d272996e09acf56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 14:04:34 -0600 Subject: Fix list var --- test/CMakeLists.txt | 2 +- test/CMakeTests.cmake | 9 +- test/CMakeVFDTests.cmake | 2 +- tools/test/h5repack/CMakeTests.cmake | 161 +++++++++++------------------------ 4 files changed, 57 insertions(+), 117 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fd16f20..fd88b5f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -269,7 +269,7 @@ set (H5_TESTS_MULTIPLE ) # Only build single source tests here foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST H5_TESTS_MULTIPLE) + if (NOT ${test} IN_LIST H5_TESTS_MULTIPLE) ADD_H5_EXE(${test}) endif () endforeach () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 67bb502..221b857 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -544,11 +544,12 @@ add_test (NAME H5TEST-clear-objects ) set (H5TEST_SEPARATE_TESTS + testhdf5 cache cache_image ) -foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) +foreach (test ${H5_TESTS}) + if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-${test} COMMAND $) set_tests_properties (H5TEST-${test} PROPERTIES @@ -598,8 +599,8 @@ if (BUILD_SHARED_LIBS) ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - foreach (test ${H5TEST_TESTS}) - if (NOT "${test}" IN_LIST H5TEST_SEPARATE_TESTS) + foreach (test ${H5_TESTS}) + if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS) if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 20020f8..944b163 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -237,7 +237,7 @@ endif () macro (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_TESTS}) - if (NOT "${test}" IN_LIST H5_VFD_SKIP_TESTS) + if (NOT ${test} IN_LIST H5_VFD_SKIP_TESTS) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) else () diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 17081a7..13ebd17 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -76,7 +76,6 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5 - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5 @@ -465,52 +464,60 @@ endif () endmacro () - macro (ADD_H5_VERIFY_TEST testname resultcode testfile testdset testfilter) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - testfiles/${testfile}-${testname}-v.out - testfiles/${testfile}-${testname}-v.out.err - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + macro (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) + if ("${testtype}" STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" + ) endif () - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects) - add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - if ("${resultcode}" STREQUAL "0") + else () + if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - else () - if ("${testfilter}" STREQUAL "CHUNKED") - set (nottestfilter "(CONTIGUOUS|COMPACT)") - endif () - if ("${testfilter}" STREQUAL "CONTIGUOUS") - set (nottestfilter "(CHUNK|COMPACT)") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () - if ("${testfilter}" STREQUAL "COMPACT") - set (nottestfilter "(CONTIGUOUS|CHUNK)") + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects) + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) + if ("${resultcode}" STREQUAL "0") + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + else () + if ("${testfilter}" STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") + endif () + if ("${testfilter}" STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif () + if ("${testfilter}" STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") endif () add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP @@ -575,62 +582,6 @@ endif () endmacro () - macro (ADD_H5_VERIFY_SUPERBLOCK testname testfile lowbound highbound superblock) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - testfiles/${testfile}-${testname}-v.out - testfiles/${testfile}-${testname}-v.out.err - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( - NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} - COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) - add_test ( - NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=SUPERBLOCK_VERSION ${superblock}" - -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" - -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" - ) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) - endif () - endmacro () - - macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) - add_test ( - NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( - NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} - COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties ( - ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES - DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects - WILL_FAIL "true" - ) - endif () - endmacro () - macro (ADD_H5_TEST_META testname testfile) # Remove any output file left over from previous test run add_test ( @@ -1420,18 +1371,6 @@ ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## -### V E R S I O N B O U N D S T E S T S -############################################################################## -# -j 0 -k 2, superblock will be 0 -ADD_H5_VERIFY_SUPERBLOCK SB_IS_0 h5repack_layout.h5 0 2 0 -# -j 1 -k 2, superblock will be 2 -ADD_H5_VERIFY_SUPERBLOCK SB_IS_2 h5repack_layout.h5 1 2 2 -# -j 2 -k 2, superblock will be 3 -ADD_H5_VERIFY_SUPERBLOCK SB_IS_3 h5repack_layout.h5 2 2 3 -# -j 0 -k 1, file cannot be opened -ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 - -############################################################################## ### P L U G I N T E S T S ############################################################################## ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) -- cgit v0.12 From 032f680919cd67202c6b5817c327139c09dacb05 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Feb 2018 14:09:27 -0600 Subject: Add import --- java/test/TestH5Pfapl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index ac54405..51fa4df 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -26,6 +26,7 @@ import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import hdf.hdf5lib.exceptions.HDF5PropertyListInterfaceException; import hdf.hdf5lib.structs.H5AC_cache_config_t; import org.junit.After; -- cgit v0.12 From 4899c9ab47b3e543a40dee3729a31c54807f0e9f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 27 Feb 2018 18:04:29 -0600 Subject: Misc improvement Description: - Added test file for h5repack test VERIFY_INVALIDBOUNDS - Updated MANIFEST - Removed unnecessary header file in test - Update h5repack script to copy the new file to the test location Platforms tested: Linux/64 (jelly) Darwin (osx1010test) --- MANIFEST | 1 + test/dtypes.c | 1 - tools/test/h5repack/h5repack.sh.in | 4 +++- tools/test/h5repack/testfiles/bounds_latest_latest.h5 | Bin 0 -> 82048 bytes 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 tools/test/h5repack/testfiles/bounds_latest_latest.h5 diff --git a/MANIFEST b/MANIFEST index 8e79458..fba4fa8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2441,6 +2441,7 @@ #test files for h5repack ./tools/test/h5repack/testfiles/README +./tools/test/h5repack/testfiles/bounds_latest_latest.h5 ./tools/test/h5repack/testfiles/h5repack_aggr.h5 ./tools/test/h5repack/testfiles/h5repack_attr.h5 ./tools/test/h5repack/testfiles/h5repack_attr_refs.h5 diff --git a/test/dtypes.c b/test/dtypes.c index e480682..e98f6be 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -18,7 +18,6 @@ * Purpose: Tests the datatype interface (H5T) */ -#include "h5test.h" #include "testhdf5.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index a34b75c..b0a2f99 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -82,6 +82,7 @@ test -d $TESTDIR || mkdir $TESTDIR # Comment '#' without space can be used. # -------------------------------------------------------------------- LIST_HDF5_TEST_FILES=" +$SRC_H5REPACK_TESTFILES/bounds_latest_latest.h5 $SRC_H5REPACK_TESTFILES/h5repack_attr.h5 $SRC_H5REPACK_TESTFILES/h5repack_attr_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_deflate.h5 @@ -534,7 +535,6 @@ VERIFY_SUPERBLOCK() ( cd $TESTDIR $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile -echo "$RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile" ) RET=$? if [ $RET != 0 ] ; then @@ -575,6 +575,8 @@ VERIFY_INVALIDBOUNDS() infile=$3 outfile=out-verbounds-low$lowbound-high$highbound.$infile + #-------------------------------------- + # check for failure with invalid bounds TESTING $H5REPACK $@ ( cd $TESTDIR diff --git a/tools/test/h5repack/testfiles/bounds_latest_latest.h5 b/tools/test/h5repack/testfiles/bounds_latest_latest.h5 new file mode 100644 index 0000000..6e8bcad Binary files /dev/null and b/tools/test/h5repack/testfiles/bounds_latest_latest.h5 differ -- cgit v0.12 From 23ceda33b3f6b6903ce7bd4373347af5e0a33cd6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Feb 2018 09:01:38 -0600 Subject: Correct use of LIST var --- test/CMakeVFDTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 944b163..a17efbb 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -88,7 +88,7 @@ endif () links_env ) if (NOT CYGWIN) - list(REMOVE_ITEM ${H5_VFD_SKIP_TESTS} big cache) + list (REMOVE_ITEM H5_VFD_SKIP_TESTS big cache) endif () # Windows only macro -- cgit v0.12 From bf9b73e877302948a54a9a4129ffb265f39b574f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Feb 2018 09:26:11 -0600 Subject: Remove t_cache_image test on Windows --- testpar/CMakeTests.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 87470f3..cd9acda 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -18,6 +18,10 @@ add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) +if (WIN32) + # t_cache_imagee uses fork() and execve(), will not run on Windows + list (REMOVE_ITEM H5P_TESTS t_cache_image) +endif () foreach (testp ${H5P_TESTS}) add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endforeach () -- cgit v0.12 From 81b96fb01a706d88f973516efb1c0a78878a004b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Feb 2018 11:47:17 -0600 Subject: Remove option from list in doc --- release_docs/INSTALL_CMake.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 99efb6a..f54ca4b 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -571,7 +571,6 @@ HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" OFF HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON -HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF HDF5_ENABLE_TRACE "Enable API tracing capability" OFF HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF -- cgit v0.12 From f2ff00bd7a21d86301dad00f851db72719e1a634 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 28 Feb 2018 14:40:13 -0600 Subject: Added bounds_latest_latest.h5 --- tools/test/h5repack/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 13ebd17..4300228 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -53,6 +53,7 @@ # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- set (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 -- cgit v0.12 From cecb59f93f1345b2a667c996304e2430a716cfeb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 1 Mar 2018 08:26:33 -0600 Subject: Correct if-endif block --- java/src/jni/h5dImp.c | 2 +- test/CMakeVFDTests.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index 66efed0..9784055 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1019,7 +1019,7 @@ Java_hdf_hdf5lib_H5_H5DreadVL } /* end else */ return (jint)status; -} /* end Java_hdf_hdf5lib_H5_H5Dread_1VLStrings */ +} /* end Java_hdf_hdf5lib_H5_H5Dread_1VL */ herr_t H5DreadVL_asstr diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index a17efbb..cbf944e 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -243,7 +243,7 @@ endif () else () DO_VFD_TEST (${test} ${vfdname} ${resultcode}) endif () - endforeach () + endif () set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) -- cgit v0.12 From 5a8ac1fb6c13e776bc17fa52c4cdf353c907907b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 1 Mar 2018 08:33:24 -0600 Subject: Fix test loop --- test/CMakeVFDTests.cmake | 78 ++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index cbf944e..995f4e0 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -244,55 +244,55 @@ endif () DO_VFD_TEST (${test} ${vfdname} ${resultcode}) endif () endif () - set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) - set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) - if (NOT CYGWIN) - set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) + endforeach () + set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) + set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) + if (NOT CYGWIN) + set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) + endif () + if (BUILD_SHARED_LIBS) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) + set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) + if (NOT CYGWIN AND NOT WIN32) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) endif () + endif () + if (HDF5_TEST_FHEAP_VFD) + add_test (NAME VFD-${vfdname}-fheap + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ) if (BUILD_SHARED_LIBS) - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) - set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) - set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) - if (NOT CYGWIN AND NOT WIN32) - set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - endif () - endif () - if (HDF5_TEST_FHEAP_VFD) - add_test (NAME VFD-${vfdname}-fheap + add_test (NAME VFD-${vfdname}-fheap-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -D "TEST_OUTPUT=${vfdname}-fheap-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - set_tests_properties (VFD-${vfdname}-fheap PROPERTIES + set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - if (BUILD_SHARED_LIBS) - add_test (NAME VFD-${vfdname}-fheap-shared - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdname}-fheap-shared" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES - TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared - ) - endif () endif () endif () endmacro () -- cgit v0.12 From c0aafa78e52fcea5bfc4252fc2c0285b9b983646 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Fri, 2 Mar 2018 11:32:13 -0500 Subject: Fixed t_pread.c to remove the use of h5jam, etc.. This fixes HDFFV-8839 and should merge into develop --- testpar/t_pread.c | 155 +++++++++++++++++------------------------------------- 1 file changed, 47 insertions(+), 108 deletions(-) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index aac5bee..53701b9 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -25,16 +25,10 @@ * since each set of three is used by the tests either to construct * or to read and validate. */ -#define NFILENAME 9 -const char *FILENAMES[NFILENAME + 1]={"t_pread_data_file", - "reloc_t_pread_data_file", - "prefix_file", - "t_pread_group_0_file", +#define NFILENAME 3 +const char *FILENAMES[NFILENAME + 1]={"reloc_t_pread_data_file", "reloc_t_pread_group_0_file", - "prefix_file_0", - "t_pread_group_1_file", "reloc_t_pread_group_1_file", - "prefix_file_1", NULL}; #define FILENAME_BUF_SIZE 1024 @@ -55,18 +49,13 @@ static int generate_test_file(MPI_Comm comm, int mpi_rank, int group); static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group); static char *test_argv0 = NULL; -extern char *dirname(char *path); /* Avoids additional includes */ - + /*------------------------------------------------------------------------- * Function: generate_test_file * * Purpose: This function is called to produce an HDF5 data file - * whose superblock is relocated to a non-zero offset by - * utilizing the 'h5jam' utility to write random text - * at the start of the file. Unlike simple concatenation - * of files, h5jam is used to place the superblock on a - * power-of-2 boundary. + * whose superblock is relocated to a power-of-2 boundary. * * Since data will be read back and validated, we generate * data in a predictable manner rather than randomly. @@ -98,13 +87,11 @@ extern char *dirname(char *path); /* Avoids additional includes */ static int generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) { - FILE *header = NULL; + int header = -1; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = NULL; char *group_filename = NULL; char data_filename[FILENAME_BUF_SIZE]; - char reloc_data_filename[FILENAME_BUF_SIZE]; - char prolog_filename[FILENAME_BUF_SIZE]; int file_index = 0; int group_size; int group_rank; @@ -117,6 +104,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) hid_t file_id = -1; hid_t memspace = -1; hid_t filespace = -1; + hid_t fctmpl = -1; hid_t fapl_id = -1; hid_t dxpl_id = -1; hid_t dset_id = -1; @@ -154,10 +142,10 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) file_index = 0; } else if ( group_id == 0 ) { /* Test 2 group 0 */ - file_index = 3; + file_index = 1; } else { /* Test 2 group 1 */ - file_index = 6; + file_index = 2; } /* The 'group_filename' is just a temp variable and @@ -175,32 +163,6 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } - if ( pass ) { - - group_filename = FILENAMES[file_index+1]; - HDassert( group_filename ); - - /* Assign the 'reloc_data_filename' */ - if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, - sizeof(reloc_data_filename)) == NULL ) { - - pass = FALSE; - failure_mssg = "h5_fixname(1) failed.\n"; - } - } - - if ( pass ) { - group_filename = FILENAMES[file_index+2]; - HDassert( group_filename ); - - /* Assign the 'prolog_filename' */ - if ( h5_fixname(group_filename, H5P_DEFAULT, prolog_filename, - sizeof(prolog_filename)) == NULL ) { - pass = FALSE; - failure_mssg = "h5_fixname(2) failed.\n"; - } - } - /* setup data to write */ if ( pass ) { if ( (data_slice = (float *)HDmalloc(COUNT * sizeof(float))) == NULL ) { @@ -218,6 +180,17 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } + /* Initialize a file creation template */ + if (pass) { + if ((fctmpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n"; + } + else if (H5Pset_userblock(fctmpl, 512) != SUCCEED) { + pass = FALSE; + failure_mssg = "H5Pset_userblock(,size) failed.\n"; + } + } /* setup FAPL */ if ( pass ) { if ( (fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) { @@ -236,7 +209,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) /* create the data file */ if ( pass ) { if ( (file_id = H5Fcreate(data_filename, H5F_ACC_TRUNC, - H5P_DEFAULT, fapl_id)) < 0 ) { + fctmpl, fapl_id)) < 0 ) { pass = FALSE; failure_mssg = "H5Fcreate() failed.\n"; } @@ -342,6 +315,13 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } + if (pass || (fctmpl != -1)) { + if (H5Pclose(fctmpl) < 0) { + pass = false; + failure_mssg = "H5Pclose(fctmpl) failed.\n"; + } + } + /* Add a userblock to the head of the datafile. * We will use this to for a functional test of the * file open optimization. This is superblock @@ -354,11 +334,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * group_rank(0) processes. Each parallel group * will create a unique file with different text * headers and different data. - * - * We also delete files that are no longer needed. */ - if ( group_rank == 0 ) { - + if (group_rank == 0) { const char *text_to_write; size_t bytes_to_write; @@ -367,69 +344,33 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) else text_to_write = hitchhiker_quote; - bytes_to_write = strlen(text_to_write); - - if ( pass ) { - if ( (header = HDfopen(prolog_filename, "w+")) == NULL ) { - pass = FALSE; - failure_mssg = "HDfopen(prolog_filename, \"w+\") failed.\n"; - } - } - - if ( pass ) { + bytes_to_write = HDstrlen(text_to_write); - if ( HDfwrite(text_to_write, 1, bytes_to_write, header) != - bytes_to_write ) { + if (pass) { + if ((header = HDopen(data_filename, O_WRONLY)) < 0) { pass = FALSE; - failure_mssg = "Unable to write header file.\n"; + failure_mssg = "HDopen(data_filename, O_WRONLY) failed.\n"; } } - if ( pass || (header != NULL) ) { - if ( HDfclose(header) != 0 ) { + if (pass) { + HDlseek(header, 0, SEEK_SET); + if (HDwrite(header, text_to_write, bytes_to_write) < 0) { pass = FALSE; - failure_mssg = "HDfclose() failed.\n"; - } + failure_mssg = "Unable to write user text into file.\n"; + } } - if ( pass ) { - char cmd[256]; - char exe_path[256]; - char *relative_path = "../tools/src/h5jam"; - char *exe_dirname = relative_path; - - /* We're checking for the existance of the h5jam utility - * With Cmake testing, all binaries are in the same directory - * e.g. the same location where this executable is found. - * We've copied the argv[0] argument and check to see - * if h5jam is co-located here. Otherwise, the autotools - * put things into directories, hence the relative path. - */ - if (test_argv0 != NULL) { - HDstrncpy(exe_path, test_argv0, sizeof(exe_path)); - if ( (exe_dirname = (char *)dirname(exe_path)) != NULL) { - HDsprintf(cmd, "%s/h5jam", exe_dirname); - if ( HDaccess(cmd, F_OK) != 0) - exe_dirname = relative_path; - } - } - HDsprintf(cmd, "%s/h5jam -i %s -u %s -o %s", - exe_dirname, - data_filename, - prolog_filename, reloc_data_filename); - - if ( system(cmd) != 0 ) { + if (pass || (header > 0)) { + if (HDclose(header) < 0) { pass = FALSE; - failure_mssg = "invocation of h5jam failed.\n"; + failure_mssg = "HDclose() failed.\n"; } } - - HDremove(prolog_filename); - HDremove(data_filename); } /* collect results from other processes. - * Only overwrite the failure message if no preveious error + * Only overwrite the failure message if no previous error * has been detected */ local_failure = ( pass ? 0 : 1 ); @@ -467,7 +408,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } /* generate_test_file() */ - + /*------------------------------------------------------------------------- * Function: test_parallel_read * @@ -564,11 +505,11 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) if ( pass ) { if ( comm == MPI_COMM_WORLD ) /* test 1 */ - group_filename = FILENAMES[1]; + group_filename = FILENAMES[0]; else if ( group_id == 0 ) /* test 2 group 0 */ - group_filename = FILENAMES[4]; + group_filename = FILENAMES[1]; else /* test 2 group 1 */ - group_filename = FILENAMES[7]; + group_filename = FILENAMES[2]; HDassert(group_filename); if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, @@ -742,7 +683,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) } /* test_parallel_read() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -781,7 +722,7 @@ main( int argc, char **argv) int mpi_rank; int mpi_size; int split_size; - MPI_Comm group_comm = MPI_COMM_WORLD; + MPI_Comm group_comm = MPI_COMM_NULL; /* I don't believe that argv[0] can ever be NULL. * It should thus be safe to dup and save as a check @@ -905,7 +846,6 @@ finish: HDfprintf(stderr, "MPI_Comm_free failed!\n"); } - /* make sure all processes are finished before final report, cleanup * and exit. */ @@ -916,7 +856,6 @@ finish: HDfprintf(stdout, "===================================\n"); if ( nerrs > 0 ) { - HDfprintf(stdout, "***%s detected %d failures***\n", header, nerrs); } else { -- cgit v0.12 From 9364df1c6d6d4661b6c32278268ccbe1640a082c Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Fri, 2 Mar 2018 13:50:23 -0600 Subject: Fix CMake build type if none was specified to be cached Restrict CMAKE_BUILD_TYPE to default ones --- config/cmake_ext_mod/HDFMacros.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 4097ca9..bdc52b9 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -27,8 +27,12 @@ macro (SET_HDF_BUILD_TYPE) set(HDF_BUILD_TYPE "Release") endif() endif() - if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") endif() endmacro () -- cgit v0.12 From b3142a85fda8670a5780e6d3d080d54a71e0fc1d Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 5 Mar 2018 08:17:39 -0600 Subject: Update install file for configure revisions. --- release_docs/INSTALL | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/release_docs/INSTALL b/release_docs/INSTALL index 2dcb9be..3709a58 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -305,7 +305,7 @@ CONTENTS to enable symbolic debugging of a production version of HDF5, one might say: - $ CFLAGS=-g ./configure --enable-production + $ CFLAGS=-g ./configure --enable-build-mode=production 4.3.5. Compiling HDF5 wrapper libraries One can optionally build the Fortran and/or C++ interfaces to the @@ -414,35 +414,35 @@ CONTENTS The library can be compiled to provide symbolic debugging support so it can be debugged with gdb, dbx, ddd, etc., or it can be compiled with various optimizations. To compile for symbolic - debugging (the default for snapshots), say `--disable-production'; - to compile with optimizations (the default for supported public - releases), say `--enable-production'. On some systems the library - can also be compiled for profiling with gprof by saying + debugging (the default for snapshots), say + `--enable-build-mode=production'; to compile with optimizations + (the default for supported public releases), + say `--enable-build-mode=production'. On some systems the + library can also be compiled for profiling with gprof by saying `--enable-production=profile'. - $ ./configure --disable-production #symbolic debugging - $ ./configure --enable-production #optimized code - $ ./configure --enable-production=profile #for use with gprof + $ ./configure --enable-build-mode=debug #symbolic debugging + $ ./configure --enable-build-mode=production #optimized code + $ ./configure --enable-production=profile #for use with gprof Regardless of whether support for symbolic debugging is enabled, the library can also perform runtime debugging of certain packages (such as type conversion execution times and extensive invariant - condition checking). To enable this debugging, supply a - comma-separated list of package names to to the `--enable-debug' - switch. See "Debugging HDF5 Applications" for a list of package - names: + condition checking). To enable this debugging, supply a + comma-separated list of package names to the `--enable-internal-debug' + switch. See "Debugging HDF5 Applications" for a list of package names: http://www.hdfgroup.org/HDF5/doc/H5.user/Debugging.html - Debugging can be disabled by saying `--disable-debug'. + Debugging can be disabled by saying `--disable-internal-debug'. The default debugging level for snapshots is a subset of the available packages; the default for supported releases is no debugging (debugging can incur a significant runtime penalty). - $ ./configure --enable-debug=s,t #debug only H5S and H5T - $ ./configure --enable-debug #debug normal packages - $ ./configure --enable-debug=all #debug all packages - $ ./configure --disable-debug #no debugging + $ ./configure --enable-internal-debug=s,t #debug only H5S and H5T + $ ./configure --enable-internal-debug #debug normal packages + $ ./configure --enable-internal-debug=all #debug all packages + $ ./configure --disable-internal-debug #no debugging HDF5 can also print a trace of all API function calls, their arguments, and the return values. To enable or disable the @@ -466,15 +466,17 @@ CONTENTS http://www.hdfgroup.org/HDF5/doc/TechNotes/ThreadSafeLibrary.html 4.3.12. Backward compatibility - The 1.8 version of the HDF5 Library can be configured to operate - identically to the v1.6 library with the + The 1.10 version of the HDF5 Library can be configured to operate + identically to the v1.8 library with the + --with-default-api-version=v18 + configure flag, or identically to the v1.6 library with the --with-default-api-version=v16 configure flag. This allows existing code to be compiled with the - v1.8 library without requiring immediate changes to the application + v1.10 library without requiring immediate changes to the application source code. For addtional configuration options and other details, see "API Compatibility Macros in HDF5": - http://www.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html + https://support.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html 4.4. Building The library, confidence tests, and programs can be built by -- cgit v0.12 From 58603849053dceb81ae8a63e05a7862fac72ff3c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2018 11:47:09 -0600 Subject: HDFFV-10414 change minor error_number --- java/test/TestH5Pfapl.java | 2 +- src/H5Pfapl.c | 202 ++++++++++++++++++++++----------------------- 2 files changed, 102 insertions(+), 102 deletions(-) diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 51fa4df..0651502 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1388,7 +1388,7 @@ public class TestH5Pfapl { } catch (HDF5PropertyListInterfaceException err) { // parallel is not supported - if (err.getMinorErrorNumber() != HDF5Constants.H5E_CANTSET) { + if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) { err.printStackTrace(); fail("H5P_evict_on_close: " + err); } diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7802535..d37d352 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -387,7 +387,7 @@ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer minumum raw data size */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_reg_prop * @@ -627,7 +627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_alignment * @@ -685,7 +685,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_alignment * @@ -726,7 +726,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_alignment() */ - + /*------------------------------------------------------------------------- * Function: H5P_set_driver * @@ -774,7 +774,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_set_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_driver * @@ -817,7 +817,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver * @@ -861,7 +861,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver * @@ -902,7 +902,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver_info * @@ -944,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver_info * @@ -984,7 +984,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_copy * @@ -1050,7 +1050,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_free * @@ -1102,7 +1102,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_create * @@ -1131,7 +1131,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_create() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_set * @@ -1164,7 +1164,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_get * @@ -1197,7 +1197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_del * @@ -1226,7 +1226,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_copy * @@ -1255,7 +1255,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_cmp * @@ -1314,7 +1314,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_close * @@ -1343,7 +1343,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_family_offset * @@ -1382,7 +1382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset * @@ -1423,7 +1423,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type * @@ -1462,7 +1462,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_multi_type * @@ -1503,7 +1503,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_cache * @@ -1557,7 +1557,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_cache * @@ -1609,7 +1609,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_image_config * @@ -1653,7 +1653,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_image_config * @@ -1704,7 +1704,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * @@ -1748,7 +1748,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_config * @@ -1799,7 +1799,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_gc_references * @@ -1852,7 +1852,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_gc_references * @@ -1895,7 +1895,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_fclose_degree * @@ -1931,7 +1931,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * @@ -1966,7 +1966,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size * @@ -2017,7 +2017,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_meta_block_size * @@ -2061,7 +2061,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_sieve_buf_size * @@ -2112,7 +2112,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_sieve_buf_size * @@ -2155,7 +2155,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_small_data_block_size * @@ -2201,7 +2201,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_small_data_block_size * @@ -2240,7 +2240,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_libver_bounds * @@ -2338,7 +2338,7 @@ done: * 5) H5F_LIBVER_LATEST, H5F_LIBVER_LATEST * See detailed description in the RFC: Setting Bounds for Object Creation in HDF5 1.10.0. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Sunday, December 30, 2007 @@ -2382,11 +2382,11 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_libver_bounds * - * Purpose: Returns the current settings for the library version format bounds + * Purpose: Returns the current settings for the library version format bounds * from a file access property list. * * Return: Non-negative on success/Negative on failure @@ -2409,7 +2409,7 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - + /* Get values */ if(low) { if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0) @@ -2425,7 +2425,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_elink_file_cache_size * @@ -2463,7 +2463,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_elink_file_cache_size * @@ -2502,7 +2502,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image * @@ -2583,7 +2583,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image * @@ -2672,7 +2672,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image_callbacks * @@ -2749,7 +2749,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image_callbacks * @@ -2805,7 +2805,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_copy * @@ -2883,7 +2883,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_free * @@ -2938,7 +2938,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_cmp * @@ -2981,7 +2981,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_enc * @@ -3027,7 +3027,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_image_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_dec * @@ -3079,7 +3079,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * @@ -3112,7 +3112,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_get * @@ -3145,7 +3145,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_del * @@ -3176,7 +3176,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_copy * @@ -3206,7 +3206,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_cmp * @@ -3265,7 +3265,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_close * @@ -3295,7 +3295,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_close() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_cmp * @@ -3407,7 +3407,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_enc * @@ -3552,7 +3552,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_dec * @@ -3687,7 +3687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_enc * @@ -3725,7 +3725,7 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_dec * @@ -3760,7 +3760,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_enc * @@ -3798,7 +3798,7 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_dec * @@ -3833,7 +3833,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_enc * @@ -3841,10 +3841,10 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) * 'high' bound of library format versions property in the * file access property list is encoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer + * Programmer * *------------------------------------------------------------------------- */ @@ -3870,7 +3870,7 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_dec * @@ -3878,10 +3878,10 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) * 'high' bound of library format versions property in the * file access property list is decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: + * Programmer: * *------------------------------------------------------------------------- */ @@ -3904,9 +3904,9 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_dec() */ - + /*------------------------------------------------------------------------- - * Function: H5Pset_core_write_tracking + * Function: H5Pset_core_write_tracking * * Purpose: Enables/disables core VFD write tracking and page * aggregation size. @@ -3945,7 +3945,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_core_write_tracking * @@ -3987,7 +3987,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_metadata_read_attempts * @@ -4030,7 +4030,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_metadata_read_attempts * @@ -4071,7 +4071,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_obj_flush_cb * @@ -4115,7 +4115,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_obj_flush_cb * @@ -4156,7 +4156,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_log_options * @@ -4208,7 +4208,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_log_options * @@ -4263,7 +4263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_enc * @@ -4316,7 +4316,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_dec * @@ -4370,7 +4370,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_del * @@ -4393,7 +4393,7 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_del() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_copy * @@ -4415,7 +4415,7 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_cmp * @@ -4447,7 +4447,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_close * @@ -4470,7 +4470,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close * @@ -4509,7 +4509,7 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) #ifndef H5_HAVE_PARALLEL /* Set value */ if(H5P_set(plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set evict on close property") + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "can't set evict on close property") #else HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "evict on close is currently not supported in parallel HDF5") #endif /* H5_HAVE_PARALLEL */ @@ -4518,7 +4518,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_evict_on_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_evict_on_close * @@ -4562,7 +4562,7 @@ done: } /* end H5Pget_evict_on_close() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5P__encode_coll_md_read_flag_t * @@ -4600,7 +4600,7 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__encode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5P__decode_coll_md_read_flag_t * @@ -4634,7 +4634,7 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_all_coll_metadata_ops * @@ -4693,7 +4693,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_all_coll_metadata_ops() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_all_coll_metadata_ops * @@ -4751,7 +4751,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_all_coll_metadata_ops */ - + /*------------------------------------------------------------------------- * Function: H5Pset_coll_metadata_write * @@ -4790,7 +4790,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_coll_metadata_write() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_coll_metadata_write * @@ -4828,7 +4828,7 @@ done: } /* end H5Pget_coll_metadata_write() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5Pset_page_buffer_size * @@ -4876,7 +4876,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_page_buffer_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_page_buffer_size * -- cgit v0.12 From 58094b4f808e7a00d533f7b19a3fafb744ef6d77 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2018 12:22:48 -0600 Subject: HDFFV-10414 restore Ctl char - do we really need these anymore --- src/H5Pfapl.c | 178 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index d37d352..490e647 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -387,7 +387,7 @@ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer minumum raw data size */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_reg_prop * @@ -627,7 +627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_alignment * @@ -685,7 +685,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_alignment * @@ -726,7 +726,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_alignment() */ - + /*------------------------------------------------------------------------- * Function: H5P_set_driver * @@ -774,7 +774,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_set_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_driver * @@ -817,7 +817,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver * @@ -861,7 +861,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver * @@ -902,7 +902,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver_info * @@ -944,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver_info * @@ -984,7 +984,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_copy * @@ -1050,7 +1050,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_free * @@ -1102,7 +1102,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_create * @@ -1131,7 +1131,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_create() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_set * @@ -1164,7 +1164,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_get * @@ -1197,7 +1197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_del * @@ -1226,7 +1226,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_copy * @@ -1255,7 +1255,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_cmp * @@ -1314,7 +1314,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_close * @@ -1343,7 +1343,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_family_offset * @@ -1382,7 +1382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset * @@ -1423,7 +1423,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type * @@ -1462,7 +1462,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_multi_type * @@ -1503,7 +1503,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_cache * @@ -1557,7 +1557,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_cache * @@ -1609,7 +1609,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_image_config * @@ -1653,7 +1653,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_image_config * @@ -1704,7 +1704,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * @@ -1748,7 +1748,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_config * @@ -1799,7 +1799,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_gc_references * @@ -1852,7 +1852,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_gc_references * @@ -1895,7 +1895,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_fclose_degree * @@ -1931,7 +1931,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * @@ -1966,7 +1966,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size * @@ -2017,7 +2017,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_meta_block_size * @@ -2061,7 +2061,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_sieve_buf_size * @@ -2112,7 +2112,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_sieve_buf_size * @@ -2155,7 +2155,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_small_data_block_size * @@ -2201,7 +2201,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_small_data_block_size * @@ -2240,7 +2240,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_libver_bounds * @@ -2382,7 +2382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_libver_bounds * @@ -2425,7 +2425,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_elink_file_cache_size * @@ -2463,7 +2463,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_elink_file_cache_size * @@ -2502,7 +2502,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image * @@ -2583,7 +2583,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image * @@ -2672,7 +2672,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image_callbacks * @@ -2749,7 +2749,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image_callbacks * @@ -2805,7 +2805,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_copy * @@ -2883,7 +2883,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_free * @@ -2938,7 +2938,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_cmp * @@ -2981,7 +2981,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_enc * @@ -3027,7 +3027,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_image_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_dec * @@ -3079,7 +3079,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * @@ -3112,7 +3112,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_get * @@ -3145,7 +3145,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_del * @@ -3176,7 +3176,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_copy * @@ -3206,7 +3206,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_cmp * @@ -3265,7 +3265,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_close * @@ -3295,7 +3295,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_close() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_cmp * @@ -3407,7 +3407,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_enc * @@ -3552,7 +3552,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_dec * @@ -3687,7 +3687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_enc * @@ -3725,7 +3725,7 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_dec * @@ -3760,7 +3760,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_enc * @@ -3833,7 +3833,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_enc * @@ -3870,7 +3870,7 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_dec * @@ -3904,7 +3904,7 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_core_write_tracking * @@ -3945,7 +3945,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_core_write_tracking * @@ -3987,7 +3987,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_metadata_read_attempts * @@ -4030,7 +4030,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_metadata_read_attempts * @@ -4071,7 +4071,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_obj_flush_cb * @@ -4115,7 +4115,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_obj_flush_cb * @@ -4156,7 +4156,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_log_options * @@ -4208,7 +4208,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_log_options * @@ -4263,7 +4263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_enc * @@ -4316,7 +4316,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_dec * @@ -4370,7 +4370,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_del * @@ -4393,7 +4393,7 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_del() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_copy * @@ -4415,7 +4415,7 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_cmp * @@ -4447,7 +4447,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_close * @@ -4470,7 +4470,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close * @@ -4518,7 +4518,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_evict_on_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_evict_on_close * @@ -4562,7 +4562,7 @@ done: } /* end H5Pget_evict_on_close() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5P__encode_coll_md_read_flag_t * @@ -4600,7 +4600,7 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__encode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5P__decode_coll_md_read_flag_t * @@ -4634,7 +4634,7 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_all_coll_metadata_ops * @@ -4693,7 +4693,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_all_coll_metadata_ops() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_all_coll_metadata_ops * @@ -4751,7 +4751,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_all_coll_metadata_ops */ - + /*------------------------------------------------------------------------- * Function: H5Pset_coll_metadata_write * @@ -4790,7 +4790,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_coll_metadata_write() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_coll_metadata_write * @@ -4828,7 +4828,7 @@ done: } /* end H5Pget_coll_metadata_write() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5Pset_page_buffer_size * @@ -4876,7 +4876,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_page_buffer_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_page_buffer_size * -- cgit v0.12 From 8ae5f6804186e3121dfe933d6bf9c9044f8ae9d6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2018 12:43:51 -0600 Subject: HDFFV-10292 Windows drive letters cause issues in paths --- release_docs/INSTALL_CMake.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index f54ca4b..923bba3 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -165,8 +165,9 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: III. Quick Step Building HDF5 C Static Libraries and Tools with CMake ======================================================================== Notes: This short set of instructions is written for users who want to - quickly build the just the HDF5 C static library and tools from + quickly build just the HDF5 C static library and tools from the HDF5 source code package using the CMake command line tools. + Avoid the use of drive letters in paths on Windows. Go through these steps: -- cgit v0.12 From 2b50dc9855cfc096675698eda084830ea73427b8 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 6 Mar 2018 09:02:32 -0600 Subject: Added h5repack tests Description: Added tests SUPERBLOCK and INVALIDBOUNDS, composed by ADB. Platforms tested: Linux/64 (jelly) - cmake --- tools/test/h5repack/CMakeTests.cmake | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 4300228..6e98ee4 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -149,6 +149,8 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none + # versionbounds + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SPT.h5repack_aggr.h5 @@ -583,6 +585,63 @@ endif () endmacro () +# VERIFY_SUPERBLOCK + macro (ADD_H5_VERIFY_SUPERBLOCK testname testfile lowbound highbound superblock) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=SUPERBLOCK_VERSION ${superblock}" + -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) + endif () + endmacro () + + macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} + COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties ( + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES + DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + WILL_FAIL "true" + ) + endif () + endmacro () + macro (ADD_H5_TEST_META testname testfile) # Remove any output file left over from previous test run add_test ( @@ -1372,6 +1431,18 @@ ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## +# -j 0 -k 2, superblock will be 0 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_0 h5repack_layout.h5 0 2 0) +# -j 1 -k 2, superblock will be 2 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_2 h5repack_layout.h5 1 2 2) +# -j 2 -k 2, superblock will be 3 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_3 h5repack_layout.h5 2 2 3) +# -j 0 -k 1, file cannot be opened +ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 + +############################################################################## ### P L U G I N T E S T S ############################################################################## ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) -- cgit v0.12 From 960a1d55eed8b30350d7a87e1a9a7da72e86d270 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 09:45:26 -0600 Subject: plist testfiles need to be copied into VFD test folders as well --- test/CMakeVFDTests.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 995f4e0..be02110 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -32,8 +32,12 @@ endif () foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files") if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files") endif () endforeach () @@ -64,6 +68,17 @@ foreach (vfdtest ${VFD_LIST}) endforeach () endforeach () +foreach (vfdtest ${VFD_LIST}) + foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIB_files") + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIBSH_files") + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIBSH_files") + endif () + endforeach () +endforeach () + add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIB tests" DEPENDS ${HDF5_VFDTEST_LIB_files_list}) if (BUILD_SHARED_LIBS) add_custom_target(HDF5_VFDTEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIBSH tests" DEPENDS ${HDF5_VFDTEST_LIBSH_files_list}) -- cgit v0.12 From f05f9d4cffab5e008c67e19034c1b248e1b01b3c Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 6 Mar 2018 11:41:33 -0600 Subject: Miscellaneous test fixes Description: - dtypes.c: added the use of highest version of nested datatypes to verify the datatype's version. - miscellaneous typos Platforms tested: Linux/64 (jelly) Darwin (osx1010test) --- test/dtypes.c | 43 ++++++++++++++++++++++++++++-------- test/tfile.c | 2 +- tools/test/h5repack/CMakeTests.cmake | 2 -- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index e98f6be..426f3b9 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -7444,15 +7444,14 @@ error: * the library will only use basic version * *************************************************************************/ -static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_shared_low_bound, unsigned *highest_version) +static herr_t verify_version(hid_t dtype, H5F_libver_t low, unsigned *highest_version) { - H5T_t *dtypep = NULL; /* Internal structure of a datatype */ - H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */ hid_t base_dtype = -1; hid_t mem_dtype = -1; + H5T_t *dtypep = NULL; /* Internal structure of a datatype */ + H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */ int nmembers = 0; unsigned i; - H5F_libver_t highest = H5F_LIBVER_EARLIEST; herr_t ret = SUCCEED; /* Generic return value */ dtypep = (H5T_t *)H5I_object(dtype); @@ -7465,6 +7464,8 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share switch (type_cls) { case H5T_ARRAY: + { + H5T_t *base_dtypep = NULL; /* Internal structure of a datatype */ if (low == H5F_LIBVER_EARLIEST) VERIFY(dtypep->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); @@ -7475,8 +7476,17 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share base_dtype = H5Tget_super(dtype); CHECK(base_dtype, FAIL, "H5Tget_super"); + /* Get the base type's internal structure for version */ + base_dtypep = (H5T_t *)H5I_object(base_dtype); + if (base_dtypep == NULL) TEST_ERROR + + /* Reset highest version if this datatype has higher version than + its outer type */ + if (*highest_version < base_dtypep->shared->version) + *highest_version = base_dtypep->shared->version; + /* Verify the base datatype recursively */ - ret = verify_version(base_dtype, low, f_shared_low_bound, highest_version); + ret = verify_version(base_dtype, low, highest_version); /* Close the member datatype before checking for failure */ if ((H5Tclose(base_dtype)) < 0) TEST_ERROR @@ -7485,17 +7495,31 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share if (ret < 0) TEST_ERROR break; + } case H5T_COMPOUND: + { + H5T_t *mem_dtypep = NULL; /* Internal structure of a datatype */ /* Get the number of members of this compound type */ if ((nmembers = H5Tget_nmembers(dtype)) < 0) TEST_ERROR /* Go through all its member datatypes */ for (i = 0; i < (unsigned)nmembers; i++) { - /* Get the member datatype and verify it recursively */ + /* Get the member datatype to verify it recursively */ mem_dtype = H5Tget_member_type(dtype, i); if (mem_dtype < 0) TEST_ERROR - ret = verify_version(mem_dtype, low, f_shared_low_bound, highest_version); + + /* Get the member type's internal structure for version */ + mem_dtypep = (H5T_t *)H5I_object(mem_dtype); + if (mem_dtypep == NULL) TEST_ERROR + + /* Reset highest version if this datatype has higher version than + its outer type */ + if (*highest_version < mem_dtypep->shared->version) + *highest_version = mem_dtypep->shared->version; + + /* Verify the datatype recursively */ + ret = verify_version(mem_dtype, low, highest_version); /* Close the member datatype before checking for failure */ if ((H5Tclose(mem_dtype)) < 0) TEST_ERROR @@ -7504,12 +7528,13 @@ static herr_t verify_version(hid_t dtype, H5F_libver_t low, H5F_libver_t f_share if (ret < 0) TEST_ERROR } /* If this compound datatype contains a datatype of higher version, it - will be promoted to that version */ + will be promoted to that version, thus, verify with highest version */ if (*highest_version > H5O_dtype_ver_bounds[low]) VERIFY(dtypep->shared->version, *highest_version, "verify_version"); else VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); break; + } case H5T_ENUM: VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version"); break; @@ -7733,7 +7758,7 @@ test_versionbounds(void) highest_version = dtypep->shared->version; /* Verify version of the datatype recursevily */ - ret = verify_version(dset_dtype, low, filep->shared->low_bound, &highest_version); + ret = verify_version(dset_dtype, low, &highest_version); /* Close the dataset's datatype */ if (H5Tclose(dset_dtype) < 0) TEST_ERROR diff --git a/test/tfile.c b/test/tfile.c index de1f362..f3d5a8f 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4966,7 +4966,7 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, #define VERBFNAME "tverbounds_dspace.h5" #define VERBDSNAME "dataset 1" #define SPACE1_DIM1 3 -static int +static void test_libver_bounds_open(void) { hid_t file = -1; /* File ID */ diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 6e98ee4..607d5b5 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -149,8 +149,6 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none - # versionbounds - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SPT.h5repack_aggr.h5 -- cgit v0.12 From e5b602fafe301d9ab8fa1c870ab18fd59c03370c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 15:40:15 -0600 Subject: Add #ifdef H5_HAVE_FORK --- testpar/t_cache_image.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 7fe0020..d23548a 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -4056,6 +4056,13 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) } /* smoke_check_1() */ +/* This test uses many POSIX things that are not available on + * Windows. We're using a check for fork(2) here as a proxy for + * all POSIX/Unix/Linux things until this test can be made + * more platform-independent. + */ +#ifdef H5_HAVE_FORK + /*------------------------------------------------------------------------- * Function: main * @@ -4271,4 +4278,14 @@ finish: return(nerrs > 0); } /* main() */ +#else /* H5_HAVE_FORK */ + +int +main(void) +{ + HDfprintf(stderr, "Non-POSIX platform. Skipping.\n"); + return EXIT_SUCCESS; +} /* end main() */ + +#endif /* H5_HAVE_FORK */ -- cgit v0.12 From b8b0afc4c3e532c07c1284eddb0c5cb7834ea86a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 15:41:51 -0600 Subject: Add #ifdef H5_HAVE_FORK eliminates special handling --- testpar/CMakeTests.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index cd9acda..87470f3 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -18,10 +18,6 @@ add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) -if (WIN32) - # t_cache_imagee uses fork() and execve(), will not run on Windows - list (REMOVE_ITEM H5P_TESTS t_cache_image) -endif () foreach (testp ${H5P_TESTS}) add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endforeach () -- cgit v0.12 From 2db84441d742433c0aee26624a7b3fd05c2dbbf2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2018 16:51:31 -0600 Subject: ifdef around another function --- testpar/t_cache_image.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index d23548a..fc88c61 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -1882,6 +1882,14 @@ par_delete_dataset(int dset_num, } /* par_delete_dataset() */ +/* This test uses many POSIX things that are not available on + * Windows. We're using a check for fork(2) here as a proxy for + * all POSIX/Unix/Linux things until this test can be made + * more platform-independent. + */ +#ifdef H5_HAVE_FORK + + /*------------------------------------------------------------------------- * Function: par_insert_cache_image() * @@ -1907,6 +1915,10 @@ par_delete_dataset(int dset_num, * * None. * + *-------------------------------------- + return; + +} /* par_insert_cache_image() */ *------------------------------------------------------------------------- */ @@ -1990,6 +2002,15 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) return; } /* par_insert_cache_image() */ +#else /* H5_HAVE_FORK */ + +static void +par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size ) +{ + return; +} /* par_insert_cache_image() */ + +#endif /* H5_HAVE_FORK */ /*------------------------------------------------------------------------- -- cgit v0.12 From d981692e63f6ea1d9987e6cb08ca6587c173dc95 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 10:52:26 -0600 Subject: HDDFV-10414 correct location of error change --- release_docs/RELEASE.txt | 6 ++ src/H5Pfapl.c | 182 +++++++++++++++++++++++------------------------ 2 files changed, 97 insertions(+), 91 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 199265c..9707a18 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -195,6 +195,12 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - H5Pset_evict_on_close in H5Pfapl.c + + Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for + parallel library. + (ADB - 2018/03/6, HDFFV-104148) + - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 490e647..148c247 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -387,7 +387,7 @@ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer minumum raw data size */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_reg_prop * @@ -627,7 +627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_alignment * @@ -685,7 +685,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_alignment * @@ -726,7 +726,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_alignment() */ - + /*------------------------------------------------------------------------- * Function: H5P_set_driver * @@ -774,7 +774,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_set_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_driver * @@ -817,7 +817,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver * @@ -861,7 +861,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver * @@ -902,7 +902,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver() */ - + /*------------------------------------------------------------------------- * Function: H5P_peek_driver_info * @@ -944,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_peek_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_driver_info * @@ -984,7 +984,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_driver_info() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_copy * @@ -1050,7 +1050,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_driver_free * @@ -1102,7 +1102,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_driver_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_create * @@ -1131,7 +1131,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_create() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_set * @@ -1164,7 +1164,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_get * @@ -1197,7 +1197,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_del * @@ -1226,7 +1226,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_copy * @@ -1255,7 +1255,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_cmp * @@ -1314,7 +1314,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_driver_close * @@ -1343,7 +1343,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_driver_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_family_offset * @@ -1382,7 +1382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset * @@ -1423,7 +1423,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_family_offset() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type * @@ -1462,7 +1462,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_multi_type * @@ -1503,7 +1503,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_multi_type() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_cache * @@ -1557,7 +1557,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_cache * @@ -1609,7 +1609,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_cache() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_image_config * @@ -1653,7 +1653,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_image_config * @@ -1704,7 +1704,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_image_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * @@ -1748,7 +1748,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_config * @@ -1799,7 +1799,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_mdc_config() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_gc_references * @@ -1852,7 +1852,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_gc_references * @@ -1895,7 +1895,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_fclose_degree * @@ -1931,7 +1931,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * @@ -1966,7 +1966,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_fclose_degree() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size * @@ -2017,7 +2017,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pget_meta_block_size * @@ -2061,7 +2061,7 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5Pset_sieve_buf_size * @@ -2112,7 +2112,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_sieve_buf_size * @@ -2155,7 +2155,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_small_data_block_size * @@ -2201,7 +2201,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_small_data_block_size * @@ -2240,7 +2240,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_libver_bounds * @@ -2382,7 +2382,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_libver_bounds * @@ -2425,7 +2425,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_libver_bounds() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_elink_file_cache_size * @@ -2463,7 +2463,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_elink_file_cache_size * @@ -2502,7 +2502,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image * @@ -2583,7 +2583,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image * @@ -2672,7 +2672,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image */ - + /*------------------------------------------------------------------------- * Function: H5Pset_file_image_callbacks * @@ -2749,7 +2749,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_file_image_callbacks * @@ -2805,7 +2805,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_file_image_callbacks() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_copy * @@ -2883,7 +2883,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__file_image_info_free * @@ -2938,7 +2938,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__file_image_info_free() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_cmp * @@ -2981,7 +2981,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_enc * @@ -3027,7 +3027,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_image_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_image_config_dec * @@ -3079,7 +3079,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_image_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * @@ -3112,7 +3112,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_set() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_get * @@ -3145,7 +3145,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_get() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_del * @@ -3176,7 +3176,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_del() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_copy * @@ -3206,7 +3206,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_cmp * @@ -3265,7 +3265,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_close * @@ -3295,7 +3295,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_file_image_info_close() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_cmp * @@ -3407,7 +3407,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_enc * @@ -3552,7 +3552,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_cache_config_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_cache_config_dec * @@ -3687,7 +3687,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_cache_config_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_enc * @@ -3725,7 +3725,7 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_fclose_degree_dec * @@ -3760,7 +3760,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_fclose_degree_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_multi_type_enc * @@ -3833,7 +3833,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_multi_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_enc * @@ -3870,7 +3870,7 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P__facc_libver_type_dec * @@ -3904,7 +3904,7 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__facc_libver_type_dec() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_core_write_tracking * @@ -3945,7 +3945,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_core_write_tracking * @@ -3987,7 +3987,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_core_write_tracking() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_metadata_read_attempts * @@ -4030,7 +4030,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_metadata_read_attempts * @@ -4071,7 +4071,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_metadata_read_attempts() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_obj_flush_cb * @@ -4115,7 +4115,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pset_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_obj_flush_cb * @@ -4156,7 +4156,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_obj_flush_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_mdc_log_options * @@ -4208,7 +4208,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_mdc_log_options * @@ -4263,7 +4263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_enc * @@ -4316,7 +4316,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_enc() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_dec * @@ -4370,7 +4370,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_dec() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_del * @@ -4393,7 +4393,7 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_del() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_copy * @@ -4415,7 +4415,7 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_copy() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_cmp * @@ -4447,7 +4447,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_mdc_log_location_cmp() */ - + /*------------------------------------------------------------------------- * Function: H5P_facc_mdc_log_location_close * @@ -4470,7 +4470,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_facc_mdc_log_location_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close * @@ -4509,16 +4509,16 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) #ifndef H5_HAVE_PARALLEL /* Set value */ if(H5P_set(plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "can't set evict on close property") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set evict on close property") #else - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "evict on close is currently not supported in parallel HDF5") + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "evict on close is currently not supported in parallel HDF5") #endif /* H5_HAVE_PARALLEL */ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_evict_on_close() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_evict_on_close * @@ -4562,7 +4562,7 @@ done: } /* end H5Pget_evict_on_close() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5P__encode_coll_md_read_flag_t * @@ -4600,7 +4600,7 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__encode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5P__decode_coll_md_read_flag_t * @@ -4634,7 +4634,7 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_coll_md_read_flag_t() */ - + /*------------------------------------------------------------------------- * Function: H5Pset_all_coll_metadata_ops * @@ -4693,7 +4693,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_all_coll_metadata_ops() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_all_coll_metadata_ops * @@ -4751,7 +4751,7 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Pget_all_coll_metadata_ops */ - + /*------------------------------------------------------------------------- * Function: H5Pset_coll_metadata_write * @@ -4790,7 +4790,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_coll_metadata_write() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_coll_metadata_write * @@ -4828,7 +4828,7 @@ done: } /* end H5Pget_coll_metadata_write() */ #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5Pset_page_buffer_size * @@ -4876,7 +4876,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pset_page_buffer_size() */ - + /*------------------------------------------------------------------------- * Function: H5Pget_page_buffer_size * -- cgit v0.12 From 1428e57fbf03d5ee58e6e4bbc2cdf71c2200607d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 10:53:07 -0600 Subject: HDFFV-10414 fix note --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9707a18..6df26d7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -199,7 +199,7 @@ Bug Fixes since HDF5-1.10.1 release Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for parallel library. - (ADB - 2018/03/6, HDFFV-104148) + (ADB - 2018/03/6, HDFFV-10414) - filter plugin handling in H5PL.c and H5Z.c -- cgit v0.12 From 36bf5edfc91777891d041939d697fa130cc779a4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 11:41:49 -0600 Subject: Add missing note --- release_docs/RELEASE.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6df26d7..6f16aa2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -201,6 +201,12 @@ Bug Fixes since HDF5-1.10.1 release parallel library. (ADB - 2018/03/6, HDFFV-10414) + - Utility function can not handle lowercase Windows drive letters + + Added call to toupper function for drive letter. + + (ADB - 2017/12/18, HDFFV-10307) + - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by -- cgit v0.12 From 08fc36b0ca10abb9960c6543b4bc854d8d8aaf31 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 12:23:04 -0600 Subject: Correct cutnpaste --- testpar/t_cache_image.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index fc88c61..5b512d6 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -1915,10 +1915,6 @@ par_delete_dataset(int dset_num, * * None. * - *-------------------------------------- - return; - -} /* par_insert_cache_image() */ *------------------------------------------------------------------------- */ -- cgit v0.12 From 8347a31871e9526c93451cec5f1d8861da3a2aa4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 15:46:58 -0600 Subject: Fix CMake missing parens --- tools/test/h5repack/CMakeTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 607d5b5..d7f9f10 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1438,7 +1438,7 @@ ADD_H5_VERIFY_SUPERBLOCK (SB_IS_2 h5repack_layout.h5 1 2 2) # -j 2 -k 2, superblock will be 3 ADD_H5_VERIFY_SUPERBLOCK (SB_IS_3 h5repack_layout.h5 2 2 3) # -j 0 -k 1, file cannot be opened -ADD_H5_VERIFY_INVALIDBOUNDS latest_latest_invalid bounds_latest_latest.h5 0 1 +ADD_H5_VERIFY_INVALIDBOUNDS (latest_latest_invalid bounds_latest_latest.h5 0 1) ############################################################################## ### P L U G I N T E S T S -- cgit v0.12 From 6d75a3ffb4b1451ff80b7fdddafa5859376bee77 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2018 15:55:33 -0600 Subject: Fix misaligned macro --- tools/test/h5repack/CMakeTests.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index d7f9f10..f40c0b1 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -629,7 +629,7 @@ set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( - NAME ADD_H5_VERIFY_INVALIDBOUNDS-${testname} + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} COMMAND $ -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties ( @@ -637,7 +637,6 @@ DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects WILL_FAIL "true" ) - endif () endmacro () macro (ADD_H5_TEST_META testname testfile) -- cgit v0.12 From 3712738877a14c3257155acd1f558cfe039f3625 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 8 Mar 2018 15:54:40 -0600 Subject: HDFFV-4359 Add C,HL,CXX files --- CMakeInstallation.cmake | 18 ----------------- MANIFEST | 2 ++ c++/src/CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++ config/cmake/libh5cc.in | 32 +++++++++++++++++++++++++++++++ config/cmake/libhdf5.pc.in | 14 ++++++++++++++ hl/src/CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 189 insertions(+), 18 deletions(-) create mode 100755 config/cmake/libh5cc.in create mode 100755 config/cmake/libhdf5.pc.in diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 0bfb2cc..4a09d2d 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -144,24 +144,6 @@ install ( ) #----------------------------------------------------------------------------- -# Create pkgconfig files -#----------------------------------------------------------------------------- -#foreach (libs ${LINK_LIBS}) -# set (LIBS "${LIBS} -l${libs}") -#endforeach () -#foreach (libs ${HDF5_LIBRARIES_TO_EXPORT}) -# set (HDF5LIBS "${HDF5LIBS} -l${libs}") -#endforeach () -#configure_file ( -# ${HDF_RESOURCES_DIR}/libhdf5.pc.in -# ${HDF5_BINARY_DIR}/CMakeFiles/libhdf5.pc @ONLY -#) -#install ( -# FILES ${HDF5_BINARY_DIR}/CMakeFiles/libhdf5.pc -# DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig -#) - -#----------------------------------------------------------------------------- # Configure the HDF518_Examples.cmake file and the examples #----------------------------------------------------------------------------- option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) diff --git a/MANIFEST b/MANIFEST index 229a5ec..4e35691 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3084,6 +3084,8 @@ ./config/cmake/HDF5Macros.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/jrunTest.cmake +./config/cmake/libh5cc.in +./config/cmake/libhdf5.pc.in ./config/cmake/libhdf5.settings.cmake.in ./config/cmake/mccacheinit.cmake ./config/cmake/patch.xml diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 921497f..e685491 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -139,3 +139,50 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_CPP_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_CPP_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_CPP_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT libraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) +endif () + diff --git a/config/cmake/libh5cc.in b/config/cmake/libh5cc.in new file mode 100755 index 0000000..f462d56 --- /dev/null +++ b/config/cmake/libh5cc.in @@ -0,0 +1,32 @@ +#! /bin/sh +## +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# 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. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +## + +prg=$0 +if [ ! -e "$prg" ]; then + case $prg in + (*/*) exit 1;; + (*) prg=$(command -v -- "$prg") || exit;; + esac +fi +dir=$( + cd -P -- "$(dirname -- "$prg")/.." && pwd -P +) || exit +prg=$dir/$(basename -- "$prg") || exit + +printf '%s\n' "$prg" +printf 'dir is %s\n' "$dir" + +export PKG_CONFIG_PATH=$dir/lib/pkgconfig + +@_PKG_CONFIG_COMPILER@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@-@_PKG_CONFIG_VERSION@` $@ diff --git a/config/cmake/libhdf5.pc.in b/config/cmake/libhdf5.pc.in new file mode 100755 index 0000000..4a2ebaa --- /dev/null +++ b/config/cmake/libhdf5.pc.in @@ -0,0 +1,14 @@ +prefix=@_PKG_CONFIG_PREFIX@ +exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@ +libdir=@_PKG_CONFIG_LIBDIR@ +includedir=@_PKG_CONFIG_INCLUDEDIR@ + +Name: @_PKG_CONFIG_LIBNAME@ +Description: HDF5 (Hierarchical Data Format 5) Software Library +Version: @_PKG_CONFIG_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@ +Requires: @_PKG_CONFIG_REQUIRES@ +Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@ +Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@ diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index d21a3ea..e9216bd 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -88,3 +88,49 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_HL_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT libraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5chl + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5chl + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) +endif () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bf7fb07..d10870d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -991,3 +991,51 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +foreach (libs ${LINK_LIBS} ${LINK_COMP_LIBS}) + set (_PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE} -l${libs}") +endforeach () + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES) +set (_PKG_CONFIG_REQUIRES_PRIVATE) + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT libraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5cc + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5cc + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) +endif () -- cgit v0.12 From 13f5388149a0dd39a6f67d30d63c6d622e249fd9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 8 Mar 2018 16:39:35 -0600 Subject: HDFFV-4359 Add HL C++ and fix install parameters --- c++/src/CMakeLists.txt | 4 ++-- hl/c++/src/CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ hl/src/CMakeLists.txt | 4 ++-- release_docs/RELEASE.txt | 10 ++++++++++ 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index e685491..350bdf7 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -168,7 +168,7 @@ configure_file ( install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig - COMPONENT libraries + COMPONENT cpplibraries ) if (NOT WIN32) @@ -182,7 +182,7 @@ if (NOT WIN32) FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ DESTINATION ${HDF5_INSTALL_BIN_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT libraries + COMPONENT cpplibraries ) endif () diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 0f187c5..28f860f 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -69,3 +69,50 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_HL_CPP_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}") +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_HL_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_HL_LIB_CORENAME}") + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT hlcpplibraries +) + +if (NOT WIN32) + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++ + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++ + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT hlcpplibraries + ) +endif () + diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index e9216bd..62e8c21 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -117,7 +117,7 @@ configure_file ( install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig - COMPONENT libraries + COMPONENT hllibraries ) if (NOT WIN32) @@ -131,6 +131,6 @@ if (NOT WIN32) FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5chl DESTINATION ${HDF5_INSTALL_BIN_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT libraries + COMPONENT hllibraries ) endif () diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6f16aa2..0061910 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -56,6 +56,16 @@ New Features ------------- - CMake + Add pkg-config file generation + + Added pkg-config file generation for the C, C++, HL, and HL C++ libraries. + In addition, builds on linux will create h5cXXX scripts that use the pkg-config + files. This is a limited implementation of a script like autotools h5cc. + + (ADB - 2018/03/08, HDFFV-4359) + + - CMake + Refactor use of CMAKE_BUILD_TYPE for new variable, which understands the type of generator in use. -- cgit v0.12 From 7c293908a772dd19d69872b4dbf1fdcbbbf5f94f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 00:35:42 -0600 Subject: Improving tests Description: Fixed typos that caused daily test failure on Ostrich Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) --- test/dtypes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dtypes.c b/test/dtypes.c index 426f3b9..1a27634 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -7684,7 +7684,7 @@ test_versionbounds(void) if (ret < 0) TEST_ERROR /* Create a enumerate datatype */ - enum_type = H5Tcreate(H5T_ENUM, sizeof(short)); + enum_type = H5Tcreate(H5T_ENUM, sizeof(color_t)); if (enum_type < 0) TEST_ERROR enum_val = E1_RED; -- cgit v0.12 From 8ba788ca891f56792bbbbc5a40f9bc2e86a663b5 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 9 Mar 2018 01:25:40 -0600 Subject: Fix for HDFFV-10209 VDS SWMR test failure Free the object header when there are chksum retries. --- src/H5Ocache.c | 39 ++++++++++++++++++++++++++++++++------- src/H5Oint.c | 1 + src/H5Opkg.h | 1 + 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 94049ef..2260e12 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -262,12 +262,23 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - /* Get stored and computed checksums */ - H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); - - if(stored_chksum != computed_chksum) - ret_value = FALSE; + /* Get stored and computed checksums */ + H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); + + if(stored_chksum != computed_chksum) { + /* These fields are not deserialized yet in H5O__prefix_deserialize() */ + HDassert(udata->oh->chunk == NULL); + HDassert(udata->oh->mesg == NULL); + HDassert(udata->oh->proxy == NULL); + + /* Indicate that udata->oh is to be freed later + in H5O__prefix_deserialize() */ + udata->free_oh = TRUE; + ret_value = FALSE; + } /* end if */ } /* end if */ + else + HDassert(!(udata->common.file_intent & H5F_ACC_SWMR_WRITE)); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cache_verify_chksum() */ @@ -1263,8 +1274,22 @@ H5O__prefix_deserialize(const uint8_t *_image, H5O_cache_ud_t *udata) /* Verify object header prefix length */ HDassert((size_t)(image - _image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); - /* Save the object header for later use in 'deserialize' callback */ - udata->oh = oh; + /* If udata->oh is to be freed (see H5O__cache_verify_chksum), + save the pointer to udata->oh and free it later after setting + udata->oh with the new object header */ + if(udata->free_oh) { + H5O_t *saved_oh = udata->oh; + HDassert(udata->oh); + + /* Save the object header for later use in 'deserialize' callback */ + udata->oh = oh; + if(H5O__free(saved_oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header") + udata->free_oh = FALSE; + } else + /* Save the object header for later use in 'deserialize' callback */ + udata->oh = oh; + oh = NULL; done: diff --git a/src/H5Oint.c b/src/H5Oint.c index 08eb28d..2351779 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -875,6 +875,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, udata.v1_pfx_nmesgs = 0; udata.chunk0_size = 0; udata.oh = NULL; + udata.free_oh = FALSE; udata.common.f = loc->file; udata.common.dxpl_id = dxpl_id; udata.common.file_intent = file_intent; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index e970406..9392fa8 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -379,6 +379,7 @@ typedef struct H5O_cache_ud_t { unsigned v1_pfx_nmesgs; /* Number of messages from v1 prefix header */ size_t chunk0_size; /* Size of serialized first chunk */ H5O_t *oh; /* Partially deserialized object header, for later use */ + hbool_t free_oh; /* Whether to free the object header or not */ H5O_common_cache_ud_t common; /* Common object header cache callback info */ } H5O_cache_ud_t; -- cgit v0.12 From 24c62ba7fefcd48cafec79385011cbd89be5d182 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 9 Mar 2018 12:31:58 -0600 Subject: Change CMake min to 3.10 --- CMakeLists.txt | 2 +- c++/CMakeLists.txt | 2 +- c++/examples/CMakeLists.txt | 2 +- c++/src/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 2 +- config/cmake/CTestScript.cmake | 2 +- config/cmake/HDF518_Examples.cmake.in | 2 +- config/cmake/HDF5_Examples.cmake.in | 2 +- config/cmake/UseJava.cmake | 74 +- config/cmake/scripts/CTestScript.cmake | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- config/cmake_ext_mod/FindMPI.cmake | 1514 -------------------- .../cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in | 4 - config/cmake_ext_mod/FindMPI/libver_mpi.c | 19 - config/cmake_ext_mod/FindMPI/libver_mpi.f90.in | 7 - config/cmake_ext_mod/FindMPI/mpiver.f90.in | 10 - config/cmake_ext_mod/FindMPI/test_mpi.c | 37 - config/cmake_ext_mod/FindMPI/test_mpi.f90.in | 6 - examples/CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 2 +- fortran/examples/CMakeLists.txt | 2 +- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 2 +- fortran/testpar/CMakeLists.txt | 2 +- hl/CMakeLists.txt | 2 +- hl/c++/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/test/CMakeLists.txt | 2 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 +- hl/test/CMakeLists.txt | 2 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 2 +- hl/tools/h5watch/CMakeLists.txt | 2 +- java/CMakeLists.txt | 2 +- java/examples/CMakeLists.txt | 2 +- java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/groups/CMakeLists.txt | 2 +- java/examples/intro/CMakeLists.txt | 2 +- java/src/CMakeLists.txt | 2 +- java/src/hdf/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 2 +- java/src/jni/CMakeLists.txt | 2 +- java/test/CMakeLists.txt | 2 +- release_docs/INSTALL_CMake.txt | 2 +- release_docs/USING_HDF5_CMake.txt | 4 +- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- testpar/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 2 +- tools/lib/CMakeLists.txt | 2 +- tools/src/CMakeLists.txt | 2 +- tools/src/h5copy/CMakeLists.txt | 2 +- tools/src/h5diff/CMakeLists.txt | 2 +- tools/src/h5dump/CMakeLists.txt | 2 +- tools/src/h5format_convert/CMakeLists.txt | 2 +- tools/src/h5import/CMakeLists.txt | 2 +- tools/src/h5jam/CMakeLists.txt | 2 +- tools/src/h5ls/CMakeLists.txt | 2 +- tools/src/h5repack/CMakeLists.txt | 2 +- tools/src/h5stat/CMakeLists.txt | 2 +- tools/src/misc/CMakeLists.txt | 2 +- tools/test/CMakeLists.txt | 2 +- tools/test/h5copy/CMakeLists.txt | 2 +- tools/test/h5diff/CMakeLists.txt | 2 +- tools/test/h5dump/CMakeLists.txt | 2 +- tools/test/h5format_convert/CMakeLists.txt | 2 +- tools/test/h5import/CMakeLists.txt | 2 +- tools/test/h5jam/CMakeLists.txt | 2 +- tools/test/h5ls/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5stat/CMakeLists.txt | 2 +- tools/test/misc/CMakeLists.txt | 2 +- tools/test/misc/vds/CMakeLists.txt | 2 +- tools/test/perform/CMakeLists.txt | 2 +- 81 files changed, 147 insertions(+), 1672 deletions(-) delete mode 100644 config/cmake_ext_mod/FindMPI.cmake delete mode 100644 config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in delete mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.c delete mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.f90.in delete mode 100644 config/cmake_ext_mod/FindMPI/mpiver.f90.in delete mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.c delete mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.f90.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e7dda17..ebbeda5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 2d3ab0f..2c161f1 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 397c300..22ecb19 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP_EXAMPLES) # -------------------------------------------------------------------- diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 350bdf7..d24a3a6 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 5194865..b4fb0fc 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index 27ae3a0..0269ba8 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ######################################################## # For any comments please contact cdashhelp@hdfgroup.org # diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 0e81217..1f4f479 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 6453b16..eb57685 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index c70f52e..60b1758 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -19,6 +19,7 @@ # [VERSION version] # [OUTPUT_NAME name] # [OUTPUT_DIR dir] +# [GENERATE_NATIVE_HEADERS target [DESTINATION dir]] # ) # # This command creates a .jar. It compiles the given @@ -34,6 +35,14 @@ # The default OUTPUT_DIR can also be changed by setting the variable # CMAKE_JAVA_TARGET_OUTPUT_DIR. # +# Optionally, using option GENERATE_NATIVE_HEADERS, native header files can be generated +# for methods declared as native. These files provide the connective glue that allow your +# Java and C code to interact. An INTERFACE target will be created for an easy usage +# of generated files. Sub-option DESTINATION can be used to specify output directory for +# generated header files. +# +# GENERATE_NATIVE_HEADERS option requires, at least, version 1.8 of the JDK. +# # Additional instructions: # # :: @@ -167,6 +176,22 @@ # # # +# :: +# +# For an optimum usage of option GENERATE_NATIVE_HEADERS, it is recommended to +# include module JNI before any call to add_jar. The produced target for native +# headers can then be used to compile C/C++ sources with command +# target_link_libraries. +# +# +# :: +# +# find_package(JNI) +# add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native) +# add_library(bar bar.cpp) +# target_link_libraries(bar PRIVATE foo-native) +# +# # Target Properties: # # :: @@ -358,6 +383,10 @@ # Create C header files from java classes. These files provide the connective glue # that allow your Java and C code to interact. # +# This command will no longer be supported starting with version 1.10 of the JDK due +# to the `suppression of javah tool `_. +# Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead. +# # There are two main signatures for create_javah. The first signature # returns generated files through variable specified by GENERATED_FILES option: # @@ -449,7 +478,7 @@ function(add_jar _TARGET_NAME) cmake_parse_arguments(_add_jar "" "VERSION;OUTPUT_DIR;OUTPUT_NAME;ENTRY_POINT;MANIFEST" - "SOURCES;INCLUDE_JARS" + "SOURCES;INCLUDE_JARS;GENERATE_NATIVE_HEADERS" ${ARGN} ) @@ -495,6 +524,31 @@ function(add_jar _TARGET_NAME) get_filename_component (_MANIFEST_VALUE "${_add_jar_MANIFEST}" ABSOLUTE) endif () + unset (_GENERATE_NATIVE_HEADERS) + if (_add_jar_GENERATE_NATIVE_HEADERS) + # Raise an error if JDK version is less than 1.8 because javac -h is not supported + # by earlier versions. + if ("${Java_VERSION}" VERSION_LESS 1.8) + message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS is not supported with this version of Java.") + endif() + cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "DESTINATION" "" ${_add_jar_GENERATE_NATIVE_HEADERS}) + if (NOT _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS) + message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: missing required argument.") + endif() + list (LENGTH _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS length) + if (length GREATER 1) + list (REMOVE_AT _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS 0) + message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: ${_add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS}: unexpected argument(s).") + endif() + if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION) + set (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir/native_headers") + endif() + + set (_GENERATE_NATIVE_HEADERS_TARGET ${_add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS}) + set (_GENERATE_NATIVE_HEADERS_OUTPUT_DIR "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION}") + set (_GENERATE_NATIVE_HEADERS -h "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}") + endif() + if (LIBRARY_OUTPUT_PATH) set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH}) else () @@ -626,6 +680,7 @@ function(add_jar _TARGET_NAME) ${CMAKE_JAVA_COMPILE_FLAGS} -classpath "${CMAKE_JAVA_INCLUDE_PATH_FINAL}" -d ${CMAKE_JAVA_CLASS_OUTPUT_PATH} + ${_GENERATE_NATIVE_HEADERS} ${_JAVA_SOURCES_FILELISTS} COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME} DEPENDS ${_JAVA_COMPILE_FILES} ${_JAVA_COMPILE_FILELISTS} ${_JAVA_COMPILE_DEPENDS} @@ -736,6 +791,17 @@ function(add_jar _TARGET_NAME) ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ) + if (_GENERATE_NATIVE_HEADERS) + # create an INTERFACE library encapsulating include directory for generated headers + add_library (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE) + target_include_directories (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE + "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}" + ${JNI_INCLUDE_DIRS}) + # this INTERFACE library depends on jar generation + add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME}) + + set_property (DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}") + endif() endfunction() function(INSTALL_JAR _TARGET_NAME) @@ -1307,6 +1373,12 @@ function(create_javadoc _target) endfunction() function (create_javah) + if ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.10) + message (FATAL_ERROR "create_javah: not supported with this Java version. Use add_jar(GENERATE_NATIVE_HEADERS) instead.") + elseif ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.8) + message (DEPRECATION "create_javah: this command will no longer be supported starting with version 1.10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.") + endif() + cmake_parse_arguments(_create_javah "" "TARGET;GENERATED_FILES;OUTPUT_NAME;OUTPUT_DIR" diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index cfad6f1..670196b 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 88843fa..7eaf80a 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -15,7 +15,7 @@ ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake deleted file mode 100644 index d01dd35..0000000 --- a/config/cmake_ext_mod/FindMPI.cmake +++ /dev/null @@ -1,1514 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. - -#.rst: -# FindMPI -# ------- -# -# Find a Message Passing Interface (MPI) implementation. -# -# The Message Passing Interface (MPI) is a library used to write -# high-performance distributed-memory parallel applications, and is -# typically deployed on a cluster. MPI is a standard interface (defined -# by the MPI forum) for which many implementations are available. -# -# Variables for using MPI -# ^^^^^^^^^^^^^^^^^^^^^^^ -# -# The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``. -# Each of these controls the various MPI languages to search for. -# The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the -# MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API -# that was removed again in MPI-3. -# -# Depending on the enabled components the following variables will be set: -# -# ``MPI_FOUND`` -# Variable indicating that MPI settings for all requested languages have been found. -# If no components are specified, this is true if MPI settings for all enabled languages -# were detected. Note that the ``MPICXX`` component does not affect this variable. -# ``MPI_VERSION`` -# Minimal version of MPI detected among the requested languages, or all enabled languages -# if no components were specified. -# -# This module will set the following variables per language in your -# project, where ```` is one of C, CXX, or Fortran: -# -# ``MPI__FOUND`` -# Variable indicating the MPI settings for ```` were found and that -# simple MPI test programs compile with the provided settings. -# ``MPI__COMPILER`` -# MPI compiler for ```` if such a program exists. -# ``MPI__COMPILE_OPTIONS`` -# Compilation options for MPI programs in ````, given as a :ref:`;-list `. -# ``MPI__COMPILE_DEFINITIONS`` -# Compilation definitions for MPI programs in ````, given as a :ref:`;-list `. -# ``MPI__INCLUDE_DIRS`` -# Include path(s) for MPI header. -# ``MPI__LINK_FLAGS`` -# Linker flags for MPI programs. -# ``MPI__LIBRARIES`` -# All libraries to link MPI programs against. -# -# Additionally, the following :prop_tgt:`IMPORTED` targets are defined: -# -# ``MPI::MPI_`` -# Target for using MPI from ````. -# -# The following variables indicating which bindings are present will be defined: -# -# ``MPI_MPICXX_FOUND`` -# Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3). -# ``MPI_Fortran_HAVE_F77_HEADER`` -# True if the Fortran 77 header ``mpif.h`` is available. -# ``MPI_Fortran_HAVE_F90_MODULE`` -# True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only). -# ``MPI_Fortran_HAVE_F08_MODULE`` -# True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only). -# -# If possible, the MPI version will be determined by this module. The facilities to detect the MPI version -# were introduced with MPI-1.2, and therefore cannot be found for older MPI versions. -# -# ``MPI__VERSION_MAJOR`` -# Major version of MPI implemented for ```` by the MPI distribution. -# ``MPI__VERSION_MINOR`` -# Minor version of MPI implemented for ```` by the MPI distribution. -# ``MPI__VERSION`` -# MPI version implemented for ```` by the MPI distribution. -# -# Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards -# always have required this binding to work in both C and C++ code. -# -# For running MPI programs, the module sets the following variables -# -# ``MPIEXEC_EXECUTABLE`` -# Executable for running MPI programs, if such exists. -# ``MPIEXEC_NUMPROC_FLAG`` -# Flag to pass to ``mpiexec`` before giving it the number of processors to run on. -# ``MPIEXEC_MAX_NUMPROCS`` -# Number of MPI processors to utilize. Defaults to the number -# of processors detected on the host system. -# ``MPIEXEC_PREFLAGS`` -# Flags to pass to ``mpiexec`` directly before the executable to run. -# ``MPIEXEC_POSTFLAGS`` -# Flags to pass to ``mpiexec`` after other flags. -# -# Variables for locating MPI -# ^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# This module performs a three step search for an MPI implementation: -# -# 1. Check if the compiler has MPI support built-in. This is the case if the user passed a -# compiler wrapper as ``CMAKE__COMPILER`` or if they're on a Cray system. -# 2. Attempt to find an MPI compiler wrapper and determine the compiler information from it. -# 3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings. -# Currently, only Microsoft MPI and MPICH2 on Windows are supported. -# -# For controlling the second step, the following variables may be set: -# -# ``MPI__COMPILER`` -# Search for the specified compiler wrapper and use it. -# ``MPI__COMPILER_FLAGS`` -# Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers -# support linking debug or tracing libraries if a specific flag is passed and this variable -# may be used to obtain them. -# ``MPI_COMPILER_FLAGS`` -# Used to initialize ``MPI__COMPILER_FLAGS`` if no language specific flag has been given. -# Empty by default. -# ``MPI_EXECUTABLE_SUFFIX`` -# A suffix which is appended to all names that are being looked for. For instance you may set this -# to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives. -# -# In order to control the guessing step, the following variable may be set: -# -# ``MPI_GUESS_LIBRARY_NAME`` -# Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for. -# By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available. -# This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden. -# -# Each of the search steps may be skipped with the following control variables: -# -# ``MPI_ASSUME_NO_BUILTIN_MPI`` -# If true, the module assumes that the compiler itself does not provide an MPI implementation and -# skips to step 2. -# ``MPI_SKIP_COMPILER_WRAPPER`` -# If true, no compiler wrapper will be searched for. -# ``MPI_SKIP_GUESSING`` -# If true, the guessing step will be skipped. -# -# Additionally, the following control variable is available to change search behavior: -# -# ``MPI_CXX_SKIP_MPICXX`` -# Add some definitions that will disable the MPI-2 C++ bindings. -# Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof, -# for example MVAPICH or Intel MPI. -# -# If the find procedure fails for a variable ``MPI__WORKS``, then the settings detected by or passed to -# the module did not work and even a simple MPI test program failed to compile. -# -# If all of these parameters were not sufficient to find the right MPI implementation, a user may -# disable the entire autodetection process by specifying both a list of libraries in ``MPI__LIBRARIES`` -# and a list of include directories in ``MPI__ADDITIONAL_INCLUDE_DIRS``. -# Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the -# settings in the cache. -# -# Cache variables for MPI -# ^^^^^^^^^^^^^^^^^^^^^^^ -# -# The variable ``MPI__INCLUDE_DIRS`` will be assembled from the following variables. -# For C and CXX: -# -# ``MPI__HEADER_DIR`` -# Location of the ``mpi.h`` header on disk. -# -# For Fortran: -# -# ``MPI_Fortran_F77_HEADER_DIR`` -# Location of the Fortran 77 header ``mpif.h``, if it exists. -# ``MPI_Fortran_MODULE_DIR`` -# Location of the ``mpi`` or ``mpi_f08`` modules, if available. -# -# For all languages the following variables are additionally considered: -# -# ``MPI__ADDITIONAL_INCLUDE_DIRS`` -# A :ref:`;-list ` of paths needed in addition to the normal include directories. -# ``MPI__INCLUDE_DIR`` -# Path variables for include folders referred to by ````. -# ``MPI__ADDITIONAL_INCLUDE_VARS`` -# A :ref:`;-list ` of ```` that will be added to the include locations of ````. -# -# The variable ``MPI__LIBRARIES`` will be assembled from the following variables: -# -# ``MPI__LIBRARY`` -# The location of a library called ```` for use with MPI. -# ``MPI__LIB_NAMES`` -# A :ref:`;-list ` of ```` that will be added to the include locations of ````. -# -# Usage of mpiexec -# ^^^^^^^^^^^^^^^^ -# -# When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically -# use all of the ``MPIEXEC_EXECUTABLE`` flags as follows: -# -# :: -# -# ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} -# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS -# -# where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to -# pass to the MPI program. -# -# Advanced variables for using MPI -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# The module can perform some advanced feature detections upon explicit request. -# -# **Important notice:** The following checks cannot be performed without *executing* an MPI test program. -# Consider the special considerations for the behavior of :command:`try_run` during cross compilation. -# Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems. -# You should only enable these detections if you absolutely need the information. -# -# If the following variables are set to true, the respective search will be performed: -# -# ``MPI_DETERMINE_Fortran_CAPABILITIES`` -# Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and -# ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran__SUBARRAYS`` -# and ``MPI_Fortran__ASYNCPROT``, where ```` is one of ``F77_HEADER``, ``F90_MODULE`` and -# ``F08_MODULE``. -# ``MPI_DETERMINE_LIBRARY_VERSION`` -# For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI__LIBRARY_VERSION``. -# This information is usually tied to the runtime component of an MPI implementation and might differ depending on ````. -# Note that the return value is entirely implementation defined. This information might be used to identify -# the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor. -# -# Backward Compatibility -# ^^^^^^^^^^^^^^^^^^^^^^ -# -# For backward compatibility with older versions of FindMPI, these -# variables are set, but deprecated: -# -# :: -# -# MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY -# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS -# MPI_LIBRARIES -# -# In new projects, please use the ``MPI__XXX`` equivalents. -# Additionally, the following variables are deprecated: -# -# ``MPI__COMPILE_FLAGS`` -# Use ``MPI__COMPILE_OPTIONS`` and ``MPI__COMPILE_DEFINITIONS`` instead. -# ``MPI__INCLUDE_PATH`` -# For consumption use ``MPI__INCLUDE_DIRS`` and for specifying folders use ``MPI__ADDITIONAL_INCLUDE_DIRS`` instead. -# ``MPIEXEC`` -# Use ``MPIEXEC_EXECUTABLE`` instead. - -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST - -# include this to handle the QUIETLY and REQUIRED arguments -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -include(GetPrerequisites) - -# Generic compiler names -set(_MPI_C_GENERIC_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) -set(_MPI_CXX_GENERIC_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) -set(_MPI_Fortran_GENERIC_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r - mpif90 mpif90_r mpf90 mpf90_r - mpif77 mpif77_r mpf77 mpf77_r - mpifc) - -# GNU compiler names -set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) -set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r mpigxx) -set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r - mpig77 mpig77_r mpg77 mpg77_r) - -# Intel MPI compiler names on Windows -if(WIN32) - list(APPEND _MPI_C_GENERIC_COMPILER_NAMES mpicc.bat) - list(APPEND _MPI_CXX_GENERIC_COMPILER_NAMES mpicxx.bat) - list(APPEND _MPI_Fortran_GENERIC_COMPILER_NAMES mpifc.bat) - - # Intel MPI compiler names - set(_MPI_Intel_C_COMPILER_NAMES mpiicc.bat) - set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc.bat) - set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) - - # Intel MPI compiler names for MSMPI - set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat) - set(_MPI_MSVC_CXX_COMPILER_NAMES mpicl.bat) -else() - # Intel compiler names - set(_MPI_Intel_C_COMPILER_NAMES mpiicc) - set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) - set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) -endif() - -# PGI compiler names -set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) -set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) -set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) - -# XLC MPI Compiler names -set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) -set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC - mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) -set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r - mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r - mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r - mpixlf mpixlf_r mpxlf mpxlf_r) - -# Prepend vendor-specific compiler wrappers to the list. If we don't know the compiler, -# attempt all of them. -# By attempting vendor-specific compiler names first, we should avoid situations where the compiler wrapper -# stems from a proprietary MPI and won't know which compiler it's being used for. For instance, Intel MPI -# controls its settings via the I_MPI_CC environment variables if the generic name is being used. -# If we know which compiler we're working with, we can use the most specialized wrapper there is in order to -# pick up the right settings for it. -foreach (LANG IN ITEMS C CXX Fortran) - set(_MPI_${LANG}_COMPILER_NAMES "") - foreach (id IN ITEMS GNU Intel MSVC PGI XL) - if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) - endif() - unset(_MPI_${id}_${LANG}_COMPILER_NAMES) - endforeach() - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) - unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES) -endforeach() - -# Names to try for mpiexec -# Only mpiexec commands are guaranteed to behave as described in the standard, -# mpirun commands are not covered by the standard in any way whatsoever. -# lamexec is the executable for LAM/MPI, srun is for SLURM or Open MPI with SLURM support. -# srun -n X is however a valid command, so it behaves 'like' mpiexec. -set(_MPIEXEC_NAMES_BASE mpiexec mpiexec.hydra mpiexec.mpd mpirun lamexec srun) - -unset(_MPIEXEC_NAMES) -foreach(_MPIEXEC_NAME IN LISTS _MPIEXEC_NAMES_BASE) - list(APPEND _MPIEXEC_NAMES "${_MPIEXEC_NAME}${MPI_EXECUTABLE_SUFFIX}") -endforeach() -unset(_MPIEXEC_NAMES_BASE) - -function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) - if(DEFINED MPI_${LANG}_COMPILER_FLAGS) - separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_${LANG}_COMPILER_FLAGS}") - else() - separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_COMPILER_FLAGS}") - endif() - execute_process( - COMMAND ${MPI_${LANG}_COMPILER} ${_MPI_COMPILER_WRAPPER_OPTIONS} ${QUERY_FLAG} - OUTPUT_VARIABLE WRAPPER_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE WRAPPER_OUTPUT ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE WRAPPER_RETURN) - # Some compiler wrappers will yield spurious zero return values, for example - # Intel MPI tolerates unknown arguments and if the MPI wrappers loads a shared - # library that has invalid or missing version information there would be warning - # messages emitted by ld.so in the compiler output. In either case, we'll treat - # the output as invalid. - if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found") - set(WRAPPER_RETURN 255) - endif() - # Ensure that no error output might be passed upwards. - if(NOT WRAPPER_RETURN EQUAL 0) - unset(WRAPPER_OUTPUT) - endif() - set(${OUTPUT_VARIABLE} "${WRAPPER_OUTPUT}" PARENT_SCOPE) - set(${RESULT_VARIABLE} "${WRAPPER_RETURN}" PARENT_SCOPE) -endfunction() - -function (_MPI_interrogate_compiler lang) - unset(MPI_COMPILE_CMDLINE) - unset(MPI_LINK_CMDLINE) - - unset(MPI_COMPILE_OPTIONS_WORK) - unset(MPI_COMPILE_DEFINITIONS_WORK) - unset(MPI_INCLUDE_DIRS_WORK) - unset(MPI_LINK_FLAGS_WORK) - unset(MPI_LIB_NAMES_WORK) - unset(MPI_LIB_FULLPATHS_WORK) - - # Check whether the -showme:compile option works. This indicates that we have either Open MPI - # or a newer version of LAM/MPI, and implies that -showme:link will also work. - # Open MPI also supports -show, but separates linker and compiler information - _MPI_check_compiler(${LANG} "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - if (MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-showme:link" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - - if (NOT MPI_COMPILER_RETURN EQUAL 0) - unset(MPI_COMPILE_CMDLINE) - endif() - endif() - - # MPICH and MVAPICH offer -compile-info and -link-info. - # For modern versions, both do the same as -show. However, for old versions, they do differ - # when called for mpicxx and mpif90 and it's necessary to use them over -show in order to find the - # removed MPI C++ bindings. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - - if (MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-link-info" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - - if (NOT MPI_COMPILER_RETURN EQUAL 0) - unset(MPI_COMPILE_CMDLINE) - endif() - endif() - endif() - - # MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the - # -showme commands are more specialized. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() - - # Older versions of LAM/MPI have "-showme". Open MPI also supports this. - # Unknown to MPICH, MVAPICH and Intel MPI. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _MPI_check_compiler(${LANG} "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() - - if (NOT (MPI_COMPILER_RETURN EQUAL 0) OR NOT (DEFINED MPI_COMPILE_CMDLINE)) - # Cannot interrogate this compiler, so exit. - set(MPI_${LANG}_WRAPPER_FOUND FALSE PARENT_SCOPE) - return() - endif() - unset(MPI_COMPILER_RETURN) - - # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE - # into MPI_LINK_CMDLINE, if we didn't find the link line. - if (NOT DEFINED MPI_LINK_CMDLINE) - set(MPI_LINK_CMDLINE "${MPI_COMPILE_CMDLINE}") - endif() - - # At this point, we obtained some output from a compiler wrapper that works. - # We'll now try to parse it into variables with meaning to us. - if("${LANG}" STREQUAL "Fortran") - # Some MPICH-1 and MVAPICH-1 versions return a three command answer for Fortran, consisting - # out of a symlink command for mpif.h, the actual compiler command and a deletion of the - # created symlink. We need to detect that case, remember the include path and drop the - # symlink/deletion operation to obtain the link/compile lines we'd usually expect. - if("${MPI_COMPILE_CMDLINE}" MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h") - get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY) - string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - endif() - endif() - - # The Intel MPI wrapper on Linux will emit some objcopy commands after its compile command - # if -static_mpi was passed to the wrapper. To avoid spurious matches, we need to drop these lines. - if(UNIX) - string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") - string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") - endif() - - # Extract compile options from the compile command line. - string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}") - - foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS) - string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}") - # Ignore -fstack-protector directives: These occur on MPICH and MVAPICH when the libraries - # themselves were built with this flag. However, this flag is unrelated to using MPI, and - # we won't match the accompanying --param-ssp-size and -Wp,-D_FORTIFY_SOURCE flags and therefore - # produce inconsistent results with the regularly flags. - # Similarly, aliasing flags do not belong into our flag array. - if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f(stack-protector|(no-|)strict-aliasing|PI[CE]|pi[ce])") - list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}") - endif() - endforeach() - - # Same deal, with the definitions. We also treat arguments passed to the preprocessor directly. - string(REGEX MATCHALL "(^| )(-Wp,|-Xpreprocessor |)[-/]D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}") - - foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS) - string(REGEX REPLACE "^ ?(-Wp,|-Xpreprocessor )?[-/]D" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") - string(REPLACE "\"" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") - if(NOT "${_MPI_COMPILE_DEFINITION}" MATCHES "^_FORTIFY_SOURCE.*") - list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${_MPI_COMPILE_DEFINITION}") - endif() - endforeach() - - # Extract include paths from compile command line - string(REGEX MATCHALL "(^| )[-/]I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") - - # If extracting failed to work, we'll try using -showme:incdirs. - if (NOT MPI_ALL_INCLUDE_PATHS) - _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN) - if(MPI_INCDIRS_COMPILER_RETURN) - separate_arguments(MPI_ALL_INCLUDE_PATHS NATIVE_COMMAND "${MPI_INCDIRS_CMDLINE}") - endif() - endif() - - foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS) - string(REGEX REPLACE "^ ?[-/]I" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") - string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") - get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH) - list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}") - endforeach() - - # Extract linker paths from the link command line - string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker |)(-L|[/-]LIBPATH:|[/-]libpath:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") - - # If extracting failed to work, we'll try using -showme:libdirs. - if (NOT MPI_ALL_LINK_PATHS) - _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN) - if(MPI_LIBDIRS_COMPILER_RETURN) - separate_arguments(MPI_ALL_LINK_PATHS NATIVE_COMMAND "${MPI_LIBDIRS_CMDLINE}") - endif() - endif() - - foreach(_MPI_LPATH IN LISTS MPI_ALL_LINK_PATHS) - string(REGEX REPLACE "^ ?(-Wl,|-Xlinker )?(-L|[/-]LIBPATH:|[/-]libpath:)" "" _MPI_LPATH "${_MPI_LPATH}") - string(REPLACE "\"" "" _MPI_LPATH "${_MPI_LPATH}") - get_filename_component(_MPI_LPATH "${_MPI_LPATH}" REALPATH) - list(APPEND MPI_LINK_DIRECTORIES_WORK "${_MPI_LPATH}") - endforeach() - - # Extract linker flags from the link command line - string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") - - foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS) - string(STRIP "${_MPI_LINK_FLAG}" _MPI_LINK_FLAG) - # MPI might be marked to build with non-executable stacks but this should not propagate. - if (NOT "${_MPI_LINK_FLAG}" MATCHES "(-Wl,|-Xlinker )-z,noexecstack") - if (MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " ${_MPI_LINK_FLAG}") - else() - set(MPI_LINK_FLAGS_WORK "${_MPI_LINK_FLAG}") - endif() - endif() - endforeach() - - # Extract the set of libraries to link against from the link command - # line - string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) - string(REGEX REPLACE "^ ?-l" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - - if(WIN32) - # A compiler wrapper on Windows will just have the name of the - # library to link on its link line, potentially with a full path - string(REGEX MATCHALL "(^| )([^\" ]+\\.lib|\"[^\"]+\\.lib\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) - string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - else() - # On UNIX platforms, archive libraries can be given with full path. - string(REGEX MATCHALL "(^| )([^\" ]+\\.a|\"[^\"]+\\.a\")" MPI_LIBFULLPATHS "${MPI_LINK_CMDLINE}") - foreach(_MPI_LIB_NAME IN LISTS MPI_LIBFULLPATHS) - string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) - if(NOT "${_MPI_LIB_PATH}" STREQUAL "") - list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") - else() - list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") - endif() - endforeach() - endif() - - # An MPI compiler wrapper could have its MPI libraries in the implictly - # linked directories of the compiler itself. - if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) - list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}") - endif() - - # Determine full path names for all of the libraries that one needs - # to link against in an MPI program - unset(MPI_PLAIN_LIB_NAMES_WORK) - foreach(_MPI_LIB_NAME IN LISTS MPI_LIB_NAMES_WORK) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_NAME}" NAME_WE) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${MPI_LINK_DIRECTORIES_WORK} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - - # Deal with the libraries given with full path next - unset(MPI_DIRECT_LIB_NAMES_WORK) - foreach(_MPI_LIB_FULLPATH IN LISTS MPI_LIB_FULLPATHS_WORK) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME) - get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_FULLPATH}" DIRECTORY) - list(APPEND MPI_DIRECT_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_PATH} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endforeach() - if(MPI_DIRECT_LIB_NAMES_WORK) - set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}") - endif() - - # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to - # link it in that case. -lpthread is covered by the normal library treatment on the other hand. - if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread") - list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread") - if(MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " -pthread") - else() - set(MPI_LINK_FLAGS_WORK "-pthread") - endif() - endif() - - if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") - endif() - if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") - endif() - if(MPI_${LANG}_EXTRA_LIB_NAMES) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") - endif() - - # If we found MPI, set up all of the appropriate cache entries - if(NOT MPI_${LANG}_COMPILE_OPTIONS) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) - endif() - if(NOT MPI_${LANG}_COMPILE_DEFINITIONS) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_COMPILE_DEFINITIONS_WORK} CACHE STRING "MPI ${LANG} compilation definitions" FORCE) - endif() - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_INCLUDE_DIRS_WORK} CACHE STRING "MPI ${LANG} additional include directories" FORCE) - endif() - if(NOT MPI_${LANG}_LINK_FLAGS) - set(MPI_${LANG}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${LANG} linker flags" FORCE) - endif() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES ${MPI_PLAIN_LIB_NAMES_WORK} CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - set(MPI_${LANG}_WRAPPER_FOUND TRUE PARENT_SCOPE) -endfunction() - -function(_MPI_guess_settings LANG) - set(MPI_GUESS_FOUND FALSE) - # Currently only MSMPI and MPICH2 on Windows are supported, so we can skip this search if we're not targeting that. - if(WIN32) - # MSMPI - - # The environment variables MSMPI_INC and MSMPILIB32/64 are the only ways of locating the MSMPI_SDK, - # which is installed separately from the runtime. Thus it's possible to have mpiexec but not MPI headers - # or import libraries and vice versa. - if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MSMPI") - # We first attempt to locate the msmpi.lib. Should be find it, we'll assume that the MPI present is indeed - # Microsoft MPI. - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB64}") - set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x64") - else() - set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB32}") - set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x86") - endif() - - find_library(MPI_msmpi_LIBRARY - NAMES msmpi - HINTS ${MPI_MSMPI_LIB_PATH} - DOC "Location of the msmpi library for Microsoft MPI") - mark_as_advanced(MPI_msmpi_LIBRARY) - - if(MPI_msmpi_LIBRARY) - # Next, we attempt to locate the MPI header. Note that for Fortran we know that mpif.h is a way - # MSMPI can be used and therefore that header has to be present. - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - get_filename_component(MPI_MSMPI_INC_DIR "$ENV{MSMPI_INC}" REALPATH) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MSMPI_INC_DIR}" CACHE STRING "MPI ${LANG} additional include directories" FORCE) - unset(MPI_MSMPI_INC_DIR) - endif() - - # For MSMPI, one can compile the MPI module by building the mpi.f90 shipped with the MSMPI SDK, - # thus it might be present or provided by the user. Figuring out which is supported is done later on. - # The PGI Fortran compiler for instance ships a prebuilt set of modules in its own include folder. - # Should a user be employing PGI or have built its own set and provided it via cache variables, the - # splitting routine would have located the module files. - - # For C and C++, we're done here (MSMPI does not ship the MPI-2 C++ bindings) - however, for Fortran - # we need some extra library to glue Fortran support together: - # MSMPI ships 2-4 Fortran libraries, each for different Fortran compiler behaviors. The library names - # ending with a c are using the cdecl calling convention, whereas those ending with an s are for Fortran - # implementations using stdcall. Therefore, the 64-bit MSMPI only ships those ending in 'c', whereas the 32-bit - # has both variants available. - # The second difference is the last but one letter, if it's an e(nd), the length of a string argument is - # passed by the Fortran compiler after all other arguments on the parameter list, if it's an m(ixed), - # it's passed immediately after the string address. - - # To summarize: - # - msmpifec: CHARACTER length passed after the parameter list and using cdecl calling convention - # - msmpifmc: CHARACTER length passed directly after string address and using cdecl calling convention - # - msmpifes: CHARACTER length passed after the parameter list and using stdcall calling convention - # - msmpifms: CHARACTER length passed directly after string address and using stdcall calling convention - # 32-bit MSMPI ships all four libraries, 64-bit MSMPI ships only the first two. - - # As is, Intel Fortran and PGI Fortran both use the 'ec' variant of the calling convention, whereas - # the old Compaq Visual Fortran compiler defaulted to the 'ms' version. It's possible to make Intel Fortran - # use the CVF calling convention using /iface:cvf, but we assume - and this is also assumed in FortranCInterface - - # this isn't the case. It's also possible to make CVF use the 'ec' variant, using /iface=(cref,nomixed_str_len_arg). - - # Our strategy is now to locate all libraries, but enter msmpifec into the LIB_NAMES array. - # Should this not be adequate it's a straightforward way for a user to change the LIB_NAMES array and - # have his library found. Still, this should not be necessary outside of exceptional cases, as reasoned. - if ("${LANG}" STREQUAL "Fortran") - set(MPI_MSMPI_CALLINGCONVS c) - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) - list(APPEND MPI_MSMPI_CALLINGCONVS s) - endif() - foreach(mpistrlenpos IN ITEMS e m) - foreach(mpicallingconv IN LISTS MPI_MSMPI_CALLINGCONVS) - find_library(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY - NAMES msmpif${mpistrlenpos}${mpicallingconv} - HINTS "${MPI_MSMPI_LIB_PATH}" - DOC "Location of the msmpi${mpistrlenpos}${mpicallingconv} library for Microsoft MPI") - mark_as_advanced(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY) - endforeach() - endforeach() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "msmpi;msmpifec" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - - # At this point we're *not* done. MSMPI requires an additional include file for Fortran giving the value - # of MPI_AINT. This file is called mpifptr.h located in the x64 and x86 subfolders, respectively. - find_path(MPI_mpifptr_INCLUDE_DIR - NAMES "mpifptr.h" - HINTS "${MPI_MSMPI_INC_PATH_EXTRA}" - DOC "Location of the mpifptr.h extra header for Microsoft MPI") - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS "mpifptr" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) - endif() - mark_as_advanced(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS MPI_mpifptr_INCLUDE_DIR) - else() - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "msmpi" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - endif() - mark_as_advanced(MPI_${LANG}_LIB_NAMES) - set(MPI_GUESS_FOUND TRUE) - endif() - endif() - - # At this point there's not many MPIs that we could still consider. - # OpenMPI 1.6.x and below supported Windows, but these ship compiler wrappers that still work. - # The only other relevant MPI implementation without a wrapper is MPICH2, which had Windows support in 1.4.1p1 and older. - if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MPICH2") - set(MPI_MPICH_PREFIX_PATHS - "$ENV{ProgramW6432}/MPICH2/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/../lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]/lib" - ) - - # All of C, C++ and Fortran will need mpi.lib, so we'll look for this first - find_library(MPI_mpi_LIBRARY - NAMES mpi - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_mpi_LIBRARY) - # If we found mpi.lib, we detect the rest of MPICH2 - if(MPI_mpi_LIBRARY) - set(MPI_MPICH_LIB_NAMES "mpi") - # If MPI-2 C++ bindings are requested, we need to locate cxx.lib as well. - # Otherwise, MPICH_SKIP_MPICXX will be defined and these bindings aren't needed. - if("${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX) - find_library(MPI_cxx_LIBRARY - NAMES cxx - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_cxx_LIBRARY) - list(APPEND MPI_MPICH_LIB_NAMES "cxx") - # For Fortran, MPICH2 provides three different libraries: - # fmpich2.lib which uses uppercase symbols and cdecl, - # fmpich2s.lib which uses uppercase symbols and stdcall (32-bit only), - # fmpich2g.lib which uses lowercase symbols with double underscores and cdecl. - # fmpich2s.lib would be useful for Compaq Visual Fortran, fmpich2g.lib has to be used with GNU g77 and is also - # provided in the form of an .a archive for MinGW and Cygwin. From our perspective, fmpich2.lib is the only one - # we need to try, and if it doesn't work with the given Fortran compiler we'd find out later on during validation - elseif("${LANG}" STREQUAL "Fortran") - find_library(MPI_fmpich2_LIBRARY - NAMES fmpich2 - HINTS ${MPI_MPICH_PREFIX_PATHS}) - find_library(MPI_fmpich2s_LIBRARY - NAMES fmpich2s - HINTS ${MPI_MPICH_PREFIX_PATHS}) - find_library(MPI_fmpich2g_LIBRARY - NAMES fmpich2g - HINTS ${MPI_MPICH_PREFIX_PATHS}) - mark_as_advanced(MPI_fmpich2_LIBRARY MPI_fmpich2s_LIBRARY MPI_fmpich2g_LIBRARY) - list(APPEND MPI_MPICH_LIB_NAMES "fmpich2") - endif() - - if(NOT MPI_${LANG}_LIB_NAMES) - set(MPI_${LANG}_LIB_NAMES "${MPI_MPICH_LIB_NAMES}" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) - endif() - unset(MPI_MPICH_LIB_NAMES) - - if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - # For MPICH2, the include folder would be in ../include relative to the library folder. - get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_mpi_LIBRARY}" DIRECTORY) - get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_MPICH_ROOT_DIR}" DIRECTORY) - if(IS_DIRECTORY "${MPI_MPICH_ROOT_DIR}/include") - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MPICH_ROOT_DIR}/include" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) - endif() - unset(MPI_MPICH_ROOT_DIR) - endif() - set(MPI_GUESS_FOUND TRUE) - endif() - unset(MPI_MPICH_PREFIX_PATHS) - endif() - endif() - set(MPI_${LANG}_GUESS_FOUND "${MPI_GUESS_FOUND}" PARENT_SCOPE) -endfunction() - -function(_MPI_adjust_compile_definitions LANG) - if("${LANG}" STREQUAL "CXX") - # To disable the C++ bindings, we need to pass some definitions since the mpi.h header has to deal with both C and C++ - # bindings in MPI-2. - if(MPI_CXX_SKIP_MPICXX AND NOT MPI_${LANG}_COMPILE_DEFINITIONS MATCHES "SKIP_MPICXX") - # MPICH_SKIP_MPICXX is being used in MPICH and derivatives like MVAPICH or Intel MPI - # OMPI_SKIP_MPICXX is being used in Open MPI - # _MPICC_H is being used for IBM Platform MPI - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX" "OMPI_SKIP_MPICXX" "_MPICC_H") - set(MPI_${LANG}_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}" CACHE STRING "MPI ${LANG} compilation definitions" FORCE) - endif() - endif() -endfunction() - -macro(_MPI_assemble_libraries LANG) - set(MPI_${LANG}_LIBRARIES "") - # Only for libraries do we need to check whether the compiler's linking stage is separate. - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() - endif() -endmacro() - -macro(_MPI_assemble_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_${LANG}_INCLUDE_DIRS "") - else() - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") - endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") - endif() - endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") - endforeach() - endif() - endif() -endmacro() - -function(_MPI_split_include_dirs LANG) - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - return() - endif() - # Backwards compatibility: Search INCLUDE_PATH if given. - if(MPI_${LANG}_INCLUDE_PATH) - list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") - endif() - - # We try to find the headers/modules among those paths (and system paths) - # For C/C++, we just need to have a look for mpi.h. - if("${LANG}" MATCHES "(C|CXX)") - find_path(MPI_${LANG}_HEADER_DIR "mpi.h" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - mark_as_advanced(MPI_${LANG}_HEADER_DIR) - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - # Fortran is more complicated here: An implementation could provide - # any of the Fortran 77/90/2008 APIs for MPI. For example, MSMPI - # only provides Fortran 77 and - if mpi.f90 is built - potentially - # a Fortran 90 module. - elseif("${LANG}" STREQUAL "Fortran") - find_path(MPI_${LANG}_F77_HEADER_DIR "mpif.h" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - find_path(MPI_${LANG}_MODULE_DIR - NAMES "mpi.mod" "mpi_f08.mod" - HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} - ) - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS - "${MPI_${LANG}_F77_HEADER_DIR}" - "${MPI_${LANG}_MODULE_DIR}" - ) - endif() - mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) - endif() - # Remove duplicates and default system directories from the list. - if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) - foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) - list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) - endforeach() - endif() - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) -endfunction() - -macro(_MPI_create_imported_target LANG) - if(NOT TARGET MPI::MPI_${LANG}) - add_library(MPI::MPI_${LANG} INTERFACE IMPORTED) - endif() - - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}") - - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") - if(MPI_${LANG}_LINK_FLAGS) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LINK_FLAGS}") - endif() - # If the compiler links MPI implicitly, no libraries will be found as they're contained within - # CMAKE__IMPLICIT_LINK_LIBRARIES already. - if(MPI_${LANG}_LIBRARIES) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") - endif() - # Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking. - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}") -endmacro() - -function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) - set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") - set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/FindMPI") - set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") - unset(MPI_TEST_COMPILE_DEFINITIONS) - if("${LANG}" STREQUAL "Fortran") - if("${MODE}" STREQUAL "F90_MODULE") - set(MPI_Fortran_INCLUDE_LINE "use mpi\n implicit none") - elseif("${MODE}" STREQUAL "F08_MODULE") - set(MPI_Fortran_INCLUDE_LINE "use mpi_f08\n implicit none") - else() # F77 header - set(MPI_Fortran_INCLUDE_LINE "implicit none\n include 'mpif.h'") - endif() - configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90" @ONLY) - set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90") - elseif("${LANG}" STREQUAL "CXX") - configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp" COPYONLY) - set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp") - if("${MODE}" STREQUAL "TEST_MPICXX") - set(MPI_TEST_COMPILE_DEFINITIONS TEST_MPI_MPICXX) - endif() - else() # C - set(MPI_TEST_SOURCE_FILE "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c") - endif() - if(RUN_BINARY) - try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} - "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" - COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} - LINK_LIBRARIES MPI::MPI_${LANG} - RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) - set(MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} "${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}" PARENT_SCOPE) - else() - try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} - "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" - COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} - LINK_LIBRARIES MPI::MPI_${LANG} - COPY_FILE "${BIN_FILE}") - endif() -endfunction() - -macro(_MPI_check_lang_works LANG) - # For Fortran we may have by the MPI-3 standard an implementation that provides: - # - the mpi_f08 module - # - *both*, the mpi module and 'mpif.h' - # Since older MPI standards (MPI-1) did not define anything but 'mpif.h', we need to check all three individually. - if( NOT MPI_${LANG}_WORKS ) - if("${LANG}" STREQUAL "Fortran") - set(MPI_Fortran_INTEGER_LINE "(kind=MPI_INTEGER_KIND)") - _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER FALSE) - _MPI_try_staged_settings(${LANG} test_mpi F90_MODULE FALSE) - _MPI_try_staged_settings(${LANG} test_mpi F08_MODULE FALSE) - - set(MPI_${LANG}_WORKS FALSE) - - foreach(mpimethod IN ITEMS F77_HEADER F08_MODULE F90_MODULE) - if(MPI_RESULT_${LANG}_test_mpi_${mpimethod}) - set(MPI_${LANG}_WORKS TRUE) - set(MPI_${LANG}_HAVE_${mpimethod} TRUE) - else() - set(MPI_${LANG}_HAVE_${mpimethod} FALSE) - endif() - endforeach() - # MPI-1 versions had no MPI_INTGER_KIND defined, so we need to try without it. - # However, MPI-1 also did not define the Fortran 90 and 08 modules, so we only try the F77 header. - unset(MPI_Fortran_INTEGER_LINE) - if(NOT MPI_${LANG}_WORKS) - _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER_NOKIND FALSE) - if(MPI_RESULT_${LANG}_test_mpi_F77_HEADER_NOKIND) - set(MPI_${LANG}_WORKS TRUE) - set(MPI_${LANG}_HAVE_F77_HEADER TRUE) - endif() - endif() - else() - _MPI_try_staged_settings(${LANG} test_mpi normal FALSE) - # If 'test_mpi' built correctly, we've found valid MPI settings. There might not be MPI-2 C++ support, but there can't - # be MPI-2 C++ support without the C bindings being present, so checking for them is sufficient. - set(MPI_${LANG}_WORKS "${MPI_RESULT_${LANG}_test_mpi_normal}") - endif() - endif() -endmacro() - -# Some systems install various MPI implementations in separate folders in some MPI prefix -# This macro enumerates all such subfolders and adds them to the list of hints that will be searched. -macro(MPI_search_mpi_prefix_folder PREFIX_FOLDER) - if(EXISTS "${PREFIX_FOLDER}") - file(GLOB _MPI_folder_children RELATIVE "${PREFIX_FOLDER}" "${PREFIX_FOLDER}/*") - foreach(_MPI_folder_child IN LISTS _MPI_folder_children) - if(IS_DIRECTORY "${PREFIX_FOLDER}/${_MPI_folder_child}") - list(APPEND MPI_HINT_DIRS "${PREFIX_FOLDER}/${_MPI_folder_child}") - endif() - endforeach() - endif() -endmacro() - -set(MPI_HINT_DIRS ${MPI_HOME} $ENV{MPI_HOME} $ENV{I_MPI_ROOT}) -if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") - # SUSE Linux Enterprise Server stores its MPI implementations under /usr/lib64/mpi/gcc/ - # We enumerate the subfolders and append each as a prefix - MPI_search_mpi_prefix_folder("/usr/lib64/mpi/gcc") -elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") - # MSMPI stores its runtime in a special folder, this adds the possible locations to the hints. - list(APPEND MPI_HINT_DIRS $ENV{MSMPI_BIN} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]") -elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") - # FreeBSD ships mpich under the normal system paths - but available openmpi implementations - # will be found in /usr/local/mpi/ - MPI_search_mpi_prefix_folder("/usr/local/mpi") -endif() - -# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. -# The MPI standard does not mandate the existence of either, but instead only makes requirements if a distribution -# ships an mpiexec program (mpirun executables are not regulated by the standard). -find_program(MPIEXEC_EXECUTABLE - NAMES ${_MPIEXEC_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${MPI_HINT_DIRS} - DOC "Executable for running MPI programs.") - -# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). -# This gives us a fairly reliable base directory to search for /bin /lib and /include from. -get_filename_component(_MPI_BASE_DIR "${MPIEXEC_EXECUTABLE}" PATH) -get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) - -# According to the MPI standard, section 8.8 -n is a guaranteed, and the only guaranteed way to -# launch an MPI process using mpiexec if such a program exists. -set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "Flag used by MPI to specify the number of processes for mpiexec; the next option will be the number of processes.") -set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by mpiexec.") -set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will be placed after all flags passed to mpiexec.") - -# Set the number of processes to the physical processor count -cmake_host_system_information(RESULT _MPIEXEC_NUMPROCS QUERY NUMBER_OF_PHYSICAL_CORES) -set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") -unset(_MPIEXEC_NUMPROCS) -mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) - -#============================================================================= -# Backward compatibility input hacks. Propagate the FindMPI hints to C and -# CXX if the respective new versions are not defined. Translate the old -# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${LANG}_LIBRARIES. -# -# Once we find the new variables, we translate them back into their old -# equivalents below. -if(NOT MPI_IGNORE_LEGACY_VARIABLES) - foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - - unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) - unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) - if(MPI_${LANG}_COMPILE_FLAGS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") - endif() - endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - - # If a list of libraries was given, we'll split it into new-style cache variables - unset(MPI_${LANG}_EXTRA_LIB_NAMES) - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - if(_MPI_LIB) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endif() - endforeach() - endif() - endforeach() -endif() -#============================================================================= - -unset(MPI_VERSION) -unset(MPI_VERSION_MAJOR) -unset(MPI_VERSION_MINOR) - -unset(_MPI_MIN_VERSION) - -# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. -if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) -endif() - -# This loop finds the compilers and sends them off for interrogation. -foreach(LANG IN ITEMS C CXX Fortran) - if(CMAKE_${LANG}_COMPILER_LOADED) - if(NOT MPI_FIND_COMPONENTS) - set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} IN_LIST MPI_FIND_COMPONENTS) - set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} STREQUAL CXX AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) - set(_MPI_FIND_${LANG} TRUE) - else() - set(_MPI_FIND_${LANG} FALSE) - endif() - else() - set(_MPI_FIND_${LANG} FALSE) - endif() - if(_MPI_FIND_${LANG}) - if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) - set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.") - mark_as_advanced(MPI_CXX_SKIP_MPICXX) - endif() - if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) - set(MPI_${LANG}_TRIED_IMPLICIT FALSE) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) - if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) - # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. - # Cray PrgEnv. - _MPI_create_imported_target(${LANG}) - _MPI_check_lang_works(${LANG}) - - # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. - if(MPI_${LANG}_WORKS) - set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) - endif() - set(MPI_${LANG}_TRIED_IMPLICIT TRUE) - endif() - - if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) - endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - endif() - - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH - DOC "MPI compiler for ${LANG}" - ) - endif() - - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - set(MPI_PINNED_COMPILER TRUE) - - # If we haven't made the implicit compiler test yet, perform it now. - if(NOT MPI_${LANG}_TRIED_IMPLICIT) - _MPI_create_imported_target(${LANG}) - _MPI_check_lang_works(${LANG}) - endif() - - # Should the MPI compiler not work implicitly for MPI, still interrogate it. - # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used - # directly during linkage instead of CMAKE__COMPILER will not work. - if(NOT MPI_${LANG}_WORKS) - set(MPI_${LANG}_WORKS_IMPLICIT FALSE) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WORKS_IMPLICIT TRUE) - endif() - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - endif() - endif() - - if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - else() - _MPI_guess_settings(${LANG}) - endif() - endif() - endif() - endif() - - _MPI_split_include_dirs(${LANG}) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - - _MPI_adjust_compile_definitions(${LANG}) - # We always create imported targets even if they're empty - _MPI_create_imported_target(${LANG}) - - if(NOT MPI_${LANG}_WORKS) - _MPI_check_lang_works(${LANG}) - endif() - - # Next, we'll initialize the MPI variables that have not been previously set. - set(MPI_${LANG}_COMPILE_OPTIONS "" CACHE STRING "MPI ${LANG} compilation flags" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) - endif() - mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS - MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) - - # If we've found MPI, then we'll perform additional analysis: Determine the MPI version, MPI library version, supported - # MPI APIs (i.e. MPI-2 C++ bindings). For Fortran we also need to find specific parameters if we're under MPI-3. - if(MPI_${LANG}_WORKS) - if("${LANG}" STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND) - if(NOT MPI_CXX_SKIP_MPICXX AND NOT MPI_CXX_VALIDATE_SKIP_MPICXX) - _MPI_try_staged_settings(${LANG} test_mpi MPICXX FALSE) - if(MPI_RESULT_${LANG}_test_mpi_MPICXX) - set(MPI_MPICXX_FOUND TRUE) - else() - set(MPI_MPICXX_FOUND FALSE) - endif() - else() - set(MPI_MPICXX_FOUND FALSE) - endif() - endif() - - # At this point, we know the bindings present but not the MPI version or anything else. - if(NOT DEFINED MPI_${LANG}_VERSION) - unset(MPI_${LANG}_VERSION_MAJOR) - unset(MPI_${LANG}_VERSION_MINOR) - endif() - set(MPI_BIN_FOLDER ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI) - - # For Fortran, we'll want to use the most modern MPI binding to test capabilities other than the - # Fortran parameters, since those depend on the method of consumption. - # For C++, we can always use the C bindings, and should do so, since the C++ bindings do not exist in MPI-3 - # whereas the C bindings do, and the C++ bindings never offered any feature advantage over their C counterparts. - if("${LANG}" STREQUAL "Fortran") - if(MPI_${LANG}_HAVE_F08_MODULE) - set(MPI_${LANG}_HIGHEST_METHOD F08_MODULE) - elseif(MPI_${LANG}_HAVE_F90_MODULE) - set(MPI_${LANG}_HIGHEST_METHOD F90_MODULE) - else() - set(MPI_${LANG}_HIGHEST_METHOD F77_HEADER) - endif() - - # Another difference between C and Fortran is that we can't use the preprocessor to determine whether MPI_VERSION - # and MPI_SUBVERSION are provided. These defines did not exist in MPI 1.0 and 1.1 and therefore might not - # exist. For C/C++, test_mpi.c will handle the MPI_VERSION extraction, but for Fortran, we need mpiver.f90. - if(NOT DEFINED MPI_${LANG}_VERSION) - _MPI_try_staged_settings(${LANG} mpiver ${MPI_${LANG}_HIGHEST_METHOD} FALSE) - if(MPI_RESULT_${LANG}_mpiver_${MPI_${LANG}_HIGHEST_METHOD}) - file(STRINGS ${MPI_BIN_FOLDER}/mpiver_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") - if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") - set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") - set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") - set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") - endif() - endif() - endif() - - # Finally, we want to find out which capabilities a given interface supports, compare the MPI-3 standard. - # This is determined by interface specific parameters MPI_SUBARRAYS_SUPPORTED and MPI_ASYNC_PROTECTS_NONBLOCKING - # and might vary between the different methods of consumption. - if(MPI_DETERMINE_Fortran_CAPABILITIES AND NOT MPI_Fortran_CAPABILITIES_DETERMINED) - foreach(mpimethod IN ITEMS F08_MODULE F90_MODULE F77_HEADER) - if(MPI_${LANG}_HAVE_${mpimethod}) - set(MPI_${LANG}_${mpimethod}_SUBARRAYS FALSE) - set(MPI_${LANG}_${mpimethod}_ASYNCPROT FALSE) - _MPI_try_staged_settings(${LANG} fortranparam_mpi ${mpimethod} TRUE) - if(MPI_RESULT_${LANG}_fortranparam_mpi_${mpimethod} AND - NOT "${MPI_RUN_RESULT_${LANG}_fortranparam_mpi_${mpimethod}}" STREQUAL "FAILED_TO_RUN") - if("${MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod}}" MATCHES - ".*INFO:SUBARRAYS\\[ *([TF]) *\\]-ASYNCPROT\\[ *([TF]) *\\].*") - if("${CMAKE_MATCH_1}" STREQUAL "T") - set(MPI_${LANG}_${mpimethod}_SUBARRAYS TRUE) - endif() - if("${CMAKE_MATCH_2}" STREQUAL "T") - set(MPI_${LANG}_${mpimethod}_ASYNCPROT TRUE) - endif() - endif() - endif() - endif() - endforeach() - set(MPI_Fortran_CAPABILITIES_DETERMINED TRUE) - endif() - else() - set(MPI_${LANG}_HIGHEST_METHOD normal) - - # By the MPI-2 standard, MPI_VERSION and MPI_SUBVERSION are valid for both C and C++ bindings. - if(NOT DEFINED MPI_${LANG}_VERSION) - file(STRINGS ${MPI_BIN_FOLDER}/test_mpi_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") - if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") - set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") - set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") - set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") - endif() - endif() - endif() - - unset(MPI_BIN_FOLDER) - - # At this point, we have dealt with determining the MPI version and parameters for each Fortran method available. - # The one remaining issue is to determine which MPI library is installed. - # Determining the version and vendor of the MPI library is only possible via MPI_Get_library_version() at runtime, - # and therefore we cannot do this while cross-compiling (a user may still define MPI__LIBRARY_VERSION_STRING - # themselves and we'll attempt splitting it, which is equivalent to provide the try_run output). - # It's also worth noting that the installed version string can depend on the language, or on the system the binary - # runs on if MPI is not statically linked. - if(MPI_DETERMINE_LIBRARY_VERSION AND NOT MPI_${LANG}_LIBRARY_VERSION_STRING) - _MPI_try_staged_settings(${LANG} libver_mpi ${MPI_${LANG}_HIGHEST_METHOD} TRUE) - if(MPI_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} AND - "${MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" EQUAL "0") - string(STRIP "${MPI_RUN_OUTPUT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" - MPI_${LANG}_LIBRARY_VERSION_STRING) - else() - set(MPI_${LANG}_LIBRARY_VERSION_STRING "NOTFOUND") - endif() - endif() - endif() - - set(MPI_${LANG}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) - set(MPI_${LANG}_FIND_VERSION ${MPI_FIND_VERSION}) - set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) - - unset(MPI_${LANG}_REQUIRED_VARS) - if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") - foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") - endforeach() - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_LIB_NAMES") - if("${LANG}" STREQUAL "Fortran") - # For Fortran we only need one of the module or header directories to have *some* support for MPI. - if(NOT MPI_${LANG}_MODULE_DIR) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_F77_HEADER_DIR") - endif() - if(NOT MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_MODULE_DIR") - endif() - else() - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_HEADER_DIR") - endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiincvar IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpiincvar}_INCLUDE_DIR") - endforeach() - endif() - # Append the works variable now. If the settings did not work, this will show up properly. - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") - else() - # If the compiler worked implicitly, use its path as output. - # Should the compiler variable be set, we also require it to work. - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_COMPILER") - if(MPI_${LANG}_COMPILER) - list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") - endif() - endif() - find_package_handle_standard_args(MPI_${LANG} REQUIRED_VARS ${MPI_${LANG}_REQUIRED_VARS} - VERSION_VAR MPI_${LANG}_VERSION) - - if(DEFINED MPI_${LANG}_VERSION) - if(NOT _MPI_MIN_VERSION OR _MPI_MIN_VERSION VERSION_GREATER MPI_${LANG}_VERSION) - set(_MPI_MIN_VERSION MPI_${LANG}_VERSION) - endif() - endif() - endif() -endforeach() - -unset(_MPI_REQ_VARS) -foreach(LANG IN ITEMS C CXX Fortran) - if((NOT MPI_FIND_COMPONENTS AND CMAKE_${LANG}_COMPILER_LOADED) OR LANG IN_LIST MPI_FIND_COMPONENTS) - list(APPEND _MPI_REQ_VARS "MPI_${LANG}_FOUND") - endif() -endforeach() - -if(MPICXX IN_LIST MPI_FIND_COMPONENTS) - list(APPEND _MPI_REQ_VARS "MPI_MPICXX_FOUND") -endif() - -find_package_handle_standard_args(MPI - REQUIRED_VARS ${_MPI_REQ_VARS} - VERSION_VAR ${_MPI_MIN_VERSION} - HANDLE_COMPONENTS) - -#============================================================================= -# More backward compatibility stuff - -# For compatibility reasons, we also define MPIEXEC -set(MPIEXEC "${MPIEXEC_EXECUTABLE}") - -# Copy over MPI__INCLUDE_PATH from the assembled INCLUDE_DIRS. -foreach(LANG IN ITEMS C CXX Fortran) - if(MPI_${LANG}_FOUND) - set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}") - unset(MPI_${LANG}_COMPILE_FLAGS) - if(MPI_${LANG}_COMPILE_OPTIONS) - set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}") - endif() - if(MPI_${LANG}_COMPILE_DEFINITIONS) - foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS) - string(APPEND MPI_${LANG}_COMPILE_FLAGS " -D${_MPI_DEF}") - endforeach() - endif() - endif() -endforeach() - -# Bare MPI sans ${LANG} vars are set to CXX then C, depending on what was found. -# This mimics the behavior of the old language-oblivious FindMPI. -set(_MPI_OLD_VARS COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) -if (MPI_CXX_FOUND) - foreach (var ${_MPI_OLD_VARS}) - set(MPI_${var} ${MPI_CXX_${var}}) - endforeach() -elseif (MPI_C_FOUND) - foreach (var ${_MPI_OLD_VARS}) - set(MPI_${var} ${MPI_C_${var}}) - endforeach() -endif() - -# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. -if (MPI_LIBRARIES) - list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) - set(MPI_LIBRARY "${MPI_LIBRARY_WORK}") - unset(MPI_LIBRARY_WORK) -else() - set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND") -endif() - -list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) -if (MPI_NUMLIBS GREATER 1) - set(MPI_EXTRA_LIBRARY_WORK "${MPI_LIBRARIES}") - list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) - set(MPI_EXTRA_LIBRARY "${MPI_EXTRA_LIBRARY_WORK}") - unset(MPI_EXTRA_LIBRARY_WORK) -else() - set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") -endif() -set(MPI_IGNORE_LEGACY_VARIABLES TRUE) -#============================================================================= - -# unset these vars to cleanup namespace -unset(_MPI_OLD_VARS) -unset(_MPI_PREFIX_PATH) -unset(_MPI_BASE_DIR) -foreach (lang C CXX Fortran) - unset(_MPI_${LANG}_COMPILER_NAMES) -endforeach() - -cmake_policy(POP) diff --git a/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in b/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in deleted file mode 100644 index 30f912c..0000000 --- a/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in +++ /dev/null @@ -1,4 +0,0 @@ - program mpi_ver - @MPI_Fortran_INCLUDE_LINE@ - print *, 'INFO:SUBARRAYS[', MPI_SUBARRAYS_SUPPORTED, ']-ASYNCPROT[', MPI_ASYNC_PROTECTS_NONBLOCKING, ']' - end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.c b/config/cmake_ext_mod/FindMPI/libver_mpi.c deleted file mode 100644 index be9d19d..0000000 --- a/config/cmake_ext_mod/FindMPI/libver_mpi.c +++ /dev/null @@ -1,19 +0,0 @@ -#include - -#ifdef __cplusplus -#include -#else -#include -#endif - -int main(int argc, char* argv[]) -{ - char mpilibver_str[MPI_MAX_LIBRARY_VERSION_STRING]; - int mpilibver_len; - MPI_Get_library_version(mpilibver_str, &mpilibver_len); -#ifdef __cplusplus - std::puts(mpilibver_str); -#else - puts(mpilibver_str); -#endif -} diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in b/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in deleted file mode 100644 index 7938587..0000000 --- a/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in +++ /dev/null @@ -1,7 +0,0 @@ - program mpi_ver - @MPI_Fortran_INCLUDE_LINE@ - character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: mpilibver_str - integer(kind=MPI_INTEGER_KIND) :: ierror, reslen - call MPI_GET_LIBRARY_VERSION(mpilibver_str, reslen, ierror) - print *, mpilibver_str - end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/mpiver.f90.in b/config/cmake_ext_mod/FindMPI/mpiver.f90.in deleted file mode 100644 index a254523..0000000 --- a/config/cmake_ext_mod/FindMPI/mpiver.f90.in +++ /dev/null @@ -1,10 +0,0 @@ - program mpi_ver - @MPI_Fortran_INCLUDE_LINE@ - integer(kind=kind(MPI_VERSION)), parameter :: zero = ichar('0') - character, dimension(17), parameter :: mpiver_str =& - (/ 'I', 'N', 'F', 'O', ':', 'M', 'P', 'I', '-', 'V', 'E', 'R', '[', & - char(zero + MPI_VERSION), & - '.', & - char(zero + MPI_SUBVERSION), ']' /) - print *, mpiver_str - end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.c b/config/cmake_ext_mod/FindMPI/test_mpi.c deleted file mode 100644 index b8a308a..0000000 --- a/config/cmake_ext_mod/FindMPI/test_mpi.c +++ /dev/null @@ -1,37 +0,0 @@ -#include - -#ifdef __cplusplus -#include -#else -#include -#endif - -#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) -const char mpiver_str[] = { 'I', 'N', - 'F', 'O', - ':', 'M', - 'P', 'I', - '-', 'V', - 'E', 'R', - '[', ('0' + MPI_VERSION), - '.', ('0' + MPI_SUBVERSION), - ']', '\0' }; -#endif - -int main(int argc, char* argv[]) -{ -#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) -#ifdef __cplusplus - std::puts(mpiver_str); -#else - puts(mpiver_str); -#endif -#endif -#ifdef TEST_MPI_MPICXX - MPI::MPI_Init(&argc, &argv); - MPI::MPI_Finalize(); -#else - MPI_Init(&argc, &argv); - MPI_Finalize(); -#endif -} diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.f90.in b/config/cmake_ext_mod/FindMPI/test_mpi.f90.in deleted file mode 100644 index 4d43a04..0000000 --- a/config/cmake_ext_mod/FindMPI/test_mpi.f90.in +++ /dev/null @@ -1,6 +0,0 @@ - program hello - @MPI_Fortran_INCLUDE_LINE@ - integer@MPI_Fortran_INTEGER_LINE@ ierror - call MPI_INIT(ierror) - call MPI_FINALIZE(ierror) - end program diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e9430d9..4da8405 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 7864f2d..8c7b8f6 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 9adf8bd..8b7333a 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 9bf1719..64cf739 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 67d377f..b71a8eb 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index b1cf9d2..979d305 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index eac6df0..54d5976 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index c5b4a72..71e5bb3 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index bf96fba..25158f2 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 28f860f..c0cc09e 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 28b5eb8..b48d147 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index dd94da0..79dfee1 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 37c5cc9..7955de2 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index ff0403a..411ceea 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 7a2eff1..82be551 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 1ec4b93..5c83d03 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 62e8c21..0daa86e 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 1f2ea17..6b3c764 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index ab71a7e..67e0ccb 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS C CXX) add_subdirectory (gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index b50bbf7..2697dfd 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS_GIF2H5) #----------------------------------------------------------------------------- diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index a1697cd..5de655e 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_HL_TOOLS_H5WATCH) #----------------------------------------------------------------------------- diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index d8cd358..fc057f7 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT ( HDF5_JAVA C Java ) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index d43b49f..3d1e30e 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES) add_subdirectory (datasets) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index ed4559c..6a90cd1 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 71cf83e..73111ed 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index dc5d834..6b55359 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 59fe48b..65db3fe 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 7075d32..0c00923 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index 35b436d..ecff984 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_HDF) add_subdirectory (hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index 1f2587e..9506fc1 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 8ab275e..96e7035 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_JNI C CXX) set (HDF5_JAVA_JNI_CSRCS diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 329c602..6158055 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 923bba3..f30c1b3 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -648,7 +648,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 8dd47c2..b516056 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -180,7 +180,7 @@ Given the preconditions in section I, create a CMakeLists.txt file at the source root. Include the following text in the file: ########################################################## -cmake_minimum_required (VERSION 3.10.1) +cmake_minimum_required (VERSION 3.10) project (HDF5MyApp C CXX) set (LIB_TYPE STATIC) # or SHARED @@ -229,7 +229,7 @@ your application with an installed HDF5 binary. ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake ======================================================================== -cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.10) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d10870d..c506ebb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fd88b5f..b3b6f5c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 3cee808..b1b9ce1 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index e02d3eb..5576f5c 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index addaf2e..db06b9a 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 5a25f76..9364658 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 606516f..8423e5a 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 2ff5817..9e9f1ea 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 491ec4b..1133218 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 712dd87..4acc999 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index efb0ad2..d628c9b 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 9035ed9..59caf44 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 71b3d1d..e9ecd44 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 3fefd24..211c947 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index cc8bee2..7842aa8 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 78ba238..948c6d4 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_SRC_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index 54dd5a2..f194d7a 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST) #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 2f5f314..1f817fb 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index cedc932..aae6327 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 1941764..6a12f5e 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 5287ae0..a27c78a 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 5492363..2cb212a 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 17dda3c..b623860 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index e92533f..8549046 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index a606ac6..50eb0af 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 0d07753..5f645097 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 178767a..084751a 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 5b34c43..50aade4 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) #----------------------------------------------------------------------------- diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index b7452e0..5104b90 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_PERFORM ) #----------------------------------------------------------------------------- -- cgit v0.12 From 2d0a0859b22d81cb82d7ff7b6f6481d272d9db71 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 9 Mar 2018 12:45:22 -0600 Subject: Remove obsolete comments --- CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebbeda5..5ac4c60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -671,12 +671,6 @@ if (HDF5_ENABLE_THREADSAFE) endif () endif () -# ----------------------------------------------------------------------- -# wrapper script variables -# -#set (CFLAGS "${C_DEFINES}") -#set (CXXFLAGS "${CXX_DEFINES}") - #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- @@ -806,11 +800,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for endif () endif () - # ----------------------------------------------------------------------- - # wrapper script variables - # -# set (FCFLAGS "${Fortran_DEFINES}") - add_subdirectory (fortran) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") -- cgit v0.12 From 75db73efc514aff2af63618cc7be357fc4e77cb6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 9 Mar 2018 12:49:26 -0600 Subject: Add release note --- release_docs/RELEASE.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 0061910..a70802e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -56,6 +56,16 @@ New Features ------------- - CMake + Change minimum version to 3.10. + + This change removes the need to support a copy of the FindMPI.cmake module, + which has been removed, along with its subfolder in the config/cmake_ext_mod + location. + + (ADB - 2018/03/09) + + - CMake + Add pkg-config file generation Added pkg-config file generation for the C, C++, HL, and HL C++ libraries. -- cgit v0.12 From 4731819b0e4f6e13aff9d040ba89c0bd6d4d67ca Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 20:44:37 -0600 Subject: Improve code Description: Added notes and changed argument to H5Fcreate to clarify the latest situation Platforms tested: Linux/64 (jelly) --- test/gen_bounds.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 9702176..7b670f7 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -267,11 +267,13 @@ error: /*********************************************************************** * gen_latest_latest() creates file "bounds_latest_latest.h5" * - * File contents: - * - Version 3 superblock (triggered by H5Fcreate with H5F_ACC_SWMR_WRITE) - * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts) + * NOTE: As of March 2018, latest is 1.10. * - * NOTE: As of Feb 2018, latest is 1.10. + * File contents: + * - Version 3 superblock (NOTE: this can also be triggered by passing in + * H5F_ACC_SWMR_WRITE, in place of H5F_ACC_TRUNC, to H5Fcreate) + * - A chunked dataset with layout version 4, "DS_chunked_layout_4". + * (triggered by H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) * * Return: SUCCEED/FAIL * @@ -279,6 +281,7 @@ error: static herr_t gen_latest_latest(void) { hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ hid_t space = -1; /* Dataspace ID */ hid_t dset = -1; /* Dataset ID */ @@ -289,8 +292,16 @@ static herr_t gen_latest_latest(void) int i, j; herr_t ret = SUCCEED; /* Generic return value */ - /* Create file with H5F_ACC_SWMR_WRITE, triggers version 3 superblock */ - fid = H5Fcreate(FILENAME_L_L, H5F_ACC_SWMR_WRITE, H5P_DEFAULT, H5P_DEFAULT); + /* Create file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; + + /* Set the "use the latest/latest version of the format" bounds + for creating objects in the file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR; + + /* Create the file with version 3 superblock */ + fid = H5Fcreate(FILENAME_L_L, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); if (fid < 0) TEST_ERROR; /* @@ -351,6 +362,8 @@ error: /*********************************************************************** * gen_v18_latest() creates file "bounds_v18_latest.h5" * + * NOTE: As of March 2018, latest is 1.10. + * * File contents: * - Version 2 superblock * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default) -- cgit v0.12 From 539f4691fa1cd9e86965106ce69b08d3e18a80a9 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 21:29:28 -0600 Subject: Added C++ wrappers - HDFFV-10149 Description: Added the following wrappers to class H5::Group: + H5Lcreate_soft: // Creates a soft link from link_name to target_name. void newLink(const char *target_name, const char *link_name,...) void newLink(const H5std_string& target_name,...) + H5Lcreate_hard: // Creates a hard link from new_name to curr_name. void newLink(const char *curr_name, const Group& new_loc,...) void newLink(const H5std_string& curr_name, const Group& new_loc,...) // Creates a hard link from new_name to curr_name in same location. void newLink(const char *curr_name, const hid_t same_loc,...) void newLink(const H5std_string& curr_name, const hid_t same_loc,...) + H5Lcopy: // Copy an object from a group of file to another. void copyLink(const char *src_name, const Group& dst,...) void copyLink(const H5std_string& src_name, const Group& dst,...) // Copy an object from a group of file to the same location. void copyLink(const char *src_name, const char *dst_name,...) void copyLink(const H5std_string& src_name,...) + H5Lmove: // Rename an object in a group or file to a new location. void moveLink(const char* src_name, const Group& dst,...) void moveLink(const H5std_string& src_name, const Group& dst,...) // Rename an object in a group or file to the same location. void moveLink(const char* src_name, const char* dst_name,...) void moveLink(const H5std_string& src_name,...) Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) Darwin (osx1010test) --- c++/src/H5Group.cpp | 311 ++++++++++++++++++++++++++++++++++++--- c++/src/H5Group.h | 69 +++++++++ c++/src/H5Location.cpp | 3 + c++/test/tlinks.cpp | 391 +++++++++++++++++++++++++++++++++---------------- 4 files changed, 628 insertions(+), 146 deletions(-) diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index c0e0dd1..aa27a18 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -76,6 +76,297 @@ void Group::closeObjId(hid_t obj_id) const } } +/*** For H5L API ***/ + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief Creates a soft link from \a link_name to \a target_name. +///\param target_name - IN: Name of object, can be a non-existing object +///\param link_name - IN: Link name for the target name +///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT +///\param lapl - IN: Link access plist - default to PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the current +/// location. +/// For information on creating a soft link, please refer to the +/// H5Lcreate_soft APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const char *target_name, const char *link_name, + const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_soft(target_name, id, link_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("newLink", "creating soft link failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a target_name and \a link_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const H5std_string& target_name, const H5std_string& + link_name, const PropList& lcpl, const PropList& lapl) const +{ + newLink(target_name.c_str(), link_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief Creates a hard link from \a new_name to \a curr_name. +///\param curr_name - IN: Name of the existing object +///\param new_name - IN: New name for the object +///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT +///\param lapl - IN: Link access plist - default to PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const char *curr_name, const Group& new_loc, + const char *new_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value = -1; + hid_t new_loc_id = new_loc.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); + if (ret_value < 0) + throwException("newLink", "creating link failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a curr_name and \a new_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const H5std_string& curr_name, const Group& new_loc, + const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const +{ + newLink(curr_name.c_str(), new_loc, new_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief Creates a hard link from \a new_name to \a curr_name - can be +/// used to pass in H5L_SAME_LOC. +///\param curr_name - IN: Name of the existing object +///\param new_name - IN: New name for the object +///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT +///\param lapl - IN: Link access plist - default to PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const char *curr_name, const hid_t same_loc, + const char *new_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT); + + if (ret_value < 0) + throwException("newLink", "creating link failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::newLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a curr_name and \a new_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::newLink(const H5std_string& curr_name, const hid_t same_loc, + const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const +{ + newLink(curr_name.c_str(), same_loc, new_name.c_str(), lcpl, lapl); +} + + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\brief Copies a link from one location to another. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const char *src_name, + const Group& dst, const char *dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + copyLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\brief Copies a link to the same location. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const char *src_name, + const char *dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::copyLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::copyLink(const H5std_string& src_name, + const H5std_string& dst_name, const PropList& lcpl, + const PropList& lapl) const +{ + copyLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\brief Renames an object in a group/file and moves it to a new location. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\note +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with Group::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const char* src_name, const Group& dst, const char* dst_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("moveLink", "H5Lmove failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const H5std_string& src_name, const Group& dst, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const +{ + moveLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\brief Renames an object in a group or file to the same location. +///\param src - IN: Source location +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default PropList::DEFAULT +///\param lapl - IN: Link access plist - default PropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\note +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with Group::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const char* src_name, const char* dst_name, const PropList& lcpl, const PropList& lapl) const +{ + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("moveLink", "H5Lmove H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: Group::moveLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void Group::moveLink(const H5std_string& src_name, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const +{ + moveLink(src_name.c_str(), H5L_SAME_LOC, dst_name.c_str(), lcpl, lapl); +} + +/*** End of H5L API section ***/ + //-------------------------------------------------------------------------- // Function: Group::getLocId // Purpose: Get the id of this group @@ -123,26 +414,6 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const } //-------------------------------------------------------------------------- -// Function: Group overload constructor - dereference -// brief Given a reference, ref, to an hdf5 group, creates a Group objec -// param attr - IN: Specifying location where the referenced object is i -// param ref - IN: Reference pointer -// param ref_type - IN: Reference type - default to H5R_OBJECT -// param plist - IN: Property list - default to PropList::DEFAULT -// exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 -// Modification -// Mar, 2017 -// Removed in 1.10.1 because H5Location is Attribute's baseclass -// now. -BMR -//-------------------------------------------------------------------------- -/* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) -{ - id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); -} - */ - -//-------------------------------------------------------------------------- // Function: Group::getNumObjs ///\brief Returns the number of objects in this group. ///\return Number of objects diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index b3a9007..d95d996 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -50,6 +50,75 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Closes an object opened by getObjId(). void closeObjId(hid_t obj_id) const; + /*** For H5L API ***/ + + // Creates a soft link from link_name to target_name. + void newLink(const char *target_name, const char *link_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void newLink(const H5std_string& target_name, + const H5std_string& link_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name. + void newLink(const char *curr_name, + const Group& new_loc, const char *new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void newLink(const H5std_string& curr_name, + const Group& new_loc, const H5std_string& new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name in same location. + void newLink(const char *curr_name, + const hid_t same_loc, const char *new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void newLink(const H5std_string& curr_name, + const hid_t same_loc, const H5std_string& new_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Copy an object from a group of file to another. + void copyLink(const char *src_name, + const Group& dst, const char *dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Copy an object from a group of file to the same location. + void copyLink(const char *src_name, const char *dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Rename an object in a group or file to a new location. + void moveLink(const char* src_name, + const Group& dst, const char* dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + + // Rename an object in a group or file to the same location. + void moveLink(const char* src_name, const char* dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const H5std_string& dst_name, + const PropList& lcpl = PropList::DEFAULT, + const PropList& lapl = PropList::DEFAULT) const; + // default constructor Group(); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 95c96ad..3ca080e 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -951,6 +951,9 @@ DataSet H5Location::openDataSet(const H5std_string& name) const // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR +// Mar 2018: Inadequate functionality, new hard link is only in +// H5L_SAME_LOC. This function will be retired in favor of +// its replacement, Group::newLink(). - BMR //-------------------------------------------------------------------------- void H5Location::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const { diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index e348d64..93bd0266 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -323,11 +323,9 @@ static const char *FILENAME[] = { * Purpose Test building a file with assorted links. * * Return Success: 0 - * * Failure: -1 * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * October 16, 2009 *------------------------------------------------------------------------- */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) @@ -438,16 +436,267 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) /*------------------------------------------------------------------------- + * Function: test_move + * + * Purpose: Tests wrappers of H5Lmove() + * + * Return: Success: 0 + * Failure: number of errors + * March, 2018 + *------------------------------------------------------------------------- + */ +const H5std_string GROUP1NAME("First_group"); +const H5std_string GROUP2NAME("Second_group"); +static void +test_move(hid_t fapl_id, hbool_t new_format) +{ + char filename[1024]; + + if(new_format) + SUBTEST("Group::moveLink (w/new group format)") + else + SUBTEST("Group::moveLink") + + try + { + // Create two new files + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + h5_fixname(FILENAME[1], fapl_id, filename, sizeof filename); + H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + + // Create groups in first file + Group grp_1(file_a.createGroup(GROUP1NAME)); + Group grp_2(file_a.createGroup(GROUP2NAME)); + Group grp_move(grp_1.createGroup("group_move")); + + // Create hard and soft links + grp_1.link(H5L_TYPE_HARD, "group_move", "hard"); + grp_2.link(H5L_TYPE_SOFT, "/First_group/group_copy", "soft"); + + // Move a group across files, should fail + try { + grp_1.moveLink("group_move", file_b, "group_new_name"); + + // Should throw an exception but didn't + H5_FAILED(); + cerr << " Group group_move should not be moved across files" << endl; + } catch (Exception& E) { + // expected + } + + // Move a soft link across files, should succeed + grp_2.moveLink("soft", file_b, "soft_new_name"); + if(file_b.exists("soft_new_name") != TRUE) + throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); + + // Move a group across groups in the same file while renaming it + grp_1.moveLink("group_move", grp_2, "group_new_name"); + + // Open the group just moved to the new location. */ + Group moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + // Verify that the group is no longer in the original location + try { + moved_grp = grp_1.openGroup("group_move"); + + // Should throw an exception but didn't + H5_FAILED(); + cerr << " Group group_move should not be in original location" << endl; + } catch (Exception& E) { + // expected + } + + // Use H5Lmove to rename a group without moving it + H5std_string new_name("group_new_name"); + H5std_string newer_name("group_newer_name"); + grp_2.moveLink(new_name, newer_name); + + // Open the group + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + // Use H5Lmove to move a group without renaming it + grp_2.moveLink(newer_name, grp_1, newer_name); + + // Open the group + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + // Move the group while giving long paths + file_a.moveLink("/First_group/group_newer_name", grp_2, "/Second_group/group_newest_name"); + + // Open the group just moved to the new location + moved_grp = grp_2.openGroup("group_newest_name"); + moved_grp.close(); + + // Verify that the groups are not in previous locations + try { + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_newer_name should not be in GROUP1NAME" << endl; + } catch (Exception& E) { + // expected + } + try { + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_newer_name should not be in GROUP2NAME" << endl; + } catch (Exception& E) { + // expected + } + try { + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_new_name should not be in GROUP2NAME" << endl; + } catch (Exception& E) { + // expected + } + try { + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_copy should not be in GROUP1NAME" << endl; + } catch (Exception& E) { + // expected + } + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} + +/*------------------------------------------------------------------------- + * Function: test_copy + * + * Purpose: Tests wrappers of H5Lcopy() + * + * Return: Success: 0 + * Failure: number of errors + * March, 2018 + *------------------------------------------------------------------------- + */ +static void test_copy(hid_t fapl_id, hbool_t new_format) +{ + char filename[1024]; + + if(new_format) + SUBTEST("Group::copyLink (w/new group format)") + else + SUBTEST("Group::copyLink") + + try + { + // Create two new files + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + h5_fixname(FILENAME[1], fapl_id, filename, sizeof filename); + H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + + // Create groups in first file + Group grp_1(file_a.createGroup(GROUP1NAME)); + Group grp_2(file_a.createGroup(GROUP2NAME)); + Group grp_move(grp_1.createGroup("group_copy")); + + // Create hard and soft links + grp_1.newLink("group_copy", H5L_SAME_LOC, "hard"); + grp_2.newLink("/First_group/group_copy", "soft"); + + // Copy a group across files, should fail + try { + grp_1.copyLink("group_copy", file_b, "group_new_name"); + } catch (Exception& E) { + // expected + } + + // Copy a soft link across files, should succeed + grp_2.copyLink("soft", file_b, "soft_new_name"); + if (file_b.exists("soft_new_name") != TRUE) + throw InvalidActionException("H5File::exists", "soft_new_name doesn't exist"); + + // Move a group across groups in the same file while renaming it + H5std_string copy_name("group_copy"); + H5std_string new_name("group_new_name"); + grp_1.copyLink(copy_name, grp_2, new_name); + + // Open the group just moved to the new location. + Group moved_grp(grp_2.openGroup("group_new_name")); + moved_grp.close(); + + // Verify that the group is also in the original location + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + // Create a group in the same location with a different name + grp_2.copyLink("group_new_name", "group_newer_name"); + + // Open the group + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + // Verify that the group is also in the original location + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + // Use H5Lcopy to copy to a different location with the same name + grp_2.copyLink("group_newer_name", grp_1, "group_newer_name"); + + // Open the group + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + // Verify that the group is still in the previous location + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + // Copy the group while giving long paths + file_a.copyLink("/First_group/group_newer_name", grp_2, "/Second_group/group_newest_name"); + + // Open the newest group just moved to the new location + moved_grp = grp_2.openGroup("group_newest_name"); + moved_grp.close(); + + // Verify that the group is still in all previous original locations + moved_grp = grp_1.openGroup("group_newer_name"); + moved_grp.close(); + + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + moved_grp = grp_2.openGroup("group_new_name"); + moved_grp.close(); + + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} + + +/*------------------------------------------------------------------------- * Function: test_num_links * * Purpose Test setting and getting limit of number of links * * Return Success: 0 - * * Failure: -1 * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * October 16, 2009 *------------------------------------------------------------------------- */ static void test_num_links(hid_t fapl_id, hbool_t new_format) @@ -491,8 +740,7 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) * * Return None * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * October 16, 2009 *------------------------------------------------------------------------- */ extern "C" @@ -516,9 +764,10 @@ void test_links() if((fapl2_id = H5Pcopy(fapl_id)) < 0) throw Exception("test_links", "H5Pcopy failed"); - /* Set the "use the latest version of the format" bounds for creating objects in the file */ + /* Set the "use the latest version of the format" bounds for creating + objects in the file */ if(H5Pset_libver_bounds(fapl2_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - throw Exception("test_links", "H5Pset_libver_bounds failed"); + throw Exception("test_links", "H5Pset_libver_bounds failed"); /* Loop over using new group format */ for(new_format = FALSE; new_format <= TRUE; new_format++) @@ -534,124 +783,10 @@ void test_links() /* General tests... (on both old & new format groups */ // FileAccPropList may be passed in instead of fapl id test_basic_links(my_fapl_id, new_format); -#if 0 -// these tests are from the C test links.c and left here for future -// implementation of H5L API - nerrors += test_basic_links(fapl_id, new_format) < 0 ? 1 : 0; - nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0; - - /* Test new H5L link creation routine */ - nerrors += test_lcpl(my_fapl, new_format); - nerrors += test_move(my_fapl, new_format); - nerrors += test_copy(my_fapl, new_format); - nerrors += test_move_preserves(my_fapl, new_format); -#ifndef H5_NO_DEPRECATED_SYMBOLS - nerrors += test_deprec(my_fapl, new_format); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_self(envval, my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_pingpong(envval, my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_closing(envval, my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_endian(new_format) < 0 ? 1 : 0; - nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0; - - /* tests for external link */ - nerrors += external_link_env(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_acc_flags(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0; - -#ifdef H5_HAVE_WINDOW_PATH - nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0; -#endif - /* These tests assume that external links are a form of UD links, - * so assume that everything that passed for external links - * above has already been tested for UD links. - */ - if(new_format == TRUE) { - nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */ - nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */ - } /* end if */ - - nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0; - - /* Misc. extra tests, useful for both new & old format files */ - nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0; - - /* Keep this test last, it's testing files that are used above */ - /* do not do this for files used by external link tests */ - nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0; -#endif // 0 + test_move(my_fapl_id, new_format); + test_copy(my_fapl_id, new_format); } /* end for */ -#if 0 - /* New group revision feature tests */ - nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0; -/* XXX: when creation order indexing is fully working, go back and add checks -* to these tests to make certain that the creation order values are -* correct. -*/ - nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0; - nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0; - nerrors += corder_transition(fapl2) < 0 ? 1 : 0; - nerrors += corder_delete(fapl2) < 0 ? 1 : 0; - nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0; - nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0; - nerrors += link_iterate(fapl2) < 0 ? 1 : 0; - nerrors += open_by_idx(fapl2) < 0 ? 1 : 0; - nerrors += object_info(fapl2) < 0 ? 1 : 0; - nerrors += group_info(fapl2) < 0 ? 1 : 0; - nerrors += timestamps(fapl2) < 0 ? 1 : 0; - - /* Test new API calls on old-style groups */ - nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0; - nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0; - nerrors += link_iterate_old(fapl) < 0 ? 1 : 0; - nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0; - nerrors += object_info_old(fapl) < 0 ? 1 : 0; - nerrors += group_info_old(fapl) < 0 ? 1 : 0; - -#endif /* Close 2nd FAPL */ H5Pclose(fapl2_id); @@ -683,5 +818,9 @@ extern "C" void cleanup_links() { HDremove(FILENAME[0]); + HDremove(FILENAME[1]); } + + + -- cgit v0.12 From 801191b4c374adc462345f2c068f1cfc6f4adf97 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 9 Mar 2018 21:38:59 -0600 Subject: Upated cpp doc. --- c++/src/cpp_doc_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 6a9f171..3943f7b 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = "1.11.2" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- cgit v0.12 From 4823abf3ee0d9df1c3f23ae7e36ce4d1d146afd6 Mon Sep 17 00:00:00 2001 From: mainzer Date: Sun, 11 Mar 2018 22:32:09 -0500 Subject: Removed commented out code from H5FDmpio.c, H5FDprivate.h and H5Fint.c Tested parallel (debug and production) and serial (production) --- src/H5FDmpio.c | 88 ------------------------------------------------------- src/H5FDprivate.h | 2 -- src/H5Fint.c | 2 -- 3 files changed, 92 deletions(-) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 3fe6ed9..08b1a3f 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -56,20 +56,6 @@ static char H5FD_mpi_native_g[] = "native"; * library to determine whether the file is empty, truncated, or okay. The MPIO * driver doesn't bother to keep it updated since it's an expensive operation. */ -#if 0 /* original version */ /* JRM */ -typedef struct H5FD_mpio_t { - H5FD_t pub; /*public stuff, must be first */ - MPI_File f; /*MPIO file handle */ - MPI_Comm comm; /*communicator */ - MPI_Info info; /*file information */ - int mpi_rank; /* This process's rank */ - int mpi_size; /* Total number of processes */ - haddr_t eof; /*end-of-file marker */ - haddr_t eoa; /*end-of-address marker */ - haddr_t last_eoa; /* Last known end-of-address marker */ - haddr_t local_eof; /* Local end-of-file address for each process */ -} H5FD_mpio_t; -#else /* modified version */ /* JRM */ typedef struct H5FD_mpio_t { H5FD_t pub; /*public stuff, must be first */ MPI_File f; /*MPIO file handle */ @@ -88,7 +74,6 @@ typedef struct H5FD_mpio_t { /* as soon as be make the necessary */ /* VFD API change. */ } H5FD_mpio_t; -#endif /* modified version */ /* JRM */ /* Private Prototypes */ @@ -1060,10 +1045,8 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, file->eof = H5FD_mpi_MPIOff_to_haddr(size); file->local_eof = file->eof; -#if 1 /* JRM */ /* Mark initial barriers in H5FD_mpio_truncate() as necessary */ file->do_pre_trunc_barrier = TRUE; -#endif /* JRM */ /* Set return value */ ret_value=(H5FD_t*)file; @@ -1956,75 +1939,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_flush() */ -#if 0 /* original version */ - -/*------------------------------------------------------------------------- - * Function: H5FD_mpio_truncate - * - * Purpose: Make certain the file's size matches it's allocated size - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * January 31, 2008 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) -{ - H5FD_mpio_t *file = (H5FD_mpio_t*)_file; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#ifdef H5FDmpio_DEBUG - if(H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "Entering %s\n", FUNC); -#endif - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); - - /* Extend the file to make sure it's large enough, then sync. - * Unfortunately, keeping track of EOF is an expensive operation, so - * we can't just check whether EOFeoa > file->last_eoa) { - int mpi_code; /* mpi return code */ - MPI_Offset mpi_off; - - if(H5FD_mpi_haddr_to_MPIOff(file->eoa, &mpi_off) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset") - - /* Extend the file's size */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, mpi_off))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) - - /* Don't let any proc return until all have extended the file. - * (Prevents race condition where some processes go ahead and write - * more data to the file before all the processes have finished making - * it the shorter length, potentially truncating the file and dropping - * the new data written) - */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) - - /* Update the 'last' eoa value */ - file->last_eoa = file->eoa; - } /* end if */ - -done: -#ifdef H5FDmpio_DEBUG - if(H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "Leaving %s\n", FUNC); -#endif - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mpio_truncate() */ - -#else /* modified versin */ - /*------------------------------------------------------------------------- * Function: H5FD_mark_pre_trunc_barrier_unecessary @@ -2192,8 +2106,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpio_truncate() */ -#endif /* modified version */ - /*------------------------------------------------------------------------- * Function: H5FD_mpio_mpi_rank diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index f7be327..f7cd931 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -203,9 +203,7 @@ H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info); -#if 1 /* JRM */ H5_DLL void H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file); -#endif /* JRM */ #endif /* H5_HAVE_PARALLEL */ #endif /* !_H5FDprivate_H */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 135d878..cc5931a 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1788,7 +1788,6 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Truncate the file to the current allocated size */ -#if 1 /* JRM */ #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { /* Since we just returned from a call to H5AC_flush(), we just @@ -1798,7 +1797,6 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi H5FD_mpio_mark_pre_trunc_barrier_unecessary(f->shared->lf); } #endif /* H5_HAVE_PARALLEL */ -#endif /* JRM */ if(H5FD_truncate(f->shared->lf, meta_dxpl_id, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") -- cgit v0.12 From 3494282d42bf6147b32a10162353920f9e8b5a6a Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 11 Mar 2018 23:36:48 -0500 Subject: HDFFV-10149 continued Description: - Moved the new wrappers committed on Mar 9: 43158f3bb352f374c31556a5d0dc463a09e0b32e to H5Location and renamed some of them for overloading. This is because the loc_id in the C APIs can be file, group, dataset, named datatype, and attribute. Previous implementation was wrong following some inaccurate C API reference manual. - Only the following wrappers are modified or added: + H5Lcreate_soft: changed name from newLink to link // Creates a soft link from link_name to target_name. void link(const char *target_name, const char *link_name,...) void link(const H5std_string& target_name,...) + H5Lcreate_hard: changed name from newLink to link // Creates a hard link from new_name to curr_name. void link(const char *curr_name, const Group& new_loc,...) void link(const H5std_string& curr_name, const Group& new_loc,...) // Creates a hard link from new_name to curr_name in same location. void link(const char *curr_name, const hid_t same_loc,...) void link(const H5std_string& curr_name, const hid_t same_loc,...) + H5Ldelete: modified existing functions to add 2nd argument // Removes the specified link from this location. void unlink(const char *link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) void unlink(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) - copyLink and moveLink were only moved from Group to H5Location, no change - Added class LinkCreatPropList - Added overloaded functions H5Location::createGroup to take a link creation property list Group createGroup(const char* name, const LinkCreatPropList& lcpl) Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) - Added wrapper for H5Lget_info() to H5Location H5L_info_t getLinkInfo(const H5std_string& link_name,...) Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) Darwin (osx1010test) --- c++/src/H5AbstractDs.cpp | 1 + c++/src/H5ArrayType.cpp | 1 + c++/src/H5AtomType.cpp | 1 + c++/src/H5Attribute.cpp | 1 + c++/src/H5CommonFG.cpp | 1 + c++/src/H5CompType.cpp | 1 + c++/src/H5Cpp.h | 1 + c++/src/H5DataSet.cpp | 1 + c++/src/H5DataType.cpp | 3 + c++/src/H5DcreatProp.cpp | 1 + c++/src/H5EnumType.cpp | 1 + c++/src/H5File.cpp | 1 + c++/src/H5FloatType.cpp | 1 + c++/src/H5Group.cpp | 292 +----------------------------- c++/src/H5Group.h | 69 -------- c++/src/H5IntType.cpp | 1 + c++/src/H5LcreatProp.cpp | 146 +++++++++++++++ c++/src/H5LcreatProp.h | 71 ++++++++ c++/src/H5Library.cpp | 1 + c++/src/H5Location.cpp | 451 +++++++++++++++++++++++++++++++++++++++++++---- c++/src/H5Location.h | 86 ++++++++- c++/src/H5Object.cpp | 1 + c++/src/H5PredType.cpp | 1 + c++/src/H5StrType.cpp | 1 + c++/src/H5VarLenType.cpp | 1 + c++/src/Makefile.am | 34 ++-- c++/test/tlinks.cpp | 127 ++++++++++++- 27 files changed, 875 insertions(+), 422 deletions(-) create mode 100644 c++/src/H5LcreatProp.cpp create mode 100644 c++/src/H5LcreatProp.h diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index b900b90..823e873 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -22,6 +22,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 76e7532..49c31d2 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 4e19850..5c24cf9 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index cbf3029..d90857f 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -27,6 +27,7 @@ #include "H5FcreatProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index af5ba0e..979816b 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -22,6 +22,7 @@ #include "H5DxferProp.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index d357fbc..28aa6cd 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h index 09914e8..b9da80a 100644 --- a/c++/src/H5Cpp.h +++ b/c++/src/H5Cpp.h @@ -25,6 +25,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 9e0f9ff..fb9b57e 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -28,6 +28,7 @@ #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 4b06c0a..032937d 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -28,6 +28,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" @@ -244,6 +245,7 @@ void DataType::copy(const DataSet& dset) throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataType::p_decode // Purpose Returns an id of a type by decoding the binary object @@ -272,6 +274,7 @@ hid_t DataType::p_decode() const return(encoded_dtype_id); } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataType::decode diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 2946730..6ed77e3 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -20,6 +20,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 02ae5a3..91866d7 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -22,6 +22,7 @@ #include "H5DcreatProp.h" #include "H5DxferProp.h" #include "H5DataSpace.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 57ee4d5..2c7ac51 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -27,6 +27,7 @@ #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 794c27d..9703149 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index aa27a18..c4c7017 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -27,6 +27,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" @@ -76,297 +77,6 @@ void Group::closeObjId(hid_t obj_id) const } } -/*** For H5L API ***/ - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief Creates a soft link from \a link_name to \a target_name. -///\param target_name - IN: Name of object, can be a non-existing object -///\param link_name - IN: Link name for the target name -///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT -///\param lapl - IN: Link access plist - default to PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\par Description -/// Note that both names are interpreted relative to the current -/// location. -/// For information on creating a soft link, please refer to the -/// H5Lcreate_soft APIs in the HDF5 C Reference Manual. -// March 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const char *target_name, const char *link_name, - const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value = -1; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcreate_soft(target_name, id, link_name, lcpl_id, lapl_id); - if (ret_value < 0) - throwException("newLink", "creating soft link failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a target_name and \a link_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const H5std_string& target_name, const H5std_string& - link_name, const PropList& lcpl, const PropList& lapl) const -{ - newLink(target_name.c_str(), link_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief Creates a hard link from \a new_name to \a curr_name. -///\param curr_name - IN: Name of the existing object -///\param new_name - IN: New name for the object -///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT -///\param lapl - IN: Link access plist - default to PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\par Description -/// Note that both names are interpreted relative to the -/// specified location. -/// For information on creating a hard link, please refer to the -/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. -// March 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const char *curr_name, const Group& new_loc, - const char *new_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value = -1; - hid_t new_loc_id = new_loc.getId(); - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); - if (ret_value < 0) - throwException("newLink", "creating link failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a curr_name and \a new_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const H5std_string& curr_name, const Group& new_loc, - const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const -{ - newLink(curr_name.c_str(), new_loc, new_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief Creates a hard link from \a new_name to \a curr_name - can be -/// used to pass in H5L_SAME_LOC. -///\param curr_name - IN: Name of the existing object -///\param new_name - IN: New name for the object -///\param lcpl - IN: Link creation plist - default to PropList::DEFAULT -///\param lapl - IN: Link access plist - default to PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\par Description -/// Note that both names are interpreted relative to the -/// specified location. -/// For information on creating a hard link, please refer to the -/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. -// March 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const char *curr_name, const hid_t same_loc, - const char *new_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value = -1; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT); - - if (ret_value < 0) - throwException("newLink", "creating link failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::newLink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a curr_name and \a new_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::newLink(const H5std_string& curr_name, const hid_t same_loc, - const H5std_string& new_name, const PropList& lcpl, const PropList& lapl) const -{ - newLink(curr_name.c_str(), same_loc, new_name.c_str(), lcpl, lapl); -} - - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\brief Copies a link from one location to another. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst - IN: Destination location -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const char *src_name, - const Group& dst, const char *dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - herr_t ret_value; - hid_t dst_id = dst.getId(); - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcopy(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); - if(ret_value < 0) - throwException("copyLink", "H5Lcopy failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a src_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const H5std_string& src_name, - const Group& dst, const H5std_string& dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - copyLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\brief Copies a link to the same location. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const char *src_name, - const char *dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - herr_t ret_value; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lcopy(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); - if(ret_value < 0) - throwException("copyLink", "H5Lcopy H5L_SAME_LOC failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::copyLink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a src_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::copyLink(const H5std_string& src_name, - const H5std_string& dst_name, const PropList& lcpl, - const PropList& lapl) const -{ - copyLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\brief Renames an object in a group/file and moves it to a new location. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst - IN: Destination location -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\note -/// Exercise care in moving groups as it is possible to render -/// data in a file inaccessible with Group::moveLink. Please refer -/// to the Group Interface in the HDF5 User's Guide for details. -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const char* src_name, const Group& dst, const char* dst_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value; - hid_t dst_id = dst.getId(); - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lmove(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); - if (ret_value < 0) - throwException("moveLink", "H5Lmove failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a src_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const H5std_string& src_name, const Group& dst, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const -{ - moveLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\brief Renames an object in a group or file to the same location. -///\param src - IN: Source location -///\param src_name - IN: Original name -///\param dst_name - IN: New name -///\param lcpl - IN: Link creation plist - default PropList::DEFAULT -///\param lapl - IN: Link access plist - default PropList::DEFAULT -///\exception H5::FileIException or H5::GroupIException -///\note -/// Exercise care in moving groups as it is possible to render -/// data in a file inaccessible with Group::moveLink. Please refer -/// to the Group Interface in the HDF5 User's Guide for details. -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const char* src_name, const char* dst_name, const PropList& lcpl, const PropList& lapl) const -{ - herr_t ret_value; - hid_t lcpl_id = lcpl.getId(); - hid_t lapl_id = lapl.getId(); - - ret_value = H5Lmove(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); - if (ret_value < 0) - throwException("moveLink", "H5Lmove H5L_SAME_LOC failed"); -} - -//-------------------------------------------------------------------------- -// Function: Group::moveLink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a src_name and \a dst_name. -///\exception H5::FileIException or H5::GroupIException -// March, 2018 -//-------------------------------------------------------------------------- -void Group::moveLink(const H5std_string& src_name, const H5std_string& dst_name, const PropList& lcpl, const PropList& lapl) const -{ - moveLink(src_name.c_str(), H5L_SAME_LOC, dst_name.c_str(), lcpl, lapl); -} - -/*** End of H5L API section ***/ - //-------------------------------------------------------------------------- // Function: Group::getLocId // Purpose: Get the id of this group diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index d95d996..b3a9007 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -50,75 +50,6 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Closes an object opened by getObjId(). void closeObjId(hid_t obj_id) const; - /*** For H5L API ***/ - - // Creates a soft link from link_name to target_name. - void newLink(const char *target_name, const char *link_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void newLink(const H5std_string& target_name, - const H5std_string& link_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Creates a hard link from new_name to curr_name. - void newLink(const char *curr_name, - const Group& new_loc, const char *new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void newLink(const H5std_string& curr_name, - const Group& new_loc, const H5std_string& new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Creates a hard link from new_name to curr_name in same location. - void newLink(const char *curr_name, - const hid_t same_loc, const char *new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void newLink(const H5std_string& curr_name, - const hid_t same_loc, const H5std_string& new_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Copy an object from a group of file to another. - void copyLink(const char *src_name, - const Group& dst, const char *dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void copyLink(const H5std_string& src_name, - const Group& dst, const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Copy an object from a group of file to the same location. - void copyLink(const char *src_name, const char *dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void copyLink(const H5std_string& src_name, - const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Rename an object in a group or file to a new location. - void moveLink(const char* src_name, - const Group& dst, const char* dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void moveLink(const H5std_string& src_name, - const Group& dst, const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - - // Rename an object in a group or file to the same location. - void moveLink(const char* src_name, const char* dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - void moveLink(const H5std_string& src_name, - const H5std_string& dst_name, - const PropList& lcpl = PropList::DEFAULT, - const PropList& lapl = PropList::DEFAULT) const; - // default constructor Group(); diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index f68e858..38191bc 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp new file mode 100644 index 0000000..4f8bffc --- /dev/null +++ b/c++/src/H5LcreatProp.cpp @@ -0,0 +1,146 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * 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. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "H5Include.h" +#include "H5Exception.h" +#include "H5IdComponent.h" +#include "H5PropList.h" +#include "H5LcreatProp.h" + +namespace H5 { + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control +// the order of creation and deletion of the global constants. See Design Notes +// in "H5PredType.cpp" for information. + +// Initialize a pointer for the constant +LinkCreatPropList* LinkCreatPropList::DEFAULT_ = 0; + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::getConstant +// Creates a LinkCreatPropList object representing the HDF5 constant +// H5P_LINK_CREATE, pointed to by LinkCreatPropList::DEFAULT_ +// exception H5::PropListIException +// Description +// If LinkCreatPropList::DEFAULT_ already points to an allocated +// object, throw a PropListIException. This scenario should not +// happen. +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList* LinkCreatPropList::getConstant() +{ + // Tell the C library not to clean up, H5Library::termH5cpp will call + // H5close - more dependency if use H5Library::dontAtExit() + if (!IdComponent::H5dontAtexit_called) + { + (void) H5dont_atexit(); + IdComponent::H5dontAtexit_called = true; + } + + // If the constant pointer is not allocated, allocate it. Otherwise, + // throw because it shouldn't be. + if (DEFAULT_ == 0) + DEFAULT_ = new LinkCreatPropList(H5P_LINK_CREATE); + else + throw PropListIException("LinkCreatPropList::getConstant", "LinkCreatPropList::getConstant is being invoked on an allocated DEFAULT_"); + return(DEFAULT_); +} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::deleteConstants +// Purpose: Deletes the constant object that LinkCreatPropList::DEFAULT_ +// points to. +// exception H5::PropListIException +// December, 2016 +//-------------------------------------------------------------------------- +void LinkCreatPropList::deleteConstants() +{ + if (DEFAULT_ != 0) + delete DEFAULT_; +} + +//-------------------------------------------------------------------------- +// Purpose: Constant for default property +//-------------------------------------------------------------------------- +const LinkCreatPropList& LinkCreatPropList::DEFAULT = *getConstant(); + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +//-------------------------------------------------------------------------- +// Function: Default Constructor +///\brief Creates a file access property list +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::LinkCreatPropList() : PropList(H5P_LINK_CREATE) {} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: LinkCreatPropList instance to copy +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::LinkCreatPropList(const LinkCreatPropList& original) : PropList(original) {} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::LinkCreatPropList(const hid_t plist_id) : PropList(plist_id) {} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::setCharEncoding +///\brief Sets the character encoding of the string. +///\exception H5::PropListIException +// March, 2018 +//-------------------------------------------------------------------------- +void LinkCreatPropList::setCharEncoding(H5T_cset_t encoding) const +{ + herr_t ret_value = H5Pset_char_encoding(id, encoding); + // Throw exception if H5Pset_char_encoding returns failure + if (ret_value < 0) + { + throw PropListIException("setCharEncoding", "H5Pset_char_encoding failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList::getCharEncoding +///\brief Gets the character encoding of the string. +///\exception H5::PropListIException +// March, 2018 +//-------------------------------------------------------------------------- +H5T_cset_t LinkCreatPropList::getCharEncoding() const +{ + H5T_cset_t encoding; + herr_t ret_value = H5Pget_char_encoding(id, &encoding); + // Throw exception if H5Pget_char_encoding returns failure + if (ret_value < 0) + { + throw PropListIException("getCharEncoding", "H5Pget_char_encoding failed"); + } + return(encoding); +} + +//-------------------------------------------------------------------------- +// Function: LinkCreatPropList destructor +///\brief Noop destructor +// December, 2016 +//-------------------------------------------------------------------------- +LinkCreatPropList::~LinkCreatPropList() {} + +} // end namespace diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h new file mode 100644 index 0000000..4ac2191 --- /dev/null +++ b/c++/src/H5LcreatProp.h @@ -0,0 +1,71 @@ +// C++ informative line for the emacs editor: -*- C++ -*- +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * 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. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// Class LinkCreatPropList represents the HDF5 file access property list and +// inherits from DataType. + +#ifndef __H5LinkCreatPropList_H +#define __H5LinkCreatPropList_H + +namespace H5 { + +/*! \class LinkCreatPropList + \brief Class LinkCreatPropList inherits from PropList and provides + wrappers for the HDF5 file access property list. +*/ +// Inheritance: PropList -> IdComponent +class H5_DLLCPP LinkCreatPropList : public PropList { + public: + ///\brief Default file access property list. + static const LinkCreatPropList& DEFAULT; + + // Creates a file access property list. + LinkCreatPropList(); + + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("LinkCreatPropList"); } + + // Copy constructor: creates a copy of a LinkCreatPropList object. + LinkCreatPropList(const LinkCreatPropList& original); + + // Creates a copy of an existing file access property list + // using the property list id. + LinkCreatPropList (const hid_t plist_id); + + // Sets the character encoding of the string. + void setCharEncoding(H5T_cset_t encoding) const; + + // Gets the character encoding of the string. + H5T_cset_t getCharEncoding() const; + + // Noop destructor + virtual ~LinkCreatPropList(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + + // Deletes the global constant, should only be used by the library + static void deleteConstants(); + + private: + static LinkCreatPropList* DEFAULT_; + + // Creates the global constant, should only be used by the library + static LinkCreatPropList* getConstant(); + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +}; // end of LinkCreatPropList +} // namespace H5 + +#endif // __H5LinkCreatPropList_H diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 214c5b2..55f82f5 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -24,6 +24,7 @@ #include "H5OcreatProp.h" #include "H5DxferProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 3ca080e..c82df2c 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -12,6 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include +using namespace std; #include "H5private.h" // for HDmemset #include "H5Include.h" @@ -24,6 +26,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" @@ -750,7 +753,53 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- // Function: H5Location::createGroup -///\brief Creates a new group at this location. +///\brief Creates a new group at this location, which can be a file, +/// group, dataset, attribute, or named datatype. +///\param name - IN: Name of the group to create +///\param size_hint - IN: Indicates the number of bytes to reserve for +/// the names that will appear in the group +///\return Group instance +///\exception H5::FileIException/H5::GroupIException/H5::LocationException +///\par Description +/// The optional \a size_hint specifies how much file space to +/// reserve for storing the names that will appear in this new +/// group. If a non-positive value is provided for the \a size_hint +/// then a default size is chosen. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Group H5Location::createGroup(const char* name, const LinkCreatPropList& lcpl) const +{ + // Call C routine H5Gcreate2 to create the named group, giving the + // location id which can be a file id or a group id + hid_t group_id = H5Gcreate2(getId(), name, lcpl.getId(), H5P_DEFAULT, H5P_DEFAULT); + + // If the creation of the group failed, throw an exception + if (group_id < 0) + throwException("createGroup", "H5Gcreate2 failed"); + + // No failure, create and return the Group object + Group group; + H5Location *ptr = &group; + ptr->p_setId(group_id); + return(group); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::createGroup +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Group H5Location::createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) const +{ + return(createGroup( name.c_str(), lcpl)); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::createGroup +///\brief Creates a new group at this location, which can be a file, +/// group, dataset, attribute, or named datatype. ///\param name - IN: Name of the group to create ///\param size_hint - IN: Indicates the number of bytes to reserve for /// the names that will appear in the group @@ -795,7 +844,6 @@ Group H5Location::createGroup(const char* name, size_t size_hint) const // No failure, create and return the Group object Group group; - //group.p_setId(group_id); H5Location *ptr = &group; ptr->p_setId(group_id); return(group); @@ -933,6 +981,134 @@ DataSet H5Location::openDataSet(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::link +///\brief Creates a soft link from \a link_name to \a target_name. +///\param target_name - IN: Name of object, can be a non-existing object +///\param link_name - IN: Link name for the target name +///\param lcpl - IN: Link creation plist - default to LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default to LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the current +/// location. +/// For information on creating a soft link, please refer to the +/// H5Lcreate_soft APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const char *target_name, const char *link_name, + const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_soft(target_name, getId(), link_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("link", "creating soft link failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a target_name and \a link_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const H5std_string& target_name, const H5std_string& + link_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + link(target_name.c_str(), link_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link +///\brief Creates a hard link from \a new_name to \a curr_name. +///\param curr_name - IN: Name of the existing object +///\param new_loc - IN: New group or root group +///\param new_name - IN: New name for the object +///\param lcpl - IN: Link creation plist - default to LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default to LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const char *curr_name, const Group& new_loc, + const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value = -1; + hid_t new_loc_id = new_loc.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); + if (ret_value < 0) + throwException("link", "creating link failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a curr_name and \a new_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const H5std_string& curr_name, const Group& new_loc, + const H5std_string& new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + link(curr_name.c_str(), new_loc, new_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link +///\brief Creates a hard link from \a new_name to \a curr_name - can be +/// used to pass in H5L_SAME_LOC. +///\param curr_name - IN: Name of the existing object +///\param loc_id - IN: Group or root group ID, or H5L_SAME_LOC +///\param new_name - IN: New name for the link +///\param lcpl - IN: Link creation plist - default to LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default to LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating a hard link, please refer to the +/// H5Lcreate_hard APIs in the HDF5 C Reference Manual. +// March 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const char *curr_name, const hid_t same_loc, + const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value = -1; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT); + + if (ret_value < 0) + throwException("link", "creating link failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a curr_name and \a new_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::link(const H5std_string& curr_name, const hid_t same_loc, + const H5std_string& new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + link(curr_name.c_str(), same_loc, new_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::link ///\brief Creates a link of the specified type from \a new_name to /// \a curr_name. ///\param link_type - IN: Link type; possible values are @@ -953,7 +1129,7 @@ DataSet H5Location::openDataSet(const H5std_string& name) const // 2007: QAK modified to use H5L APIs - BMR // Mar 2018: Inadequate functionality, new hard link is only in // H5L_SAME_LOC. This function will be retired in favor of -// its replacement, Group::newLink(). - BMR +// its replacement. - BMR //-------------------------------------------------------------------------- void H5Location::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const { @@ -993,36 +1169,164 @@ void H5Location::link(H5L_type_t link_type, const H5std_string& curr_name, const } //-------------------------------------------------------------------------- -// Function: H5Location::unlink -///\brief Removes the specified name at this location. -///\param name - IN: Name of the object to be removed -///\exception H5::FileIException/H5::GroupIException/H5::LocationException -// Programmer Binh-Minh Ribler - 2000 -// Modification -// 2007: QAK modified to use H5L APIs - BMR +// Function: H5Location::copyLink +///\brief Copies a link from one group to another. +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 //-------------------------------------------------------------------------- -void H5Location::unlink(const char* name) const +void H5Location::copyLink(const char *src_name, + const Group& dst, const char *dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const { - herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT); + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::copyLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const +{ + copyLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::copyLink +///\brief Copies a link from a group in the same location. +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::copyLink(const char *src_name, + const char *dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const +{ + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lcopy(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if(ret_value < 0) + throwException("copyLink", "H5Lcopy H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::copyLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::copyLink(const H5std_string& src_name, + const H5std_string& dst_name, const LinkCreatPropList& lcpl, + const LinkAccPropList& lapl) const +{ + copyLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::moveLink +///\brief Renames a link in this group and moves it to a new location. +///\param src_name - IN: Original name +///\param dst - IN: Destination location +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\note +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with H5Location::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::moveLink(const char* src_name, const Group& dst, const char* dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + herr_t ret_value; + hid_t dst_id = dst.getId(); + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, dst_id, dst_name, lcpl_id, lapl_id); if (ret_value < 0) - throwException("unlink", "H5Ldelete failed"); + throwException("moveLink", "H5Lmove failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::unlink +// Function: H5Location::moveLink ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::moveLink(const H5std_string& src_name, const Group& dst, const H5std_string& dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + moveLink(src_name.c_str(), dst, dst_name.c_str(), lcpl, lapl); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::moveLink +///\brief Renames a link in this group. +///\param src_name - IN: Original name +///\param dst_name - IN: New name +///\param lcpl - IN: Link creation plist - default LinkCreatPropList::DEFAULT +///\param lapl - IN: Link access plist - default LinkAccPropList::DEFAULT +///\exception H5::FileIException or H5::GroupIException +///\note +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with H5Location::moveLink. Please refer +/// to the Group Interface in the HDF5 User's Guide for details. +// March, 2018 //-------------------------------------------------------------------------- -void H5Location::unlink(const H5std_string& name) const +void H5Location::moveLink(const char* src_name, const char* dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const { - unlink(name.c_str()); + herr_t ret_value; + hid_t lcpl_id = lcpl.getId(); + hid_t lapl_id = lapl.getId(); + + ret_value = H5Lmove(getId(), src_name, H5L_SAME_LOC, dst_name, lcpl_id, lapl_id); + if (ret_value < 0) + throwException("moveLink", "H5Lmove H5L_SAME_LOC failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::moveLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src_name and \a dst_name. +///\exception H5::FileIException or H5::GroupIException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::moveLink(const H5std_string& src_name, const H5std_string& dst_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const +{ + moveLink(src_name.c_str(), dst_name.c_str(), lcpl, lapl); } //-------------------------------------------------------------------------- // Function: H5Location::move -///\brief Renames an object at this location. +///\brief Renames an object at this location. - Deprecated due to inadequate functionality ///\param src - IN: Object's original name ///\param dst - IN: Object's new name ///\exception H5::FileIException/H5::GroupIException/H5::LocationException @@ -1030,27 +1334,80 @@ void H5Location::unlink(const H5std_string& name) const /// Exercise care in moving groups as it is possible to render /// data in a file inaccessible with H5Location::move. Please refer /// to the Group Interface in the HDF5 User's Guide for details. -// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR +// 2018: Will be replaced by H5Location::moveLink() -BMR //-------------------------------------------------------------------------- void H5Location::move(const char* src, const char* dst) const { - herr_t ret_value = H5Lmove(getId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT); - if (ret_value < 0) - throwException("move", "H5Lmove failed"); + moveLink(src, dst, LinkCreatPropList::DEFAULT, LinkAccPropList::DEFAULT); } //-------------------------------------------------------------------------- // Function: H5Location::move ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c H5std_string for \a src and \a dst. -// Programmer Binh-Minh Ribler - 2000 +/// \c H5std_string for \a src and \a dst. - Deprecated due to inadequate functionality +// Modification +// 2018: Will be replaced by H5Location::moveLink() -BMR //-------------------------------------------------------------------------- void H5Location::move(const H5std_string& src, const H5std_string& dst) const { - move(src.c_str(), dst.c_str()); + moveLink(src.c_str(), dst.c_str(), LinkCreatPropList::DEFAULT, LinkAccPropList::DEFAULT); +} + +#if 0 +//-------------------------------------------------------------------------- +// Function: H5Location::deleteLink +///\brief Removes the specified link from this group. +///\param name - IN: Name of the object to be removed +///\exception H5::FileIException/H5::GroupIException/H5::LocationException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::deleteLink(const char* name, const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT); + if (ret_value < 0) + throwException("deleteLink", "H5Ldelete failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::deleteLink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::deleteLink(const H5std_string& name, const LinkAccPropList& lapl) const +{ + deleteLink(name.c_str()); +} + +#endif +//-------------------------------------------------------------------------- +// Function: H5Location::unlink +///\brief Removes the specified link from this group. +///\param name - IN: Name of the object to be removed +///\exception H5::FileIException/H5::GroupIException/H5::LocationException +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::unlink(const char* name, const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Ldelete(getId(), name, lapl.getId()); + if (ret_value < 0) + throwException("unlink", "H5Ldelete failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::unlink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// March, 2018 +//-------------------------------------------------------------------------- +void H5Location::unlink(const H5std_string& name, const LinkAccPropList& lapl) const +{ + unlink(name.c_str(), lapl); } #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -1064,7 +1421,7 @@ void H5Location::move(const H5std_string& src, const H5std_string& dst) const ///\par Description /// For information, please refer to the H5Gget_objinfo API in /// the HDF5 C Reference Manual. -// Programmer Binh-Minh Ribler - 2000 +// 2000 //-------------------------------------------------------------------------- void H5Location::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const { @@ -1090,8 +1447,7 @@ void H5Location::getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_s ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above functions in that it doesn't have /// the paramemter \a follow_link. -// Programmer Binh-Minh Ribler - Nov, 2005 -// Note: need to modify to use H5Oget_info and H5Lget_info - BMR +// Nov, 2005 //-------------------------------------------------------------------------- void H5Location::getObjinfo(const char* name, H5G_stat_t& statbuf) const { @@ -1114,13 +1470,44 @@ void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- +// Function: H5Location::getLinkInfo +///\brief Returns the name of the object that the symbolic link points to. +///\param link_name - IN: Symbolic link to the object +///\param size - IN: Maximum number of characters of value to be returned +///\return Name of the object +///\exception H5::FileIException/H5::GroupIException/H5::LocationException +// 2000 +//-------------------------------------------------------------------------- +H5L_info_t H5Location::getLinkInfo(const char* link_name, const LinkAccPropList& lapl) const +{ + H5L_info_t linkinfo; // link info structure + + herr_t ret_value = H5Lget_info(getId(), link_name, &linkinfo, lapl.getId()); + if (ret_value < 0) + throwException("getLinkInfo", "H5Lget_info to find buffer size failed"); + + return(linkinfo); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::getLinkInfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a link_name. +//-------------------------------------------------------------------------- +H5L_info_t H5Location::getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl) const +{ + return(getLinkInfo(link_name.c_str(), lapl)); +} + +//-------------------------------------------------------------------------- // Function: H5Location::getLinkval ///\brief Returns the name of the object that the symbolic link points to. ///\param name - IN: Symbolic link to the object ///\param size - IN: Maximum number of characters of value to be returned ///\return Name of the object ///\exception H5::FileIException/H5::GroupIException/H5::LocationException -// Programmer Binh-Minh Ribler - 2000 +// 2000 //-------------------------------------------------------------------------- H5std_string H5Location::getLinkval(const char* name, size_t size) const { @@ -1670,7 +2057,7 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) cons // Programmer Binh-Minh Ribler - 2000 // Modification // August 2017 - BMR -// Keep Group::throwException and H5File::throwException to +// Keep H5Location::throwException and H5File::throwException to // maintain backward compatibility. For other subclasses, throw // LocationException. //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index e5fbc84..19c49ea 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -90,6 +90,10 @@ class H5_DLLCPP H5Location : public IdComponent { // Retrieves a dataspace with the region pointed to selected. DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; + // Create a new group with using link create property list. + Group createGroup(const char* name, const LinkCreatPropList& lcpl) const; + Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) const; + // From CommonFG // Creates a new group at this location which can be a file // or another group. @@ -109,6 +113,9 @@ class H5_DLLCPP H5Location : public IdComponent { DataSet openDataSet(const char* name) const; DataSet openDataSet(const H5std_string& name) const; + H5L_info_t getLinkInfo(const char* link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + H5L_info_t getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Returns the value of a symbolic link. H5std_string getLinkval(const char* link_name, size_t size=0) const; H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; @@ -154,26 +161,95 @@ class H5_DLLCPP H5Location : public IdComponent { int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + // Creates a soft link from link_name to target_name. + void link(const char *target_name, const char *link_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void link(const H5std_string& target_name, + const H5std_string& link_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name. + void link(const char *curr_name, + const Group& new_loc, const char *new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void link(const H5std_string& curr_name, + const Group& new_loc, const H5std_string& new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Creates a hard link from new_name to curr_name in same location. + void link(const char *curr_name, + const hid_t same_loc, const char *new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void link(const H5std_string& curr_name, + const hid_t same_loc, const H5std_string& new_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Creates a link of the specified type from new_name to current_name; // both names are interpreted relative to the specified location id. + // Deprecated due to inadequate functionality. void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const; void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const; - // Removes the specified name at this location. - void unlink(const char* name) const; - void unlink(const H5std_string& name) const; + // Removes the specified link from this location. + void unlink(const char *link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void unlink(const H5std_string& link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; // Mounts the file 'child' onto this location. void mount(const char* name, const H5File& child, const PropList& plist) const; - //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; - //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 // Unmounts the file named 'name' from this parent location. void unmount(const char* name) const; void unmount(const H5std_string& name) const; + // Copies a link from a group to another. + void copyLink(const char *src_name, + const Group& dst, const char *dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Makes a copy of a link in the same group. + void copyLink(const char *src_name, const char *dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void copyLink(const H5std_string& src_name, + const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Renames a link in this group and moves to a new location. + void moveLink(const char* src_name, + const Group& dst, const char* dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const Group& dst, const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Renames a link in this group. + void moveLink(const char* src_name, const char* dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void moveLink(const H5std_string& src_name, + const H5std_string& dst_name, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Renames an object at this location. + // Deprecated due to inadequate functionality. void move(const char* src, const char* dst) const; void move(const H5std_string& src, const H5std_string& dst) const; diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index fcdfd59..27881c4 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -23,6 +23,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 53d525c..704a617 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 7125676..4c0b3d2 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -20,6 +20,7 @@ #include "H5OcreatProp.h" #include "H5DcreatProp.h" #include "H5DxferProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 5b29682..188ee41 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -19,6 +19,7 @@ #include "H5PropList.h" #include "H5OcreatProp.h" #include "H5DcreatProp.h" +#include "H5LcreatProp.h" #include "H5LaccProp.h" #include "H5Location.h" #include "H5Object.h" diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am index efe17dc..c02a9e7 100644 --- a/c++/src/Makefile.am +++ b/c++/src/Makefile.am @@ -32,27 +32,29 @@ bin_SCRIPTS=h5c++ # Source files for the library libhdf5_cpp_la_SOURCES=H5Exception.cpp H5IdComponent.cpp \ - H5DataSpace.cpp H5PropList.cpp H5Library.cpp \ - H5FaccProp.cpp H5FcreatProp.cpp H5LaccProp.cpp \ - H5DxferProp.cpp H5DcreatProp.cpp H5Location.cpp \ - H5AbstractDs.cpp H5Attribute.cpp H5Object.cpp \ - H5OcreatProp.cpp H5DataType.cpp H5AtomType.cpp \ - H5PredType.cpp H5EnumType.cpp H5IntType.cpp \ - H5FloatType.cpp H5StrType.cpp H5ArrayType.cpp \ - H5VarLenType.cpp H5CompType.cpp H5DataSet.cpp \ - H5CommonFG.cpp H5Group.cpp H5File.cpp + H5DataSpace.cpp H5PropList.cpp H5Library.cpp \ + H5FaccProp.cpp H5FcreatProp.cpp H5LcreatProp.cpp \ + H5LaccProp.cpp H5DxferProp.cpp H5DcreatProp.cpp \ + H5Location.cpp H5AbstractDs.cpp H5Attribute.cpp \ + H5Object.cpp H5OcreatProp.cpp H5DataType.cpp \ + H5AtomType.cpp H5PredType.cpp H5EnumType.cpp \ + H5IntType.cpp H5FloatType.cpp H5StrType.cpp \ + H5ArrayType.cpp H5VarLenType.cpp H5CompType.cpp \ + H5DataSet.cpp H5CommonFG.cpp H5Group.cpp H5File.cpp # HDF5 C++ library depends on HDF5 Library. libhdf5_cpp_la_LIBADD=$(LIBHDF5) # Public headers -include_HEADERS=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h H5Classes.h \ - H5CommonFG.h H5CompType.h H5DataSet.h H5DataSpace.h H5DataType.h \ - H5OcreatProp.h H5DcreatProp.h H5DxferProp.h H5EnumType.h \ - H5Exception.h H5FaccProp.h H5FcreatProp.h H5File.h H5FloatType.h \ - H5Group.h H5IdComponent.h H5Include.h H5IntType.h H5LaccProp.h \ - H5Library.h H5Location.h H5Object.h H5PredType.h H5PropList.h \ - H5StrType.h H5CppDoc.h H5ArrayType.h H5VarLenType.h +include_HEADERS=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h \ + H5Classes.h H5CommonFG.h H5CompType.h H5DataSet.h \ + H5DataSpace.h H5DataType.h H5OcreatProp.h H5DcreatProp.h\ + H5DxferProp.h H5EnumType.h H5Exception.h H5FaccProp.h \ + H5FcreatProp.h H5File.h H5FloatType.h H5Group.h \ + H5IdComponent.h H5Include.h H5IntType.h H5LcreatProp.h \ + H5LaccProp.h H5Library.h H5Location.h H5Object.h \ + H5PredType.h H5PropList.h H5StrType.h H5CppDoc.h \ + H5ArrayType.h H5VarLenType.h # h5c++ and libhdf5.settings are generated during configure. Remove only when # distclean. diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 93bd0266..87fffc4 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -432,7 +432,92 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) { issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } -} +} // test_basic_links + + +/*------------------------------------------------------------------------- + * Function: test_lcpl + * + * Purpose: Tests link creation property lists, specifically, the + * character encoding property. + * + * Return: Success: 0 + * Failure: number of errors + * March, 2018 + *------------------------------------------------------------------------- + */ +const H5std_string GROUP1NAME("First_group"); +const H5std_string GROUP2NAME("Second_group"); +static int +test_lcpl(hid_t fapl_id, hbool_t new_format) +{ + H5L_info_t linfo; + char filename[1024]; + hsize_t dims[2]; + + if(new_format) + TESTING("link creation property lists (w/new group format)") + else + TESTING("link creation property lists") + + try + { + FileAccPropList fapl(fapl_id); + + // Create a new file. + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + + // Create and link a group with the default LCPL. + Group grp_1(file.createGroup(GROUP1NAME)); + grp_1.close(); + + // Check that its character encoding is the default. + linfo = file.getLinkInfo(GROUP1NAME); + if(linfo.cset != H5T_CSET_ASCII) + throw InvalidActionException("H5Lget_info", "Character encoding is not default"); + + // Create and commit a datatype with the default LCPL. + IntType dtype; + dtype.commit(file, "/type"); + dtype.close(); + + // Check that its character encoding is the default. + linfo = file.getLinkInfo("type"); + verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__); + + // Create a simple dataspace. + dims[0] = H5L_DIM1; + dims[1] = H5L_DIM2; + DataSpace dspace(2 ,dims); + + // Create a dataset using the default LCPL. + DataSet dset(file.createDataSet("/dataset", PredType::NATIVE_INT, dspace)); + dset.close(); + + // Check that its character encoding is the default. + linfo = file.getLinkInfo("/dataset"); + verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__); + + // Create a link creation property list with the UTF-8 character encoding. + LinkCreatPropList lcpl; + lcpl.setCharEncoding(H5T_CSET_UTF8); + + // Create and link a group with the new LCPL. + Group grp_2(file.createGroup(GROUP2NAME, lcpl)); + grp_2.close(); + + // Check that its character encoding is UTF-8. + linfo = file.getLinkInfo(GROUP2NAME); + verify_val(linfo.cset, H5T_CSET_UTF8, "Character encoding is not UTF-8", __LINE__, __FILE__); + + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} // end test_lcpl() /*------------------------------------------------------------------------- @@ -445,8 +530,6 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) * March, 2018 *------------------------------------------------------------------------- */ -const H5std_string GROUP1NAME("First_group"); -const H5std_string GROUP2NAME("Second_group"); static void test_move(hid_t fapl_id, hbool_t new_format) { @@ -459,11 +542,13 @@ test_move(hid_t fapl_id, hbool_t new_format) try { + FileAccPropList fapl(fapl_id); + // Create two new files h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); - H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + H5File file_a(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); h5_fixname(FILENAME[1], fapl_id, filename, sizeof filename); - H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + H5File file_b(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); // Create groups in first file Group grp_1(file_a.createGroup(GROUP1NAME)); @@ -574,7 +659,7 @@ test_move(hid_t fapl_id, hbool_t new_format) { issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); } -} +} // test_move /*------------------------------------------------------------------------- * Function: test_copy @@ -609,8 +694,8 @@ static void test_copy(hid_t fapl_id, hbool_t new_format) Group grp_move(grp_1.createGroup("group_copy")); // Create hard and soft links - grp_1.newLink("group_copy", H5L_SAME_LOC, "hard"); - grp_2.newLink("/First_group/group_copy", "soft"); + grp_1.link("group_copy", H5L_SAME_LOC, "hard"); + grp_2.link("/First_group/group_copy", "soft"); // Copy a group across files, should fail try { @@ -679,13 +764,37 @@ static void test_copy(hid_t fapl_id, hbool_t new_format) moved_grp = grp_1.openGroup("group_copy"); moved_grp.close(); + // Delete "group_newer_name" from group 2, then try to open it. + grp_2.unlink("group_newer_name"); + try { + moved_grp = grp_2.openGroup("group_newer_name"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_newer_name should not be in GROUP2NAME" << endl; + } catch (Exception& E) { + // expected + } + + // Delete "group_copy" from group 1, then try to open it. + grp_1.unlink("group_copy"); + try { + moved_grp = grp_1.openGroup("group_copy"); + moved_grp.close(); + + H5_FAILED(); // Should throw an exception but didn't + cerr << " Group group_copy should not be in GROUP1NAME" << endl; + } catch (Exception& E) { + // expected + } + PASSED(); } // end of try block catch (Exception& E) { issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); } -} +} // test_copy /*------------------------------------------------------------------------- -- cgit v0.12 From 784165335992b4b58eca3fd91cc313bbca345c9f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 11 Mar 2018 23:39:46 -0500 Subject: Updated MANIFEST for H5LcreatProp.[h,cpp] --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index 4e35691..805c8d9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -374,6 +374,8 @@ ./c++/src/H5IntType.h ./c++/src/H5LaccProp.cpp ./c++/src/H5LaccProp.h +./c++/src/H5LcreatProp.cpp +./c++/src/H5LcreatProp.h ./c++/src/H5Library.cpp ./c++/src/H5Library.h ./c++/src/H5Location.cpp -- cgit v0.12 From 17af6bcb791ae8fa1027717bc155c56bc7d17640 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 11 Mar 2018 23:43:52 -0500 Subject: Updated for H5LcreatProp.[h,cpp] --- c++/src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 350bdf7..5d0d6b6 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -33,6 +33,7 @@ set (CPP_SOURCES ${HDF5_CPP_SRC_SOURCE_DIR}/H5IdComponent.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5LaccProp.cpp + ${HDF5_CPP_SRC_SOURCE_DIR}/H5LcreatProp.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.cpp @@ -70,6 +71,7 @@ set (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5Include.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5LaccProp.h + ${HDF5_CPP_SRC_SOURCE_DIR}/H5LcreatProp.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.h -- cgit v0.12 From 5a0d8d0d16fad83346089ab160a2d3b128a2373d Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 00:03:46 -0500 Subject: Updated RELEASE.txt Description: - Wrappers for H5Lcreate_soft, H5Lcreate_hard, H5Lcopy, H5Lmove, H5Ldelete, and H5Lget_info - Class LinkCreatPropList - Fixed typo in source file Platforms tested: Linux/64 (jelly) --- c++/src/H5Location.cpp | 2 +- release_docs/RELEASE.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index c82df2c..2dceb6e 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -1471,7 +1471,7 @@ void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const //-------------------------------------------------------------------------- // Function: H5Location::getLinkInfo -///\brief Returns the name of the object that the symbolic link points to. +///\brief Returns the information of the named link. ///\param link_name - IN: Symbolic link to the object ///\param size - IN: Maximum number of characters of value to be returned ///\return Name of the object diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 0061910..12776eb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -151,7 +151,63 @@ New Features C++ Library: ------------ - - + - The following wrappers are added: + + + H5Lcreate_soft: + // Creates a soft link from link_name to target_name. + void link(const char *target_name, const char *link_name,...) + void link(const H5std_string& target_name,...) + + + H5Lcreate_hard: + // Creates a hard link from new_name to curr_name. + void link(const char *curr_name, const Group& new_loc,...) + void link(const H5std_string& curr_name, const Group& new_loc,...) + + // Creates a hard link from new_name to curr_name in same location. + void link(const char *curr_name, const hid_t same_loc,...) + void link(const H5std_string& curr_name, const hid_t same_loc,...) + + Note: previous version of H5Location::link will be deprecated. + + + H5Lcopy: + // Copy an object from a group of file to another. + void copyLink(const char *src_name, const Group& dst,...) + void copyLink(const H5std_string& src_name, const Group& dst,...) + + // Copy an object from a group of file to the same location. + void copyLink(const char *src_name, const char *dst_name,...) + void copyLink(const H5std_string& src_name,...) + + + H5Lmove: + // Rename an object in a group or file to a new location. + void moveLink(const char* src_name, const Group& dst,...) + void moveLink(const H5std_string& src_name, const Group& dst,...) + + // Rename an object in a group or file to the same location. + void moveLink(const char* src_name, const char* dst_name,...) + void moveLink(const H5std_string& src_name,...) + + Note: previous version H5Location::move will be deprecated. + + + H5Ldelete: + // Removes the specified link from this location. + void unlink(const char *link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + void unlink(const H5std_string& link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + + - Added class LinkCreatPropList + + - Added overloaded functions H5Location::createGroup to take a link + creation property list + Group createGroup(const char* name, const LinkCreatPropList& lcpl) + Group createGroup(const H5std_string& name, const LinkCreatPropList& lcpl) + - Added wrapper for H5Lget_info() to H5Location + // Returns the information of the named link. + H5L_info_t getLinkInfo(const H5std_string& link_name,...) + + (BMR - 2018/03/11, HDFFV-10149) + Java Library: ---------------- -- cgit v0.12 From b638bbd74b79f935a43aa6a804492e035ec315f6 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 00:53:16 -0500 Subject: Code improvement Description: - Removed memory leaks caused by accidentally invoking p_get_member_type - Added the call to test_lcpl, missed previously Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) Darwin (osx1010test) --- c++/src/H5CompType.cpp | 38 +++++++++++++++++++------------------- c++/test/tlinks.cpp | 13 +++++++------ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 28aa6cd..3731fd4 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -304,7 +304,7 @@ DataType CompType::getMemberDataType(unsigned member_num) const ArrayType CompType::getMemberArrayType(unsigned member_num) const { try { - ArrayType arraytype(p_get_member_type(member_num)); + ArrayType arraytype; f_DataType_setId(&arraytype, p_get_member_type(member_num)); return(arraytype); } @@ -324,10 +324,10 @@ ArrayType CompType::getMemberArrayType(unsigned member_num) const //-------------------------------------------------------------------------- CompType CompType::getMemberCompType(unsigned member_num) const { - try { - CompType comptype(p_get_member_type(member_num)); + try { + CompType comptype; f_DataType_setId(&comptype, p_get_member_type(member_num)); - return(comptype); + return(comptype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); @@ -345,10 +345,10 @@ CompType CompType::getMemberCompType(unsigned member_num) const //-------------------------------------------------------------------------- EnumType CompType::getMemberEnumType(unsigned member_num) const { - try { - EnumType enumtype(p_get_member_type(member_num)); + try { + EnumType enumtype; f_DataType_setId(&enumtype, p_get_member_type(member_num)); - return(enumtype); + return(enumtype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); @@ -366,10 +366,10 @@ EnumType CompType::getMemberEnumType(unsigned member_num) const //-------------------------------------------------------------------------- IntType CompType::getMemberIntType(unsigned member_num) const { - try { - IntType inttype(p_get_member_type(member_num)); + try { + IntType inttype; f_DataType_setId(&inttype, p_get_member_type(member_num)); - return(inttype); + return(inttype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); @@ -387,10 +387,10 @@ IntType CompType::getMemberIntType(unsigned member_num) const //-------------------------------------------------------------------------- FloatType CompType::getMemberFloatType(unsigned member_num) const { - try { - FloatType floatype(p_get_member_type(member_num)); + try { + FloatType floatype; f_DataType_setId(&floatype, p_get_member_type(member_num)); - return(floatype); + return(floatype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); @@ -408,10 +408,10 @@ FloatType CompType::getMemberFloatType(unsigned member_num) const //-------------------------------------------------------------------------- StrType CompType::getMemberStrType(unsigned member_num) const { - try { - StrType strtype(p_get_member_type(member_num)); + try { + StrType strtype; f_DataType_setId(&strtype, p_get_member_type(member_num)); - return(strtype); + return(strtype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); @@ -429,10 +429,10 @@ StrType CompType::getMemberStrType(unsigned member_num) const //-------------------------------------------------------------------------- VarLenType CompType::getMemberVarLenType(unsigned member_num) const { - try { - VarLenType varlentype(p_get_member_type(member_num)); + try { + VarLenType varlentype; f_DataType_setId(&varlentype, p_get_member_type(member_num)); - return(varlentype); + return(varlentype); } catch (DataTypeIException& E) { throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 87fffc4..b8560aa 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -448,7 +448,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) */ const H5std_string GROUP1NAME("First_group"); const H5std_string GROUP2NAME("Second_group"); -static int +static void test_lcpl(hid_t fapl_id, hbool_t new_format) { H5L_info_t linfo; @@ -456,9 +456,9 @@ test_lcpl(hid_t fapl_id, hbool_t new_format) hsize_t dims[2]; if(new_format) - TESTING("link creation property lists (w/new group format)") + SUBTEST("Link creation property lists (w/new group format)") else - TESTING("link creation property lists") + SUBTEST("Link creation property lists") try { @@ -466,7 +466,7 @@ test_lcpl(hid_t fapl_id, hbool_t new_format) // Create a new file. h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); - H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_id); + H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); // Create and link a group with the default LCPL. Group grp_1(file.createGroup(GROUP1NAME)); @@ -478,12 +478,12 @@ test_lcpl(hid_t fapl_id, hbool_t new_format) throw InvalidActionException("H5Lget_info", "Character encoding is not default"); // Create and commit a datatype with the default LCPL. - IntType dtype; + IntType dtype(PredType::NATIVE_INT); dtype.commit(file, "/type"); dtype.close(); // Check that its character encoding is the default. - linfo = file.getLinkInfo("type"); + linfo = file.getLinkInfo("/type"); verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__); // Create a simple dataspace. @@ -894,6 +894,7 @@ void test_links() test_basic_links(my_fapl_id, new_format); test_move(my_fapl_id, new_format); test_copy(my_fapl_id, new_format); + test_lcpl(my_fapl_id, new_format); } /* end for */ /* Close 2nd FAPL */ -- cgit v0.12 From f08b8fa10e7bac5ae26e3b06f938d38ebb3f28e1 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 12 Mar 2018 09:02:15 -0500 Subject: Enhancement to the tool h5clear (HDFFV-10360) --- MANIFEST | 23 ++ src/H5F.c | 94 +++++- src/H5Fint.c | 41 ++- src/H5Fpkg.h | 3 +- src/H5Fprivate.h | 4 + src/H5Fpublic.h | 2 + src/H5Fsuper.c | 112 +++++-- src/H5Pfapl.c | 21 ++ test/tfile.c | 128 +++++++ tools/src/misc/h5clear.c | 158 ++++++++- tools/test/misc/CMakeTestsClear.cmake | 100 +++++- tools/test/misc/h5clear_gentest.c | 369 +++++++++++++++++++-- .../misc/testfiles/h5clear_equal_after_size.ddl | 1 + .../misc/testfiles/h5clear_equal_before_size.ddl | 1 + .../misc/testfiles/h5clear_fsm_persist_equal.h5 | Bin 0 -> 2565 bytes .../misc/testfiles/h5clear_fsm_persist_greater.h5 | Bin 0 -> 2565 bytes .../misc/testfiles/h5clear_fsm_persist_less.h5 | Bin 0 -> 2565 bytes .../misc/testfiles/h5clear_fsm_persist_noclose.h5 | Bin 0 -> 2448 bytes .../testfiles/h5clear_fsm_persist_user_equal.h5 | Bin 0 -> 3077 bytes .../testfiles/h5clear_fsm_persist_user_greater.h5 | Bin 0 -> 3077 bytes .../testfiles/h5clear_fsm_persist_user_less.h5 | Bin 0 -> 3077 bytes .../misc/testfiles/h5clear_greater_after_size.ddl | 1 + .../misc/testfiles/h5clear_greater_before_size.ddl | 1 + .../misc/testfiles/h5clear_less_after_size.ddl | 1 + .../misc/testfiles/h5clear_less_before_size.ddl | 1 + tools/test/misc/testfiles/h5clear_missing_file.ddl | 10 +- .../misc/testfiles/h5clear_noclose_after_size.ddl | 1 + .../misc/testfiles/h5clear_noclose_before_size.ddl | 1 + .../test/misc/testfiles/h5clear_status_noclose.h5 | Bin 0 -> 2448 bytes .../h5clear_status_noclose_after_size.ddl | 1 + tools/test/misc/testfiles/h5clear_usage.ddl | 10 +- .../testfiles/h5clear_user_equal_after_size.ddl | 1 + .../testfiles/h5clear_user_equal_before_size.ddl | 1 + .../testfiles/h5clear_user_greater_after_size.ddl | 1 + .../testfiles/h5clear_user_greater_before_size.ddl | 1 + .../testfiles/h5clear_user_less_after_size.ddl | 1 + .../testfiles/h5clear_user_less_before_size.ddl | 1 + tools/test/misc/testh5clear.sh.in | 122 ++++++- 38 files changed, 1114 insertions(+), 98 deletions(-) create mode 100644 tools/test/misc/testfiles/h5clear_equal_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_equal_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 create mode 100644 tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 create mode 100644 tools/test/misc/testfiles/h5clear_greater_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_greater_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_less_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_less_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_noclose_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_noclose_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_status_noclose.h5 create mode 100644 tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_less_after_size.ddl create mode 100644 tools/test/misc/testfiles/h5clear_user_less_before_size.ddl diff --git a/MANIFEST b/MANIFEST index 229a5ec..2646d0f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1486,15 +1486,38 @@ ./tools/test/misc/testh5mkgrp.sh.in ./tools/test/misc/testh5repart.sh.in ./tools/test/misc/talign.c +./tools/test/misc/testfiles/h5clear_equal_after_size.ddl +./tools/test/misc/testfiles/h5clear_equal_before_size.ddl +./tools/test/misc/testfiles/h5clear_greater_after_size.ddl +./tools/test/misc/testfiles/h5clear_greater_before_size.ddl +./tools/test/misc/testfiles/h5clear_less_after_size.ddl +./tools/test/misc/testfiles/h5clear_less_before_size.ddl ./tools/test/misc/testfiles/h5clear_missing_file.ddl +./tools/test/misc/testfiles/h5clear_noclose_after_size.ddl +./tools/test/misc/testfiles/h5clear_noclose_before_size.ddl ./tools/test/misc/testfiles/h5clear_no_mdc_image.ddl ./tools/test/misc/testfiles/h5clear_open_fail.ddl +./tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl ./tools/test/misc/testfiles/h5clear_usage.ddl +./tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl +./tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl +./tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl +./tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl +./tools/test/misc/testfiles/h5clear_user_less_after_size.ddl +./tools/test/misc/testfiles/h5clear_user_less_before_size.ddl +./tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 +./tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 ./tools/test/misc/testfiles/h5clear_log_v3.h5 ./tools/test/misc/testfiles/h5clear_mdc_image.h5 ./tools/test/misc/testfiles/h5clear_sec2_v0.h5 ./tools/test/misc/testfiles/h5clear_sec2_v2.h5 ./tools/test/misc/testfiles/h5clear_sec2_v3.h5 +./tools/test/misc/testfiles/h5clear_status_noclose.h5 ./tools/test/misc/testfiles/latest_h5clear_log_v3.h5 ./tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 ./tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 diff --git a/src/H5F.c b/src/H5F.c index 8e5f65a..2cd65cb 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -845,8 +845,6 @@ herr_t H5Fget_filesize(hid_t file_id, hsize_t *size) { H5F_t *file; /* File object for file ID */ - haddr_t eof; /* End of file address */ - haddr_t eoa; /* End of allocation address */ haddr_t max_eof_eoa; /* Maximum of the EOA & EOF */ haddr_t base_addr; /* Base address for the file */ herr_t ret_value = SUCCEED; /* Return value */ @@ -859,11 +857,9 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Go get the actual file size */ - eof = H5FD_get_eof(file->shared->lf, H5FD_MEM_DEFAULT); - eoa = H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT); - max_eof_eoa = MAX(eof, eoa); - if(HADDR_UNDEF == max_eof_eoa) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof/eoa requests failed") + if(H5F__get_max_eof_eoa(file, &max_eof_eoa) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") + base_addr = H5FD_get_base_addr(file->shared->lf); if(size) @@ -1949,3 +1945,87 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Fget_mdc_image_info() */ + +/*------------------------------------------------------------------------- + * Function: H5Fget_eoa + * + * Purpose: Returns the address of the first byte after the last + * allocated memory in the file. + * (See H5FDget_eoa() in H5FD.c) + * + * Return: Success: First byte after allocated memory. + * Failure: HADDR_UNDEF + * + * Return: Non-negative on success/Negative on errors + *------------------------------------------------------------------------- + */ +herr_t +H5Fget_eoa(hid_t file_id, haddr_t *eoa) +{ + H5F_t *file; /* File object for file ID */ + haddr_t rel_eoa; /* Relative address of EOA */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*a", file_id, eoa); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID") + + /* This public routine will work only for drivers with this feature enabled.*/ + /* We might introduce a new feature flag in the future */ + if(!H5F_HAS_FEATURE(file, H5FD_FEAT_SUPPORTS_SWMR_IO)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") + + /* The real work */ + if(HADDR_UNDEF == (rel_eoa = H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get_eoa request failed") + + /* (Note compensating for base address subtraction in internal routine) */ + if(eoa) + *eoa = rel_eoa + H5FD_get_base_addr(file->shared->lf); +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fget_eoa() */ + + +/*------------------------------------------------------------------------- + * Function: H5Fincrement_filesize + * + * Purpose: Set the EOA for the file to the maximum of (EOA, EOF) + increment + * + * Return: Non-negative on success/Negative on errors + *------------------------------------------------------------------------- + */ +herr_t +H5Fincrement_filesize(hid_t file_id, hsize_t increment) +{ + H5F_t *file; /* File object for file ID */ + haddr_t max_eof_eoa; /* Maximum of the relative EOA & EOF */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ih", file_id, increment); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID") + + /* This public routine will work only for drivers with this feature enabled.*/ + /* We might introduce a new feature flag in the future */ + if(!H5F_HAS_FEATURE(file, H5FD_FEAT_SUPPORTS_SWMR_IO)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") + + /* Get the maximum of EOA and EOF */ + if(H5F__get_max_eof_eoa(file, &max_eof_eoa) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") + + /* Set EOA to the maximum value + increment */ + /* H5FD_set_eoa() will add base_addr to max_eof_eoa */ + if(H5FD_set_eoa(file->shared->lf, H5FD_MEM_DEFAULT, max_eof_eoa + increment) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fincrement_filesize() */ diff --git a/src/H5Fint.c b/src/H5Fint.c index c41453a..24eb761 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -124,7 +124,6 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ hbool_t driver_prop_copied = FALSE; /* Whether the driver property has been set up */ unsigned efc_size = 0; - hbool_t latest_format = FALSE; /* Always use the latest format? */ hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -820,7 +819,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t else { H5P_genplist_t *plist; /* Property list */ unsigned efc_size; /* External file cache size */ - hbool_t latest_format; /* Always use the latest format? */ size_t u; /* Local index variable */ HDassert(lf != NULL); @@ -1602,7 +1600,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, } /* end if */ else if (1 == shared->nrefs) { /* Read the superblock if it hasn't been read before. */ - if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, TRUE) < 0) + if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, fapl_id, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") /* Create the page buffer before initializing the superblock */ @@ -2912,6 +2910,43 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__set_paged_aggr() */ +/*------------------------------------------------------------------------- + * Function: H5F__get_max_eof_eoa + * + * Purpose: Determine the maximum of (EOA, EOF) for the file + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa) +{ + haddr_t eof; /* Relative address for EOF */ + haddr_t eoa; /* Relative address for EOA */ + haddr_t tmp_max; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + + /* Get the relative EOA and EOF */ + eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT); + eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT); + + /* Determine the maximum */ + tmp_max = MAX(eof, eoa); + if(HADDR_UNDEF == tmp_max) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof/eoa requests failed") + + *max_eof_eoa = tmp_max; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__get_max_eof_eoa() */ + #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index c9aba56..a4c1a24 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -412,7 +412,7 @@ H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nop /* Superblock related routines */ H5_DLL herr_t H5F__super_init(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, +H5_DLL herr_t H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id, hbool_t initial_read); H5_DLL herr_t H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size); H5_DLL herr_t H5F__super_free(H5F_super_t *sblock); @@ -457,6 +457,7 @@ H5_DLL htri_t H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, H5_DLL herr_t H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr); H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, hbool_t paged); +H5_DLL herr_t H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa); /* Functions that flush or evict */ H5_DLL herr_t H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 856e618..28ebbd2 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -492,6 +492,10 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ +#define H5F_ACS_NULL_FSM_ADDR_NAME "null_fsm_addr" /* Nullify addresses of free-space managers */ + /* Private property used only by h5clear */ +#define H5F_ACS_SKIP_EOF_CHECK_NAME "skip_eof_check" /* Skip EOF check */ + /* Private property used only by h5clear */ #define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */ #define H5F_ACS_MDC_LOG_LOCATION_NAME "mdc_log_location" /* Name of metadata cache log location */ #define H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME "start_mdc_log_on_access" /* Whether logging starts on file create/open */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index d333fa7..73c59f5 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -241,6 +241,8 @@ H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); H5_DLL herr_t H5Funmount(hid_t loc, const char *name); H5_DLL hssize_t H5Fget_freespace(hid_t file_id); H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); +H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); +H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4250ff0..3db9b2f 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -324,7 +324,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial_read) +H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id, hbool_t initial_read) { H5P_genplist_t *dxpl = NULL; /* DXPL object */ H5AC_ring_t ring, orig_ring = H5AC_RING_INV; @@ -337,7 +337,8 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial haddr_t eof; /* End of file address */ unsigned rw_flags; /* Read/write permissions for file */ hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *a_plist; /* File access property list */ + herr_t ret_value = SUCCEED; /* Return value */ #ifdef H5_HAVE_PARALLEL int mpi_rank = 0, mpi_size = 1; int mpi_result; @@ -595,6 +596,20 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial * as the file can appear truncated if only part of it has been * been flushed to disk by the SWMR writer process. */ + /* The EOF check is also skipped when the private property + * H5F_ACS_SKIP_EOF_CHECK_NAME exists in the fapl. + * This property is enabled by the tool h5clear with these + * two options: (1) --filesize (2) --increment + */ + + /* Check if this private property exists in fapl */ + if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file access property list") + if(H5P_exist_plist(a_plist, H5F_ACS_SKIP_EOF_CHECK_NAME) > 0) { + if(H5P_get(a_plist, H5F_ACS_SKIP_EOF_CHECK_NAME, &skip_eof_check) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get clearance for persisting fsm addr") + } + if(H5F_INTENT(f) & H5F_ACC_SWMR_READ) { /* * When the file is opened for SWMR read access, skip the check if: @@ -757,6 +772,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(status) { H5O_fsinfo_t fsinfo; /* File space info message from superblock extension */ uint8_t flags; /* Message flags */ + hbool_t null_fsm_addr = FALSE; /* Whether to drop free-space to the floor */ /* Get message flags */ if(H5O_msg_get_flags(&ext_loc, H5O_FSINFO_ID, meta_dxpl_id, &flags) < 0) @@ -765,6 +781,13 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial /* If message is NOT marked "unknown"--set up file space info */ if(!(flags & H5O_MSG_FLAG_WAS_UNKNOWN)) { + /* The tool h5clear uses this property to tell the library + to drop free-space to the floor */ + if(H5P_exist_plist(a_plist, H5F_ACS_NULL_FSM_ADDR_NAME) > 0) { + if(H5P_get(a_plist, H5F_ACS_NULL_FSM_ADDR_NAME, &null_fsm_addr) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get clearance for persisting fsm addr") + } + /* Retrieve the 'file space info' structure */ if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo, meta_dxpl_id)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free-space manager info message") @@ -808,13 +831,30 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(f->shared->eoa_pre_fsm_fsalloc != fsinfo.eoa_pre_fsm_fsalloc) f->shared->eoa_pre_fsm_fsalloc = fsinfo.eoa_pre_fsm_fsalloc; - /* f->shared->eoa_pre_fsm_fsalloc must always be HADDR_UNDEF - * in the absence of persistant free space managers. + /* f->shared->eoa_pre_fsm_fsalloc must always be HADDR_UNDEF + * in the absence of persistant free space managers. + */ + /* If the following two conditions are true: + * (1) skipping EOF check (skip_eof_check) + * (2) dropping free-space to the floor (null_fsm_addr) + * skip the asserts as "eoa_pre_fsm_fsalloc" may be undefined + * for a crashed file with persistant free space managers. + * #1 and #2 are enabled when the tool h5clear --increment + * option is used. */ - HDassert((!f->shared->fs_persist) || (f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF)); - HDassert(!f->shared->first_alloc_dealloc); + if(!skip_eof_check && !null_fsm_addr) { + HDassert((!f->shared->fs_persist) || (f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF)); + HDassert(!f->shared->first_alloc_dealloc); + } - if((f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF) && + /* As "eoa_pre_fsm_fsalloc" may be undefined for a crashed file + * with persistant free space managers, therefore, set + * "first_alloc_dealloc" when the condition + * "dropping free-space to the floor is true. + * This will ensure that no action is done to settle things on file + * close via H5MF_settle_meta_data_fsm() and H5MF_settle_raw_data_fsm(). + */ + if((f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF || null_fsm_addr) && (H5F_INTENT(f) & H5F_ACC_RDWR)) f->shared->first_alloc_dealloc = TRUE; @@ -822,7 +862,20 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial for(u = 1; u < NELMTS(f->shared->fs_addr); u++) f->shared->fs_addr[u] = fsinfo.fs_addr[u - 1]; - if(fsinfo.mapped && (rw_flags & H5AC__READ_ONLY_FLAG) == 0) { + /* If the following two conditions are true: + * (1) file is persisting free-space + * (2) dropping free-space to the floor (null_fsm_addr) + * nullify the addresses of the FSMs + */ + if(f->shared->fs_persist && null_fsm_addr) { + for(u = 0; u < NELMTS(fsinfo.fs_addr); u++) + f->shared->fs_addr[u] = fsinfo.fs_addr[u] = HADDR_UNDEF; + } + + /* For fsinfo.mapped: remove the FSINFO message from the superblock extension + and write a new message to the extension */ + /* For null_fsm_addr: just update FSINFO message in the superblock extension */ + if(((fsinfo.mapped || null_fsm_addr) && (rw_flags & H5AC__READ_ONLY_FLAG) == 0)) { /* Do the same kluge until we know for sure. VC */ #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ @@ -836,11 +889,16 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_FSINFO_ID) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") + if(null_fsm_addr) { + if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") + } else { + if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_FSINFO_ID) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") - if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) - HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") + if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") + } #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ f->shared->sblock = NULL; #endif /* JRM */ @@ -1637,13 +1695,13 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, /* Open/create the superblock extension object header */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) { - if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") + if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") } /* end if */ else { HDassert(may_create); - if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension") + if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension") ext_created = TRUE; } /* end else */ HDassert(H5F_addr_defined(ext_loc.addr)); @@ -1651,24 +1709,24 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, /* Check if message with ID does not exist in the object header */ if((status = H5O_msg_exists(&ext_loc, id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message or message exists") + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message or message exists") /* Check for creating vs. writing */ if(may_create) { - if(status) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should not exist") + if(status) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should not exist") - /* Create the message with ID in the superblock extension */ - if(H5O_msg_create(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") + /* Create the message with ID in the superblock extension */ + if(H5O_msg_create(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") } /* end if */ else { - if(!status) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should exist") + if(!status) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should exist") - /* Update the message with ID in the superblock extension */ - if(H5O_msg_write(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") + /* Update the message with ID in the superblock extension */ + if(H5O_msg_write(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") } /* end else */ done: diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 148c247..eded286 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -193,6 +193,14 @@ /* Definition for status_flags in the superblock */ #define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) #define H5F_ACS_CLEAR_STATUS_FLAGS_DEF FALSE + +/* Definition for dropping free-space to the floor when reading in the superblock */ +#define H5F_ACS_NULL_FSM_ADDR_SIZE sizeof(hbool_t) +#define H5F_ACS_NULL_FSM_ADDR_DEF FALSE +/* Definition for skipping EOF check when reading in the superblock */ +#define H5F_ACS_SKIP_EOF_CHECK_SIZE sizeof(hbool_t) +#define H5F_ACS_SKIP_EOF_CHECK_DEF FALSE + /* Definition for 'use metadata cache logging' flag */ #define H5F_ACS_USE_MDC_LOGGING_SIZE sizeof(hbool_t) #define H5F_ACS_USE_MDC_LOGGING_DEF FALSE @@ -374,6 +382,9 @@ static const size_t H5F_def_core_write_tracking_page_size_g = H5F_ACS_CORE_WRITE static const unsigned H5F_def_metadata_read_attempts_g = H5F_ACS_METADATA_READ_ATTEMPTS_DEF; /* Default setting for the # of metadata read attempts */ static const H5F_object_flush_t H5F_def_object_flush_cb_g = H5F_ACS_OBJECT_FLUSH_CB_DEF; /* Default setting for object flush callback */ static const hbool_t H5F_def_clear_status_flags_g = H5F_ACS_CLEAR_STATUS_FLAGS_DEF; /* Default to clear the superblock status_flags */ +static const hbool_t H5F_def_skip_eof_check_g = H5F_ACS_SKIP_EOF_CHECK_DEF; /* Default setting for skipping EOF check */ +static const hbool_t H5F_def_null_fsm_addr_g = H5F_ACS_NULL_FSM_ADDR_DEF; /* Default setting for dropping free-space to the floor */ + static const hbool_t H5F_def_use_mdc_logging_g = H5F_ACS_USE_MDC_LOGGING_DEF; /* Default metadata cache logging flag */ static const char *H5F_def_mdc_log_location_g = H5F_ACS_MDC_LOG_LOCATION_DEF; /* Default mdc log location */ static const hbool_t H5F_def_start_mdc_log_on_access_g = H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF; /* Default mdc log start on access flag */ @@ -565,6 +576,16 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the private property of whether to skip EOF check. It's used by h5clear only. */ + if(H5P_register_real(pclass, H5F_ACS_SKIP_EOF_CHECK_NAME, H5F_ACS_SKIP_EOF_CHECK_SIZE, &H5F_def_skip_eof_check_g, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the private property of whether to drop free-space to the floor. It's used by h5clear only. */ + if(H5P_register_real(pclass, H5F_ACS_NULL_FSM_ADDR_NAME, H5F_ACS_NULL_FSM_ADDR_SIZE, &H5F_def_null_fsm_addr_g, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the metadata cache logging flag. */ if(H5P_register_real(pclass, H5F_ACS_USE_MDC_LOGGING_NAME, H5F_ACS_USE_MDC_LOGGING_SIZE, &H5F_def_use_mdc_logging_g, NULL, NULL, NULL, H5F_ACS_USE_MDC_LOGGING_ENC, H5F_ACS_USE_MDC_LOGGING_DEC, NULL, NULL, NULL, NULL) < 0) diff --git a/test/tfile.c b/test/tfile.c index f3d5a8f..80c1e11 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -134,6 +134,9 @@ #define NGROUPS 2 #define NDSETS 4 +/* Declaration for test_incr_filesize() */ +#define FILE8 "tfile8.h5" /* Test file */ + /* Files created under 1.6 branch and 1.8 branch--used in test_filespace_compatible() */ const char *OLD_FILENAME[] = { "filespace_1_6.h5", /* 1.6 HDF5 file */ @@ -6926,6 +6929,130 @@ test_libver_macros2(void) /**************************************************************** ** +** test_filesize(): +** Verify H5Fincrement_filesize() and H5Fget_eoa() works as +** indicated in the "RFC: Enhancement to the tool h5clear". +** +****************************************************************/ +static void +test_incr_filesize(const char *env_h5_drvr) +{ + hid_t fid; /* File opened with read-write permission */ + h5_stat_size_t filesize; /* Size of file when empty */ + hid_t fcpl; /* File creation property list */ + hid_t fapl; /* File access property list */ + hid_t dspace; /* Dataspace ID */ + hid_t dset; /* Dataset ID */ + hid_t dcpl; /* Dataset creation property list */ + unsigned u; /* Local index variable */ + char filename[FILENAME_LEN]; /* Filename to use */ + char name[32]; /* Dataset name */ + haddr_t stored_eoa; /* The stored EOA value */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + herr_t ret; /* Return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing H5Fincrement_filesize() and H5Fget_eoa())\n")); + + fapl = h5_fileaccess(); + h5_fixname(FILE8, fapl, filename, sizeof filename); + + /* Get the VFD feature flags */ + driver_id = H5Pget_driver(fapl); + CHECK(driver_id, FAIL, "H5Pget_driver"); + + ret = H5FDdriver_query(driver_id, &driver_flags); + CHECK(ret, FAIL, "H5PDdriver_query"); + + /* Check whether the VFD feature flag supports these two public routines */ + if(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO) { + + fcpl = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl, FAIL, "H5Pcreate"); + + /* Set file space strategy */ + ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)1); + CHECK(ret, FAIL, "H5P_set_file_space_strategy"); + + /* Create the test file */ + fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create dataspace for datasets */ + dspace = H5Screate(H5S_SCALAR); + CHECK(dspace, FAIL, "H5Screate"); + + /* Create a dataset creation property list */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + + /* Set the space allocation time to early */ + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); + CHECK(ret, FAIL, "H5Pset_alloc_time"); + + /* Create datasets in file */ + for(u = 0; u < 10; u++) { + sprintf(name, "Dataset %u", u); + dset = H5Dcreate2(fid, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); + + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + } /* end for */ + + /* Close dataspace */ + ret = H5Sclose(dspace); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close dataset creation property list */ + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Get the file size */ + filesize = h5_get_file_size(filename, fapl); + + /* Open the file */ + fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Get the stored EOA */ + ret = H5Fget_eoa(fid, &stored_eoa); + CHECK(ret, FAIL, "H5Fget_eoa"); + + /* Verify the stored EOA is the same as filesize */ + VERIFY(filesize, stored_eoa, "file size"); + + /* Set the EOA to the MAX(EOA, EOF) + 512 */ + ret = H5Fincrement_filesize(fid, 512); + CHECK(ret, FAIL, "H5Fincrement_filesize"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Get the file size */ + filesize = h5_get_file_size(filename, fapl); + + /* Verify the filesize is the previous stored_eoa + 512 */ + VERIFY(filesize, stored_eoa+512, "file size"); + + /* Close the file access property list */ + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the file creation property list */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + } +} /* end test_incr_filesize() */ + +/**************************************************************** +** ** test_deprec(): ** Test deprecated functionality. ** @@ -7210,6 +7337,7 @@ test_file(void) test_libver_bounds_low_high(); test_libver_macros(); /* Test the macros for library version comparison */ test_libver_macros2(); /* Test the macros for library version comparison */ + test_incr_filesize(env_h5_drvr); /* Test H5Fincrement_filesize() and H5Fget_eoa() */ #ifndef H5_NO_DEPRECATED_SYMBOLS test_deprec(); /* Test deprecated routines */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index e3b989d..5724e1b 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -12,9 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Purpose: A tool to clear the status_flags field from the file's superblock via -s option. - * A tool to remove cache image from the file via -m option. - * + * Purpose: A tool used to do the following: + * (1) -s, --status: clear the status_flags field from the file's superblock + * (2) -m, --image: remove the metadata cache image from the file + * (3) --increment=C: set the file's EOA to the maximum of (EOA, EOF) + C + * (4) --filesize: print the file's EOA and EOF */ #include "hdf5.h" #include "H5private.h" @@ -24,18 +26,25 @@ /* Name of tool */ #define PROGRAMNAME "h5clear" -/* Make this private property (defined in H5Fprivate.h) available to h5clear. */ -#define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" +/* Make these private properties (defined in H5Fprivate.h) available to h5clear. */ +#define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" +#define H5F_ACS_NULL_FSM_ADDR_NAME "null_fsm_addr" +#define H5F_ACS_SKIP_EOF_CHECK_NAME "skip_eof_check" + +/* Default increment is 1 megabytes for the --increment option */ +#define DEFAULT_INCREMENT 1024*1024 static char *fname_g = NULL; static hbool_t clear_status_flags = FALSE; static hbool_t remove_cache_image = FALSE; +static hbool_t print_filesize = FALSE; +static hbool_t increment_eoa_eof = FALSE; +static hsize_t increment = DEFAULT_INCREMENT; /* - * Command-line options: The user can specify short or long-named - * parameters. + * Command-line options: only publicize long options */ -static const char *s_opts = "hVsm"; +static const char *s_opts = "hVsmzi*"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h'}, @@ -54,6 +63,21 @@ static struct long_options l_opts[] = { { "imag", no_arg, 'm' }, { "ima", no_arg, 'm' }, { "im", no_arg, 'm' }, + { "filesize", no_arg, 'z' }, + { "filesiz", no_arg, 'z' }, + { "filesi", no_arg, 'z' }, + { "files", no_arg, 'z' }, + { "file", no_arg, 'z' }, + { "fil", no_arg, 'z' }, + { "fi", no_arg, 'z' }, + { "increment", optional_arg, 'i' }, + { "incremen", optional_arg, 'i' }, + { "increme", optional_arg, 'i' }, + { "increm", optional_arg, 'i' }, + { "incre", optional_arg, 'i' }, + { "incr", optional_arg, 'i' }, + { "inc", optional_arg, 'i' }, + { "in", optional_arg, 'i' }, { NULL, 0, '\0' } }; @@ -76,6 +100,9 @@ static void usage(const char *prog) HDfprintf(stdout, " -V, --version Print version number and exit\n"); HDfprintf(stdout, " -s, --status Clear the status_flags field in the file's superblock\n"); HDfprintf(stdout, " -m, --image Remove the metadata cache image from the file\n"); + HDfprintf(stdout, " --filesize Print the file's EOA and EOF\n"); + HDfprintf(stdout, " --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file \n"); + HDfprintf(stdout, " C is >= 0; C is optional and will default to 1M when not set"); HDfprintf(stdout, "\n"); HDfprintf(stdout, "Examples of use:\n"); HDfprintf(stdout, "\n"); @@ -84,6 +111,12 @@ static void usage(const char *prog) HDfprintf(stdout, "\n"); HDfprintf(stdout, "h5clear -m file_name\n"); HDfprintf(stdout, " Remove the metadata cache image from the HDF5 file .\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, "h5clear --increment file_name\n"); + HDfprintf(stdout, " Set the EOA to the maximum of (EOA, EOF) + 1M for the file .\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, "h5clear --increment=512 file_name\n"); + HDfprintf(stdout, " Set the EOA to the maximum of (EOA, EOF) + 512 for the file .\n"); } /* usage() */ @@ -131,6 +164,18 @@ parse_command_line(int argc, const char **argv) remove_cache_image = TRUE; break; + case 'z': + print_filesize = TRUE; + break; + + case 'i': + increment_eoa_eof = TRUE; + if(opt_arg != NULL && (increment = HDatoi(opt_arg)) < 0) { + usage(h5tools_getprogname()); + goto done; + } + break; + default: usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); @@ -176,8 +221,24 @@ leave(int ret) /*------------------------------------------------------------------------- * Function: main * - * Purpose: To clear the status_flags field in the file's superblock (-s option). - * To remove the cache image from the file (-m option). + * Purpose: The options are: + * (1) -s, --status: clear the status_flags field from the file's superblock + * (2) -m, --image: remove the metadata cache image from the file + * (3) --increment=C: set the file's EOA to the maximum of (EOA, EOF) + C + * (4) --filesize: print the file's EOA and EOF + * + * The three options: -s, -m, and --increment will modify the file + * so the file is opened with write access. + * The --filesize option just prints the EOA and EOF, so the file + * is opened with read access. + * + * The -s option will activate the private property: + * --H5F_ACS_CLEAR_STATUS_FLAGS_NAME + * The --increment option will active these two private properties: + * --H5F_ACS_NULL_FSM_ADDR_NAME + * --H5F_ACS_SKIP_EOF_CHECK_NAME + * The --filesize will activate the private property: + * --H5F_ACS_SKIP_EOF_CHECK_NAME * * Return: Success: 0 * Failure: 1 @@ -187,11 +248,12 @@ leave(int ret) int main (int argc, const char *argv[]) { - char *fname = NULL; /* File name */ - hid_t fapl = -1; /* File access property list */ - hid_t fid = -1; /* File ID */ + char *fname = NULL; /* File name */ + hid_t fapl = -1; /* File access property list */ + hid_t fid = -1; /* File ID */ haddr_t image_addr; hsize_t image_len; + unsigned flags = H5F_ACC_RDWR; /* file access flags */ h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -209,12 +271,22 @@ main (int argc, const char *argv[]) if(fname_g == NULL) goto done; - if(!clear_status_flags && !remove_cache_image) { + /* Print usage/exit if not using at least one of the options */ + if(!clear_status_flags && !remove_cache_image && + !increment_eoa_eof && !print_filesize) { usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto done; } + /* Cannot combine the --filesize option with other options */ + if(print_filesize && + (clear_status_flags || remove_cache_image || increment_eoa_eof)) { + error_msg("Cannot combine --filesize with other options\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + /* Duplicate the file name */ fname = HDstrdup(fname_g); @@ -228,7 +300,7 @@ main (int argc, const char *argv[]) /* -s option */ if(clear_status_flags) { /* Set to clear the status_flags in the file's superblock */ - /* This is a private property used by h5clear only */ + /* Activate this private property */ if(H5Pset(fapl, H5F_ACS_CLEAR_STATUS_FLAGS_NAME, &clear_status_flags) < 0) { error_msg("H5Pset\n"); h5tools_setstatus(EXIT_FAILURE); @@ -236,12 +308,64 @@ main (int argc, const char *argv[]) } } - if((fid = h5tools_fopen(fname, H5F_ACC_RDWR, fapl, NULL, NULL, (size_t)0)) < 0) { + /* --increment option */ + if(increment_eoa_eof) { + /* Activate this private property */ + if(H5Pset(fapl, H5F_ACS_SKIP_EOF_CHECK_NAME, &increment_eoa_eof) < 0) { + error_msg("H5Pset\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + /* Activate this private property */ + if(H5Pset(fapl, H5F_ACS_NULL_FSM_ADDR_NAME, &increment_eoa_eof) < 0) { + error_msg("H5Pset\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } + + /* --filesize option; open the file read-only */ + if(print_filesize) { + /* Activate this private property */ + if(H5Pset(fapl, H5F_ACS_SKIP_EOF_CHECK_NAME, &print_filesize) < 0) { + error_msg("H5Pset\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + flags = H5F_ACC_RDONLY; + } + + /* Open the file */ + if((fid = h5tools_fopen(fname, flags, fapl, NULL, NULL, (size_t)0)) < 0) { error_msg("h5tools_fopen\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } + /* --filesize option */ + if(print_filesize) { + h5_stat_t st; /* Stat info call */ + haddr_t eoa; /* The EOA value */ + + /* Get the file's EOA and EOF */ + if(H5Fget_eoa(fid, &eoa) < 0 || HDstat(fname, &st) < 0) { + error_msg("H5Fget_eoa or HDstat\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + HDfprintf(stdout, "EOA is %a; EOF is %a \n", eoa, st.st_size); + } + + /* --increment option */ + if(increment_eoa_eof) { + /* Set the file's EOA to the maximum of (EOA, EOF) + increment */ + if(H5Fincrement_filesize(fid, increment) < 0) { + error_msg("H5Fset_eoa\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } + /* -m option */ if(remove_cache_image) { if(H5Fget_mdc_image_info(fid, &image_addr, &image_len) < 0) { @@ -253,7 +377,9 @@ main (int argc, const char *argv[]) warn_msg("No cache image in the file\n"); } + h5tools_setstatus(EXIT_SUCCESS); + done: if(fname) HDfree(fname); diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 942ae7a..5efce0a 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -20,11 +20,19 @@ # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- set (HDF5_TEST_FILES + h5clear_fsm_persist_equal.h5 + h5clear_fsm_persist_greater.h5 + h5clear_fsm_persist_less.h5 + h5clear_fsm_persist_noclose.h5 + h5clear_fsm_persist_user_equal.h5 + h5clear_fsm_persist_user_greater.h5 + h5clear_fsm_persist_user_less.h5 h5clear_log_v3.h5 h5clear_mdc_image.h5 - mod_h5clear_mdc_image.h5 + h5clear_status_noclose.h5 latest_h5clear_log_v3.h5 latest_h5clear_sec2_v3.h5 + mod_h5clear_mdc_image.h5 ) set (HDF5_SEC2_TEST_FILES h5clear_sec2_v0.h5 @@ -32,10 +40,25 @@ h5clear_sec2_v3.h5 ) set (HDF5_REFERENCE_TEST_FILES - h5clear_usage.ddl - h5clear_open_fail.ddl + h5clear_equal_after_size.ddl + h5clear_equal_before_size.ddl + h5clear_greater_after_size.ddl + h5clear_greater_before_size.ddl + h5clear_less_after_size.ddl + h5clear_less_before_size.ddl h5clear_missing_file.ddl + h5clear_noclose_after_size.ddl + h5clear_noclose_before_size.ddl h5clear_no_mdc_image.ddl + h5clear_open_fail.ddl + h5clear_status_noclose_after_size.ddl + h5clear_usage.ddl + h5clear_user_equal_after_size.ddl + h5clear_user_equal_before_size.ddl + h5clear_user_greater_after_size.ddl + h5clear_user_greater_before_size.ddl + h5clear_user_less_after_size.ddl + h5clear_user_less_before_size.ddl ) foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES} ${HDF5_REFERENCE_TEST_FILES}) @@ -270,3 +293,74 @@ endif() ADD_H5_TEST (latest_h5clr_log_v3 latest_h5clear_log_v3 "true") ADD_H5_TEST (h5clr_sec2_v0 h5clear_sec2_v0 "false") ADD_H5_TEST (h5clr_sec2_v2 h5clear_sec2_v2 "false") +# +# +# +# The following tests verify the filesize, increment the filesize, then verify the filesize again. +# +# (1) h5clear_status_noclose.h5 +# "h5clear --filesize h5clear_status_noclose.h5" (unable to open the file because status_flags is enabled) +# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) +# (no output, check exit code) +# "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image "false" "-s" "--increment=0" h5clear_status_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) +# +# (2) h5clear_fsm_persist_noclose.h5 +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, just check exit code) +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_open_fail_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image "false" "--increment=0" h5clear_fsm_persist_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) +# +# (3) h5clear_fsm_persist_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_equal_before_size h5clear_equal_before_size 0 "--filesize" h5clear_fsm_persist_equal.h5) + ADD_H5_RETTEST (h5clr_equal_incr "false" "--increment" h5clear_fsm_persist_equal.h5) + ADD_H5_CMP (h5clr_equal_after_size h5clear_equal_after_size 0 "--filesize" h5clear_fsm_persist_equal.h5) +# +# (4) h5clear_fsm_persist_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_greater_before_size h5clear_greater_before_size 0 "--filesize" h5clear_fsm_persist_greater.h5) + ADD_H5_RETTEST (h5clr_greater_incr "false" "--increment=0" h5clear_fsm_persist_greater.h5) + ADD_H5_CMP (h5clr_greater_after_size h5clear_greater_after_size 0 "--filesize" h5clear_fsm_persist_greater.h5) +# +# (5) h5clear_fsm_persist_less.h5 +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_less_before_size h5clear_less_before_size 0 "--filesize" h5clear_fsm_persist_less.h5) + ADD_H5_RETTEST (h5clr_less_incr "false" "--increment=200" h5clear_fsm_persist_less.h5) + ADD_H5_CMP (h5clr_less_after_size h5clear_less_after_size 0 "--filesize" h5clear_fsm_persist_less.h5) +# +# (6) h5clear_fsm_persist_user_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_user_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_user_equal_before_size h5clear_user_equal_before_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) + ADD_H5_RETTEST (h5clr_user_equal_incr "false" "--increment" h5clear_fsm_persist_user_equal.h5) + ADD_H5_CMP (h5clr_user_equal_after_size h5clear_user_equal_after_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) +# +# (7) h5clear_fsm_persist_user_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_user_greater_before_size h5clear_user_greater_before_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) + ADD_H5_RETTEST (h5clr_user_greater_incr "false" "--increment=0" h5clear_fsm_persist_user_greater.h5) + ADD_H5_CMP (h5clr_user_greater_after_size h5clear_user_greater_after_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) +# +# (8) h5clear_fsm_persist_user_less.h5 +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) + ADD_H5_CMP (h5clr_user_less_before_size h5clear_user_less_before_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) + ADD_H5_RETTEST (h5clr_user_less_incr "false" "--increment=0" h5clear_fsm_persist_user_less.h5) + ADD_H5_CMP (h5clr_user_less_after_size h5clear_user_less_after_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) +# +# diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 326109c..ccb510f 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -21,10 +21,25 @@ const char *FILENAME[] = { "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */ }; +const char *FILENAME_ENHANCE[] = { + "h5clear_fsm_persist_equal.h5", /* 0: persisting free-space, stored EOA = actual EOF */ + "h5clear_fsm_persist_greater.h5", /* 1: persisting free-space, stored EOA > actual EOF */ + "h5clear_fsm_persist_less.h5", /* 2: persisting free-space, stored EOA < actual EOF */ + "h5clear_fsm_persist_user_equal.h5", /* 3: user block, persisting free-space, stored EOA = actual EOF */ + "h5clear_fsm_persist_user_greater.h5", /* 4: user block, persisting free-space, stored EOA > actual EOF */ + "h5clear_fsm_persist_user_less.h5", /* 5: user block, persisting free-space, stored EOA < actual EOF */ + "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit, + stored EOA < actual EOF */ + "h5clear_fsm_persist_noclose.h5" /* 7 -- persisting free-space, no flush, exit, stored EOA < actual EOF */ +}; + #define KB 1024U #define CACHE_IMAGE_FILE "h5clear_mdc_image.h5" #define DSET "DSET" +#define DATASET "dset" +#define NUM_ELMTS 100 +#define USERBLOCK 512 /*------------------------------------------------------------------------- * Function: gen_cache_image_file @@ -118,26 +133,224 @@ error: H5Pclose(dcpl); } H5E_END_TRY; return 1; -} +} /* gen_cache_image_file() */ + +/*------------------------------------------------------------------------- + * Function: gen_enhance_files + * + * Purpose: To create the first 6 files in FILENAME_ENHANCE[]: + * (0) FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5" + * (1) FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5" + * (2) FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5" + * (3) FILENAME_ENHANCE[3]: "h5clear_user_fsm_persist_equal.h5" + * (4) FILENAME_ENHANCE[4]: "h5clear_user_fsm_persist_greater.h5" + * (5) FILENAME_ENHANCE[5]: "h5clear_user_fsm_persist_less.h5" + * After creating the files for #1, #2, #4 #5, write invalid EOA + * value to the location where the EOA is stored in the superblock. + * Also modify the chksum in the superblock due to this change. + * + * The first call to this routine (without user block) will generate + * the first 3 files. + * The second call to this routine (with user block) will generate + * the last 3 files. + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Vailin Choi; March 2017 + * + *------------------------------------------------------------------------- + */ +static int +gen_enhance_files(hbool_t user) +{ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t fapl = -1; /* File access property list */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hsize_t dim[1]; /* Dimension sizes */ + int data[NUM_ELMTS]; /* Buffer for data */ + int fd = -1; /* The file descriptor ID */ + int64_t eoa; /* The EOA value */ + int32_t chksum; /* The chksum value */ + int i = 0 , j = 0, u = 0; /* Local index variable */ + + /* Get a copy of the default file creation property */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Check to see if user block will be added */ + if(user) { + if(H5Pset_userblock(fcpl, (hsize_t)USERBLOCK) < 0) + goto error; + u = 3; + } + + /* Set file space strategy and persisting free-space */ + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) + goto error; + + /* + * Create the file, then write invalid EOA to the file. + */ + for(i = 0+u; i < 3+u; i++) { + + /* Create the file with the file space strategy and persisting free-space */ + if((fid = H5Fcreate(FILENAME_ENHANCE[i], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) + goto error; + + /* Create the dataset */ + dim[0] = NUM_ELMTS; + if((sid = H5Screate_simple(1, dim, NULL)) < 0) + goto error; + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + for(j = 0; j < NUM_ELMTS; j++) + data[j] = j; + + /* Write the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto error; + + /* Closing */ + if(H5Dclose(did) < 0) + goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + + /* + * No further action for: + * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5" + * --FILENAME_ENHANCE[3]: "h5clear_fsm_persist_user_equal.h5", + */ + if(!(i % 3)) + continue; + /* + * For the following files: + * --FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5" + * --FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5" + * --FILENAME_ENHANCE[4]: "h5clear_fsm_persist_greater.h5" + * --FILENAME_ENHANCE[5]: "h5clear_fsm_persist_less.h5" + * + * Write invalid value to the location for stored eoa and + * update the chksum value. + */ + /* Open the file */ + if((fd = open(FILENAME_ENHANCE[i], O_RDWR, 0663)) < 0) + goto error; + + switch(i) { + case 1: /* stored EOA is > EOF */ + eoa = 3048; + chksum = 268376587; + break; + + case 2: /* stored EOA is < EOF */ + eoa = 512; + chksum = 372920305; + break; + + case 4: /* with userblock, stored EOA > EOF */ + eoa = 4000; + chksum = 4168810027; + break; + + case 5: /* with userblock, stored EOA < EOF */ + eoa = 3000; + chksum = 3716054346; + break; + + default: + break; + } + + /* location of "end of file address" */ + if(lseek(fd, (off_t)(28+(user?USERBLOCK:0)), SEEK_SET) < 0) + goto error; + + /* Write the bad eoa value to the file */ + if(write(fd, &eoa, sizeof(eoa)) < 0) + goto error; + + /* location of "superblock checksum" */ + if(lseek(fd, (off_t)(44+(user?USERBLOCK:0)), SEEK_SET) < 0) + goto error; + + /* Write the chksum value to the file */ + if(write(fd, &chksum, sizeof(chksum)) < 0) + goto error; + + /* Close the file */ + if(close(fd) < 0) + goto error; + + } /* end for */ + + /* Close the property list */ + if(H5Pclose(fcpl) < 0) + goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + H5Dclose(did); + H5Fclose(fid); + H5Pclose(fcpl); + } H5E_END_TRY; + return 1; +} /* gen_enhance_files() */ /*------------------------------------------------------------------------- * Function: main * - * Purpose: To create HDF5 files with non-zero status_flags in the superblock - * via flushing and exiting without closing the library. + * Purpose: Generate test files used by h5clear. * - * Due to file locking, status_flags in the superblock will be - * nonzero after H5Fcreate. The library will clear status_flags - * on file closing. This program, after "H5Fcreate" the files, - * exits without going through library closing. Thus, status_flags - * for these files are not cleared. - * The library will check consistency of status_flags when opening - * a file with superblock >= v3 and will return error accordingly. - * The library will not check status_flags when opening a file - * with < v3 superblock. + * (A) gen_cache_image_file(): + * --generate a file with cache image feature + * --"h5clear_mdc_image.h5" + * (B) gen_enhance_files(): + * --generate the first 6 files in FILENAME_ENHANCE[]: + * (0) "h5clear_fsm_persist_equal.h5" + * (1) "h5clear_fsm_persist_greater.h5" + * (2) "h5clear_fsm_persist_less.h5" + * (3) "h5clear_fsm_persist_user_equal.h5" + * (4) "h5clear_fsm_persist_user_greater.h5" + * (5) "h5clear_fsm_persist_user_less.h5" * - * These files are used by "h5clear" to see if the tool clears - * status_flags properly so users can open the files afterwards. + * (C) Generate the following FILENAME[] files in main(): + * (0a) "h5clear_sec2_v3.h5" + * (0b) "latest_h5clear_sec2_v3.h5" + * (1a) "h5clear_log_v3.h5", + * (1b) "latest_h5clear_log_v3.h5" + * (2) "h5clear_sec2_v0.h5" + * (3) "h5clear_sec2_v2.h5" + * + * These HDF5 files are created with non-zero status_flags in + * the superblock via flushing and exiting without closing the + * library. + * Due to file locking, status_flags in the superblock will be + * nonzero after H5Fcreate. The library will clear status_flags + * on file closing. + * This program, after "H5Fcreate" the files, exits without + * going through library closing. Thus, status_flags for these + * files are not cleared. + * The library will check consistency of status_flags when + * opening a file with superblock >= v3 and will return error + * accordingly. + * The library will not check status_flags when opening a file + * with < v3 superblock. + * These files are used by "h5clear" to see if the tool clears + * status_flags properly so users can open the files afterwards. + * + * (D) Generate the last two files in FILENAME_ENHANCE[] in main(): + * (6) "h5clear_status_noclose.h5", + * (7) "h5clear_fsm_persist_noclose.h5" * * Return: Success: 0 * Failure: 1 @@ -149,20 +362,30 @@ error: int main(void) { - hid_t fid; /* File ID */ - hid_t fcpl; /* File creation property list */ - hid_t fapl, new_fapl; /* File access property lists */ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t fapl = -1, new_fapl = -1; /* File access property lists */ char fname[512]; /* File name */ - unsigned new_format; /* To use latest library format or not */ + unsigned new_format; /* To use latest library format or not */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hsize_t dim[1]; /* Dimension sizes */ + int data[NUM_ELMTS]; /* Buffer for data */ + int i; /* Local index variables */ /* Generate a file with cache image feature enabled */ if(gen_cache_image_file(CACHE_IMAGE_FILE) < 0) goto error; + /* Generate the first 6 files in FILENAME_ENHANCE[] */ + if(gen_enhance_files(FALSE) < 0) + goto error; + if(gen_enhance_files(TRUE) < 0) + goto error; + /* - * Generate files with invalid status_flags + * Generate files in FILENAME[] */ - /* Create a copy of the file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; @@ -174,7 +397,11 @@ main(void) if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) goto error; - /* Files created within this for loop will have v3 superblock and nonzero status_flags */ + /* + * Files created within this for loop will have v3 superblock and nonzero status_flags + * --FILENAME[0]: "h5clear_sec2_v3.h5", "latest_h5clear_sec2_v3.h5" + * --FILENAME[1]: "h5clear_log_v3.h5", "latest_h5clear_log_v3.h5" + */ for(new_format = FALSE; new_format <= TRUE; new_format++) { hid_t fapl2, my_fapl; /* File access property lists */ @@ -228,7 +455,8 @@ main(void) } /* end for */ /* - * Create a sec2 file with v0 superblock but nonzero status_flags + * Create a sec2 file with v0 superblock but nonzero status_flags: + * FILENAME[2]: "h5clear_sec2_v0.h5" */ if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; @@ -239,7 +467,8 @@ main(void) /* - * Create a sec2 file with v2 superblock but nonzero status_flags + * Create a sec2 file with v2 superblock but nonzero status_flags: + * FILENAME[3]: "h5clear_sec2_v2.h5" */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; @@ -264,6 +493,100 @@ main(void) if(H5Pclose(fcpl) < 0) goto error; + /* + * Create the last two files in FILENAME_ENHANCE[]: + * --FILENAME_ENHANCE[6]: h5clear_status_noclose.h5 + * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 + */ + /* + * FILENAME_ENHANCE[6]: h5clear_status_noclose.h5 + * --stored EOA < actual EOF + * --version 3 superblock + * --nonzero status_flags + * --does not persist free-space + * --does not flush the file, just exit without closing file: + * --this file is similar to the user-suppplied test file attached with HDFFV-10347 + */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set to latest format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto error; + + /* Create file with SWMR-write access */ + if((fid = H5Fcreate(FILENAME_ENHANCE[6], H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) + goto error; + + /* Create the dataset */ + dim[0] = NUM_ELMTS; + if((sid = H5Screate_simple(1, dim, NULL)) < 0) + goto error; + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + for(i = 0; i < NUM_ELMTS; i++) + data[i] = i; + + /* Write the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto error; + + /* Closing */ + if(H5Dclose(did) < 0) + goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Pclose(fapl) < 0) + goto error; + + /* Does not flush and does not close the file */ + + + /* + * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 + * --stored EOA < actual EOF + * --persisting free-space + * --undefined fsinfo.eoa_pre_fsm_fsalloc + * --undefined fsinfo.fs_addr + * --does not flush the file, just exit without closing + */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; + + /* Set file space strategy and persisting free-space */ + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) + goto error; + + /* Create the file with the set file space info */ + if((fid = H5Fcreate(FILENAME_ENHANCE[7], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) + goto error; + + /* Create the dataset */ + dim[0] = NUM_ELMTS; + if((sid = H5Screate_simple(1, dim, NULL)) < 0) + goto error; + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + for(i = 0; i < NUM_ELMTS; i++) + data[i] = i; + + /* Write the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto error; + + /* Closing */ + if(H5Dclose(did) < 0) + goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Pclose(fcpl) < 0) + goto error; + + /* Does not flush and does not close the file */ + + fflush(stdout); fflush(stderr); diff --git a/tools/test/misc/testfiles/h5clear_equal_after_size.ddl b/tools/test/misc/testfiles/h5clear_equal_after_size.ddl new file mode 100644 index 0000000..1b9a4e4 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_equal_after_size.ddl @@ -0,0 +1 @@ +EOA is 1051141; EOF is 1051141 diff --git a/tools/test/misc/testfiles/h5clear_equal_before_size.ddl b/tools/test/misc/testfiles/h5clear_equal_before_size.ddl new file mode 100644 index 0000000..9beed42 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_equal_before_size.ddl @@ -0,0 +1 @@ +EOA is 2565; EOF is 2565 diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 new file mode 100644 index 0000000..0577690 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_equal.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 new file mode 100644 index 0000000..6358878 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_greater.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 new file mode 100644 index 0000000..c1f3221 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_less.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 new file mode 100644 index 0000000..57462db Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_noclose.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 new file mode 100644 index 0000000..5389c41 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_user_equal.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 new file mode 100644 index 0000000..f40e760 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_user_greater.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 b/tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 new file mode 100644 index 0000000..55d0cc5 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_fsm_persist_user_less.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_greater_after_size.ddl b/tools/test/misc/testfiles/h5clear_greater_after_size.ddl new file mode 100644 index 0000000..74c8f19 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_greater_after_size.ddl @@ -0,0 +1 @@ +EOA is 3048; EOF is 3048 diff --git a/tools/test/misc/testfiles/h5clear_greater_before_size.ddl b/tools/test/misc/testfiles/h5clear_greater_before_size.ddl new file mode 100644 index 0000000..03b22fb --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_greater_before_size.ddl @@ -0,0 +1 @@ +EOA is 3048; EOF is 2565 diff --git a/tools/test/misc/testfiles/h5clear_less_after_size.ddl b/tools/test/misc/testfiles/h5clear_less_after_size.ddl new file mode 100644 index 0000000..bedf0d2 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_less_after_size.ddl @@ -0,0 +1 @@ +EOA is 2765; EOF is 2765 diff --git a/tools/test/misc/testfiles/h5clear_less_before_size.ddl b/tools/test/misc/testfiles/h5clear_less_before_size.ddl new file mode 100644 index 0000000..50ba4c4 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_less_before_size.ddl @@ -0,0 +1 @@ +EOA is 512; EOF is 2565 diff --git a/tools/test/misc/testfiles/h5clear_missing_file.ddl b/tools/test/misc/testfiles/h5clear_missing_file.ddl index 1e5150c..13eb2c9 100644 --- a/tools/test/misc/testfiles/h5clear_missing_file.ddl +++ b/tools/test/misc/testfiles/h5clear_missing_file.ddl @@ -4,7 +4,9 @@ usage: h5clear [OPTIONS] file_name -V, --version Print version number and exit -s, --status Clear the status_flags field in the file's superblock -m, --image Remove the metadata cache image from the file - + --filesize Print the file's EOA and EOF + --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file + C is >= 0; C is optional and will default to 1M when not set Examples of use: h5clear -s file_name @@ -12,4 +14,10 @@ h5clear -s file_name h5clear -m file_name Remove the metadata cache image from the HDF5 file . + +h5clear --increment file_name + Set the EOA to the maximum of (EOA, EOF) + 1M for the file . + +h5clear --increment=512 file_name + Set the EOA to the maximum of (EOA, EOF) + 512 for the file . h5clear error: missing file name diff --git a/tools/test/misc/testfiles/h5clear_noclose_after_size.ddl b/tools/test/misc/testfiles/h5clear_noclose_after_size.ddl new file mode 100644 index 0000000..7846b47 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_noclose_after_size.ddl @@ -0,0 +1 @@ +EOA is 2448; EOF is 2448 diff --git a/tools/test/misc/testfiles/h5clear_noclose_before_size.ddl b/tools/test/misc/testfiles/h5clear_noclose_before_size.ddl new file mode 100644 index 0000000..f294a6d --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_noclose_before_size.ddl @@ -0,0 +1 @@ +EOA is 2048; EOF is 2448 diff --git a/tools/test/misc/testfiles/h5clear_status_noclose.h5 b/tools/test/misc/testfiles/h5clear_status_noclose.h5 new file mode 100644 index 0000000..94a950d Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_status_noclose.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl b/tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl new file mode 100644 index 0000000..7846b47 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_status_noclose_after_size.ddl @@ -0,0 +1 @@ +EOA is 2448; EOF is 2448 diff --git a/tools/test/misc/testfiles/h5clear_usage.ddl b/tools/test/misc/testfiles/h5clear_usage.ddl index a399ae7..32dd549 100644 --- a/tools/test/misc/testfiles/h5clear_usage.ddl +++ b/tools/test/misc/testfiles/h5clear_usage.ddl @@ -4,7 +4,9 @@ usage: h5clear [OPTIONS] file_name -V, --version Print version number and exit -s, --status Clear the status_flags field in the file's superblock -m, --image Remove the metadata cache image from the file - + --filesize Print the file's EOA and EOF + --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file + C is >= 0; C is optional and will default to 1M when not set Examples of use: h5clear -s file_name @@ -12,3 +14,9 @@ h5clear -s file_name h5clear -m file_name Remove the metadata cache image from the HDF5 file . + +h5clear --increment file_name + Set the EOA to the maximum of (EOA, EOF) + 1M for the file . + +h5clear --increment=512 file_name + Set the EOA to the maximum of (EOA, EOF) + 512 for the file . diff --git a/tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl b/tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl new file mode 100644 index 0000000..028e134 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_equal_after_size.ddl @@ -0,0 +1 @@ +EOA is 1051653; EOF is 1051653 diff --git a/tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl b/tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl new file mode 100644 index 0000000..ef7c391 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_equal_before_size.ddl @@ -0,0 +1 @@ +EOA is 3077; EOF is 3077 diff --git a/tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl b/tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl new file mode 100644 index 0000000..9d7de6f --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_greater_after_size.ddl @@ -0,0 +1 @@ +EOA is 4000; EOF is 4000 diff --git a/tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl b/tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl new file mode 100644 index 0000000..c3fe625 --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_greater_before_size.ddl @@ -0,0 +1 @@ +EOA is 4000; EOF is 3077 diff --git a/tools/test/misc/testfiles/h5clear_user_less_after_size.ddl b/tools/test/misc/testfiles/h5clear_user_less_after_size.ddl new file mode 100644 index 0000000..02c0d2a --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_less_after_size.ddl @@ -0,0 +1 @@ +EOA is 3277; EOF is 3277 diff --git a/tools/test/misc/testfiles/h5clear_user_less_before_size.ddl b/tools/test/misc/testfiles/h5clear_user_less_before_size.ddl new file mode 100644 index 0000000..0651c2b --- /dev/null +++ b/tools/test/misc/testfiles/h5clear_user_less_before_size.ddl @@ -0,0 +1 @@ +EOA is 3000; EOF is 3077 diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in index 2966b2c..11c2ff9 100644 --- a/tools/test/misc/testh5clear.sh.in +++ b/tools/test/misc/testh5clear.sh.in @@ -66,6 +66,21 @@ $SRC_H5CLEAR_TESTFILES/h5clear_usage.ddl $SRC_H5CLEAR_TESTFILES/h5clear_open_fail.ddl $SRC_H5CLEAR_TESTFILES/h5clear_missing_file.ddl $SRC_H5CLEAR_TESTFILES/h5clear_no_mdc_image.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_status_noclose_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_noclose_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_noclose_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_equal_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_equal_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_greater_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_greater_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_less_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_less_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_equal_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_equal_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_greater_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_greater_after_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_less_before_size.ddl +$SRC_H5CLEAR_TESTFILES/h5clear_user_less_after_size.ddl $SRC_H5CLEAR_TESTFILES/h5clear_sec2_v0.h5 $SRC_H5CLEAR_TESTFILES/h5clear_sec2_v2.h5 $SRC_H5CLEAR_TESTFILES/h5clear_sec2_v3.h5 @@ -74,6 +89,14 @@ $SRC_H5CLEAR_TESTFILES/latest_h5clear_log_v3.h5 $SRC_H5CLEAR_TESTFILES/latest_h5clear_sec2_v3.h5 $SRC_H5CLEAR_TESTFILES/h5clear_mdc_image.h5 $SRC_H5CLEAR_TESTFILES/mod_h5clear_mdc_image.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_status_noclose.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_noclose.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_equal.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_greater.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_less.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_user_equal.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_user_greater.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_fsm_persist_user_less.h5 " COPY_TESTFILES_TO_TESTDIR() @@ -152,7 +175,8 @@ TOOLTEST_OUT() { fname=$1 option1=$2 option2=$3 - expected=$4 + option3=$4 + expected=$5 # Prepare expected and actual output expect="$TESTDIR/$expected" actual="$TESTDIR/`basename $expected .ddl`.out" @@ -161,10 +185,10 @@ TOOLTEST_OUT() { actual_err_sav=${actual_err}-sav # Run test. - TESTING $H5CLEAR $option1 $option2 $fname + TESTING $H5CLEAR $option1 $option2 $option3 $option4 $fname ( cd $TESTDIR - $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname + $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $option3 $option4 $fname ) >$actual 2>$actual_err cp $actual $actual_sav cp $actual_err $actual_err_sav @@ -245,17 +269,16 @@ $CP -f $TESTDIR/h5clear_sec2_v3.h5 $TESTDIR/orig_h5clear_sec2_v3.h5 # "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) # "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) # "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) -TOOLTEST_OUT "" -h "" h5clear_usage.ddl -TOOLTEST_OUT "" "" "" h5clear_usage.ddl -TOOLTEST_OUT junk.h5 "" "" h5clear_usage.ddl -TOOLTEST_OUT orig_h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl -TOOLTEST_OUT "" -m "" h5clear_missing_file.ddl -TOOLTEST_OUT junk.h5 -s "" h5clear_open_fail.ddl -TOOLTEST_OUT "" -m -s h5clear_missing_file.ddl -TOOLTEST_OUT junk.h5 -m -s h5clear_open_fail.ddl -TOOLTEST_OUT orig_h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl -# +TOOLTEST_OUT "" -h "" "" h5clear_usage.ddl +TOOLTEST_OUT "" "" "" "" h5clear_usage.ddl +TOOLTEST_OUT junk.h5 "" "" "" h5clear_usage.ddl +TOOLTEST_OUT orig_h5clear_sec2_v3.h5 "" "" "" h5clear_usage.ddl +TOOLTEST_OUT "" -m "" "" h5clear_missing_file.ddl +TOOLTEST_OUT junk.h5 -s "" "" h5clear_open_fail.ddl +TOOLTEST_OUT "" -m -s "" h5clear_missing_file.ddl +TOOLTEST_OUT junk.h5 -m -s "" h5clear_open_fail.ddl +TOOLTEST_OUT orig_h5clear_sec2_v2.h5 -m "" "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT orig_h5clear_sec2_v0.h5 -s -m "" h5clear_no_mdc_image.ddl # # # The following are tests to verify the expected exit code from h5clear: @@ -285,8 +308,8 @@ TOOLTEST h5clear_sec2_v0.h5 -l -m $FAIL # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: -TOOLTEST_OUT mod_h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT mod_h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT mod_h5clear_mdc_image.h5 -m "" "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT mod_h5clear_mdc_image.h5 -s -m "" h5clear_no_mdc_image.ddl # # # @@ -319,6 +342,73 @@ OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED # # # +# (1) h5clear_status_noclose.h5 +# "h5clear --filesize h5clear_status_noclose.h5" (unable to open the file because status_flag is on) +# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) +# (no output, check exit code) +# "h5clear --filesize h5clear_status_noclose_user.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_status_noclose.h5 --filesize "" "" h5clear_open_fail.ddl +TOOLTEST h5clear_status_noclose.h5 -s --increment=0 $SUCCEED +TOOLTEST_OUT h5clear_status_noclose.h5 --filesize "" "" h5clear_status_noclose_after_size.ddl +# +# (2) h5clear_fsm_persist_noclose.h5 +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_noclose.h5 --filesize "" "" h5clear_noclose_before_size.ddl +TOOLTEST h5clear_fsm_persist_noclose.h5 --increment=0 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_noclose.h5 --filesize "" "" h5clear_noclose_after_size.ddl +# +# (3) h5clear_fsm_persist_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_equal.h5 --filesize "" "" h5clear_equal_before_size.ddl +TOOLTEST h5clear_fsm_persist_equal.h5 --increment "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_equal.h5 --filesize "" "" h5clear_equal_after_size.ddl +# +# (4) h5clear_fsm_persist_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_greater.h5 --filesize "" "" h5clear_greater_before_size.ddl +TOOLTEST h5clear_fsm_persist_greater.h5 --increment=0 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_greater.h5 --filesize "" "" h5clear_greater_after_size.ddl +# +# (5) h5clear_fsm_persist_less.h5 +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_less.h5 --filesize "" "" h5clear_less_before_size.ddl +TOOLTEST h5clear_fsm_persist_less.h5 --increment=200 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_less.h5 --filesize "" "" h5clear_less_after_size.ddl +# +# (6) h5clear_fsm_persist_user_equal.h5 +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF before the next action) +# "h5clear --increment h5clear_fsm_persist_user_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_user_equal.h5 --filesize "" "" h5clear_user_equal_before_size.ddl +TOOLTEST h5clear_fsm_persist_user_equal.h5 --increment "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_user_equal.h5 --filesize "" "" h5clear_user_equal_after_size.ddl +# +# (7) h5clear_fsm_persist_user_greater.h5 +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) +# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_user_greater.h5 --filesize "" "" h5clear_user_greater_before_size.ddl +TOOLTEST h5clear_fsm_persist_user_greater.h5 --increment=0 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_user_greater.h5 --filesize "" "" h5clear_user_greater_after_size.ddl +# +# (8) h5clear_fsm_persist_user_less.h5 +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_user_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF after the last action) +TOOLTEST_OUT h5clear_fsm_persist_user_less.h5 --filesize "" "" h5clear_user_less_before_size.ddl +TOOLTEST h5clear_fsm_persist_user_less.h5 --increment=200 "" $SUCCEED +TOOLTEST_OUT h5clear_fsm_persist_user_less.h5 --filesize "" "" h5clear_user_less_after_size.ddl +# +# +# # Clean up test files if test -z "$HDF5_NOCLEANUP"; then rm -f h5clear_*.h5 latest_h5clear*.h5 -- cgit v0.12 From 1651db060844acd4203f066e539f380318a7f70f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Mar 2018 10:59:07 -0500 Subject: HDFFV-10418 adjust build commands to match main library build --- fortran/src/CMakeLists.txt | 4 ++-- hl/fortran/src/CMakeLists.txt | 44 ++++++++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 64cf739..3abab4e 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_F90_SRC C CXX Fortran) +project (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows @@ -295,7 +295,7 @@ if (BUILD_SHARED_LIBS) ) if (WIN32) set_property (TARGET ${HDF5_F90_LIBSH_TARGET} - APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_DLL;HDF5F90_WINDOWS" + APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_DLL;HDF5F90_WINDOWS" ) endif () set (install_targets ${install_targets} ${HDF5_F90_LIBSH_TARGET}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 82be551..6dd94fe 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT(HDF5_HL_F90_SRC C CXX Fortran) +project (HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows @@ -37,10 +37,10 @@ set_target_properties (H5HL_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") + file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/shared") set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE}) endif () -file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/static") +file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- @@ -110,34 +110,34 @@ set (HDF5_HL_F90_F_BASE_SOURCES ) add_custom_command ( - OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/H5TBff_gen.F90 COMMAND $ - WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/static + WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files" ) add_custom_target (H5HLgen ALL - DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + DEPENDS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/H5TBff_gen.F90 ) set_source_files_properties ( - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) if (BUILD_SHARED_LIBS) add_custom_command ( - OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + OUTPUT ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 COMMAND $ - WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/shared + WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/shared DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files" ) add_custom_target (H5HLgenSH ALL - DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + DEPENDS ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 ) set_source_files_properties ( - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) endif () @@ -146,8 +146,8 @@ set (HDF5_HL_F90_F_SOURCES ${HDF5_HL_F90_F_BASE_SOURCES} # generated files - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/static/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) @@ -156,8 +156,8 @@ if (BUILD_SHARED_LIBS) ${HDF5_HL_F90_F_BASE_SOURCES} # generated files - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 - ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 + ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) endif () @@ -165,6 +165,10 @@ endif () add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC) set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES @@ -189,11 +193,17 @@ if (BUILD_SHARED_LIBS) endif () TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) + target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) + target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED ${HDF5_HL_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl/fortran LINKER_LANGUAGE Fortran + COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared -- cgit v0.12 From 2adf6c741fcd984a3067373e03023e71a8d721a9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Mar 2018 13:40:38 -0500 Subject: Remove obsolete files --- MANIFEST | 7 ------- 1 file changed, 7 deletions(-) diff --git a/MANIFEST b/MANIFEST index 805c8d9..7d28f12 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3101,7 +3101,6 @@ ./config/cmake_ext_mod/ConfigureChecks.cmake ./config/cmake_ext_mod/CTestCustom.cmake -./config/cmake_ext_mod/FindMPI.cmake ./config/cmake_ext_mod/FindSZIP.cmake ./config/cmake_ext_mod/GetTimeOfDayTest.cpp ./config/cmake_ext_mod/grepTest.cmake @@ -3117,12 +3116,6 @@ ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in -./config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in -./config/cmake_ext_mod/FindMPI/libver_mpi.c -./config/cmake_ext_mod/FindMPI/libver_mpi.f90.in -./config/cmake_ext_mod/FindMPI/mpiver.f90.in -./config/cmake_ext_mod/FindMPI/test_mpi.c -./config/cmake_ext_mod/FindMPI/test_mpi.f90.in # CMake-specific User Files ./config/cmake/UserMacros/Windows_MT.cmake -- cgit v0.12 From 6a53c14240872fcc82504fffaa010d754a8c73e0 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 13:47:27 -0500 Subject: Add HDfree of vector, matrix_out and matrix_out1 previously HDmalloced in coll_write_test(). --- testpar/t_span_tree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 20bc4ac..f4de133 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -255,7 +255,7 @@ void coll_write_test(int chunk_factor) #endif - int *matrix_out, *matrix_out1, *vector; + int *matrix_out = NULL, *matrix_out1 = NULL, *vector = NULL; int mpi_size,mpi_rank; @@ -662,6 +662,13 @@ void coll_write_test(int chunk_factor) ret = H5Fclose(file); VRFY((ret >= 0),""); + if (vector != NULL) + HDfree(vector); + if (matrix_out != NULL) + HDfree(matrix_out); + if (matrix_out1 != NULL) + HDfree(matrix_out1); + return ; } -- cgit v0.12 From 5d7c18fcfc14a53f4d6321460463357fbda61f4b Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 14:10:59 -0500 Subject: Remove comparison to NULL for variables to be freed. --- testpar/t_span_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index f4de133..3c836ad 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -662,11 +662,11 @@ void coll_write_test(int chunk_factor) ret = H5Fclose(file); VRFY((ret >= 0),""); - if (vector != NULL) + if (vector) HDfree(vector); - if (matrix_out != NULL) + if (matrix_out) HDfree(matrix_out); - if (matrix_out1 != NULL) + if (matrix_out1) HDfree(matrix_out1); return ; -- cgit v0.12 From 1a3beaadce81ad257d186c9dca8906577cce58b0 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Mon, 12 Mar 2018 16:17:10 -0400 Subject: Unify the test (t_bigio.c) between hdf5_1_10 and develop --- testpar/t_bigio.c | 395 +++++++++++------------------------------------------- 1 file changed, 79 insertions(+), 316 deletions(-) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 611ff1a..fdd3488 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -3,7 +3,10 @@ #include "testphdf5.h" #include "H5Dprivate.h" /* For Chunk tests */ -// int TestVerbosity = VERBO_LO; /* Default Verbosity is Low */ +/* FILENAME and filenames must have the same number of names */ +const char *FILENAME[2]={ "bigio_test.h5", + NULL + }; /* Constants definitions */ #define MAX_ERR_REPORT 10 /* Maximum number of errors reported */ @@ -38,7 +41,6 @@ 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; -char filename[20] = "bigio_test.h5"; int nerrors = 0; int mpi_size, mpi_rank; @@ -506,7 +508,7 @@ dataset_big_write(void) H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); /* create the file collectively */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); + fid = H5Fcreate(FILENAME[0], H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ @@ -515,7 +517,8 @@ dataset_big_write(void) /* Each process takes a slabs of rows. */ - printf("\nTesting Dataset1 write by ROW\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset1 write by ROW\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size; @@ -563,21 +566,6 @@ dataset_big_write(void) VRFY((ret>= 0),"set independent IO collectively succeeded"); } - /* write data collectively */ - MESG("writeAll by Row"); - { - int j,k =0; - for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - if(k < 10) { - printf("%lld ", wdata[k]); - k++; - } - } - } - printf("\n"); - } - ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); @@ -591,9 +579,9 @@ dataset_big_write(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); - /* Each process takes a slabs of cols. */ - printf("\nTesting Dataset2 write by COL\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset2 write by COL\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size; @@ -641,21 +629,6 @@ dataset_big_write(void) VRFY((ret>= 0),"set independent IO collectively succeeded"); } - /* write data collectively */ - MESG("writeAll by Col"); - { - int j,k =0; - for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - if(k < 10) { - printf("%lld ", wdata[k]); - k++; - } - } - } - printf("\n"); - } - ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); @@ -671,7 +644,8 @@ dataset_big_write(void) /* ALL selection */ - printf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = 1; @@ -685,7 +659,7 @@ dataset_big_write(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(MAINPROCESS) { + if(mpi_rank == 0) { ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sset_all succeeded"); } @@ -697,7 +671,7 @@ dataset_big_write(void) /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); VRFY((mem_dataspace >= 0), ""); - if(!MAINPROCESS) { + if(!mpi_rank == 0) { ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sset_none succeeded"); } @@ -719,21 +693,6 @@ dataset_big_write(void) MESG("data_array created"); } - /* write data collectively */ - MESG("writeAll by process 0"); - { - int j,k =0; - for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - if(k < 10) { - printf("%lld ", wdata[k]); - k++; - } - } - } - printf("\n"); - } - ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); @@ -747,7 +706,8 @@ dataset_big_write(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); /* Point selection */ - printf("\nTesting Dataset4 write point selection\n"); + if (mpi_rank == 0) + HDprintf("\nTesting Dataset4 write point selection\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size * 4; @@ -818,101 +778,7 @@ dataset_big_write(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - /* Irregular selection */ - /* Need larger memory for data buffer */ - free(wdata); -#if 0 - wdata = (B_DATATYPE *)malloc(bigcount*4*sizeof(B_DATATYPE)); - VRFY((wdata != NULL), "wdata malloc succeeded"); - - printf("\nTesting Dataset5 write irregular selection\n"); - /* Create a large dataset */ - dims[0] = bigcount/6; - dims[1] = mpi_size * 4; - - sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); - dataset = H5Dcreate2(fid, DATASET5, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); - H5Sclose(sid); - - /* first select 1 col in this procs splice */ - block[0] = dims[0]; - block[1] = 1; - stride[0] = block[0]; - stride[1] = block[1]; - count[0] = 1; - count[1] = 1; - start[0] = 0; - start[1] = mpi_rank * 4; - - /* create a file dataspace */ - file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - - // dims[1] = 4; - /* create a memory dataspace */ - mem_dataspace = H5Screate_simple (RANK, dims, NULL); - VRFY((mem_dataspace >= 0), ""); - - ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - - start[1] = 0; - ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - - /* select every other row in the process splice and OR it with - the col selection to create an irregular selection */ - for(h=0 ; h= 0), "H5Sset_hyperslab succeeded"); - - start[1] = 0; - ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_OR, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - } - printf("Setting up for collective transfer\n"); - /* set up the collective transfer properties list */ - xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); - if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); - } - - /* fill the local slab with some trivial data */ - fill_datasets(start, dims, wdata); - MESG("data_array initialized"); - if(VERBOSE_MED){ - MESG("data_array created"); - } - - ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, - xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); - - /* release all temporary handles. */ - H5Sclose(file_dataspace); - H5Sclose(mem_dataspace); - H5Pclose(xfer_plist); - - ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); - free(wdata); -#endif H5Fclose(fid); } @@ -960,15 +826,16 @@ dataset_big_read(void) H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); /* open the file collectively */ - fid=H5Fopen(filename,H5F_ACC_RDONLY,acc_tpl); + fid=H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_tpl); VRFY((fid >= 0), "H5Fopen succeeded"); /* Release file-access template */ ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); + if (mpi_rank == 0) + HDprintf("\nRead Testing Dataset1 by COL\n"); - printf("\nRead Testing Dataset1 by COL\n"); dataset = H5Dopen2(fid, DATASET1, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -1016,18 +883,6 @@ dataset_big_read(void) xfer_plist, rdata); VRFY((ret >= 0), "H5Dread dataset1 succeeded"); - { - for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - if(k < 10) { - printf("%lld ", rdata[k]); - k++; - } - } - } - printf("\n"); - } - /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} @@ -1040,7 +895,8 @@ dataset_big_read(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); - printf("\nRead Testing Dataset2 by ROW\n"); + if (mpi_rank == 0) + HDprintf("\nRead Testing Dataset2 by ROW\n"); memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -1089,18 +945,6 @@ dataset_big_read(void) xfer_plist, rdata); VRFY((ret >= 0), "H5Dread dataset2 succeeded"); - { - for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - if(k < 10) { - printf("%lld ", rdata[k]); - k++; - } - } - } - printf("\n"); - } - /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} @@ -1112,8 +956,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - - printf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); + if (mpi_rank == 0) + HDprintf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET3, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -1124,7 +968,7 @@ dataset_big_read(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(MAINPROCESS) { + if(mpi_rank == 0) { ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sset_all succeeded"); } @@ -1136,7 +980,7 @@ dataset_big_read(void) /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); VRFY((mem_dataspace >= 0), ""); - if(!MAINPROCESS) { + if(!mpi_rank == 0) { ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sset_none succeeded"); } @@ -1163,19 +1007,7 @@ dataset_big_read(void) xfer_plist, rdata); VRFY((ret >= 0), "H5Dread dataset3 succeeded"); - { - for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - if(k < 10) { - printf("%lld ", rdata[k]); - k++; - } - } - } - printf("\n"); - } - - if(MAINPROCESS) { + if(mpi_rank == 0) { /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} @@ -1188,7 +1020,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - printf("\nRead Testing Dataset4 with Point selection\n"); + if (mpi_rank == 0) + HDprintf("\nRead Testing Dataset4 with Point selection\n"); dataset = H5Dopen2(fid, DATASET4, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -1258,131 +1091,33 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - printf("\nRead Testing Dataset5 with Irregular selection\n"); - /* Need larger memory for data buffer */ free(wdata); free(rdata); -#if 0 - wdata = (B_DATATYPE *)malloc(bigcount*4*sizeof(B_DATATYPE)); - VRFY((wdata != NULL), "wdata malloc succeeded"); - rdata = (B_DATATYPE *)malloc(bigcount*4*sizeof(B_DATATYPE)); - VRFY((rdata != NULL), "rdata malloc succeeded"); - - dataset = H5Dopen2(fid, DATASET5, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); - - dims[0] = bigcount; - dims[1] = mpi_size * 4; - - /* first select 1 col in this proc splice */ - block[0] = dims[0]; - block[1] = 1; - stride[0] = block[0]; - stride[1] = block[1]; - count[0] = 1; - count[1] = 1; - start[0] = 0; - start[1] = mpi_rank * 4; - - /* get file dataspace */ - file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - - /* create a memory dataspace */ - mem_dataspace = H5Screate_simple (RANK, dims, NULL); - VRFY((mem_dataspace >= 0), ""); - - ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - - start[1] = 0; - ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - - /* select every other row in the process splice and OR it with - the col selection to create an irregular selection */ - for(h=0 ; h= 0), "H5Sset_hyperslab succeeded"); - - start[1] = 0; - ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_OR, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - - //fprintf(stderr, "%d: %d - %d\n", mpi_rank, (int)h, (int)H5Sget_select_npoints(mem_dataspace)); - } - - /* set up the collective transfer properties list */ - xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); - ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); - if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); - } - - /* read data collectively */ - ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, - xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset1 succeeded"); - - /* fill dataset with test data */ - fill_datasets(start, dims, wdata); - MESG("data_array initialized"); - if(VERBOSE_MED){ - MESG("data_array created"); - } - - - /* verify the read data with original expected data */ - block[0] = dims[0]; - block[1] = 1; - stride[0] = block[0]; - stride[1] = block[1]; - count[0] = 1; - count[1] = 1; - start[0] = 0; - start[1] = 0; - ret = verify_data(start, count, stride, block, rdata, wdata); - if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} - - for(h=0 ; h= 0), "H5Dclose1 succeeded"); - + if (file_dataspace != -1) H5Sclose(file_dataspace); + if (mem_dataspace != -1) H5Sclose(mem_dataspace); + if (xfer_plist != -1) H5Pclose(xfer_plist); + if (dataset != -1) { + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + } H5Fclose(fid); /* release data buffers */ if(rdata) free(rdata); if(wdata) free(wdata); -#endif + } /* dataset_large_readAll */ @@ -1478,7 +1213,8 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) void coll_chunk1(void) { - if (MAINPROCESS) + const char *filename = FILENAME[0]; + if (mpi_rank == 0) printf("coll_chunk1\n"); coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1531,7 +1267,8 @@ coll_chunk1(void) void coll_chunk2(void) { - if (MAINPROCESS) + const char *filename = FILENAME[0]; + if (mpi_rank == 0) printf("coll_chunk2\n"); coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1585,8 +1322,9 @@ coll_chunk2(void) void coll_chunk3(void) { - if (MAINPROCESS) - printf("coll_chunk3\n"); + const char *filename = FILENAME[0]; + if (mpi_rank == 0) + printf("coll_chunk3\n"); coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); @@ -1956,7 +1694,7 @@ coll_chunktest(const char* filename, acc_plist = create_faccess_plist(comm, info, facc_type); VRFY((acc_plist >= 0),"MPIO creation property list succeeded"); - file = H5Fopen(filename,H5F_ACC_RDONLY,acc_plist); + file = H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_plist); VRFY((file >= 0),"H5Fcreate succeeded"); status = H5Pclose(acc_plist); @@ -2134,16 +1872,34 @@ 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); + /* Having set the bigio handling to a size that is managable, + * 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. + */ if (newsize != oldsize) { - bigcount = newsize * 2; + bigcount = newsize * 2; } MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* Attempt to turn off atexit post processing so that in case errors + * happen during the test and the process is aborted, it will not get + * hang in the atexit post processing in which it may try to make MPI + * calls. By then, MPI calls may not work. + */ + if (H5dont_atexit() < 0){ + HDprintf("Failed to turn off atexit processing. Continue.\n"); + }; + + /* set alarm. */ + ALARM_ON; + ExpressMode = do_express_test(mpi_rank); dataset_big_write(); @@ -2153,7 +1909,8 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); if (ExpressMode > 0) { - printf("***Express test mode on. Several tests are skipped\n"); + if (mpi_rank == 0) + HDprintf("***Express test mode on. Several tests are skipped\n"); } else { coll_chunk1(); @@ -2163,6 +1920,12 @@ int main(int argc, char **argv) coll_chunk3(); } + /* turn off alarm */ + ALARM_OFF; + + if (mpi_rank == 0) + HDremove(FILENAME[0]); + /* close HDF5 library */ H5close(); -- cgit v0.12 From 2d4d39d15763042661347e5a16de6cf154537dda Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 19:39:20 -0500 Subject: Fixed documentation Description: - Updated the description of copy constructor for clarification. - Removed unnecessary comments. Platforms tested: Linux/64 (jelly) --- c++/src/H5AbstractDs.h | 12 ---------- c++/src/H5ArrayType.cpp | 2 +- c++/src/H5ArrayType.h | 2 +- c++/src/H5AtomType.cpp | 2 +- c++/src/H5AtomType.h | 2 +- c++/src/H5Attribute.cpp | 2 +- c++/src/H5Attribute.h | 2 +- c++/src/H5CompType.cpp | 2 +- c++/src/H5CompType.h | 2 +- c++/src/H5DataSet.cpp | 2 +- c++/src/H5DataSet.h | 2 +- c++/src/H5DataSpace.cpp | 2 +- c++/src/H5DataSpace.h | 2 +- c++/src/H5DataType.cpp | 2 +- c++/src/H5DataType.h | 2 +- c++/src/H5DcreatProp.cpp | 2 +- c++/src/H5DcreatProp.h | 2 +- c++/src/H5DxferProp.cpp | 2 +- c++/src/H5DxferProp.h | 2 +- c++/src/H5EnumType.cpp | 2 +- c++/src/H5EnumType.h | 2 +- c++/src/H5Exception.cpp | 2 +- c++/src/H5FaccProp.cpp | 2 +- c++/src/H5FaccProp.h | 2 +- c++/src/H5FcreatProp.cpp | 2 +- c++/src/H5FcreatProp.h | 2 +- c++/src/H5File.cpp | 57 +++++++++++++++++++++++------------------------- c++/src/H5File.h | 6 ++--- c++/src/H5FloatType.cpp | 2 +- c++/src/H5FloatType.h | 2 +- c++/src/H5Group.cpp | 2 +- c++/src/H5Group.h | 2 +- c++/src/H5IdComponent.h | 13 ----------- c++/src/H5IntType.cpp | 2 +- c++/src/H5IntType.h | 2 +- c++/src/H5LaccProp.cpp | 2 +- c++/src/H5LaccProp.h | 2 +- c++/src/H5LcreatProp.cpp | 2 +- c++/src/H5LcreatProp.h | 2 +- c++/src/H5Object.cpp | 29 ------------------------ c++/src/H5Object.h | 13 ----------- c++/src/H5OcreatProp.cpp | 2 +- c++/src/H5OcreatProp.h | 2 +- c++/src/H5PredType.cpp | 2 +- c++/src/H5PredType.h | 2 +- c++/src/H5PropList.cpp | 2 +- c++/src/H5PropList.h | 2 +- c++/src/H5StrType.cpp | 2 +- c++/src/H5StrType.h | 2 +- c++/src/H5VarLenType.cpp | 2 +- c++/src/H5VarLenType.h | 2 +- release_docs/RELEASE.txt | 7 +++++- 52 files changed, 81 insertions(+), 146 deletions(-) diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 16bef66..399e033 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -74,18 +74,6 @@ class H5_DLLCPP AbstractDs { // Default constructor AbstractDs(); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. - - // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); - - // Copy constructor - // AbstractDs( const AbstractDs& original ); - private: // This member function is implemented by DataSet and Attribute - pure virtual. virtual hid_t p_get_type() const = 0; diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 49c31d2..836c837 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -46,7 +46,7 @@ ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- // Function: ArrayType copy constructor -///\brief Copy constructor: makes a copy of the original ArrayType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const ArrayType& original) : DataType(original) {} diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 5443ae6..d99b936 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -50,7 +50,7 @@ class H5_DLLCPP ArrayType : public DataType { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("ArrayType"); } - // Copy constructor: makes copy of the original object. + // Copy constructor: same as the original ArrayType. ArrayType(const ArrayType& original); // Constructor that takes an existing id diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 5c24cf9..a9f6f36 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -47,7 +47,7 @@ AtomType::AtomType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- // Function: AtomType copy constructor -///\brief Copy constructor: makes a copy of the original AtomType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::AtomType(const AtomType& original) : DataType(original) {} diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 7ce66a0..80271ac 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -60,7 +60,7 @@ class H5_DLLCPP AtomType : public DataType { virtual H5std_string fromClass () const { return("AtomType"); } #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor - makes copy of the original object + // Copy constructor: same as the original AtomType. AtomType(const AtomType& original); // Noop destructor diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index d90857f..ccba623 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -51,7 +51,7 @@ Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Attribute copy constructor -///\brief Copy constructor: makes a copy of the original Attribute object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: Original Attribute object to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 823947e..c6fdaec 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -29,7 +29,7 @@ namespace H5 { class H5_DLLCPP Attribute : public AbstractDs, public H5Location { public: - // Copy constructor: makes a copy of an existing Attribute object. + // Copy constructor: same as the original Attribute. Attribute(const Attribute& original); // Default constructor diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 3731fd4..8252d76 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -40,7 +40,7 @@ CompType::CompType() : DataType() {} //-------------------------------------------------------------------------- // Function: CompType copy constructor -///\brief Copy constructor: makes copy of the original CompType object +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: Original CompType instance // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index a811b4a..d85e2ed 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -36,7 +36,7 @@ class H5_DLLCPP CompType : public DataType { // Gets the compound datatype of the specified dataset CompType(const DataSet& dataset); // H5Dget_type - // Copy constructor - makes a copy of original object + // Copy constructor - same as the original CompType. CompType(const CompType& original); // Constructors that open a compound datatype, given a location. diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index fb9b57e..fbddd8d 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -68,7 +68,7 @@ DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existin //-------------------------------------------------------------------------- // Function: DataSet copy constructor -///\brief Copy constructor: makes a copy of the original DataSet object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: DataSet instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index f9d2ec3..104ccea 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -93,7 +93,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Default constructor. DataSet(); - // Copy constructor. + // Copy constructor - same as the original DataSet. DataSet(const DataSet& original); // Creates a copy of an existing DataSet using its id. diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index b563da4..e8e5712 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -133,7 +133,7 @@ DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id) //-------------------------------------------------------------------------- // Function: DataSpace copy constructor -///\brief Copy constructor: makes a copy of the original DataSpace object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: DataSpace object to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index ed141a3..54c68ac 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -36,7 +36,7 @@ class H5_DLLCPP DataSpace : public IdComponent { // Creates a DataSpace object using an existing dataspace id. DataSpace(const hid_t space_id); - // Copy constructor: makes a copy of the original DataSpace object. + // Copy constructor - same as the original DataSpace. DataSpace(const DataSpace& original); // Assignment operator diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 032937d..a6b8c24 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -125,7 +125,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, //-------------------------------------------------------------------------- // Function: DataType copy constructor -///\brief Copy constructor: makes a copy of the original DataType object +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType(const DataType& original) : H5Object(), id(original.id), encoded_buf(NULL), buf_size(0) diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 906ccef..52fd4de 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -30,7 +30,7 @@ class H5_DLLCPP DataType : public H5Object { // Creates a datatype given its class and size DataType(const H5T_class_t type_class, size_t size); - // Copy constructor: makes a copy of the original object + // Copy constructor - same as the original DataType. DataType(const DataType& original); // Creates a copy of a predefined type diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 6ed77e3..0c2a8c0 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -95,7 +95,7 @@ DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {} //-------------------------------------------------------------------------- // Function: DSetCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// DSetCreatPropList object // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 89318e8..9f54e8d 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -122,7 +122,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DSetCreatPropList"); } - // Copy constructor: creates a copy of a DSetCreatPropList object. + // Copy constructor - same as the original DSetCreatPropList. DSetCreatPropList(const DSetCreatPropList& orig); // Creates a copy of an existing dataset creation property list diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 21e18e7..90ecf88 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -101,7 +101,7 @@ DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET //-------------------------------------------------------------------------- // Function DSetMemXferPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// DSetMemXferPropList object ///\param original - IN: Original dataset memory and transfer property /// list object to copy diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 75205cf..6955778 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -102,7 +102,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } - // Copy constructor: makes a copy of a DSetMemXferPropList object. + // Copy constructor - same as the original DSetMemXferPropList. DSetMemXferPropList(const DSetMemXferPropList& orig); // Creates a copy of an existing dataset memory and transfer diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 91866d7..00b726c 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -53,7 +53,7 @@ EnumType::EnumType(const hid_t existing_id) : DataType( existing_id ) {} //-------------------------------------------------------------------------- // Function: EnumType copy constructor -///\brief Copy constructor: makes a copy of the original EnumType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType(const EnumType& original) : DataType( original ) {} diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index e0d5b88..4797ee7 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -75,7 +75,7 @@ class H5_DLLCPP EnumType : public DataType { // Creates an enumeration datatype using an existing id EnumType(const hid_t existing_id); - // Copy constructor: makes a copy of the original EnumType object. + // Copy constructor: same as the original EnumType. EnumType(const EnumType& original); virtual ~EnumType(); diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index c52a279..cf9e577 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -39,7 +39,7 @@ Exception::Exception(const H5std_string& func, const H5std_string& message) : de //-------------------------------------------------------------------------- // Function: Exception copy constructor -///\brief Copy constructor: makes a copy of the original Exception object. +///\brief Copy constructor: same HDF5 object as \a original ///\param orig - IN: Exception instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 9e1098b..286f6e7 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -88,7 +88,7 @@ FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {} //-------------------------------------------------------------------------- // Function: FileAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: FileAccPropList instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 1df8fc8..58f049e 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -136,7 +136,7 @@ class H5_DLLCPP FileAccPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("FileAccPropList"); } - // Copy constructor: creates a copy of a FileAccPropList object. + // Copy constructor: same as the original FileAccPropList. FileAccPropList(const FileAccPropList& original); // Creates a copy of an existing file access property list diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 98a35cb..9b0fecc 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -86,7 +86,7 @@ FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// FileCreatPropList object. ///\param original - IN: FileCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 31a944c..cc28920 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -79,7 +79,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass() const { return("FileCreatPropList"); } - // Copy constructor: creates a copy of a FileCreatPropList object. + // Copy constructor: same as the original FileCreatPropList. FileCreatPropList(const FileCreatPropList& orig); // Creates a copy of an existing file create property list diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 2c7ac51..f5246f9 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -46,7 +46,7 @@ namespace H5 { //-------------------------------------------------------------------------- // Function H5File default constructor ///\brief Default constructor: creates a stub H5File object. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File() : Group(), id(H5I_INVALID_HID) {} @@ -78,7 +78,7 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} // Notes With a PGI compiler (~2012-2013,) the exception thrown by // p_get_file could not be caught in the applications. Added try // block here to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { @@ -103,7 +103,7 @@ H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& cr // Notes With a PGI compiler (~2012-2013,) the exception thrown by // p_get_file could not be caught in the applications. Added try // block here to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { @@ -118,7 +118,6 @@ H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatProp //-------------------------------------------------------------------------- // This function is private and contains common code between the // constructors taking a string or a char* -// Programmer Binh-Minh Ribler - 2000 // Modification // - removed H5F_ACC_CREAT because H5Fcreate will fail with // H5F_ACC_CREAT. - BMR, Sep 17, 2014 @@ -153,7 +152,6 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro // Function: H5File overloaded constructor ///\brief Creates an H5File object using an existing file id. ///\param existing_id - IN: Id of an existing file -// Programmer Binh-Minh Ribler - 2015 // Description // Mar 29, 2015 // Added in responding to a request from user Jason Newton. @@ -172,10 +170,10 @@ H5File::H5File(hid_t existing_id) : Group() //-------------------------------------------------------------------------- // Function: H5File copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original /// H5File object. ///\param original - IN: H5File instance to copy -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5File& original) : Group() { @@ -189,7 +187,7 @@ H5File::H5File(const H5File& original) : Group() ///\param name - IN: Name of the file ///\return true if the file is in HDF5 format, and false, otherwise ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const char* name) { @@ -211,7 +209,7 @@ bool H5File::isHdf5(const char* name) ///\brief This is an overloaded member function, provided for convenience. /// It takes an \c H5std_string for \a name. (Static) ///\param name - IN: Name of the file - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const H5std_string& name) { @@ -234,7 +232,7 @@ bool H5File::isHdf5(const H5std_string& name) /// /// H5F_ACC_RDONLY: Open with read only access. - default /// -// Programmer Binh-Minh Ribler - Oct, 2005 +// October 2005 //-------------------------------------------------------------------------- void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist) { @@ -261,7 +259,7 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis ///\param flags - IN: File access flags ///\param access_plist - IN: File access property list. Default to /// FileAccPropList::DEFAULT -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAccPropList& access_plist) { @@ -276,7 +274,6 @@ void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAc // Description // If this object has represented another HDF5 file, the previous // HDF5 file need to be closed first. -// Programmer Binh-Minh Ribler - 2000 // Note: This wrapper doesn't seem right regarding the 'id' and should // be investigated. BMR - 2/20/2005 // Modification @@ -303,10 +300,10 @@ void H5File::reOpen() //-------------------------------------------------------------------------- // Function: H5File::getCreatePlist -///\brief Returns the creation property list of this file +///\brief Returns a copy of the creation property list of this file ///\return FileCreatPropList object ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- FileCreatPropList H5File::getCreatePlist() const { @@ -327,10 +324,10 @@ FileCreatPropList H5File::getCreatePlist() const //-------------------------------------------------------------------------- // Function: H5File::getAccessPlist -///\brief Returns the access property list of this file +///\brief Returns a copy of the access property list of this file ///\return FileAccPropList object ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- FileAccPropList H5File::getAccessPlist() const { @@ -357,7 +354,7 @@ FileAccPropList H5File::getAccessPlist() const ///\par Description /// The retrieved information may include information about /// superblock extension, free space management, and shared object -// Programmer Binh-Minh Ribler - February 2017 +// February 2017 //-------------------------------------------------------------------------- void H5File::getFileInfo(H5F_info2_t& file_info) const { @@ -373,7 +370,7 @@ void H5File::getFileInfo(H5F_info2_t& file_info) const ///\brief Returns the amount of free space in the file. ///\return Amount of free space ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 //-------------------------------------------------------------------------- hssize_t H5File::getFreeSpace() const { @@ -405,7 +402,7 @@ hssize_t H5File::getFreeSpace() const /// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 //-------------------------------------------------------------------------- ssize_t H5File::getObjCount(unsigned types) const { @@ -440,7 +437,7 @@ ssize_t H5File::getObjCount(unsigned types) const /// Multiple object types can be combined with the logical OR operator (|). // // Notes: will do the overload for this one after hearing from Quincey??? -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 //-------------------------------------------------------------------------- void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const { @@ -468,7 +465,7 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const /// The obtained file handle is dynamic and is valid only while /// the file remains open; it will be invalid if the file is /// closed and reopened or opened during a subsequent session. -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const { @@ -489,7 +486,7 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const // Param file_handle - Pointer to the file handle being used by // the low-level virtual file driver // Exception H5::FileIException -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 // Modification // Planned for removal. -BMR, 2014/04/16 // Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 @@ -508,7 +505,7 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const ///\param file_handle - Pointer to the file handle being used by /// the low-level virtual file driver ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - May 2004 +// May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(void **file_handle) const { @@ -550,7 +547,7 @@ hsize_t H5File::getFileSize() const // AbstractDS and Attribute are moved out of H5Object. In // addition, member IdComponent::id is moved into subclasses, and // IdComponent::getId now becomes pure virtual function. -// Programmer Binh-Minh Ribler - May, 2008 +// May, 2008 //-------------------------------------------------------------------------- hid_t H5File::getId() const { @@ -564,7 +561,7 @@ hid_t H5File::getId() const // Exception H5::FileIException // Description // This function is replaced by the above function reOpen. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- void H5File::reopen() { @@ -577,7 +574,7 @@ void H5File::reopen() // Description // This function is a redefinition of CommonFG::getLocId. It // is used by CommonFG member functions to get the file id. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 // Deprecated: // Aug 18, 2016 -BMR // After HDFFV-9920, the Group's methods can use getId() and @@ -598,7 +595,7 @@ hid_t H5File::getLocId() const // The underlaying reference counting in the C library ensures // that the current valid id of this object is properly closed. // Then the object's id is reset to the new id. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- void H5File::p_setId(const hid_t new_id) { @@ -619,7 +616,7 @@ void H5File::p_setId(const hid_t new_id) ///\brief Closes this HDF5 file. /// ///\exception H5::FileIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +// March 2005 //-------------------------------------------------------------------------- void H5File::close() { @@ -646,7 +643,7 @@ void H5File::close() // proper exception can be thrown for file or group. The // "H5File::" will be inserted to indicate the function called is // an implementation of H5File. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 //-------------------------------------------------------------------------- void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const { @@ -658,7 +655,7 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m //-------------------------------------------------------------------------- // Function: H5File destructor ///\brief Properly terminates access to this file. -// Programmer Binh-Minh Ribler - 2000 +// December 2000 // Modification // - Replaced resetIdComponent() with decRefCount() to use C // library ID reference counting mechanism - BMR, Feb 20, 2005 diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 214feb0..473428a 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -41,10 +41,10 @@ class H5_DLLCPP H5File : public Group { // Close this file. virtual void close(); - // Gets the access property list of this file. + // Gets a copy of the access property list of this file. FileAccPropList getAccessPlist() const; - // Gets the creation property list of this file. + // Gets a copy of the creation property list of this file. FileCreatPropList getCreatePlist() const; // Gets general information about this file. @@ -97,7 +97,7 @@ class H5_DLLCPP H5File : public Group { // Default constructor H5File(); - // Copy constructor: makes a copy of the original H5File object. + // Copy constructor: same as the original H5File. H5File(const H5File& original); // Gets the HDF5 file id. diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 9703149..0a2c107 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -66,7 +66,7 @@ FloatType::FloatType(const hid_t existing_id) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- // Function: FloatType copy constructor -///\brief Copy constructor: makes a copy of the original FloatType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType(const FloatType& original) : AtomType( original ){} diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index d26df5c..f74a9ae 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -71,7 +71,7 @@ class H5_DLLCPP FloatType : public AtomType { // Creates a floating-point datatype using an existing id. FloatType(const hid_t existing_id); - // Copy constructor: makes a copy of the original FloatType object. + // Copy constructor: same as the original FloatType. FloatType(const FloatType& original); // Noop destructor. diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index c4c7017..25e67d3 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -53,7 +53,7 @@ Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: Group copy constructor -///\brief Copy constructor: makes a copy of the original Group object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: Original group to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index b3a9007..70b6bff 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -53,7 +53,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // default constructor Group(); - // Copy constructor: makes a copy of the original object + // Copy constructor: same as the original Group. Group(const Group& original); // Gets the group id. diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index baf939e..b4070b0 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -60,21 +60,8 @@ class H5_DLLCPP IdComponent { // Sets the identifier of this object to a new value. void setId(const hid_t new_id); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. - - // Creates an object to hold an HDF5 identifier. - // IdComponent(const hid_t h5_id); - removed from 1.10.1 - #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor: makes copy of the original IdComponent object. - // IdComponent(const IdComponent& original); - removed from 1.8.15 - // Gets the identifier of this object. virtual hid_t getId () const = 0; diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 38191bc..dd9d042 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -43,7 +43,7 @@ IntType::IntType() {} //-------------------------------------------------------------------------- // Function: IntType copy constructor -///\brief Copy constructor: makes a copy of the original IntType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType(const IntType& original) : AtomType( original ) {} diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index a9ebad0..496872b 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -53,7 +53,7 @@ class H5_DLLCPP IntType : public AtomType { // Creates a integer datatype using an existing id IntType(const hid_t existing_id); - // Copy constructor: makes copy of IntType object + // Copy constructor: same as the original IntType. IntType(const IntType& original); // Noop destructor. diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index 1267286..49ffa2b 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -88,7 +88,7 @@ LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {} //-------------------------------------------------------------------------- // Function: LinkAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy Constructor: same HDF5 object as \a original ///\param original - IN: LinkAccPropList instance to copy // Programmer Binh-Minh Ribler - December, 2016 //-------------------------------------------------------------------------- diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 6c86a85..70890b3 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -36,7 +36,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("LinkAccPropList"); } - // Copy constructor: creates a copy of a LinkAccPropList object. + // Copy constructor: same as the original LinkAccPropList. LinkAccPropList(const LinkAccPropList& original); // Creates a copy of an existing file access property list diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp index 4f8bffc..8bece44 100644 --- a/c++/src/H5LcreatProp.cpp +++ b/c++/src/H5LcreatProp.cpp @@ -88,7 +88,7 @@ LinkCreatPropList::LinkCreatPropList() : PropList(H5P_LINK_CREATE) {} //-------------------------------------------------------------------------- // Function: LinkCreatPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: LinkCreatPropList instance to copy // December, 2016 //-------------------------------------------------------------------------- diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h index 4ac2191..12cb479 100644 --- a/c++/src/H5LcreatProp.h +++ b/c++/src/H5LcreatProp.h @@ -36,7 +36,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("LinkCreatPropList"); } - // Copy constructor: creates a copy of a LinkCreatPropList object. + // Copy constructor: same as the original LinkCreatPropList. LinkCreatPropList(const LinkCreatPropList& original); // Creates a copy of an existing file access property list diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 27881c4..5d102d7 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -58,35 +58,6 @@ extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, H5Object::H5Object() : H5Location() {} //-------------------------------------------------------------------------- -// Function: H5Object overloaded constructor (protected) -// Purpose Creates an H5Object object using the id of an existing HDF5 -// object. -// Parameters object_id - IN: Id of an existing HDF5 object -// Programmer Binh-Minh Ribler - 2000 -// *** Deprecation warning *** -// This constructor is no longer appropriate because the data member "id" had -// been moved to the sub-classes. It will be removed in 1.10 release. If its -// removal does not raise any problems in 1.10, it will be removed from 1.8 in -// subsequent releases. -// Removed in 1.10.1 - Aug 2016 -//-------------------------------------------------------------------------- -//H5Object::H5Object(const hid_t object_id) : H5Location() {} - -//-------------------------------------------------------------------------- -// Function: H5Object copy constructor -///\brief Copy constructor: makes a copy of the original H5Object -/// instance. -///\param original - IN: H5Object instance to copy -// Programmer Binh-Minh Ribler - 2000 -// *** Deprecation warning *** -// This constructor is no longer appropriate because the data member "id" had -// been moved to the sub-classes. It is removed from 1.8.15 because it is -// a noop and it can be generated by the compiler if needed. -// Removed in 1.10.1 - Aug 2016 -//-------------------------------------------------------------------------- -// H5Object::H5Object(const H5Object& original) : H5Location() {} - -//-------------------------------------------------------------------------- // Function: f_Attribute_setId - friend // Purpose: This function is friend to class H5::Attribute so that it // can set Attribute::id in order to work around a problem diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 3772e08..10b3865 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -104,19 +104,6 @@ class H5_DLLCPP H5Object : public H5Location { // Default constructor H5Object(); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. - - // Creates a copy of an existing object giving the object id - // H5Object(const hid_t object_id); - - // Copy constructor: makes copy of an H5Object object. - // H5Object(const H5Object& original); - // Sets the identifier of this object to a new value. - this one // doesn't increment reference count virtual void p_setId(const hid_t new_id) = 0; diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 121198c..0542d5e 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -88,7 +88,7 @@ ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {} //-------------------------------------------------------------------------- // Function: ObjCreatPropList copy constructor -///\brief Copy Constructor: makes a copy of the original +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: ObjCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index d1eae86..1d5dd55 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -46,7 +46,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("ObjCreatPropList"); } - // Copy constructor: creates a copy of a ObjCreatPropList object. + // Copy constructor: same as the original ObjCreatPropList. ObjCreatPropList(const ObjCreatPropList& original); // Creates a copy of an existing object creation property list diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 704a617..3f153e5 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -55,7 +55,7 @@ PredType::PredType() : AtomType() {} //-------------------------------------------------------------------------- // Function: PredType copy constructor -///\brief Copy constructor: makes a copy of the original PredType object. +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: PredType instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index c631fb9..0978384 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -34,7 +34,7 @@ class H5_DLLCPP PredType : public AtomType { // id in the left hand side object. PredType& operator=(const PredType& rhs); - // Copy constructor - makes copy of the original object + // Copy constructor: same as the original PredType. PredType(const PredType& original); // Noop destructor diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 16a6316..ef9e16d 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -94,7 +94,7 @@ PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {} //-------------------------------------------------------------------------- // Function: PropList copy constructor -///\brief Copy constructor +///\brief Copy constructor: same HDF5 object as \a original ///\param original - IN: The original property list to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 6e1e287..e0244c1 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -106,7 +106,7 @@ class H5_DLLCPP PropList : public IdComponent { // Default constructor: creates a stub PropList object. PropList(); - // Copy constructor: creates a copy of a PropList object. + // Copy constructor: same as the original PropList. PropList(const PropList& original); // Gets the property list id. diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 4c0b3d2..a067d6c 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -120,7 +120,7 @@ StrType::StrType(const hid_t existing_id) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- // Function: StrType copy constructor -///\brief Copy constructor: makes a copy of the original StrType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType(const StrType& original) : AtomType ( original ) {} diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 24c9ca3..38974da 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -65,7 +65,7 @@ class H5_DLLCPP StrType : public AtomType { // Creates a string datatype using an existing id StrType(const hid_t existing_id); - // Copy constructor - makes a copy of the original object + // Copy constructor: same as the original StrType. StrType(const StrType& original); // Noop destructor. diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 188ee41..e70d42f 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -45,7 +45,7 @@ VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- // Function: VarLenType copy constructor -///\brief Copy constructor: makes a copy of the original VarLenType object. +///\brief Copy constructor: same HDF5 object as \a original // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 078b534..ab3c14c 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -38,7 +38,7 @@ class H5_DLLCPP VarLenType : public DataType { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("VarLenType"); } - // Copy constructor: makes copy of the original object. + // Copy constructor: same as the original VarLenType. VarLenType(const VarLenType& original); // Constructor that takes an existing id diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 12776eb..0d739a5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -628,7 +628,12 @@ Bug Fixes since HDF5-1.10.1 release C++ APIs -------- - - + - Removal of memomry leaks + + A private function was inadvertently called, causing memory leaks. This + is now fixed. + + (BMR - 2018/03/12 - User's reported in email) Testing ------- -- cgit v0.12 From b877534a330a201e3b5c51d97daa8e01a5c1cd3a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 12 Mar 2018 17:56:54 -0700 Subject: Added a fix for HDFFV-10358. --- release_docs/RELEASE.txt | 17 +++++++++++++++++ src/H5Gcache.c | 3 ++- src/H5Gent.c | 7 +++++-- src/H5Gpkg.h | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a70802e..4ac4545 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -321,6 +321,23 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2018/02/26, HDFFV-10357) + - If an HDF5 file contains a malformed symbol table node that declares + it contains more symbols than it actually contains, the library + can run off the end of the metadata cache buffer while processing + the symbol table node. + + This issue was reported to The HDF Group as issue #CVE-2017-17509. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Performing bounds checks on the buffer while processing fixes the + problem. Instead of the segmentation fault, the normal HDF5 error + handling is invoked. + + (DER - 2018/03/12, HDFFV-10358) + Configuration ------------- - CMake diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 65115a5..b447cad 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -170,6 +170,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, H5F_t *f = (H5F_t *)_udata; /* User data for callback */ H5G_node_t *sym = NULL; /* Symbol table node created */ const uint8_t *image = (const uint8_t *)_image; /* Pointer to image to deserialize */ + const uint8_t *image_end = image + len - 1; /* Pointer to end of image buffer */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -203,7 +204,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, UINT16DECODE(image, sym->nsyms); /* entries */ - if(H5G__ent_decode_vec(f, &image, sym->entry, sym->nsyms) < 0) + if(H5G__ent_decode_vec(f, &image, image_end, sym->entry, sym->nsyms) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries") /* Set return value */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 7987850..6e076ae 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -91,7 +91,7 @@ H5FL_BLK_EXTERN(str_buf); *------------------------------------------------------------------------- */ herr_t -H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n) +H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, const uint8_t *p_end, H5G_entry_t *ent, unsigned n) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -104,9 +104,12 @@ H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsign HDassert(ent); /* decode entries */ - for(u = 0; u < n; u++) + for(u = 0; u < n; u++) { + if(*pp > p_end) + HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "ran off the end of the image buffer") if(H5G_ent_decode(f, pp, ent + u) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 76bf08b..20e595f 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -395,7 +395,7 @@ H5_DLL void H5G__ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth); H5_DLL void H5G__ent_reset(H5G_entry_t *ent); H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, - H5G_entry_t *ent, unsigned n); + const uint8_t *p_end, H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, -- cgit v0.12 From 86890ac84ba74a437f87d98e7d7931dccc0fe856 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 20:39:03 -0500 Subject: Add release note for HDFFFV-10397. --- release_docs/RELEASE.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 81a052a..bb8168f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -642,7 +642,11 @@ Bug Fixes since HDF5-1.10.1 release Testing ------- - - + - Memory for three variables in testphdf5's coll_write_test was malloced + but not freed, leaking memory when running the test. The variables' + memory is now freed. + + (LRK - 2018/03/12, HDFFV-10397) Supported Platforms =================== -- cgit v0.12 From 19d54162ce7e43f04572b7cea12695df11ba7bea Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Mar 2018 21:07:24 -0500 Subject: Fixed typo --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 36bf869..0093f3b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -638,7 +638,7 @@ Bug Fixes since HDF5-1.10.1 release C++ APIs -------- - - Removal of memomry leaks + - Removal of memory leaks A private function was inadvertently called, causing memory leaks. This is now fixed. -- cgit v0.12 From cbe8171f67870598d8829e9105de890cf6b8cb0e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Mar 2018 10:26:10 -0500 Subject: Fix CMake test names --- tools/test/misc/CMakeTestsClear.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 5efce0a..3104c1d 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -303,17 +303,17 @@ endif() # "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) # (no output, check exit code) # "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) - ADD_H5_RETTEST (h5clr_mdc_image "false" "-s" "--increment=0" h5clear_status_noclose.h5) - ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) + ADD_H5_CMP (h5clr_open_fail_nc_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image_nc "false" "-s" "--increment=0" h5clear_status_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_nc_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) # # (2) h5clear_fsm_persist_noclose.h5 # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, just check exit code) # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) - ADD_H5_RETTEST (h5clr_mdc_image "false" "--increment=0" h5clear_fsm_persist_noclose.h5) - ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_CMP (h5clr_open_fail_fsm_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_RETTEST (h5clr_mdc_image_fsm "false" "--increment=0" h5clear_fsm_persist_noclose.h5) + ADD_H5_CMP (h5clr_no_mdc_image_fsm_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) # # (3) h5clear_fsm_persist_equal.h5 # "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) -- cgit v0.12 From 5c2473a01e8ece7f77836afef885cffed2638970 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 13 Mar 2018 10:10:14 -0700 Subject: Added a "won't fix" RELEASE.txt entry for HDFFV-10356. --- release_docs/RELEASE.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e108ed8..9dc7f3a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -362,6 +362,26 @@ Bug Fixes since HDF5-1.10.1 release (DER - 2018/02/26, HDFFV-10355) + - If an HDF5 file contains a malformed compound datatype with a + suitably large offset, the type conversion code can run off + the end of the type conversion buffer, causing a segmentation + fault. + + This issue was reported to The HDF Group as issue #CVE-2017-17507. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME + + Fixing this problem would involve updating the publicly visible + H5T_conv_t function pointer typedef and versioning the API calls + which use it. We normally only modify the public API during + major releases, so this bug will not be fixed at this time. + + (DER - 2018/02/26, HDFFV-10356) + - If an HDF5 file contains a malformed compound type which contains a member of size zero, a division by zero error will occur while processing the type. -- cgit v0.12 From 6287bac6e5916d69f1df3f3907f2c530c8ba5ada Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Mar 2018 12:26:24 -0500 Subject: Rework new tests into one macro --- tools/test/misc/CMakeTestsClear.cmake | 137 +++++++++++++++++++++++++++------- 1 file changed, 112 insertions(+), 25 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 3104c1d..a51d0e9 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -108,6 +108,42 @@ endif () endmacro () + macro (ADD_H5_CMP_WITH_COPY testname resultcode resultfile testfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR_CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}.out + testfiles/${testname}.out.err + testfiles/${testfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5CLEAR_CMP-copy_${testname} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}" + ) + set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) + add_test ( + NAME H5CLEAR_CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname}) + set (last_test "H5CLEAR_CMP-${testname}") + endif () + endmacro () + macro (ADD_H5_RETTEST testname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -123,6 +159,70 @@ endif () endmacro () + macro (ADD_H5_FILESIZE_TEST testname resultcode resultfile incr_size) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR_FILESIZE_TEST-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}_before_size.out + testfiles/${testname}_before_size.out.err + testfiles/${testname}_after_size.out + testfiles/${testname}_after_size.out.err + testfiles/${testname}.h5 + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR_FILESIZE_TEST-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5CLEAR_FILESIZE_TEST-copy_${testname} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5" + ) + set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects) + add_test ( + NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--filesize;${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}_before_size.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_before_size.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname}) + if (NOT ${incr_size} MATCHES "NONE") + add_test ( + NAME H5CLEAR_FILESIZE_INCR-${testname} + COMMAND $ --increment=${incr_size} ${testname}.h5 + ) + else () + add_test ( + NAME H5CLEAR_FILESIZE_INCR-${testname} + COMMAND $ --increment ${testname}.h5 + ) + endif () + set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WILL_FAIL "${resultcode}") + set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size) + add_test ( + NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--filesize;${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}_after_size.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_after_size.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_INCR-${testname}) + set (last_test "H5CLEAR_FILESIZE_CMP-${testname}_after_size") + endif () + endmacro () + macro (ADD_H5_TEST testname testfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -183,6 +283,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) latest_h5clear_sec2_v3.h5 mod_h5clear_mdc_image.h5 mod_h5clear_mdc_image2.h5 + ${HDF5_TEST_FILES} ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test}) @@ -303,7 +404,7 @@ endif() # "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) # (no output, check exit code) # "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_nc_s h5clear_open_fail 1 "--filesize" h5clear_status_noclose.h5) + ADD_H5_CMP_WITH_COPY (h5clr_open_fail_nc_s 1 h5clear_open_fail h5clear_status_noclose.h5 "--filesize") ADD_H5_RETTEST (h5clr_mdc_image_nc "false" "-s" "--increment=0" h5clear_status_noclose.h5) ADD_H5_CMP (h5clr_no_mdc_image_nc_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) # @@ -311,56 +412,42 @@ endif() # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, just check exit code) # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_open_fail_fsm_s h5clear_noclose_before_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) - ADD_H5_RETTEST (h5clr_mdc_image_fsm "false" "--increment=0" h5clear_fsm_persist_noclose.h5) - ADD_H5_CMP (h5clr_no_mdc_image_fsm_m h5clear_noclose_after_size 0 "--filesize" h5clear_fsm_persist_noclose.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_noclose 0 h5clear_noclose 0) # # (3) h5clear_fsm_persist_equal.h5 # "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF before the next action) # "h5clear --increment h5clear_fsm_persist_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_equal_before_size h5clear_equal_before_size 0 "--filesize" h5clear_fsm_persist_equal.h5) - ADD_H5_RETTEST (h5clr_equal_incr "false" "--increment" h5clear_fsm_persist_equal.h5) - ADD_H5_CMP (h5clr_equal_after_size h5clear_equal_after_size 0 "--filesize" h5clear_fsm_persist_equal.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_equal 0 h5clear_equal NONE) # # (4) h5clear_fsm_persist_greater.h5 # "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_greater_before_size h5clear_greater_before_size 0 "--filesize" h5clear_fsm_persist_greater.h5) - ADD_H5_RETTEST (h5clr_greater_incr "false" "--increment=0" h5clear_fsm_persist_greater.h5) - ADD_H5_CMP (h5clr_greater_after_size h5clear_greater_after_size 0 "--filesize" h5clear_fsm_persist_greater.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_greater 0 h5clear_greater 0) # # (5) h5clear_fsm_persist_less.h5 # "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF before the next action) # "h5clear --increment=200 h5clear_fsm_persist_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_less_before_size h5clear_less_before_size 0 "--filesize" h5clear_fsm_persist_less.h5) - ADD_H5_RETTEST (h5clr_less_incr "false" "--increment=200" h5clear_fsm_persist_less.h5) - ADD_H5_CMP (h5clr_less_after_size h5clear_less_after_size 0 "--filesize" h5clear_fsm_persist_less.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_less 0 h5clear_less 200) # # (6) h5clear_fsm_persist_user_equal.h5 # "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF before the next action) # "h5clear --increment h5clear_fsm_persist_user_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_user_equal_before_size h5clear_user_equal_before_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) - ADD_H5_RETTEST (h5clr_user_equal_incr "false" "--increment" h5clear_fsm_persist_user_equal.h5) - ADD_H5_CMP (h5clr_user_equal_after_size h5clear_user_equal_after_size 0 "--filesize" h5clear_fsm_persist_user_equal.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_user_equal 0 h5clear_user_equal NONE) # # (7) h5clear_fsm_persist_user_greater.h5 # "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) # "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) # "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_user_greater_before_size h5clear_user_greater_before_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) - ADD_H5_RETTEST (h5clr_user_greater_incr "false" "--increment=0" h5clear_fsm_persist_user_greater.h5) - ADD_H5_CMP (h5clr_user_greater_after_size h5clear_user_greater_after_size 0 "--filesize" h5clear_fsm_persist_user_greater.h5) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_user_greater 0 h5clear_user_greater 0) # # (8) h5clear_fsm_persist_user_less.h5 -# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF before the next action) -# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code) -# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action) - ADD_H5_CMP (h5clr_user_less_before_size h5clear_user_less_before_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) - ADD_H5_RETTEST (h5clr_user_less_incr "false" "--increment=0" h5clear_fsm_persist_user_less.h5) - ADD_H5_CMP (h5clr_user_less_after_size h5clear_user_less_after_size 0 "--filesize" h5clear_fsm_persist_user_less.h5) +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF before the next action) +# "h5clear --increment=200 h5clear_fsm_persist_user_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code) +# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF after the last action) + ADD_H5_FILESIZE_TEST (h5clear_fsm_persist_user_less 0 h5clear_user_less 200) # # -- cgit v0.12 From b5867a05a7adf5d1c89721bf42a5bbaddb47dbd9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Mar 2018 17:21:02 -0500 Subject: HDFFV-10412 add error on function for Java --- java/src/hdf/hdf5lib/H5.java | 8 +++++++- java/src/jni/exceptionImp.c | 17 +++++++++++++++++ java/src/jni/exceptionImp.h | 10 ++++++++++ java/src/jni/h5util.c | 3 +++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 20aa634..9d1aed1 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -424,7 +424,7 @@ public class H5 implements java.io.Serializable { private synchronized static native int H5dont_atexit() throws HDF5LibraryException; /** - * Turn off error handling By default, the C library prints the error stack of the HDF-5 C library on stdout. This + * Turn off error handling. By default, the C library prints the error stack of the HDF-5 C library on stdout. This * behavior may be disabled by calling H5error_off(). * * @return a non-negative value if successful @@ -432,6 +432,12 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5error_off(); /** + * Turn on error handling. By default, the C library prints the error stack of the HDF-5 C library on stdout. This + * behavior may be reenabled by calling H5error_on(). + */ + public synchronized static native void H5error_on(); + + /** * H5garbage_collect collects on all free-lists of all types. * * @return a non-negative value if successful diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index 05c193f..afad5d5 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -33,6 +33,9 @@ extern "C" { #include "h5jni.h" #include "exceptionImp.h" +extern H5E_auto2_t efunc; +extern void *edata; + /*******************/ /* Local Variables */ @@ -122,10 +125,24 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5error_1off (JNIEnv *env, jclass clss) { + H5Eget_auto2(H5E_DEFAULT, &efunc, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); return 0; } /* end Java_hdf_hdf5lib_H5_H5error_1off() */ +/* + * Class: hdf_hdf5lib_exceptions_HDF5Library + * Method: H5error_on + * Signature: ()V + * + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5error_1on + (JNIEnv *env, jclass clss) +{ + H5Eset_auto2(H5E_DEFAULT, efunc, edata); +} /* end Java_hdf_hdf5lib_H5_H5error_1on() */ + /* * Class: hdf_hdf5lib_exceptions_HDFLibraryException diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h index cb74602..423e537 100644 --- a/java/src/jni/exceptionImp.h +++ b/java/src/jni/exceptionImp.h @@ -31,6 +31,16 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5error_1off (JNIEnv *env, jclass clss ); +/* + * Class: hdf_hdf5lib_exceptions_HDF5Library + * Method: H5error_on + * Signature: ()V + * + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5error_1on + (JNIEnv *env, jclass clss ); + /* * Class: hdf_hdf5lib_exceptions_HDFLibraryException diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index bd9fc0f..fdabd76 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -41,6 +41,9 @@ jobject get_callback; jobject set_callback; jobject delete_callback; +H5E_auto2_t efunc; +void *edata; + /********************/ /* Local Prototypes */ /********************/ -- cgit v0.12 From 0d5c1153f1e8b55784512a3cb722bda94e1b2080 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 14 Mar 2018 11:13:16 -0500 Subject: Add info to release notes for: (1) library version bounds (2) HDFFV-10360 (h5clear) (3) HDFFV-10209 (VDS SWMR test failure) --- release_docs/RELEASE.txt | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9dc7f3a..cfa0b1c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -86,6 +86,19 @@ New Features Library: -------- + - Add an enumerated value to H5F_libver_t for H5Pset_libver_bounds(). + + Currently, the library defines two values for H5F_libver_t and supports + only two pairs of (low, high) combinations as derived from these values. + Thus the bounds setting via H5Pset_libver_bounds() is rather restricted. + + Add an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and + H5Pset_libver_bounds() now supports five pairs of (low, high) combinations + as derived from these values. This addition provides the user more + flexibility in setting bounds for object creation. + + (VC - 2018/03/14) + - Add prefix option to VDS files. Currently, VDS source files must be in the active directory to be @@ -271,6 +284,17 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - Freeing of object header in H5Ocache.c + + It was discovered that the object header was not released properly + when the checksum verification failed and a re-load of the object + header was needed. + + Free the object header that failed the chksum verification only + after the new object header is reloaded, deserialized and set up. + + (VC - 2018/03/14, HDFFV-10209) + - H5Pset_evict_on_close in H5Pfapl.c Changed the minor error number from H5E_CANTSET to H5E_UNSUPPORTED for @@ -492,6 +516,20 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5clear + + An enhancement to the tool in setting a file's stored EOA. + + It was discovered that a crashed file's stored EOA in the superblock + was smaller than the actual file's EOF. When the file was reopened + and closed, the library truncated the file to the stored EOA. + + Add an option to the tool in setting the file's stored EOA in the + superblock to the maximum of (EOA, EOF) + increment. + Another option is also added to print the file's EOA and EOF. + + (VC - 2018/03/14, HDFFV-10360) + - h5repack h5repack changes the chunk parameters when a change of layout is not -- cgit v0.12 From 6cbc1104197358b7f56830f5362b24fad5e96631 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Mar 2018 15:57:51 -0500 Subject: HDFFV-10412 add note for new H5error_on Java API --- release_docs/RELEASE.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cfa0b1c..e6fd8d3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -89,12 +89,12 @@ New Features - Add an enumerated value to H5F_libver_t for H5Pset_libver_bounds(). Currently, the library defines two values for H5F_libver_t and supports - only two pairs of (low, high) combinations as derived from these values. + only two pairs of (low, high) combinations as derived from these values. Thus the bounds setting via H5Pset_libver_bounds() is rather restricted. - Add an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and - H5Pset_libver_bounds() now supports five pairs of (low, high) combinations - as derived from these values. This addition provides the user more + Add an enumerated value (H5F_LIBVER_V18) to H5F_libver_t and + H5Pset_libver_bounds() now supports five pairs of (low, high) combinations + as derived from these values. This addition provides the user more flexibility in setting bounds for object creation. (VC - 2018/03/14) @@ -234,6 +234,14 @@ New Features Java Library: ---------------- + - Wrapper added for enabling the error stack. + + H5error_off would disable the error stack reporting. In order + to re-enable the reporting, the error stack info needs to be + saved so that H5error_on can revert state. + + (ADB - 2018/03/13, HDFFV-10412) + - Wrappers added for the following APIs: H5Pset_evict_on_close H5Pget_evict_on_close @@ -525,7 +533,7 @@ Bug Fixes since HDF5-1.10.1 release and closed, the library truncated the file to the stored EOA. Add an option to the tool in setting the file's stored EOA in the - superblock to the maximum of (EOA, EOF) + increment. + superblock to the maximum of (EOA, EOF) + increment. Another option is also added to print the file's EOA and EOF. (VC - 2018/03/14, HDFFV-10360) @@ -722,8 +730,8 @@ Bug Fixes since HDF5-1.10.1 release Testing ------- - - Memory for three variables in testphdf5's coll_write_test was malloced - but not freed, leaking memory when running the test. The variables' + - Memory for three variables in testphdf5's coll_write_test was malloced + but not freed, leaking memory when running the test. The variables' memory is now freed. (LRK - 2018/03/12, HDFFV-10397) -- cgit v0.12 From 8f5be458f4284f763ef30c5bf665740d69c5ec16 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 15 Mar 2018 09:06:16 -0500 Subject: Fixed memory leak Description: Added LinkCreatPropList to initH5cpp to cleaning up resource at exit. Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich) --- c++/src/H5Library.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 55f82f5..2cbdfba 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -188,6 +188,10 @@ void H5Library::initH5cpp() if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating LinkAccPropList::deleteConstants failed"); + ret_value = std::atexit(LinkCreatPropList::deleteConstants); + if (ret_value != 0) + throw LibraryIException("H5Library::initH5cpp", "Registrating LinkCreatPropList::deleteConstants failed"); + ret_value = std::atexit(FileAccPropList::deleteConstants); if (ret_value != 0) throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed"); -- cgit v0.12 From 4b6d3193e1392b64b401e1b4de60a2b0ef586f23 Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 15 Mar 2018 11:18:47 -0500 Subject: Add 2 parallel test files to CHECK-CLEANFILES so that if their tests fail before removing them, make check-clean will remove them. --- testpar/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 1f15830..5c7cb26 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -37,9 +37,12 @@ LDADD = $(LIBH5TEST) $(LIBHDF5) # Temporary files # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf +# bigio_test.h5 is from t_bigio +# ShapeSameTest.h5 is from t_shapesame # shutdown.h5 is from t_pshutdown # after_mpi_fin.h5 is from t_init_term # go is used for debugging. See testphdf5.c. -CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 shutdown.h5 after_mpi_fin.h5 go +CHECK_CLEANFILES+=MPItest.h5 Para*.h5 bigio_test.h5 CacheTestDummy.h5 \ + ShapeSameTest.h5 shutdown.h5 after_mpi_fin.h5 go include $(top_srcdir)/config/conclude.am -- cgit v0.12 From 7399997968b3521afb08e62880a3be586bd21cec Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 13:41:25 -0500 Subject: Java constants for new lib verbounds values --- java/src/hdf/hdf5lib/HDF5Constants.java | 12 ++++++++++++ java/src/jni/h5Constants.c | 8 ++++++++ java/src/jni/h5pImp.c | 14 +++----------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 3e43ba2..eb4055d 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -206,7 +206,11 @@ public class HDF5Constants { public static final int H5F_CLOSE_SEMI = H5F_CLOSE_SEMI(); public static final int H5F_CLOSE_STRONG = H5F_CLOSE_STRONG(); public static final int H5F_CLOSE_WEAK = H5F_CLOSE_WEAK(); + public static final int H5F_LIBVER_ERROR = H5F_LIBVER_ERROR(); public static final int H5F_LIBVER_EARLIEST = H5F_LIBVER_EARLIEST(); + public static final int H5F_LIBVER_V18 = H5F_LIBVER_V18(); + public static final int H5F_LIBVER_V110 = H5F_LIBVER_V110(); + public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS(); public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST(); public static final int H5F_OBJ_ALL = H5F_OBJ_ALL(); public static final int H5F_OBJ_ATTR = H5F_OBJ_ATTR(); @@ -999,8 +1003,16 @@ public class HDF5Constants { private static native final int H5F_CLOSE_WEAK(); + private static native final int H5F_LIBVER_ERROR(); + private static native final int H5F_LIBVER_EARLIEST(); + private static native final int H5F_LIBVER_V18(); + + private static native final int H5F_LIBVER_V110(); + + private static native final int H5F_LIBVER_NBOUNDS(); + private static native final int H5F_LIBVER_LATEST(); private static native final int H5F_OBJ_ALL(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 5a4b53e..fbbd332 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -380,8 +380,16 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1STRONG(JNIEnv *env, jclass cls) { ret JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1WEAK(JNIEnv *env, jclass cls) { return H5F_CLOSE_WEAK; } JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_ERROR;} +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_EARLIEST;} JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V18;} +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V110;} +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_NBOUNDS;} +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls){return H5F_LIBVER_LATEST;} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1ALL(JNIEnv *env, jclass cls) { return H5F_OBJ_ALL; } diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index cf27341..49cfeb9 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -2794,17 +2794,9 @@ Java_hdf_hdf5lib_H5_H5Pset_1libver_1bounds { herr_t retVal = -1; - if ((H5F_libver_t)high != H5F_LIBVER_LATEST) { - h5badArgument(env, "H5Pset_libver_bounds: invalid high library version bound"); - } /* end if */ - else if(((H5F_libver_t)low !=H5F_LIBVER_EARLIEST) && ((H5F_libver_t)low != H5F_LIBVER_LATEST)) { - h5badArgument(env, "H5Pset_libver_bounds: invalid low library version bound"); - } /* end else if */ - else { - retVal = H5Pset_libver_bounds((hid_t)fapl_id, (H5F_libver_t)low, (H5F_libver_t)high); - if(retVal < 0) - h5libraryError(env); - } /* end else */ + retVal = H5Pset_libver_bounds((hid_t)fapl_id, (H5F_libver_t)low, (H5F_libver_t)high); + if(retVal < 0) + h5libraryError(env); return (jint)retVal; } /* end Java_hdf_hdf5lib_H5_H5Pset_1libver_1bounds */ -- cgit v0.12 From 3f221c1347fbce0342f7e726bf00fe577d7c4422 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:11:15 -0500 Subject: Correct constant var names --- java/src/jni/h5Constants.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index fbbd332..900316e 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -380,15 +380,15 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1STRONG(JNIEnv *env, jclass cls) { ret JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1WEAK(JNIEnv *env, jclass cls) { return H5F_CLOSE_WEAK; } JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_ERROR;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1ERROR(JNIEnv *env, jclass cls){return H5F_LIBVER_ERROR;} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_EARLIEST;} JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V18;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V18(JNIEnv *env, jclass cls){return H5F_LIBVER_V18;} JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_V110;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V110(JNIEnv *env, jclass cls){return H5F_LIBVER_V110;} JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_NBOUNDS;} +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1NBOUNDS(JNIEnv *env, jclass cls){return H5F_LIBVER_NBOUNDS;} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls){return H5F_LIBVER_LATEST;} JNIEXPORT jint JNICALL -- cgit v0.12 From 692c7867ef243bfbf28c2064e6b3c09070c29175 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:14:29 -0500 Subject: Exception type changed --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 9e45e4c..cfe7c33 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -211,7 +211,7 @@ public class TestH5P { H5.H5Pset_libver_bounds(fapl_id, 5, HDF5Constants.H5F_LIBVER_LATEST); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidhigh() throws Throwable { H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST, 5); } -- cgit v0.12 From fe22bb8e44b89468849f5a70f014215a459c9d5b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:15:45 -0500 Subject: Exception changed --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index cfe7c33..f713063 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -206,7 +206,7 @@ public class TestH5P { assertEquals(nlinks, 20L); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidlow() throws Throwable { H5.H5Pset_libver_bounds(fapl_id, 5, HDF5Constants.H5F_LIBVER_LATEST); } -- cgit v0.12 From b2d739ef39633ed688ce855fba72aa3ddcbaf43d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:28:36 -0500 Subject: Chnage values so test will fail when new latest is added --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index f713063..d69403c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -213,7 +213,7 @@ public class TestH5P { @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidhigh() throws Throwable { - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST, 5); + H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_LATEST+1); } @Test -- cgit v0.12 From 57e468aba7ba66bba1f9a1736450ed4295a6c25d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2018 14:35:03 -0500 Subject: Change max value --- java/test/TestH5P.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index d69403c..521a53c 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -213,7 +213,7 @@ public class TestH5P { @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidhigh() throws Throwable { - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_LATEST+1); + H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_V110+1); } @Test -- cgit v0.12