From 9dc86e2cde33766cf7eea5d0b92e032f283a6a13 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Thu, 7 May 2015 13:23:09 -0500 Subject: [svn-r27035] Do not pass warnings options to non-gnu compilers when compiling with CMake --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cacc5d..a3d537c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -472,7 +472,7 @@ endif (HDF5_DISABLE_COMPILER_WARNINGS) # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -if (NOT MSVC) +if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") @@ -535,7 +535,7 @@ if (NOT MSVC) # Append more extra warning flags that only gcc 4.7+ know about set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") -endif (NOT MSVC) +endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings @@ -548,7 +548,9 @@ if (HDF5_ENABLE_ALL_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") else (MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + endif (CMAKE_COMPILER_IS_GNUCC) endif (MSVC) endif (HDF5_ENABLE_ALL_WARNINGS) @@ -563,7 +565,9 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") else (MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + endif (CMAKE_COMPILER_IS_GNUCC) endif (MSVC) endif (HDF5_ENABLE_GROUPZERO_WARNINGS) -- cgit v0.12 From 674e9f842cea8ab59339dc8cccf040872fe6ece2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 May 2015 14:46:53 -0500 Subject: [svn-r27037] Added other platforms comment to cmd line and quoted use of directory in option. --- config/cmake/scripts/HDF518config.cmake | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index 70423a3..f0aceea 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -1,8 +1,11 @@ -######################################################################### -### For Windows ${CTEST_SCRIPT_ARG} is one of ### -### [64-VS2013, 32-VS2013, 64-VS2012, 32-VS2012] ### -### ctest -S HDF518config.cmake,32-VS2012 -C Release -V -O hdf518.log ### -######################################################################### +########################################################################## +### For Windows ${CTEST_SCRIPT_ARG} is one of ### +### [64-VS2013, 32-VS2013, 64-VS2012, 32-VS2012] ### +### ctest -S HDF518config.cmake,32-VS2012 -C Release -VV -O hdf518.log ### +### ### +### Other platforms do not use ${CTEST_SCRIPT_ARG} ### +### ctest -S HDF518config.cmake -C Release -VV -O hdf518.log ### +########################################################################## cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) set(CTEST_SOURCE_VERSION 1.8.15) @@ -90,14 +93,14 @@ set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") #### Change default configuration of options in config/cmake/cacheinit.cmake file ### #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") -### uncomment/comment and change the following lines for configuration options +### uncomment/comment or change the following lines for configuration options ### comment the following line or change OFF to ON in order to build shared libraries set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") #### ext libraries #### ### ext libs from tgz -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=\"${CTEST_SCRIPT_DIRECTORY}\"") ### ext libs from svn #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") ### ext libs on system -- cgit v0.12 From 83d37604d35c55971aa03c4acb59826e9a4a3abe Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 8 May 2015 00:10:26 -0500 Subject: [svn-r27040] Moved '*' in H5PLget_loading_state() so that bin/trace would correctly process it and ran bin/trace. Tested on: h5committest --- src/H5FD.c | 2 +- src/H5PL.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 77b7a5b..0e4d840 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1845,7 +1845,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xiIu", file, dxpl_id, closing); + H5TRACE3("e", "*xib", file, dxpl_id, closing); /* Check args */ if(!file || !file->cls) diff --git a/src/H5PL.c b/src/H5PL.c index 619dd84..f4cd3e7 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -237,10 +237,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLget_loading_state(unsigned int* plugin_type) +H5PLget_loading_state(unsigned int *plugin_type) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE1("e", "*Iu", plugin_type); if(plugin_type) *plugin_type = H5PL_plugin_g; -- cgit v0.12 From 67ba6cb57d84dd34c69930d469ae445697b49731 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 10 May 2015 17:38:04 -0500 Subject: [svn-r27045] Renamed H5_ASSIGN_OVERFLOW() to H5_CHECKED_ASSIGN() and re-ordered the arguments to be in a more logical order. Tested on: h5committest --- src/H5Adense.c | 2 +- src/H5Aint.c | 14 +++++++++----- src/H5B2hdr.c | 8 ++++---- src/H5B2int.c | 14 +++++++------- src/H5Dbtree.c | 6 +++--- src/H5Dchunk.c | 42 +++++++++++++++++++++--------------------- src/H5Dcompact.c | 2 +- src/H5Dcontig.c | 30 +++++++++++++++++++++--------- src/H5Defl.c | 2 +- src/H5Dio.c | 4 ++-- src/H5Dmpio.c | 8 ++++---- src/H5FAdblock.c | 2 +- src/H5FDcore.c | 4 ++-- src/H5FDdirect.c | 2 +- src/H5FDfamily.c | 4 ++-- src/H5FDlog.c | 2 +- src/H5FDsec2.c | 2 +- src/H5FScache.c | 4 ++-- src/H5Faccum.c | 14 +++++++------- src/H5Fsuper.c | 2 +- src/H5Fsuper_cache.c | 6 +++--- src/H5Gdeprec.c | 2 +- src/H5Glink.c | 2 +- src/H5HFdbg.c | 6 +++--- src/H5HFdblock.c | 4 ++-- src/H5HFdtable.c | 4 ++-- src/H5HFhdr.c | 2 +- src/H5HFhuge.c | 6 +++--- src/H5HLcache.c | 4 +++- src/H5I.c | 6 +++--- src/H5MF.c | 2 +- src/H5O.c | 4 ++-- src/H5Oattr.c | 2 +- src/H5Ocache.c | 2 +- src/H5Ofill.c | 2 +- src/H5Omessage.c | 4 ++-- src/H5Pencdec.c | 4 ++-- src/H5Pgcpl.c | 2 +- src/H5S.c | 2 +- src/H5Shyper.c | 20 ++++++++++---------- src/H5Smpio.c | 6 +++--- src/H5Sselect.c | 4 ++-- src/H5Tarray.c | 2 +- src/H5Tconv.c | 18 +++++++++--------- src/H5Tfloat.c | 2 +- src/H5Tnative.c | 6 +++--- src/H5Zdeflate.c | 6 +++--- src/H5Znbit.c | 2 +- src/H5Zscaleoffset.c | 2 +- src/H5Zszip.c | 12 ++++++------ src/H5private.h | 7 +++++-- 51 files changed, 171 insertions(+), 150 deletions(-) diff --git a/src/H5Adense.c b/src/H5Adense.c index 0b73a20..e0499f5 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -538,7 +538,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) udata.common.shared_fheap = shared_fheap; udata.common.name = attr->shared->name; udata.common.name_hash = H5_checksum_lookup3(attr->shared->name, HDstrlen(attr->shared->name), 0); - H5_ASSIGN_OVERFLOW(udata.common.flags, mesg_flags, unsigned, uint8_t); + H5_CHECKED_ASSIGN(udata.common.flags, uint8_t, mesg_flags, unsigned); udata.common.corder = attr->shared->crt_idx; udata.common.found_op = NULL; udata.common.found_op_data = NULL; diff --git a/src/H5Aint.c b/src/H5Aint.c index e28c2cc..bfc8eaf 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -255,7 +255,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, /* Get # of elements for attribute's dataspace */ if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, NULL, "dataspace is invalid") - H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, size_t); + H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); HDassert(attr->shared->dt_size > 0); HDassert(attr->shared->ds_size > 0); @@ -508,7 +508,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) /* Get # of elements for attribute's dataspace */ if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, size_t); + H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); /* If there's actually data elements for the attribute, make a copy of the data passed in */ if(nelmts > 0) { @@ -621,7 +621,7 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) /* Create buffer for data to store on disk */ if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, size_t); + H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); if(nelmts > 0) { /* Get the memory and file datatype sizes */ @@ -1680,7 +1680,7 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, *last_attr = skip; /* Iterate over attribute messages */ - H5_ASSIGN_OVERFLOW(/* To: */ u, /* From: */ skip, /* From: */ hsize_t, /* To: */ size_t) + H5_CHECKED_ASSIGN(u, size_t, skip, hsize_t) for(; u < atable->nattrs && !ret_value; u++) { /* Check which type of callback to make */ switch(attr_op->op_type) { @@ -2012,7 +2012,11 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si *recompute_size = TRUE; /* Compute the size of the data */ - H5_ASSIGN_OVERFLOW(attr_dst->shared->data_size, H5S_GET_EXTENT_NPOINTS(attr_dst->shared->ds) * H5T_get_size(attr_dst->shared->dt), hssize_t, size_t); + /* NOTE: This raises warnings. If we are going to be serious about + * expecting overflow here, we should implement testing similar to + * that described in CERT bulletins INT30-C and INT32-C. + */ + H5_CHECKED_ASSIGN(attr_dst->shared->data_size, size_t, H5S_GET_EXTENT_NPOINTS(attr_dst->shared->ds) * H5T_get_size(attr_dst->shared->dt), hssize_t); /* Copy (& convert) the data, if necessary */ if(attr_src->shared->data) { diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 452a35d..d28c263 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -160,7 +160,7 @@ HDmemset(hdr->page, 0, hdr->node_size); /* Initialize leaf node info */ sz_max_nrec = H5B2_NUM_LEAF_REC(hdr->node_size, hdr->rrec_size); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[0].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned) + H5_CHECKED_ASSIGN(hdr->node_info[0].max_nrec, unsigned, sz_max_nrec, size_t) hdr->node_info[0].split_nrec = (hdr->node_info[0].max_nrec * hdr->split_percent) / 100; hdr->node_info[0].merge_nrec = (hdr->node_info[0].max_nrec * hdr->merge_percent) / 100; hdr->node_info[0].cum_max_nrec = hdr->node_info[0].max_nrec; @@ -182,14 +182,14 @@ HDmemset(hdr->page, 0, hdr->node_size); /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) + H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); /* Initialize internal node info */ if(depth > 0) { for(u = 1; u < (unsigned)(depth + 1); u++) { sz_max_nrec = H5B2_NUM_INT_REC(hdr, u); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned) + H5_CHECKED_ASSIGN(hdr->node_info[u].max_nrec, unsigned, sz_max_nrec, size_t) HDassert(hdr->node_info[u].max_nrec <= hdr->node_info[u - 1].max_nrec); hdr->node_info[u].split_nrec = (hdr->node_info[u].max_nrec * hdr->split_percent) / 100; @@ -198,7 +198,7 @@ HDmemset(hdr->page, 0, hdr->node_size); hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) + H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't create node native key block factory") diff --git a/src/H5B2int.c b/src/H5B2int.c index ef83e93..310aef1 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -382,13 +382,13 @@ H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Update node info for new depth of tree */ sz_max_nrec = H5B2_NUM_INT_REC(hdr, hdr->depth); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[hdr->depth].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned) + H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].max_nrec, unsigned, sz_max_nrec, size_t) hdr->node_info[hdr->depth].split_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->split_percent) / 100; hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100; hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) * hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec; u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[hdr->depth].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) + H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") if(NULL == (hdr->node_info[hdr->depth].node_ptr_fac = H5FL_fac_init(sizeof(H5B2_node_ptr_t) * (hdr->node_info[hdr->depth].max_nrec + 1)))) @@ -546,7 +546,7 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Count the number of records being moved */ for(u = 0; u < move_nrec; u++) moved_nrec += right_node_ptrs[u].all_nrec; - H5_ASSIGN_OVERFLOW(/* To: */ left_moved_nrec, /* From: */ moved_nrec, /* From: */ hsize_t, /* To: */ hssize_t) + H5_CHECKED_ASSIGN(left_moved_nrec, hssize_t, moved_nrec, hsize_t) right_moved_nrec -= (hssize_t)moved_nrec; /* Copy node pointers from right node to left */ @@ -600,7 +600,7 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, for(u = 0; u < move_nrec; u++) moved_nrec += right_node_ptrs[u].all_nrec; left_moved_nrec -= (hssize_t)moved_nrec; - H5_ASSIGN_OVERFLOW(/* To: */ right_moved_nrec, /* From: */ moved_nrec, /* From: */ hsize_t, /* To: */ hssize_t) + H5_CHECKED_ASSIGN(right_moved_nrec, hssize_t, moved_nrec, hsize_t) } /* end if */ /* Update number of records in child nodes */ @@ -1848,7 +1848,7 @@ H5B2_protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, unsigned nrec, /* Set up user data for callback */ udata.f = hdr->f; udata.hdr = hdr; - H5_ASSIGN_OVERFLOW(/* To: */ udata.nrec, /* From: */ nrec, /* From: */ unsigned, /* To: */ uint16_t) + H5_CHECKED_ASSIGN(udata.nrec, uint16_t, nrec, unsigned) /* Protect the leaf node */ if(NULL == (ret_value = (H5B2_leaf_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_LEAF, addr, &udata, rw))) @@ -1968,8 +1968,8 @@ H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, /* Set up user data for callback */ udata.f = hdr->f; udata.hdr = hdr; - H5_ASSIGN_OVERFLOW(/* To: */ udata.nrec, /* From: */ nrec, /* From: */ unsigned, /* To: */ uint16_t) - H5_ASSIGN_OVERFLOW(/* To: */ udata.depth, /* From: */ depth, /* From: */ unsigned, /* To: */ uint16_t) + H5_CHECKED_ASSIGN(udata.nrec, uint16_t, nrec, unsigned) + H5_CHECKED_ASSIGN(udata.depth, uint16_t, depth, unsigned) /* Protect the internal node */ if(NULL == (ret_value = (H5B2_internal_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_INT, addr, &udata, rw))) diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index d05de03..4f6b988 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -284,7 +284,7 @@ H5D__btree_new_node(H5F_t *f, hid_t UNUSED dxpl_id, H5B_ins_t op, * The left key describes the storage of the UDATA chunk being * inserted into the tree. */ - H5_ASSIGN_OVERFLOW(lt_key->nbytes, udata->chunk_block.length, hsize_t, uint32_t); + H5_CHECKED_ASSIGN(lt_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t); lt_key->filter_mask = udata->filter_mask; for(u = 0; u < udata->common.layout->ndims; u++) lt_key->offset[u] = udata->common.offset[u]; @@ -548,7 +548,7 @@ H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key, /* Set node's address (already re-allocated by main chunk routines) */ HDassert(H5F_addr_defined(udata->chunk_block.offset)); *new_node_p = udata->chunk_block.offset; - H5_ASSIGN_OVERFLOW(lt_key->nbytes, udata->chunk_block.length, hsize_t, uint32_t); + H5_CHECKED_ASSIGN(lt_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t); lt_key->filter_mask = udata->filter_mask; *lt_key_changed = TRUE; ret_value = H5B_INS_CHANGE; @@ -568,7 +568,7 @@ H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key, * Split this node, inserting the new new node to the right of the * current node. The MD_KEY is where the split occurs. */ - H5_ASSIGN_OVERFLOW(md_key->nbytes, udata->chunk_block.length, hsize_t, uint32_t); + H5_CHECKED_ASSIGN(md_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t); md_key->filter_mask = udata->filter_mask; for(u = 0; u < udata->common.layout->ndims; u++) { HDassert(0 == udata->common.offset[u] % udata->common.layout->dim[u]); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index b0d935c..d990804 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -558,7 +558,7 @@ H5D__chunk_construct(H5F_t UNUSED *f, H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "chunk size must be < 4GB") /* Retain computed chunk size */ - H5_ASSIGN_OVERFLOW(dset->shared->layout.u.chunk.size, chunk_size, uint64_t, uint32_t); + H5_CHECKED_ASSIGN(dset->shared->layout.u.chunk.size, uint32_t, chunk_size, uint64_t); /* Reset address and pointer of the array struct for the chunked storage index */ if(H5D_chunk_idx_reset(&dset->shared->layout.storage.u.chunk, TRUE) < 0) @@ -718,7 +718,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if((sm_ndims = H5S_GET_EXTENT_NDIMS(mem_space)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimension number") /* Set the number of dimensions for the memory dataspace */ - H5_ASSIGN_OVERFLOW(fm->m_ndims, sm_ndims, int, unsigned); + H5_CHECKED_ASSIGN(fm->m_ndims, unsigned, sm_ndims, int); /* Get rank for file dataspace */ fm->f_ndims = f_ndims = dataset->shared->layout.u.chunk.ndims - 1; @@ -1317,7 +1317,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t /* Get number of elements selected in chunk */ if((schunk_points = H5S_GET_SELECT_NPOINTS(tmp_fchunk)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements") - H5_ASSIGN_OVERFLOW(new_chunk_info->chunk_points, schunk_points, hssize_t, uint32_t); + H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, schunk_points, hssize_t); /* Decrement # of points left in file selection */ sel_points -= (hsize_t)schunk_points; @@ -1793,7 +1793,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; /* Initialize temporary contiguous storage info */ - H5_ASSIGN_OVERFLOW(ctg_store.contig.dset_size, io_info->dset->shared->layout.u.chunk.size, uint32_t, hsize_t); + H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, io_info->dset->shared->layout.u.chunk.size, uint32_t); /* Set up compact I/O info object */ HDmemcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); @@ -1938,7 +1938,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; /* Initialize temporary contiguous storage info */ - H5_ASSIGN_OVERFLOW(ctg_store.contig.dset_size, io_info->dset->shared->layout.u.chunk.size, uint32_t, hsize_t); + H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, io_info->dset->shared->layout.u.chunk.size, uint32_t); /* Set up compact I/O info object */ HDmemcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); @@ -2248,7 +2248,7 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud /* Stored the information to cache */ HDmemcpy(last->offset, udata->common.offset, sizeof(hsize_t) * udata->common.layout->ndims); last->addr = udata->chunk_block.offset; - H5_ASSIGN_OVERFLOW(last->nbytes, udata->chunk_block.length, hsize_t, uint32_t); + H5_CHECKED_ASSIGN(last->nbytes, uint32_t, udata->chunk_block.length, hsize_t); last->filter_mask = udata->filter_mask; /* Indicate that the cached info is valid */ @@ -2517,7 +2517,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t point_of_no_return = TRUE; ent->chunk = NULL; } /* end else */ - H5_ASSIGN_OVERFLOW(nbytes, udata.chunk_block.length, hsize_t, size_t); + H5_CHECKED_ASSIGN(nbytes, size_t, udata.chunk_block.length, hsize_t); if(H5Z_pipeline(&(dset->shared->dcpl_cache.pline), 0, &(udata.filter_mask), dxpl_cache->err_detect, dxpl_cache->filter_cb, &nbytes, &alloc, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "output pipeline failed") @@ -2526,7 +2526,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t if(nbytes > ((size_t)0xffffffff)) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ - H5_ASSIGN_OVERFLOW(udata.chunk_block.length, nbytes, size_t, hsize_t); + H5_CHECKED_ASSIGN(udata.chunk_block.length, hsize_t, nbytes, size_t); /* Indicate that the chunk must be allocated */ must_alloc = TRUE; @@ -2835,7 +2835,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Get the chunk's size */ HDassert(layout->u.chunk.size > 0); - H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); + H5_CHECKED_ASSIGN(chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Check if the chunk is in the cache */ if(UINT_MAX != udata->idx_hint) { @@ -3000,8 +3000,8 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, ent->chunk_block.offset = chunk_addr; ent->chunk_block.length = chunk_alloc; HDmemcpy(ent->offset, io_info->store->chunk.offset, sizeof(hsize_t) * layout->u.chunk.ndims); - H5_ASSIGN_OVERFLOW(ent->rd_count, chunk_size, size_t, uint32_t); - H5_ASSIGN_OVERFLOW(ent->wr_count, chunk_size, size_t, uint32_t); + H5_CHECKED_ASSIGN(ent->rd_count, uint32_t, chunk_size, size_t); + H5_CHECKED_ASSIGN(ent->wr_count, uint32_t, chunk_size, size_t); ent->chunk = (uint8_t *)chunk; /* Add it to the cache */ @@ -3321,7 +3321,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Get original chunk size */ - H5_ASSIGN_OVERFLOW(orig_chunk_size, layout->u.chunk.size, uint32_t, size_t); + H5_CHECKED_ASSIGN(orig_chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Check the dataset's fill-value status */ if(H5P_is_fill_value_defined(fill, &fill_status) < 0) @@ -3498,7 +3498,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, udata.common.storage = &layout->storage.u.chunk; udata.common.offset = chunk_offset; udata.chunk_block.offset = HADDR_UNDEF; - H5_ASSIGN_OVERFLOW(udata.chunk_block.length, chunk_size, size_t, uint32_t); + H5_CHECKED_ASSIGN(udata.chunk_block.length, uint32_t, chunk_size, size_t); udata.filter_mask = filter_mask; /* Allocate the chunk (with all processes) */ @@ -3656,9 +3656,9 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, leftover_blocks = chunk_info->num_io % mpi_size; /* Cast values to types needed by MPI */ - H5_ASSIGN_OVERFLOW(blocks, num_blocks, size_t, int); - H5_ASSIGN_OVERFLOW(leftover, leftover_blocks, size_t, int); - H5_ASSIGN_OVERFLOW(block_len, chunk_size, size_t, int); + H5_CHECKED_ASSIGN(blocks, int, num_blocks, size_t); + H5_CHECKED_ASSIGN(leftover, int, leftover_blocks, size_t); + H5_CHECKED_ASSIGN(block_len, int, chunk_size, size_t); /* Allocate buffers */ /* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */ @@ -3787,7 +3787,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) /* Get the chunk's size */ HDassert(layout->u.chunk.size > 0); - H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); + H5_CHECKED_ASSIGN(chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Get the info for the chunk in the file */ if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, io_info->store->chunk.index, &chk_udata) < 0) @@ -4558,7 +4558,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_ENTER_STATIC /* Get 'size_t' local value for number of bytes in chunk */ - H5_ASSIGN_OVERFLOW(nbytes, chunk_rec->nbytes, uint32_t, size_t); + H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); /* Check parameter for type conversion */ if(udata->do_convert) { @@ -4675,7 +4675,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) 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 */ - H5_ASSIGN_OVERFLOW(udata_dst.chunk_block.length, nbytes, size_t, uint32_t); + H5_CHECKED_ASSIGN(udata_dst.chunk_block.length, uint32_t, nbytes, size_t); udata->buf = buf; udata->buf_size = buf_size; } /* end if */ @@ -4777,7 +4777,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, /* Get the dim info for dataset */ if((sndims = H5S_extent_get_dims(ds_extent_src, curr_dims, NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions") - H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); + H5_CHECKED_ASSIGN(ndims, unsigned, sndims, int); /* Set the source layout chunk information */ if(H5D__chunk_set_info_real(layout_src, ndims, curr_dims) < 0) @@ -4885,7 +4885,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, do_convert = TRUE; } /* end if */ - H5_ASSIGN_OVERFLOW(buf_size, layout_src->size, uint32_t, size_t); + H5_CHECKED_ASSIGN(buf_size, size_t, layout_src->size, uint32_t); reclaim_buf_size = 0; } /* end else */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 1d8b97c..af70c07 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -197,7 +197,7 @@ H5D__compact_construct(H5F_t *f, H5D_t *dset) tmp_size = H5T_get_size(dset->shared->type); HDassert(tmp_size > 0); tmp_size = tmp_size * (hsize_t)stmp_size; - H5_ASSIGN_OVERFLOW(dset->shared->layout.storage.u.compact.size, tmp_size, hssize_t, size_t); + H5_CHECKED_ASSIGN(dset->shared->layout.storage.u.compact.size, size_t, tmp_size, hssize_t); /* Verify data size is smaller than maximum header message size * (64KB) minus other layout message fields. diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index e913a3f..898b46d 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -259,7 +259,7 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id) /* Get the number of elements in the dataset's dataspace */ if((snpoints = H5S_GET_EXTENT_NPOINTS(dset->shared->space)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "dataset has negative number of elements") - H5_ASSIGN_OVERFLOW(npoints, snpoints, hssize_t, size_t); + H5_CHECKED_ASSIGN(npoints, size_t, snpoints, hssize_t); /* Initialize the fill value buffer */ if(H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, @@ -644,6 +644,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, size_t sieve_size = (size_t)-1; /* Size of sieve buffer */ haddr_t rel_eoa; /* Relative end of file address */ hsize_t max_data; /* Actual maximum size of data to cache */ + hsize_t min; /* temporary minimum value (avoids some ugly macro nesting) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -684,7 +685,8 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, max_data = store_contig->dset_size - dst_off; /* Compute the size of the sieve buffer */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Read the new sieve buffer */ if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) @@ -757,9 +759,13 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Only need this when resizing sieve buffer */ max_data = store_contig->dset_size - dst_off; - /* Compute the size of the sieve buffer */ - /* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); + /* Compute the size of the sieve buffer. + * Don't read off the end of the file, don't read past + * the end of the data element, and don't read more than + * the buffer size. + */ + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Update local copies of sieve information */ sieve_start = dset_contig->sieve_loc; @@ -915,6 +921,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, size_t sieve_size = (size_t)-1; /* size of sieve buffer */ haddr_t rel_eoa; /* Relative end of file address */ hsize_t max_data; /* Actual maximum size of data to cache */ + hsize_t min; /* temporary minimum value (avoids some ugly macro nesting) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -960,7 +967,8 @@ if(dset_contig->sieve_size > len) max_data = store_contig->dset_size - dst_off; /* Compute the size of the sieve buffer */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Check if there is any point in reading the data from the file */ if(dset_contig->sieve_size > len) { @@ -1075,9 +1083,13 @@ if(dset_contig->sieve_size > len) /* Only need this when resizing sieve buffer */ max_data = store_contig->dset_size - dst_off; - /* Compute the size of the sieve buffer */ - /* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); + /* Compute the size of the sieve buffer. + * Don't read off the end of the file, don't read past + * the end of the data element, and don't read more than + * the buffer size. + */ + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Update local copies of sieve information */ sieve_start = dset_contig->sieve_loc; diff --git a/src/H5Defl.c b/src/H5Defl.c index 355492f..6707568 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -170,7 +170,7 @@ H5D__efl_construct(H5F_t *f, H5D_t *dset) stmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space); HDassert(stmp_size >= 0); tmp_size = (hsize_t)stmp_size * dt_size; - H5_ASSIGN_OVERFLOW(dset->shared->layout.storage.u.contig.size, tmp_size, hssize_t, hsize_t); + H5_CHECKED_ASSIGN(dset->shared->layout.storage.u.contig.size, hsize_t, tmp_size, hssize_t); /* Get the sieve buffer size for this dataset */ dset->shared->cache.contig.sieve_buf_size = H5F_SIEVE_BUF_SIZE(f); diff --git a/src/H5Dio.c b/src/H5Dio.c index 44080dc..f9e8f37 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -409,7 +409,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, mem_space = file_space; if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") - H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); + H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); /* Fill the DXPL cache values for later use */ if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) @@ -679,7 +679,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") - H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, hsize_t); + H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); /* Make certain that the number of elements in each selection is the same */ if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index db487cd..825c562 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -438,7 +438,7 @@ H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, /* Get the number of chunks to perform I/O on */ num_chunkf = 0; ori_num_chunkf = H5SL_count(fm->sel_chunks); - H5_ASSIGN_OVERFLOW(num_chunkf, ori_num_chunkf, size_t, int); + H5_CHECKED_ASSIGN(num_chunkf, int, ori_num_chunkf, size_t); /* Determine the summation of number of chunks for all processes */ if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, sum_chunkf, 1, MPI_INT, MPI_SUM, io_info->comm))) @@ -826,7 +826,7 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ } /* end if */ /* Retrieve total # of chunks in dataset */ - H5_ASSIGN_OVERFLOW(total_chunks, fm->layout->u.chunk.nchunks, hsize_t, size_t); + H5_CHECKED_ASSIGN(total_chunks, size_t, fm->layout->u.chunk.nchunks, hsize_t); /* Handle special case when dataspace dimensions only allow one chunk in * the dataset. [This sometimes is used by developers who want the @@ -1148,7 +1148,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty #endif /* Retrieve total # of chunks in dataset */ - H5_ASSIGN_OVERFLOW(total_chunk, fm->layout->u.chunk.nchunks, hsize_t, size_t); + H5_CHECKED_ASSIGN(total_chunk, size_t, fm->layout->u.chunk.nchunks, hsize_t); HDassert(total_chunk != 0); /* Allocate memories */ @@ -1699,7 +1699,7 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Setup parameters */ - H5_ASSIGN_OVERFLOW(total_chunks, fm->layout->u.chunk.nchunks, hsize_t, int); + H5_CHECKED_ASSIGN(total_chunks, int, fm->layout->u.chunk.nchunks, hsize_t); percent_nproc_per_chunk = H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME); /* if ratio is 0, perform collective io */ if(0 == percent_nproc_per_chunk) { diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 80e2159..9efc2bc 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -129,7 +129,7 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts)) hsize_t npages = ((nelmts + dblock->dblk_page_nelmts) - 1) / dblock->dblk_page_nelmts; /* Safely assign the number of pages */ - H5_ASSIGN_OVERFLOW(/* To: */ dblock->npages, /* From: */ npages, /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(dblock->npages, size_t, npages, hsize_t); /* Sanity check that we have at least 1 page */ HDassert(dblock->npages > 0); diff --git a/src/H5FDcore.c b/src/H5FDcore.c index ba4270e..f9bda00 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -1300,7 +1300,7 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had size_t new_eof; /* Determine new size of memory buffer */ - H5_ASSIGN_OVERFLOW(new_eof, file->increment * ((addr + size) / file->increment), hsize_t, size_t); + H5_CHECKED_ASSIGN(new_eof, size_t, file->increment * ((addr + size) / file->increment), hsize_t); if((addr + size) % file->increment) new_eof += file->increment; @@ -1469,7 +1469,7 @@ H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing) new_eof = file->eoa; else { /* set eof to smallest multiple of increment that exceeds eoa */ /* Determine new size of memory buffer */ - H5_ASSIGN_OVERFLOW(new_eof, file->increment * (file->eoa / file->increment), hsize_t, size_t); + H5_CHECKED_ASSIGN(new_eof, size_t, file->increment * (file->eoa / file->increment), hsize_t); if(file->eoa % file->increment) new_eof += file->increment; } /* end else */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 7507a2e..c2b0660 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -515,7 +515,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info") file->fd = fd; - H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,h5_stat_size_t,haddr_t); + H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t); file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; #ifdef H5_HAVE_WIN32_API diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index ad703ef..e79e1cf 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -1170,7 +1170,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si /* Read from each member */ while(size > 0) { - H5_ASSIGN_OVERFLOW(u,addr /file->memb_size,hsize_t,unsigned); + H5_CHECKED_ASSIGN(u, unsigned, addr / file->memb_size, hsize_t); sub = addr % file->memb_size; @@ -1239,7 +1239,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s /* Write to each member */ while (size>0) { - H5_ASSIGN_OVERFLOW(u,addr /file->memb_size,hsize_t,unsigned); + H5_CHECKED_ASSIGN(u, unsigned, addr / file->memb_size, hsize_t); sub = addr % file->memb_size; diff --git a/src/H5FDlog.c b/src/H5FDlog.c index a2284dd..cc0caa4 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -571,7 +571,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") file->fd = fd; - H5_ASSIGN_OVERFLOW(file->eof, sb.st_size, h5_stat_size_t, haddr_t); + H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t); file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; #ifdef H5_HAVE_WIN32_API diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 1130789..b938c41 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -358,7 +358,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") file->fd = fd; - H5_ASSIGN_OVERFLOW(file->eof, sb.st_size, h5_stat_size_t, haddr_t); + H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t); file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; #ifdef H5_HAVE_WIN32_API diff --git a/src/H5FScache.c b/src/H5FScache.c index e03a0a4..306a3fd 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -578,7 +578,7 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Allocate space for the buffer to serialize the sections into */ - H5_ASSIGN_OVERFLOW(/* To: */ old_sect_size, /* From: */ udata->fspace->sect_size, /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(old_sect_size, size_t, udata->fspace->sect_size, hsize_t); if(NULL == (buf = H5FL_BLK_MALLOC(sect_block, (size_t)udata->fspace->sect_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -1038,7 +1038,7 @@ H5FS_cache_sinfo_size(const H5F_t UNUSED *f, const H5FS_sinfo_t *sinfo, size_t * HDassert(size_ptr); /* Set size value */ - H5_ASSIGN_OVERFLOW(/* To: */ *size_ptr, /* From: */ sinfo->fspace->alloc_sect_size, /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(*size_ptr, size_t, sinfo->fspace->alloc_sect_size, hsize_t); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FS_cache_sinfo_size() */ diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 7eb75bd..7cd9abb 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -172,7 +172,7 @@ H5F__accum_read(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr, /* Read the part before the metadata accumulator */ if(addr < accum->loc) { /* Set the amount to read */ - H5_ASSIGN_OVERFLOW(amount_before, (accum->loc - addr), hsize_t, size_t); + H5_CHECKED_ASSIGN(amount_before, size_t, (accum->loc - addr), hsize_t); /* Make room for the metadata to read in */ HDmemmove(accum->buf + amount_before, accum->buf, accum->size); @@ -193,7 +193,7 @@ H5F__accum_read(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr, size_t amount_after; /* Amount to read at a time */ /* Set the amount to read */ - H5_ASSIGN_OVERFLOW(amount_after, ((addr + size) - (accum->loc + accum->size)), hsize_t, size_t); + H5_CHECKED_ASSIGN(amount_after, size_t, ((addr + size) - (accum->loc + accum->size)), hsize_t); /* Dispatch to driver */ if(H5FD_read(fio_info->f->shared->lf, fio_info->dxpl, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0) @@ -536,14 +536,14 @@ H5F__accum_write(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr, size_t old_offset; /* Offset of old data within the accumulator buffer */ /* Calculate the amount we will need to add to the accumulator size, based on the amount of overlap */ - H5_ASSIGN_OVERFLOW(add_size, (accum->loc - addr), hsize_t, size_t); + H5_CHECKED_ASSIGN(add_size, size_t, (accum->loc - addr), hsize_t); /* Check if we need to adjust accumulator size */ if(H5F__accum_adjust(accum, fio_info, H5F_ACCUM_PREPEND, add_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Calculate the proper offset of the existing metadata */ - H5_ASSIGN_OVERFLOW(old_offset, (addr + size) - accum->loc, hsize_t, size_t); + H5_CHECKED_ASSIGN(old_offset, size_t, (addr + size) - accum->loc, hsize_t); /* Move the existing metadata to the proper location */ HDmemmove(accum->buf + size, accum->buf + old_offset, (accum->size - old_offset)); @@ -576,7 +576,7 @@ H5F__accum_write(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr, size_t dirty_off; /* Offset of dirty region */ /* Calculate the amount we will need to add to the accumulator size, based on the amount of overlap */ - H5_ASSIGN_OVERFLOW(add_size, (addr + size) - (accum->loc + accum->size), hsize_t, size_t); + H5_CHECKED_ASSIGN(add_size, size_t, (addr + size) - (accum->loc + accum->size), hsize_t); /* Check if we need to adjust accumulator size */ if(H5F__accum_adjust(accum, fio_info, H5F_ACCUM_APPEND, add_size) < 0) @@ -885,7 +885,7 @@ H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t UNUSED type, haddr_t a size_t new_accum_size; /* Size of new accumulator buffer */ /* Calculate the size of the overlap with the accumulator, etc. */ - H5_ASSIGN_OVERFLOW(overlap_size, (addr + size) - accum->loc, haddr_t, size_t); + H5_CHECKED_ASSIGN(overlap_size, size_t, (addr + size) - accum->loc, haddr_t); new_accum_size = accum->size - overlap_size; /* Move the accumulator buffer information to eliminate the freed block */ @@ -919,7 +919,7 @@ H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t UNUSED type, haddr_t a haddr_t dirty_start = accum->loc + accum->dirty_off; /* Calculate the size of the overlap with the accumulator */ - H5_ASSIGN_OVERFLOW(overlap_size, (accum->loc + accum->size) - addr, haddr_t, size_t); + H5_CHECKED_ASSIGN(overlap_size, size_t, (accum->loc + accum->size) - addr, haddr_t); /* Check if block to free begins before end of dirty region */ if(accum->dirty && H5F_addr_lt(addr, dirty_end)) { diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index dd80a46..845ab8c 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -434,7 +434,7 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id) superblock_size = (hsize_t)H5F_SUPERBLOCK_SIZE(super_vers, f); /* Compute the size of the driver information block */ - H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t); + H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); if(driver_size > 0) { driver_size += H5F_DRVINFOBLOCK_HDR_SIZE; diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index f3931cb..5737ce4 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -723,7 +723,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, HGOTO_ERROR(H5E_FILE, H5E_CANTENCODE, FAIL, "can't encode root group symbol table entry") /* Encode the driver information block. */ - H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t); + H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); /* Checking whether driver block address is defined here is to handle backward * compatibility. If the file was created with v1.6 library or earlier and no @@ -799,7 +799,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, } /* end else */ /* Retrieve the total size of the superblock info */ - H5_ASSIGN_OVERFLOW(superblock_size, (p - buf), ptrdiff_t, size_t); + H5_CHECKED_ASSIGN(superblock_size, size_t, (p - buf), ptrdiff_t); /* Double check we didn't overrun the block (unlikely) */ HDassert(superblock_size <= sizeof(buf)); @@ -824,7 +824,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, /* Check for ignoring the driver info for this file */ if(!H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { /* Check for driver info message */ - H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t); + H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); if(driver_size > 0) { H5O_drvinfo_t drvinfo; /* Driver info */ uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index ca9e7fd..8f2fe54 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -261,7 +261,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get group info") /* Set the non-default local heap size hint */ - H5_ASSIGN_OVERFLOW(ginfo.lheap_size_hint, size_hint, size_t, uint32_t); + H5_CHECKED_ASSIGN(ginfo.lheap_size_hint, uint32_t, size_hint, size_t); if(H5P_set(gc_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set group info") } /* end if */ diff --git a/src/H5Glink.c b/src/H5Glink.c index f934052..8b258b5 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -467,7 +467,7 @@ H5G__link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, *last_lnk += skip; /* Iterate over link messages */ - H5_ASSIGN_OVERFLOW(/* To: */ u, /* From: */ skip, /* From: */ hsize_t, /* To: */ size_t) + H5_CHECKED_ASSIGN(u, size_t, skip, hsize_t) for(; u < ltable->nlinks && !ret_value; u++) { /* Make the callback */ ret_value = (op)(&(ltable->lnks[u]), op_data); diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 7d22ddd..8620f6f 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -387,11 +387,11 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) if(sect_start < dblock_start) start = 0; else - H5_ASSIGN_OVERFLOW(/* To: */ start, /* From: */ (sect_start - dblock_start), /* From: */ hsize_t, /* To: */ size_t) + H5_CHECKED_ASSIGN(start, size_t, (sect_start - dblock_start), hsize_t) if(sect_end > dblock_end) - H5_ASSIGN_OVERFLOW(/* To: */ end, /* From: */ udata->dblock_size, /* From: */ hsize_t, /* To: */ size_t) + H5_CHECKED_ASSIGN(end, size_t, udata->dblock_size, hsize_t) else - H5_ASSIGN_OVERFLOW(/* To: */ end, /* From: */ ((sect_end - dblock_start) + 1), /* From: */ hsize_t, /* To: */ size_t) + H5_CHECKED_ASSIGN(end, size_t, ((sect_end - dblock_start) + 1), hsize_t) /* Calculate the length */ len = end - start; diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index c4ae573..9a8da4a 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -131,7 +131,7 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo dblock->block_off = par_iblock->block_off; dblock->block_off += hdr->man_dtable.row_block_off[par_row]; dblock->block_off += hdr->man_dtable.row_block_size[par_row] * (par_entry % hdr->man_dtable.cparam.width); - H5_ASSIGN_OVERFLOW(/* To: */ dblock->size, /* From: */ hdr->man_dtable.row_block_size[par_row], /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(dblock->size, size_t, hdr->man_dtable.row_block_size[par_row], hsize_t); } /* end if */ else { /* Must be the root direct block */ @@ -397,7 +397,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") HDassert(next_row < iblock->nrows); - H5_ASSIGN_OVERFLOW(/* To: */ next_size, /* From: */ hdr->man_dtable.row_block_size[next_row], /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(next_size, size_t, hdr->man_dtable.row_block_size[next_row], hsize_t); /* Check for skipping over blocks */ if(min_dblock_size > next_size) { diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index 607862a..c523396 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -168,7 +168,7 @@ HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off); /* Check for offset in first row */ if(off < dtable->num_id_first_row) { *row = 0; - H5_ASSIGN_OVERFLOW(/* To: */ *col, /* From: */ (off / dtable->cparam.start_block_size), /* From: */ hsize_t, /* To: */ unsigned); + H5_CHECKED_ASSIGN(*col, unsigned, (off / dtable->cparam.start_block_size), hsize_t); } /* end if */ else { unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */ @@ -178,7 +178,7 @@ HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off); HDfprintf(stderr, "%s: high_bit = %u, off_mask = %Hu\n", "H5HF_dtable_lookup", high_bit, off_mask); #endif /* QAK */ *row = (high_bit - dtable->first_row_bits) + 1; - H5_ASSIGN_OVERFLOW(/* To: */ *col, /* From: */ ((off - off_mask) / dtable->row_block_size[*row]), /* From: */ hsize_t, /* To: */ unsigned); + H5_CHECKED_ASSIGN(*col, unsigned, ((off - off_mask) / dtable->row_block_size[*row]), hsize_t); } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index d3c4473..cf8da23 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -262,7 +262,7 @@ H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) if(u < hdr->man_dtable.max_direct_rows) { hdr->man_dtable.row_tot_dblock_free[u] = hdr->man_dtable.row_block_size[u] - H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->man_dtable.row_max_dblock_free[u], /* From: */ hdr->man_dtable.row_tot_dblock_free[u], /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(hdr->man_dtable.row_max_dblock_free[u], size_t, hdr->man_dtable.row_tot_dblock_free[u], hsize_t); } /* end if */ else if(H5HF_hdr_compute_free_space(hdr, u) < 0) diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 6f0b48e..7f0da02 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -653,7 +653,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Retrieve the object's address & length */ obj_addr = found_rec.addr; - H5_ASSIGN_OVERFLOW(/* To: */ obj_size, /* From: */ found_rec.len, /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(obj_size, size_t, found_rec.len, hsize_t); filter_mask = found_rec.filter_mask; } /* end if */ else { @@ -669,7 +669,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Retrieve the object's address & length */ obj_addr = found_rec.addr; - H5_ASSIGN_OVERFLOW(/* To: */ obj_size, /* From: */ found_rec.len, /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(obj_size, size_t, found_rec.len, hsize_t); } /* end else */ } /* end else */ @@ -797,7 +797,7 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Retrieve the object's address & length */ obj_addr = found_rec.addr; - H5_ASSIGN_OVERFLOW(/* To: */ obj_size, /* From: */ found_rec.len, /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(obj_size, size_t, found_rec.len, hsize_t); } /* end else */ /* Write the object's data to the file */ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index a3c43ac..6576284 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -258,6 +258,7 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) size_t spec_read_size; /* Size of buffer to speculatively read in */ const uint8_t *p; /* Pointer into decoding buffer */ haddr_t eoa; /* Relative end of file address */ + hsize_t min; /* temp min value to avoid macro nesting */ H5HL_prfx_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -276,7 +277,8 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, NULL, "unable to determine file size") /* Compute the size of the speculative local heap prefix buffer */ - H5_ASSIGN_OVERFLOW(spec_read_size, MIN(eoa - addr, H5HL_SPEC_READ_SIZE), /* From: */ hsize_t, /* To: */ size_t); + min = MIN(eoa - addr, H5HL_SPEC_READ_SIZE); + H5_CHECKED_ASSIGN(spec_read_size, size_t, min, hsize_t); HDassert(spec_read_size >= udata->sizeof_prfx); /* Attempt to speculatively read both local heap prefix and heap data */ diff --git a/src/H5I.c b/src/H5I.c index eb34d6e..528be81 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -433,7 +433,7 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) if((members = H5I_nmembers(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTCOUNT, FAIL, "can't compute number of members") - H5_ASSIGN_OVERFLOW(*num_members, members, int64_t, hsize_t); + H5_CHECKED_ASSIGN(*num_members, hsize_t, members, int64_t); } /* end if */ done: @@ -460,7 +460,7 @@ int64_t H5I_nmembers(H5I_type_t type) { H5I_id_type_t *type_ptr = NULL; - int ret_value; + int64_t ret_value; FUNC_ENTER_NOAPI(FAIL) @@ -470,7 +470,7 @@ H5I_nmembers(H5I_type_t type) HGOTO_DONE(0); /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, type_ptr->id_count, uint64_t, int64_t); + H5_CHECKED_ASSIGN(ret_value, int64_t, type_ptr->id_count, uint64_t); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5MF.c b/src/H5MF.c index 29e9ece..eecd724 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -1383,7 +1383,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, /* Query how many sections of this type */ if(H5FS_sect_stats(f->shared->fs_man[ty], NULL, &hnums) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space stats") - H5_ASSIGN_OVERFLOW(nums, hnums, hsize_t, size_t); + H5_CHECKED_ASSIGN(nums, size_t, hnums, hsize_t); /* Increment total # of sections */ total_sects += nums; diff --git a/src/H5O.c b/src/H5O.c index 1fd7225..6745716 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -2716,8 +2716,8 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) hdr->version = oh->version; /* Set the number of messages & chunks */ - H5_ASSIGN_OVERFLOW(hdr->nmesgs, oh->nmesgs, size_t, unsigned); - H5_ASSIGN_OVERFLOW(hdr->nchunks, oh->nchunks, size_t, unsigned); + H5_CHECKED_ASSIGN(hdr->nmesgs, unsigned, oh->nmesgs, size_t); + H5_CHECKED_ASSIGN(hdr->nchunks, unsigned, oh->nchunks, size_t); /* Set the status flags */ hdr->flags = oh->flags; diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 2269bd3..9710f5d 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -218,7 +218,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_fl p += attr->shared->ds_size; /* Compute the size of the data */ - H5_ASSIGN_OVERFLOW(attr->shared->data_size, H5S_GET_EXTENT_NPOINTS(attr->shared->ds) * H5T_get_size(attr->shared->dt), hsize_t, size_t); + H5_CHECKED_ASSIGN(attr->shared->data_size, size_t, H5S_GET_EXTENT_NPOINTS(attr->shared->ds) * H5T_get_size(attr->shared->dt), hsize_t); /* Go get the data */ if(attr->shared->data_size) { diff --git a/src/H5Ocache.c b/src/H5Ocache.c index b3dea03..b1d94d8 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -184,7 +184,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine file size") /* Compute the size of the speculative object header buffer */ - H5_ASSIGN_OVERFLOW(spec_read_size, MIN(eoa - addr, H5O_SPEC_READ_SIZE), /* From: */ hsize_t, /* To: */ size_t); + H5_CHECKED_ASSIGN(spec_read_size, size_t, MIN(eoa - addr, H5O_SPEC_READ_SIZE), hsize_t); /* Attempt to speculatively read both object header prefix and first chunk */ if(H5F_block_read(f, H5FD_MEM_OHDR, addr, spec_read_size, dxpl_id, read_buf) < 0) diff --git a/src/H5Ofill.c b/src/H5Ofill.c index a0fc42e..33022fc 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -977,7 +977,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ } /* end if */ H5T_close(fill->type); fill->type = NULL; - H5_ASSIGN_OVERFLOW(fill->size, H5T_get_size(dset_type), size_t, ssize_t); + H5_CHECKED_ASSIGN(fill->size, ssize_t, H5T_get_size(dset_type), size_t); /* Note that the fill value info has changed */ *fill_changed = TRUE; diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 1369583..f70fa72 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -807,7 +807,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) /* Count the messages of the correct type */ msg_count = H5O_msg_count_real(oh, type); - H5_ASSIGN_OVERFLOW(ret_value, msg_count, unsigned, int); + H5_CHECKED_ASSIGN(ret_value, int, msg_count, unsigned); done: if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) @@ -2300,7 +2300,7 @@ H5O_msg_get_chunkno(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "message type not found") /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, idx_msg->chunkno, unsigned, int); + H5_CHECKED_ASSIGN(ret_value, int, idx_msg->chunkno, unsigned); done: if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 3285ae3..bd0a260 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -509,7 +509,7 @@ H5P__decode_size_t(const void **_pp, void *_value) /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); - H5_ASSIGN_OVERFLOW(*value, enc_value, uint64_t, size_t); + H5_CHECKED_ASSIGN(*value, size_t, enc_value, uint64_t); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_size_t() */ @@ -550,7 +550,7 @@ H5P__decode_hsize_t(const void **_pp, void *_value) /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); - H5_ASSIGN_OVERFLOW(*value, enc_value, uint64_t, hsize_t); + H5_CHECKED_ASSIGN(*value, hsize_t, enc_value, uint64_t); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__decode_hsize_t() */ diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index b7d5106..1e3a278 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -179,7 +179,7 @@ H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get group info") /* Update field */ - H5_ASSIGN_OVERFLOW(ginfo.lheap_size_hint, size_hint, size_t, uint32_t); + H5_CHECKED_ASSIGN(ginfo.lheap_size_hint, uint32_t, size_hint, size_t); /* Set value */ if(H5P_set(plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) diff --git a/src/H5S.c b/src/H5S.c index dd2bb0a..9b37797 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1521,7 +1521,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) /* Find out the size of buffer needed for selection */ if((sselect_size = H5S_SELECT_SERIAL_SIZE(obj)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace selection size") - H5_ASSIGN_OVERFLOW(select_size, sselect_size, hssize_t, size_t); + H5_CHECKED_ASSIGN(select_size, size_t, sselect_size, hssize_t); /* Verify the size of buffer. If it's not big enough, simply return the * right size without filling the buffer. */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 9b1562f..0d5e630 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -7635,7 +7635,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter, /* Finish the span in the fastest changing dimension */ /* Compute the number of bytes to attempt in this span */ - H5_ASSIGN_OVERFLOW(span_size,((curr_span->high-abs_arr[fast_dim])+1)*elem_size,hsize_t,size_t); + H5_CHECKED_ASSIGN(span_size, size_t, ((curr_span->high-abs_arr[fast_dim])+1)*elem_size, hsize_t); /* Check number of bytes against upper bounds allowed */ if(span_size>io_bytes_left) @@ -7778,7 +7778,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter, loc_off += curr_span->pstride; /* Compute the number of elements to attempt in this span */ - H5_ASSIGN_OVERFLOW(span_size, curr_span->nelem, hsize_t, size_t); + H5_CHECKED_ASSIGN(span_size, size_t, curr_span->nelem, hsize_t); /* Check number of elements against upper bounds allowed */ if(span_size >= io_bytes_left) { @@ -8108,7 +8108,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, loc += offset[u] * slab[u]; /* Set the number of elements to write each time */ - H5_ASSIGN_OVERFLOW(actual_elem, tdiminfo[fast_dim].block, hsize_t, size_t); + H5_CHECKED_ASSIGN(actual_elem, size_t, tdiminfo[fast_dim].block, hsize_t); /* Set the number of actual bytes */ actual_bytes = actual_elem * elem_size; @@ -8117,7 +8117,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, fast_dim_start = tdiminfo[fast_dim].start; fast_dim_stride = tdiminfo[fast_dim].stride; fast_dim_block = tdiminfo[fast_dim].block; - H5_ASSIGN_OVERFLOW(fast_dim_buf_off, slab[fast_dim] * fast_dim_stride, hsize_t, size_t); + H5_CHECKED_ASSIGN(fast_dim_buf_off, size_t, slab[fast_dim] * fast_dim_stride, hsize_t); fast_dim_offset = (hsize_t)((hssize_t)fast_dim_start + sel_off[fast_dim]); /* Compute the number of blocks which would fit into the buffer */ @@ -8138,7 +8138,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, /* Check if there is a partial row left (with full blocks) */ if(tmp_count[fast_dim] > 0) { /* Get number of blocks in fastest dimension */ - H5_ASSIGN_OVERFLOW(fast_dim_count, tdiminfo[fast_dim].count - tmp_count[fast_dim], hsize_t, size_t); + H5_CHECKED_ASSIGN(fast_dim_count, size_t, tdiminfo[fast_dim].count - tmp_count[fast_dim], hsize_t); /* Make certain this entire row will fit into buffer */ fast_dim_count = MIN(fast_dim_count, tot_blk_count); @@ -8223,7 +8223,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, curr_rows = total_rows = (size_t)(tot_blk_count / tdiminfo[fast_dim].count); /* Reset copy of number of blocks in fastest dimension */ - H5_ASSIGN_OVERFLOW(fast_dim_count, tdiminfo[fast_dim].count, hsize_t, size_t); + H5_CHECKED_ASSIGN(fast_dim_count, size_t, tdiminfo[fast_dim].count, hsize_t); /* Read in data until an entire sequence can't be written out any longer */ while(curr_rows > 0) { @@ -8528,7 +8528,7 @@ H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter, tot_blk_count = MIN(tot_blk_count, maxseq); /* Set the number of elements to write each time */ - H5_ASSIGN_OVERFLOW(actual_elem, fast_dim_block, hsize_t, size_t); + H5_CHECKED_ASSIGN(actual_elem, size_t, fast_dim_block, hsize_t); /* Check for blocks to operate on */ if(tot_blk_count > 0) { @@ -8785,10 +8785,10 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t /* Calculate the number of elements left in the sequence */ if(tdiminfo[fast_dim].count == 1) { - H5_ASSIGN_OVERFLOW(leftover, tdiminfo[fast_dim].block - (iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start), hsize_t, size_t); + H5_CHECKED_ASSIGN(leftover, size_t, tdiminfo[fast_dim].block - (iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start), hsize_t); } /* end if */ else { - H5_ASSIGN_OVERFLOW(leftover, tdiminfo[fast_dim].block - ((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride), hsize_t, size_t); + H5_CHECKED_ASSIGN(leftover, size_t, tdiminfo[fast_dim].block - ((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride), hsize_t); } /* end else */ /* Make certain that we don't write too many */ @@ -8807,7 +8807,7 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t /* Add a new sequence */ off[0] = loc; - H5_ASSIGN_OVERFLOW(len[0], actual_elem * elem_size, hsize_t, size_t); + H5_CHECKED_ASSIGN(len[0], size_t, actual_elem * elem_size, hsize_t); /* Increment sequence array locations */ off++; diff --git a/src/H5Smpio.c b/src/H5Smpio.c index def7598..c2190b4 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -94,13 +94,13 @@ H5S_mpio_all_type(const H5S_t *space, size_t elmt_size, /* Just treat the entire extent as a block of bytes */ if((snelmts = (hssize_t)H5S_GET_EXTENT_NPOINTS(space)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") - H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, hsize_t); + H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); total_bytes = (hsize_t)elmt_size * nelmts; /* fill in the return values */ *new_type = MPI_BYTE; - H5_ASSIGN_OVERFLOW(*count, total_bytes, hsize_t, int); + H5_CHECKED_ASSIGN(*count, int, total_bytes, hsize_t); *is_derived_type = FALSE; done: @@ -388,7 +388,7 @@ H5S_mpio_permute_type(const H5S_t *space, size_t elmt_size, hsize_t **permute, sel_iter_init = TRUE; /* Selection iteration info has been initialized */ /* Set the number of elements to iterate over */ - H5_ASSIGN_OVERFLOW(max_elem, num_points, hsize_t, size_t); + H5_CHECKED_ASSIGN(max_elem, size_t, num_points, hsize_t); /* Loop, while elements left in selection */ u = 0; diff --git a/src/H5Sselect.c b/src/H5Sselect.c index a4f13d7..e04ae16 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -1304,7 +1304,7 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t space_size[ndims] = elmt_size; /* Compute the maximum number of bytes required */ - H5_ASSIGN_OVERFLOW(max_elem, nelmts, hssize_t, size_t); + H5_CHECKED_ASSIGN(max_elem, size_t, nelmts, hssize_t); /* Loop, while elements left in selection */ while(max_elem > 0 && user_ret == 0) { @@ -2063,7 +2063,7 @@ H5S_select_fill(const void *fill, size_t fill_size, const H5S_t *space, void *_b HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't get number of elements selected") /* Compute the number of bytes to process */ - H5_ASSIGN_OVERFLOW(max_elem, nelmts, hssize_t, size_t); + H5_CHECKED_ASSIGN(max_elem, size_t, nelmts, hssize_t); /* Loop, while elements left in selection */ while(max_elem > 0) { diff --git a/src/H5Tarray.c b/src/H5Tarray.c index c73b934..2e9dec0 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -202,7 +202,7 @@ H5T__array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) /* Copy the array dimensions & compute the # of elements in the array */ for(u = 0, ret_value->shared->u.array.nelem = 1; u < ndims; u++) { - H5_ASSIGN_OVERFLOW(ret_value->shared->u.array.dim[u], dim[u], hsize_t, size_t); + H5_CHECKED_ASSIGN(ret_value->shared->u.array.dim[u], size_t, dim[u], hsize_t); ret_value->shared->u.array.nelem *= (size_t)dim[u]; } /* end for */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index df85553..1c51b69 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -1952,7 +1952,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) src2dst[i] = -1; for(j = 0; j < dst_nmembs; j++) { if(!HDstrcmp(src->shared->u.compnd.memb[i].name, dst->shared->u.compnd.memb[j].name)) { - H5_ASSIGN_OVERFLOW(src2dst[i],j,unsigned,int); + H5_CHECKED_ASSIGN(src2dst[i], int, j, unsigned); break; } /* end if */ } /* end for */ @@ -2187,16 +2187,16 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion and striding through background. */ if(buf_stride) { - H5_ASSIGN_OVERFLOW(src_delta, buf_stride, size_t, ssize_t); + H5_CHECKED_ASSIGN(src_delta, ssize_t, buf_stride, size_t); if(!bkg_stride) { - H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + H5_CHECKED_ASSIGN(bkg_delta, ssize_t, dst->shared->size, size_t); } /* end if */ else - H5_ASSIGN_OVERFLOW(bkg_delta, bkg_stride, size_t, ssize_t); + H5_CHECKED_ASSIGN(bkg_delta, ssize_t, bkg_stride, size_t); } /* end if */ else if(dst->shared->size <= src->shared->size) { - H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); - H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + H5_CHECKED_ASSIGN(src_delta, ssize_t, src->shared->size, size_t); + H5_CHECKED_ASSIGN(bkg_delta, ssize_t, dst->shared->size, size_t); } /* end else-if */ else { H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); @@ -2278,7 +2278,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* If the bkg_delta was set to -(dst->shared->size), make it positive now */ if(buf_stride == 0 && dst->shared->size > src->shared->size) - H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + H5_CHECKED_ASSIGN(bkg_delta, ssize_t, dst->shared->size, size_t); /* * Copy the background buffer back into the in-place conversion @@ -2833,8 +2833,8 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_delta = dst_delta = (ssize_t)buf_stride; s = d = buf; } else if(dst->shared->size <= src->shared->size) { - H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); - H5_ASSIGN_OVERFLOW(dst_delta, dst->shared->size, size_t, ssize_t); + H5_CHECKED_ASSIGN(src_delta, ssize_t, src->shared->size, size_t); + H5_CHECKED_ASSIGN(dst_delta, ssize_t, dst->shared->size, size_t); s = d = buf; } else { H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index 7d08d62..fff413d 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -203,7 +203,7 @@ H5Tget_ebias(hid_t type_id) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, 0, "operation not defined for datatype class") /* bias */ - H5_ASSIGN_OVERFLOW(ret_value, dt->shared->u.atomic.u.f.ebias, uint64_t, size_t); + H5_CHECKED_ASSIGN(ret_value, size_t, dt->shared->u.atomic.u.f.ebias, uint64_t); done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 960a811..bf6ba08 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -276,7 +276,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if((snmemb = H5T_get_nmembers(dtype)) <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "compound data type doesn't have any member") - H5_ASSIGN_OVERFLOW(nmemb, snmemb, int, unsigned); + H5_CHECKED_ASSIGN(nmemb, unsigned, snmemb, int); if(NULL == (memb_list = (H5T_t **)H5MM_calloc(nmemb * sizeof(H5T_t *)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") @@ -388,7 +388,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Retrieve member info and insert members into new enum type */ if((snmemb = H5T_get_nmembers(dtype)) <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumerate data type doesn't have any member") - H5_ASSIGN_OVERFLOW(nmemb, snmemb, int, unsigned); + H5_CHECKED_ASSIGN(nmemb, unsigned, snmemb, int); for(u = 0; u < nmemb; u++) { if(NULL == (memb_name = H5T__get_member_name(dtype, u))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member name") @@ -429,7 +429,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Retrieve dimension information for array data type */ if((sarray_rank = H5T__get_array_ndims(dtype)) <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get dimension rank") - H5_ASSIGN_OVERFLOW(array_rank, sarray_rank, int, unsigned); + H5_CHECKED_ASSIGN(array_rank, unsigned, sarray_rank, int); if(NULL == (dims = (hsize_t*)H5MM_malloc(array_rank * sizeof(hsize_t)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") if(H5T__get_array_dims(dtype, dims) < 0) diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 82ad1ba..06d9866 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -102,9 +102,9 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, /* Set the uncompression parameters */ HDmemset(&z_strm, 0, sizeof(z_strm)); z_strm.next_in = (Bytef *)*buf; - H5_ASSIGN_OVERFLOW(z_strm.avail_in,nbytes,size_t,unsigned); + H5_CHECKED_ASSIGN(z_strm.avail_in, unsigned, nbytes, size_t); z_strm.next_out = (Bytef *)outbuf; - H5_ASSIGN_OVERFLOW(z_strm.avail_out,nalloc,size_t,unsigned); + H5_CHECKED_ASSIGN(z_strm.avail_out, unsigned, nalloc, size_t); /* Initialize the uncompression routines */ if (Z_OK!=inflateInit(&z_strm)) @@ -169,7 +169,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, int aggression; /* Compression aggression setting */ /* Set the compression aggression level */ - H5_ASSIGN_OVERFLOW(aggression,cd_values[0],unsigned,int); + H5_CHECKED_ASSIGN(aggression, int, cd_values[0], unsigned); /* Allocate output (compressed) buffer */ if(NULL == (outbuf = H5MM_malloc(z_dst_nbytes))) diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 9506ace..ff3ead2 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -803,7 +803,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) cd_values_index = 2; /* Set "local" parameter for number of elements in the chunk */ - H5_ASSIGN_OVERFLOW(cd_values[cd_values_index++], npoints, hssize_t, unsigned); + H5_CHECKED_ASSIGN(cd_values[cd_values_index++], unsigned, npoints, hssize_t); /* Assume no need to compress now, will be changed to FALSE later if not */ need_not_compress = TRUE; diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 38e2986..cda0a11 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -901,7 +901,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get number of points in the dataspace") /* Set "local" parameter for this dataset's number of elements */ - H5_ASSIGN_OVERFLOW(cd_values[H5Z_SCALEOFFSET_PARM_NELMTS],npoints,hssize_t,unsigned); + H5_CHECKED_ASSIGN(cd_values[H5Z_SCALEOFFSET_PARM_NELMTS], unsigned, npoints, hssize_t); /* Get datatype's class */ if((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 4544ec3..631667b 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -225,7 +225,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) } /* end else */ /* Assign the final value to the scanline */ - H5_ASSIGN_OVERFLOW(cd_values[H5Z_SZIP_PARM_PPS],scanline,hsize_t,unsigned); + H5_CHECKED_ASSIGN(cd_values[H5Z_SZIP_PARM_PPS], unsigned, scanline, hsize_t); /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) @@ -301,10 +301,10 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level") /* Copy the filter parameters into the szip parameter block */ - H5_ASSIGN_OVERFLOW(sz_param.options_mask,cd_values[H5Z_SZIP_PARM_MASK],unsigned,int); - H5_ASSIGN_OVERFLOW(sz_param.bits_per_pixel,cd_values[H5Z_SZIP_PARM_BPP],unsigned,int); - H5_ASSIGN_OVERFLOW(sz_param.pixels_per_block,cd_values[H5Z_SZIP_PARM_PPB],unsigned,int); - H5_ASSIGN_OVERFLOW(sz_param.pixels_per_scanline,cd_values[H5Z_SZIP_PARM_PPS],unsigned,int); + H5_CHECKED_ASSIGN(sz_param.options_mask, int, cd_values[H5Z_SZIP_PARM_MASK], unsigned); + H5_CHECKED_ASSIGN(sz_param.bits_per_pixel, int, cd_values[H5Z_SZIP_PARM_BPP], unsigned); + H5_CHECKED_ASSIGN(sz_param.pixels_per_block, int, cd_values[H5Z_SZIP_PARM_PPB], unsigned); + H5_CHECKED_ASSIGN(sz_param.pixels_per_scanline, int, cd_values[H5Z_SZIP_PARM_PPS], unsigned); /* Input; uncompress */ if (flags & H5Z_FLAG_REVERSE) { @@ -314,7 +314,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* Get the size of the uncompressed buffer */ newbuf = *buf; UINT32DECODE(newbuf,stored_nalloc); - H5_ASSIGN_OVERFLOW(nalloc,stored_nalloc,uint32_t,size_t); + H5_CHECKED_ASSIGN(nalloc, size_t, stored_nalloc, uint32_t); /* Allocate space for the uncompressed buffer */ if(NULL==(outbuf = H5MM_malloc(nalloc))) diff --git a/src/H5private.h b/src/H5private.h index d1bbc24..66bf7eb 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1523,11 +1523,14 @@ extern char *strdup(const char *s); /* Include the generated overflow header file */ #include "H5overflow.h" -#define H5_ASSIGN_OVERFLOW(dst, src, srctype, dsttype) \ +/* Assign a variable to one of a different size (think safer dst = (dsttype)src"). + * The code generated by the macro checks for overflows. + */ +#define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ H5_GLUE4(ASSIGN_,srctype,_TO_,dsttype)(dst,dsttype,src,srctype)\ #else /* NDEBUG */ -#define H5_ASSIGN_OVERFLOW(dst, src, srctype, dsttype) \ +#define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ (dst) = (dsttype)(src); #endif /* NDEBUG */ -- cgit v0.12 From 7e231953a25fd4cc82f5b14b48b2c928cb3748e7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 13 May 2015 16:30:24 -0500 Subject: [svn-r27058] Description: Convert internal chunk structures to use 'scaled' coordinates instead of absolute coordinates. Tested on: Mac OSX/64 10.10.3 (amazon) w/parallel & serial Linux 2.6.x/32 (jam) w/parallel & serial Linux 2.6.x/64 (koala) w/serial --- src/H5Bprivate.h | 1 + src/H5Dbtree.c | 222 +++++++++++++++++++++++++---------- src/H5Dchunk.c | 326 ++++++++++++++++++++++++++++++--------------------- src/H5Ddeprec.c | 50 +++++++- src/H5Dint.c | 42 ++++++- src/H5Dmpio.c | 8 +- src/H5Dpkg.h | 22 ++-- src/H5Dprivate.h | 2 +- src/H5Fprivate.h | 1 - src/H5VM.c | 97 ++++++--------- src/H5VMprivate.h | 6 +- tools/misc/h5debug.c | 39 +++++- 12 files changed, 528 insertions(+), 288 deletions(-) diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 9e95c15..02fb82c 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -100,6 +100,7 @@ typedef struct H5B_shared_t { size_t sizeof_len; /* Size of file lengths (in bytes) */ uint8_t *page; /* Disk page */ size_t *nkey; /* Offsets of each native key in native key buffer */ + void *udata; /* 'Local' info for a B-tree */ } H5B_shared_t; /* diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 4f6b988..2933e5e 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -49,11 +49,6 @@ /* Local Macros */ /****************/ -/* - * Given a B-tree node return the dimensionality of the chunks pointed to by - * that node. - */ -#define H5D_BTREE_NDIMS(X) (((X)->sizeof_rkey-8)/8) /******************/ /* Local Typedefs */ @@ -74,7 +69,7 @@ * The chunk's file address is part of the B-tree and not part of the key. */ typedef struct H5D_btree_key_t { - hsize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /*logical offset to start*/ uint32_t nbytes; /*size of stored data */ unsigned filter_mask; /*excluded filters */ } H5D_btree_key_t; @@ -97,8 +92,9 @@ typedef struct H5D_btree_dbg_t { /* Local Prototypes */ /********************/ +static herr_t H5D__btree_shared_free(void *_shared); static herr_t H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, - unsigned ndims); + const H5O_layout_chunk_t *layout); /* B-tree iterator callbacks */ static int H5D__btree_idx_iterate_cb(H5F_t *f, hid_t dxpl_id, const void *left_key, @@ -203,6 +199,10 @@ H5B_class_t H5B_BTREE[1] = {{ /* Local Variables */ /*******************/ +/* Declare a free list to manage H5O_layout_chunk_t objects */ +H5FL_DEFINE_STATIC(H5O_layout_chunk_t); + + /*------------------------------------------------------------------------- * Function: H5D__btree_get_shared @@ -287,7 +287,7 @@ H5D__btree_new_node(H5F_t *f, hid_t UNUSED dxpl_id, H5B_ins_t op, H5_CHECKED_ASSIGN(lt_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t); lt_key->filter_mask = udata->filter_mask; for(u = 0; u < udata->common.layout->ndims; u++) - lt_key->offset[u] = udata->common.offset[u]; + lt_key->scaled[u] = udata->common.scaled[u]; /* * The right key might already be present. If not, then add a zero-width @@ -297,9 +297,8 @@ H5D__btree_new_node(H5F_t *f, hid_t UNUSED dxpl_id, H5B_ins_t op, rt_key->nbytes = 0; rt_key->filter_mask = 0; for(u = 0; u < udata->common.layout->ndims; u++) { - HDassert(udata->common.offset[u] + udata->common.layout->dim[u] > - udata->common.offset[u]); - rt_key->offset[u] = udata->common.offset[u] + udata->common.layout->dim[u]; + HDassert(udata->common.scaled[u] + 1 > udata->common.scaled[u]); + rt_key->scaled[u] = udata->common.scaled[u] + 1; } /* end if */ } /* end if */ @@ -342,7 +341,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ - ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->offset, rt_key->offset); + ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_cmp2() */ @@ -397,18 +396,18 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) /* indexed storage B-tree... */ /* (Dump the B-tree with h5debug to look at it) -QAK */ if(udata->layout->ndims == 2) { - if(udata->offset[0] > rt_key->offset[0]) + if(udata->scaled[0] > rt_key->scaled[0]) ret_value = 1; - else if(udata->offset[0] == rt_key->offset[0] && - udata->offset[1] >= rt_key->offset[1]) + else if(udata->scaled[0] == rt_key->scaled[0] && + udata->scaled[1] >= rt_key->scaled[1]) ret_value = 1; - else if(udata->offset[0] < lt_key->offset[0]) + else if(udata->scaled[0] < lt_key->scaled[0]) ret_value = (-1); } /* end if */ else { - if(H5VM_vector_ge_u(udata->layout->ndims, udata->offset, rt_key->offset)) + if(H5VM_vector_ge_u(udata->layout->ndims, udata->scaled, rt_key->scaled)) ret_value = 1; - else if(H5VM_vector_lt_u(udata->layout->ndims, udata->offset, lt_key->offset)) + else if(H5VM_vector_lt_u(udata->layout->ndims, udata->scaled, lt_key->scaled)) ret_value = (-1); } /* end else */ @@ -460,7 +459,7 @@ H5D__btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void /* Is this *really* the requested chunk? */ for(u = 0; u < udata->common.layout->ndims; u++) - if(udata->common.offset[u] >= lt_key->offset[u] + udata->common.layout->dim[u]) + if(udata->common.scaled[u] >= (lt_key->scaled[u] + 1)) HGOTO_DONE(FALSE) /* Initialize return values */ @@ -475,6 +474,44 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__chunk_disjoint + * + * Purpose: Determines if two chunks are disjoint. + * + * Return: Success: FALSE if they are not disjoint. + * TRUE if they are disjoint. + * + * Programmer: Quincey Koziol + * Wednesday, May 6, 2015 + * + * Note: Assumes that the chunk offsets are scaled coordinates + * + *------------------------------------------------------------------------- + */ +static hbool_t +H5D__chunk_disjoint(unsigned n, const hsize_t *scaled1, const hsize_t *scaled2) +{ + unsigned u; /* Local index variable */ + hbool_t ret_value = FALSE; /* Return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(n); + HDassert(scaled1); + HDassert(scaled2); + + /* Loop over two chunks, detecting disjointness and getting out quickly */ + for(u = 0; u < n; u++) + if((scaled1[u] + 1) <= scaled2[u] || (scaled2[u] + 1) <= scaled1[u]) + HGOTO_DONE(TRUE) + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__chunk_disjoint() */ + + +/*------------------------------------------------------------------------- * Function: H5D__btree_insert * * Purpose: This function is called when the B-tree insert engine finds @@ -538,8 +575,7 @@ H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key, HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error") } else if(H5VM_vector_eq_u(udata->common.layout->ndims, - udata->common.offset, lt_key->offset) && - lt_key->nbytes > 0) { + udata->common.scaled, lt_key->scaled) && lt_key->nbytes > 0) { /* * Already exists. If the new size is not the same as the old size * then we should reallocate storage. @@ -558,22 +594,18 @@ H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key, ret_value = H5B_INS_NOOP; } - } else if (H5VM_hyper_disjointp(udata->common.layout->ndims, - lt_key->offset, udata->common.layout->dim, - udata->common.offset, udata->common.layout->dim)) { - HDassert(H5VM_hyper_disjointp(udata->common.layout->ndims, - rt_key->offset, udata->common.layout->dim, - udata->common.offset, udata->common.layout->dim)); + } else if (H5D__chunk_disjoint(udata->common.layout->ndims, + lt_key->scaled, udata->common.scaled)) { + HDassert(H5D__chunk_disjoint(udata->common.layout->ndims, + rt_key->scaled, udata->common.scaled)); /* * Split this node, inserting the new new node to the right of the * current node. The MD_KEY is where the split occurs. */ H5_CHECKED_ASSIGN(md_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t); md_key->filter_mask = udata->filter_mask; - for(u = 0; u < udata->common.layout->ndims; u++) { - HDassert(0 == udata->common.offset[u] % udata->common.layout->dim[u]); - md_key->offset[u] = udata->common.offset[u]; - } /* end for */ + for(u = 0; u < udata->common.layout->ndims; u++) + md_key->scaled[u] = udata->common.scaled[u]; HDassert(H5F_addr_defined(udata->chunk_block.offset)); *new_node_p = udata->chunk_block.offset; @@ -643,9 +675,10 @@ done: static herr_t H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { - H5D_btree_key_t *key = (H5D_btree_key_t *) _key; - size_t ndims; - unsigned u; + const H5O_layout_chunk_t *layout; /* Chunk layout description */ + H5D_btree_key_t *key = (H5D_btree_key_t *) _key; /* Pointer to decoded key */ + hsize_t tmp_offset; /* Temporary coordinate offset, from file */ + unsigned u; /* Local index variable */ FUNC_ENTER_STATIC_NOERR @@ -653,14 +686,21 @@ H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key HDassert(shared); HDassert(raw); HDassert(key); - ndims = H5D_BTREE_NDIMS(shared); - HDassert(ndims <= H5O_LAYOUT_NDIMS); + layout = (const H5O_layout_chunk_t *)shared->udata; + HDassert(layout); + HDassert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS); /* decode */ UINT32DECODE(raw, key->nbytes); UINT32DECODE(raw, key->filter_mask); - for(u = 0; u < ndims; u++) - UINT64DECODE(raw, key->offset[u]); + for(u = 0; u < layout->ndims; u++) { + /* Retrieve coordinate offset */ + UINT64DECODE(raw, tmp_offset); + HDassert(0 == (tmp_offset % layout->dim[u])); + + /* Convert to a scaled offset */ + key->scaled[u] = tmp_offset / layout->dim[u]; + } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__btree_decode_key() */ @@ -681,9 +721,10 @@ H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key static herr_t H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { + const H5O_layout_chunk_t *layout; /* Chunk layout description */ const H5D_btree_key_t *key = (const H5D_btree_key_t *)_key; - size_t ndims; - unsigned u; + hsize_t tmp_offset; /* Temporary coordinate offset, from file */ + unsigned u; /* Local index variable */ FUNC_ENTER_STATIC_NOERR @@ -691,14 +732,18 @@ H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key HDassert(shared); HDassert(raw); HDassert(key); - ndims = H5D_BTREE_NDIMS(shared); - HDassert(ndims <= H5O_LAYOUT_NDIMS); + layout = (const H5O_layout_chunk_t *)shared->udata; + HDassert(layout); + HDassert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS); /* encode */ UINT32ENCODE(raw, key->nbytes); UINT32ENCODE(raw, key->filter_mask); - for(u = 0; u < ndims; u++) - UINT64ENCODE(raw, key->offset[u]); + for(u = 0; u < layout->ndims; u++) { + /* Compute coordinate offset from scaled offset */ + tmp_offset = key->scaled[u] * layout->dim[u]; + UINT64ENCODE(raw, tmp_offset); + } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__btree_encode_key() */ @@ -733,7 +778,7 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "Filter mask:", key->filter_mask); HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:"); for(u = 0; u < udata->ndims; u++) - HDfprintf(stream, "%s%Hd", u?", ":"", key->offset[u]); + HDfprintf(stream, "%s%Hd", u?", ":"", (key->scaled[u] * udata->common.layout->dim[u])); HDfputs("}\n", stream); FUNC_LEAVE_NOAPI(SUCCEED) @@ -741,6 +786,38 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, /*------------------------------------------------------------------------- + * Function: H5D__btree_shared_free + * + * Purpose: Free "local" B-tree shared info + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, May 7, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__btree_shared_free(void *_shared) +{ + H5B_shared_t *shared = (H5B_shared_t *)_shared; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Free the chunk layout information */ + shared->udata = H5FL_FREE(H5O_layout_chunk_t, shared->udata); + + /* Chain up to the generic B-tree shared info free routine */ + if(H5B_shared_free(shared) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't free shared B-tree info") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__btree_shared_free() */ + + +/*------------------------------------------------------------------------- * Function: H5D__btree_shared_create * * Purpose: Create & initialize B-tree shared info @@ -753,9 +830,11 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, *------------------------------------------------------------------------- */ static herr_t -H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned ndims) +H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, + const H5O_layout_chunk_t *layout) { H5B_shared_t *shared; /* Shared B-tree node info */ + H5O_layout_chunk_t *my_layout = NULL; /* Pointer to copy of layout info */ size_t sizeof_rkey; /* Size of raw (disk) key */ herr_t ret_value = SUCCEED; /* Return value */ @@ -764,20 +843,27 @@ H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned nd /* Set the raw key size */ sizeof_rkey = 4 + /*storage size */ 4 + /*filter mask */ - ndims * 8; /*dimension indices */ + layout->ndims * 8; /*dimension indices */ /* Allocate & initialize global info for the shared structure */ if(NULL == (shared = H5B_shared_new(f, H5B_BTREE, sizeof_rkey))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info") + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info") /* Set up the "local" information for this dataset's chunks */ - /* */ + if(NULL == (my_layout = H5FL_MALLOC(H5O_layout_chunk_t))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate chunk layout") + HDmemcpy(my_layout, layout, sizeof(H5O_layout_chunk_t)); + shared->udata = my_layout; /* Make shared B-tree info reference counted */ - if(NULL == (store->u.btree.shared = H5UC_create(shared, H5B_shared_free))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") + if(NULL == (store->u.btree.shared = H5UC_create(shared, H5D__btree_shared_free))) + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") done: + if(ret_value < 0) + if(my_layout) + my_layout = H5FL_FREE(H5O_layout_chunk_t, my_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_shared_create() */ @@ -813,7 +899,7 @@ H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *spac idx_info->storage->u.btree.dset_ohdr_addr = dset_ohdr_addr; /* Allocate the shared structure */ - if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") done: @@ -1006,8 +1092,8 @@ H5D__btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, /* Sanity check for memcpy() */ HDcompile_assert(offsetof(H5D_chunk_rec_t, nbytes) == offsetof(H5D_btree_key_t, nbytes)); HDcompile_assert(sizeof(chunk_rec.nbytes) == sizeof(lt_key->nbytes)); - HDcompile_assert(offsetof(H5D_chunk_rec_t, offset) == offsetof(H5D_btree_key_t, offset)); - HDcompile_assert(sizeof(chunk_rec.offset) == sizeof(lt_key->offset)); + HDcompile_assert(offsetof(H5D_chunk_rec_t, scaled) == offsetof(H5D_btree_key_t, scaled)); + HDcompile_assert(sizeof(chunk_rec.scaled) == sizeof(lt_key->scaled)); HDcompile_assert(offsetof(H5D_chunk_rec_t, filter_mask) == offsetof(H5D_btree_key_t, filter_mask)); HDcompile_assert(sizeof(chunk_rec.filter_mask) == sizeof(lt_key->filter_mask)); @@ -1144,7 +1230,7 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) tmp_storage = *idx_info->storage; /* Set up the shared structure */ - if(H5D__btree_shared_create(idx_info->f, &tmp_storage, idx_info->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info->f, &tmp_storage, idx_info->layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") /* Set up B-tree user data */ @@ -1201,9 +1287,9 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(!H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Create shared B-tree info for each file */ - if(H5D__btree_shared_create(idx_info_src->f, idx_info_src->storage, idx_info_src->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info_src->f, idx_info_src->storage, idx_info_src->layout) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for source shared B-tree info") - if(H5D__btree_shared_create(idx_info_dst->f, idx_info_dst->storage, idx_info_dst->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info_dst->f, idx_info_dst->storage, idx_info_dst->layout) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for destination shared B-tree info") /* Create the root of the B-tree that describes chunked storage in the dest. file */ @@ -1283,7 +1369,7 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) HDassert(index_size); /* Initialize the shared info for the B-tree traversal */ - if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") shared_init = TRUE; @@ -1415,11 +1501,13 @@ done: */ herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, - int fwidth, unsigned ndims) + int fwidth, unsigned ndims, const uint32_t *dim) { H5D_btree_dbg_t udata; /* User data for B-tree callback */ H5O_storage_chunk_t storage; /* Storage information for B-tree callback */ + H5O_layout_chunk_t layout; /* Layout information for B-tree callback */ hbool_t shared_init = FALSE; /* Whether B-tree shared info is initialized */ + unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1428,15 +1516,21 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent HDmemset(&storage, 0, sizeof(storage)); storage.idx_type = H5D_CHUNK_IDX_BTREE; + /* Reset "fake" layout info */ + HDmemset(&layout, 0, sizeof(layout)); + layout.ndims = ndims; + for(u = 0; u < ndims; u++) + layout.dim[u] = dim[u]; + /* Allocate the shared structure */ - if(H5D__btree_shared_create(f, &storage, ndims) < 0) + if(H5D__btree_shared_create(f, &storage, &layout) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") shared_init = TRUE; /* Set up user data for callback */ - udata.common.layout = NULL; + udata.common.layout = &layout; udata.common.storage = &storage; - udata.common.offset = NULL; + udata.common.scaled = NULL; udata.ndims = ndims; /* Dump the records for the B-tree */ @@ -1446,10 +1540,10 @@ done: if(shared_init) { /* Free the raw B-tree node buffer */ if(NULL == storage.u.btree.shared) - HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil") + HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted shared info nil") else if(H5UC_DEC(storage.u.btree.shared) < 0) - HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page") + HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted shared info") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index d990804..ea3557c 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -160,6 +160,7 @@ typedef struct H5D_chunk_it_ud4_t { FILE *stream; /* Output stream */ hbool_t header_displayed; /* Node's header is displayed? */ unsigned ndims; /* Number of dimensions for chunk/dataset */ + uint32_t *chunk_dim; /* Chunk dimensions */ } H5D_chunk_it_ud4_t; /* Callback info for nonexistent readvv operation */ @@ -231,6 +232,7 @@ static herr_t H5D__chunk_file_cb(void *elem, hid_t type_id, unsigned ndims, const hsize_t *coords, void *fm); static herr_t H5D__chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims, const hsize_t *coords, void *fm); +static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled); static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset); static herr_t H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, @@ -322,9 +324,9 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ - hsize_t chunk_idx; /* Global index of chunk */ H5F_block_t old_chunk; /* Offset/length of old chunk */ H5D_chk_idx_info_t idx_info; /* Chunked index info */ + hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ herr_t ret_value = SUCCEED; /* Return value */ @@ -337,10 +339,11 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") /* Calculate the index of this chunk */ - chunk_idx = H5VM_chunk_index(dset->shared->ndims, offset, layout->u.chunk.dim, layout->u.chunk.down_chunks); + H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); + scaled[dset->shared->ndims] = 0; /* Find out the file address of the chunk (if any) */ - if(H5D__chunk_lookup(dset, dxpl_id, offset, chunk_idx, &udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -627,6 +630,22 @@ H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) H5D__chunk_cinfo_cache_reset(&(rdcc->last)); } /* end else */ + /* Compute scaled dimension info, if dataset dims > 1 */ + if(dset->shared->ndims > 1) { + unsigned u; /* Local index value */ + + for(u = 0; u < dset->shared->ndims; u++) { + /* Initial scaled dimension sizes */ + rdcc->scaled_dims[u] = dset->shared->curr_dims[u] / dset->shared->layout.u.chunk.dim[u]; + + /* Inital 'power2up' values for scaled dimensions */ + rdcc->scaled_power2up[u] = H5VM_power2up(rdcc->scaled_dims[u]); + + /* Number of bits required to encode scaled dimension size */ + rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]); + } /* end for */ + } /* end if */ + /* Compose chunked index info struct */ idx_info.f = f; idx_info.dxpl_id = dxpl_id; @@ -1128,6 +1147,7 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info) { H5D_chunk_info_t *chunk_info; /* Chunk information to insert into skip list */ + hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of chunk */ hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ unsigned u; /* Local index variable */ @@ -1149,19 +1169,20 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t /* Set chunk location & hyperslab size */ for(u = 0; u < fm->f_ndims; u++) { HDassert(sel_start[u] == sel_end[u]); - chunk_info->coords[u] = (sel_start[u] / fm->layout->u.chunk.dim[u]) * fm->layout->u.chunk.dim[u]; + chunk_info->scaled[u] = sel_start[u] / fm->layout->u.chunk.dim[u]; + coords[u] = chunk_info->scaled[u] * fm->layout->u.chunk.dim[u]; } /* end for */ - chunk_info->coords[fm->f_ndims] = 0; + chunk_info->scaled[fm->f_ndims] = 0; /* Calculate the index of this chunk */ - chunk_info->index = H5VM_chunk_index(fm->f_ndims, chunk_info->coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks); + chunk_info->index = H5VM_array_offset_pre(fm->f_ndims, fm->layout->u.chunk.down_chunks, chunk_info->scaled); /* Copy selection for file's dataspace into chunk dataspace */ if(H5S_select_copy(fm->single_space, fm->file_space, FALSE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file selection") /* Move selection back to have correct offset in chunk */ - if(H5S_SELECT_ADJUST_U(fm->single_space, chunk_info->coords) < 0) + if(H5S_SELECT_ADJUST_U(fm->single_space, coords) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection") #ifdef H5_HAVE_PARALLEL @@ -1214,6 +1235,8 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t hsize_t coords[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */ hsize_t end[H5O_LAYOUT_NDIMS]; /* Final coordinates of chunk */ hsize_t chunk_index; /* Index of chunk */ + hsize_t start_scaled[H5S_MAX_RANK]; /* Starting scaled coordinates of selection */ + hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ int curr_dim; /* Current dimension to increment */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1232,13 +1255,13 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t /* Set initial chunk location & hyperslab size */ for(u = 0; u < fm->f_ndims; u++) { - start_coords[u] = (sel_start[u] / fm->layout->u.chunk.dim[u]) * fm->layout->u.chunk.dim[u]; - coords[u] = start_coords[u]; + scaled[u] = start_scaled[u] = sel_start[u] / fm->layout->u.chunk.dim[u]; + coords[u] = start_coords[u] = scaled[u] * fm->layout->u.chunk.dim[u]; end[u] = (coords[u] + fm->chunk_dim[u]) - 1; } /* end for */ /* Calculate the index of this chunk */ - chunk_index = H5VM_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks); + chunk_index = H5VM_array_offset_pre(fm->f_ndims, fm->layout->u.chunk.down_chunks, scaled); /* Iterate through each chunk in the dataset */ while(sel_points) { @@ -1304,9 +1327,9 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t new_chunk_info->mspace=NULL; new_chunk_info->mspace_shared = FALSE; - /* Copy the chunk's coordinates */ - HDmemcpy(new_chunk_info->coords, coords, sizeof(hsize_t) * fm->f_ndims); - new_chunk_info->coords[fm->f_ndims] = 0; + /* Copy the chunk's scaled coordinates */ + HDmemcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); + new_chunk_info->scaled[fm->f_ndims] = 0; /* Insert the new chunk into the skip list */ if(H5SL_insert(fm->sel_chunks, new_chunk_info, &new_chunk_info->index) < 0) { @@ -1337,11 +1360,13 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t H5_CHECK_OVERFLOW(fm->chunk_dim[curr_dim],hsize_t,hssize_t); coords[curr_dim]+=fm->chunk_dim[curr_dim]; end[curr_dim]+=fm->chunk_dim[curr_dim]; + scaled[curr_dim]++; /* Bring chunk location back into bounds, if necessary */ if(coords[curr_dim] > sel_end[curr_dim]) { do { /* Reset current dimension's location to 0 */ + scaled[curr_dim] = start_scaled[curr_dim]; coords[curr_dim] = start_coords[curr_dim]; /*lint !e771 The start_coords will always be initialized */ end[curr_dim] = (coords[curr_dim] + fm->chunk_dim[curr_dim]) - 1; @@ -1349,12 +1374,13 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t curr_dim--; /* Increment chunk location in current dimension */ + scaled[curr_dim]++; coords[curr_dim] += fm->chunk_dim[curr_dim]; end[curr_dim] = (coords[curr_dim] + fm->chunk_dim[curr_dim]) - 1; } while(coords[curr_dim] > sel_end[curr_dim]); /* Re-calculate the index of this chunk */ - chunk_index = H5VM_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks); + chunk_index = H5VM_array_offset_pre(fm->f_ndims, fm->layout->u.chunk.down_chunks, scaled); } /* end if */ } /* end while */ @@ -1455,10 +1481,16 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) if(H5S_select_copy(chunk_info->mspace,chunk_info->fspace,FALSE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy selection") - /* Compensate for the chunk offset */ - for(u=0; uf_ndims; u++) { - H5_CHECK_OVERFLOW(chunk_info->coords[u],hsize_t,hssize_t); - chunk_adjust[u]=adjust[u]-(hssize_t)chunk_info->coords[u]; /*lint !e771 The adjust array will always be initialized */ + /* Compute the adjustment for this chunk */ + for(u = 0; u < fm->f_ndims; u++) { + hsize_t coords[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */ + + /* Compute the chunk coordinates from the scaled coordinates */ + coords[u] = chunk_info->scaled[u] * fm->layout->u.chunk.dim[u]; + + /* Compensate for the chunk offset */ + H5_CHECK_OVERFLOW(coords[u], hsize_t, hssize_t); + chunk_adjust[u] = adjust[u] - (hssize_t)coords[u]; /*lint !e771 The adjust array will always be initialized */ } /* end for */ /* Adjust the selection */ @@ -1553,12 +1585,9 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons /* Set the number of selected elements in chunk to zero */ chunk_info->chunk_points = 0; - /* Compute the chunk's coordinates */ - for(u = 0; u < fm->f_ndims; u++) { - H5_CHECK_OVERFLOW(fm->layout->u.chunk.dim[u], hsize_t, hssize_t); - chunk_info->coords[u] = scaled[u] * (hssize_t)fm->layout->u.chunk.dim[u]; - } /* end for */ - chunk_info->coords[fm->f_ndims] = 0; + /* Set the chunk's scaled coordinates */ + HDmemcpy(chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); + chunk_info->scaled[fm->f_ndims] = 0; /* Insert the new chunk into the skip list */ if(H5SL_insert(fm->sel_chunks,chunk_info,&chunk_info->index) < 0) { @@ -1580,7 +1609,7 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons /* Get the offset of the element within the chunk */ for(u = 0; u < fm->f_ndims; u++) - coords_in_chunk[u] = coords[u] - chunk_info->coords[u]; + coords_in_chunk[u] = coords[u] - (scaled[u] * fm->layout->u.chunk.dim[u]); /* Add point to file selection for chunk */ if(H5S_select_elements(chunk_info->fspace, H5S_SELECT_APPEND, (size_t)1, coords_in_chunk) < 0) @@ -1831,7 +1860,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -1849,14 +1878,15 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, if((cacheable = H5D__chunk_cacheable(io_info, udata.chunk_block.offset, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") if(cacheable) { - /* Pass in chunk's coordinates in a union. */ - io_info->store->chunk.offset = chunk_info->coords; - io_info->store->chunk.index = chunk_info->index; + /* Load the chunk into cache and lock it. */ /* Compute # of bytes accessed in chunk */ H5_CHECK_OVERFLOW(type_info->src_type_size, /*From:*/ size_t, /*To:*/ uint32_t); src_accessed_bytes = chunk_info->chunk_points * (uint32_t)type_info->src_type_size; + /* Set chunk's [scaled] coordinates */ + io_info->store->chunk.scaled = chunk_info->scaled; + /* Lock the chunk into the cache */ if(NULL == (chunk = H5D__chunk_lock(io_info, &udata, FALSE))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") @@ -1963,7 +1993,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Look up the chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -1978,10 +2008,6 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, * simply allocate space instead of load the chunk. */ hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ - /* Pass in chunk's coordinates in a union. */ - io_info->store->chunk.offset = chunk_info->coords; - io_info->store->chunk.index = chunk_info->index; - /* Compute # of bytes accessed in chunk */ H5_CHECK_OVERFLOW(type_info->dst_type_size, /*From:*/ size_t, /*To:*/ uint32_t); dst_accessed_bytes = chunk_info->chunk_points * (uint32_t)type_info->dst_type_size; @@ -1991,6 +2017,9 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size) entire_chunk = FALSE; + /* Set chunk's [scaled] coordinates */ + io_info->store->chunk.scaled = chunk_info->scaled; + /* Lock the chunk into the cache */ if(NULL == (chunk = H5D__chunk_lock(io_info, &udata, entire_chunk))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") @@ -2242,11 +2271,10 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud HDassert(last); HDassert(udata); HDassert(udata->common.layout); - HDassert(udata->common.storage); - HDassert(udata->common.offset); + HDassert(udata->common.scaled); /* Stored the information to cache */ - HDmemcpy(last->offset, udata->common.offset, sizeof(hsize_t) * udata->common.layout->ndims); + HDmemcpy(last->scaled, udata->common.scaled, sizeof(hsize_t) * udata->common.layout->ndims); last->addr = udata->chunk_block.offset; H5_CHECKED_ASSIGN(last->nbytes, uint32_t, udata->chunk_block.length, hsize_t); last->filter_mask = udata->filter_mask; @@ -2281,16 +2309,15 @@ H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *uda HDassert(last); HDassert(udata); HDassert(udata->common.layout); - HDassert(udata->common.storage); - HDassert(udata->common.offset); + HDassert(udata->common.scaled); /* Check if the cached information is what is desired */ if(last->valid) { unsigned u; /* Local index variable */ - /* Check that the offset is the same */ + /* Check that the scaled offset is the same */ for(u = 0; u < udata->common.layout->ndims; u++) - if(last->offset[u] != udata->common.offset[u]) + if(last->scaled[u] != udata->common.scaled[u]) HGOTO_DONE(FALSE) /* Retrieve the information from the cache */ @@ -2360,6 +2387,53 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__chunk_hash_val + * + * Purpose: To calculate an index based on the dataset's scaled coordinates and + * sizes of the faster dimensions. + * + * Return: Hash value index + * + * Programmer: Vailin Choi; Nov 2014 + * + *------------------------------------------------------------------------- + */ +static unsigned +H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled) +{ + hsize_t val; /* Intermediate value */ + unsigned ndims = shared->ndims; /* Rank of dataset */ + unsigned ret; /* Value to return */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(shared); + HDassert(scaled); + + /* If the fastest changing dimension doesn't have enough entropy, use + * other dimensions too + */ + if(ndims > 1 && shared->cache.chunk.scaled_dims[ndims - 1] <= shared->cache.chunk.nslots) { + unsigned u; /* Local index variable */ + + val = scaled[0]; + for(u = 1; u < ndims; u++) { + val <<= shared->cache.chunk.scaled_encode_bits[u]; + val ^= scaled[u]; + } /* end for */ + } /* end if */ + else + val = scaled[ndims - 1]; + + /* Modulo value against the number of array slots */ + ret = (unsigned)(val % shared->cache.chunk.nslots); + + FUNC_LEAVE_NOAPI(ret) +} /* H5D__chunk_hash_val() */ + + +/*------------------------------------------------------------------------- * Function: H5D__chunk_lookup * * Purpose: Loops up a chunk in cache and on disk, and retrieves @@ -2373,8 +2447,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, - hsize_t chunk_idx, H5D_chunk_ud_t *udata) +H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, + H5D_chunk_ud_t *udata) { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ hbool_t found = FALSE; /* In cache? */ @@ -2385,13 +2459,13 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, HDassert(dset); HDassert(dset->shared->layout.u.chunk.ndims > 0); - HDassert(chunk_offset); + HDassert(scaled); HDassert(udata); /* Initialize the query information about the chunk we are looking for */ udata->common.layout = &(dset->shared->layout.u.chunk); udata->common.storage = &(dset->shared->layout.storage.u.chunk); - udata->common.offset = chunk_offset; + udata->common.scaled = scaled; /* Reset information about the chunk we are looking for */ udata->chunk_block.offset = HADDR_UNDEF; @@ -2400,12 +2474,12 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, /* Check for chunk in cache */ if(dset->shared->cache.chunk.nslots > 0) { - udata->idx_hint = H5D_CHUNK_HASH(dset->shared, chunk_idx); + udata->idx_hint = H5D__chunk_hash_val(dset->shared, scaled); ent = dset->shared->cache.chunk.slot[udata->idx_hint]; if(ent) for(u = 0, found = TRUE; u < dset->shared->ndims; u++) - if(chunk_offset[u] != ent->offset[u]) { + if(scaled[u] != ent->scaled[u]) { found = FALSE; break; } /* end if */ @@ -2486,7 +2560,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /* Set up user data for index callbacks */ udata.common.layout = &dset->shared->layout.u.chunk; udata.common.storage = &dset->shared->layout.storage.u.chunk; - udata.common.offset = ent->offset; + udata.common.scaled = ent->scaled; udata.chunk_block.offset = ent->chunk_block.offset; udata.chunk_block.length = dset->shared->layout.u.chunk.size; udata.filter_mask = 0; @@ -2852,7 +2926,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Make sure this is the right chunk */ for(u = 0; u < layout->u.chunk.ndims; u++) - HDassert(io_info->store->chunk.offset[u] == ent->offset[u]); + HDassert(io_info->store->chunk.scaled[u] == ent->scaled[u]); } #endif /* NDEBUG */ @@ -2979,7 +3053,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* See if the chunk can be cached */ if(rdcc->nslots > 0 && chunk_size <= rdcc->nbytes_max) { /* Calculate the index */ - udata->idx_hint = H5D_CHUNK_HASH(dset->shared, io_info->store->chunk.index); + udata->idx_hint = H5D__chunk_hash_val(io_info->dset->shared, udata->common.scaled); /* Add the chunk to the cache only if the slot is not already locked */ ent = rdcc->slot[udata->idx_hint]; @@ -2999,7 +3073,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Initialize the new entry */ ent->chunk_block.offset = chunk_addr; ent->chunk_block.length = chunk_alloc; - HDmemcpy(ent->offset, io_info->store->chunk.offset, sizeof(hsize_t) * layout->u.chunk.ndims); + HDmemcpy(ent->scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims); H5_CHECKED_ASSIGN(ent->rd_count, uint32_t, chunk_size, size_t); H5_CHECKED_ASSIGN(ent->wr_count, uint32_t, chunk_size, size_t); ent->chunk = (uint8_t *)chunk; @@ -3106,7 +3180,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, HDmemset(&fake_ent, 0, sizeof(fake_ent)); fake_ent.dirty = TRUE; - HDmemcpy(fake_ent.offset, io_info->store->chunk.offset, layout->u.chunk.ndims * sizeof(fake_ent.offset[0])); + HDmemcpy(fake_ent.scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims); HDassert(layout->u.chunk.size > 0); fake_ent.chunk_block.offset = udata->chunk_block.offset; fake_ent.chunk_block.length = udata->chunk_block.length; @@ -3254,9 +3328,9 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, { H5D_chk_idx_info_t idx_info; /* Chunked index info */ const H5D_chunk_ops_t *ops = dset->shared->layout.storage.u.chunk.ops; /* Chunk operations */ - hsize_t min_unalloc[H5O_LAYOUT_NDIMS]; /* First chunk in each dimension that is unallocated */ - hsize_t max_unalloc[H5O_LAYOUT_NDIMS]; /* Last chunk in each dimension that is unallocated */ - hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */ + hsize_t min_unalloc[H5O_LAYOUT_NDIMS]; /* First chunk in each dimension that is unallocated (in scaled coordinates) */ + hsize_t max_unalloc[H5O_LAYOUT_NDIMS]; /* Last chunk in each dimension that is unallocated (in scaled coordinates) */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Offset of current chunk (in scaled coordinates) */ size_t orig_chunk_size; /* Original size of chunk in bytes */ size_t chunk_size; /* Actual size of chunk in bytes, possibly filtered */ unsigned filter_mask = 0; /* Filter mask for chunks that have them */ @@ -3292,8 +3366,8 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, space_dim = dset->shared->curr_dims; space_ndims = dset->shared->ndims; - /* The last dimension in chunk_offset is always 0 */ - chunk_offset[space_ndims] = (hsize_t)0; + /* The last dimension in scaled chunk coordinates is always 0 */ + scaled[space_ndims] = (hsize_t)0; /* Check if any space dimensions are 0, if so we do not have to do anything */ @@ -3380,10 +3454,8 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, * that we assume here that all elements of space_dim are > 0. This is * checked at the top of this function. */ for(op_dim = 0; op_dim < (unsigned)space_ndims; op_dim++) { - min_unalloc[op_dim] = ((old_dim[op_dim] + chunk_dim[op_dim] - 1) - / chunk_dim[op_dim]) * chunk_dim[op_dim]; - max_unalloc[op_dim] = ((space_dim[op_dim] - 1) / chunk_dim[op_dim]) - * chunk_dim[op_dim]; + min_unalloc[op_dim] = (old_dim[op_dim] + chunk_dim[op_dim] - 1) / chunk_dim[op_dim]; + max_unalloc[op_dim] = (space_dim[op_dim] - 1) / chunk_dim[op_dim]; } /* end for */ /* Loop over all chunks */ @@ -3403,6 +3475,9 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, * Every time the algorithm finishes allocating chunks allocated beyond a * certain dimension, max_unalloc is updated in order to avoid allocating * those chunks again. + * + * Note that min_unalloc & max_unalloc are in scaled coordinates. + * */ for(op_dim = 0; op_dim < space_ndims; op_dim++) { H5D_chunk_ud_t udata; /* User data for querying chunk info */ @@ -3413,8 +3488,8 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, continue; else { /* Reset the chunk offset indices */ - HDmemset(chunk_offset, 0, (space_ndims * sizeof(chunk_offset[0]))); - chunk_offset[op_dim] = min_unalloc[op_dim]; + HDmemset(scaled, 0, (space_ndims * sizeof(scaled[0]))); + scaled[op_dim] = min_unalloc[op_dim]; carry = FALSE; } /* end else */ @@ -3428,11 +3503,8 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, #ifndef NDEBUG /* None of the chunks should be allocated */ { - hsize_t chunk_idx; - /* Look up this chunk */ - chunk_idx = H5VM_chunk_index(space_ndims, chunk_offset, layout->u.chunk.dim, layout->u.chunk.down_chunks); - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") HDassert(!H5F_addr_defined(udata.chunk_block.offset)); @@ -3445,8 +3517,8 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hbool_t outside_orig = FALSE; for(u = 0; u < space_ndims; u++) { - HDassert(chunk_offset[u] < space_dim[u]); - if(chunk_offset[u] >= old_dim[u]) + HDassert((scaled[u] * chunk_dim[u]) < space_dim[u]); + if((scaled[u] * chunk_dim[u]) >= old_dim[u]) outside_orig = TRUE; } /* end for */ HDassert(outside_orig); @@ -3496,7 +3568,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, /* Initialize the chunk information */ udata.common.layout = &layout->u.chunk; udata.common.storage = &layout->storage.u.chunk; - udata.common.offset = chunk_offset; + udata.common.scaled = scaled; udata.chunk_block.offset = HADDR_UNDEF; H5_CHECKED_ASSIGN(udata.chunk_block.length, uint32_t, chunk_size, size_t); udata.filter_mask = filter_mask; @@ -3549,12 +3621,12 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, /* Increment indices and adjust the edge chunk state */ carry = TRUE; for(i = ((int)space_ndims - 1); i >= 0; --i) { - chunk_offset[i] += chunk_dim[i]; - if(chunk_offset[i] > max_unalloc[i]) { + scaled[i]++; + if(scaled[i] > max_unalloc[i]) { if((unsigned)i == op_dim) - chunk_offset[i] = min_unalloc[i]; + scaled[i] = min_unalloc[i]; else - chunk_offset[i] = 0; + scaled[i] = 0; } /* end if */ else { carry = FALSE; @@ -3569,7 +3641,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, if(min_unalloc[op_dim] == 0) break; else - max_unalloc[op_dim] = min_unalloc[op_dim] - chunk_dim[op_dim]; + max_unalloc[op_dim] = min_unalloc[op_dim] - 1; } /* end for(op_dim=0...) */ #ifdef H5_HAVE_PARALLEL @@ -3771,7 +3843,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) const H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */ - const hsize_t *chunk_offset = io_info->store->chunk.offset; /* Chunk offset */ + const hsize_t *scaled = udata->common.scaled; /* Scaled chunk offset */ H5S_sel_iter_t chunk_iter; /* Memory selection iteration info */ hssize_t sel_nelmts; /* Number of elements in selection */ hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */ @@ -3790,7 +3862,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) H5_CHECKED_ASSIGN(chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, io_info->store->chunk.index, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, io_info->dxpl_id, scaled, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* If this chunk does not exist in cache or on disk, no need to do anything */ @@ -3810,7 +3882,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) /* Compute the # of elements to leave with existing value, in each dimension */ for(u = 0; u < rank; u++) { - count[u] = MIN(layout->u.chunk.dim[u], (udata->space_dim[u] - chunk_offset[u])); + count[u] = MIN(layout->u.chunk.dim[u], (udata->space_dim[u] - (scaled[u] * layout->u.chunk.dim[u]))); HDassert(count[u] > 0); } /* end for */ @@ -3973,13 +4045,10 @@ done: herr_t H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) { - hsize_t min_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of first chunk to modify in each dimension */ - hsize_t max_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of last chunk to modify in each dimension */ - hssize_t max_fill_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of last chunk that might be filled in each dimension */ + hsize_t min_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Scaled offset of first chunk to modify in each dimension */ + hsize_t max_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk to modify in each dimension */ + hssize_t max_fill_chunk_off[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk that might be filled in each dimension */ hbool_t fill_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension needs to be filled */ - hbool_t dims_outside_fill[H5O_LAYOUT_NDIMS]; /* Dimensions in chunk offset outside fill dimensions */ - int ndims_outside_fill = 0; /* Number of dimensions in chunk offset outside fill dimensions */ - hbool_t has_fill = FALSE; /* Whether there are chunks that must be filled */ H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_io_info_t chk_io_info; /* Chunked I/O info object */ H5D_storage_t chk_store; /* Chunk storage information */ @@ -3987,7 +4056,6 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Current dataspace dimensions */ unsigned op_dim; /* Current operating dimension */ @@ -3997,10 +4065,9 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) H5D_chunk_common_ud_t idx_udata; /* User data for index removal routine */ H5S_t *chunk_space = NULL; /* Dataspace for a chunk */ hsize_t chunk_dim[H5O_LAYOUT_NDIMS]; /* Chunk dimensions */ - hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled offset of current chunk */ hsize_t hyper_start[H5O_LAYOUT_NDIMS]; /* Starting location of hyperslab */ uint32_t elmts_per_chunk; /* Elements in chunk */ - hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -4019,8 +4086,8 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) space_dim = dset->shared->curr_dims; space_ndims = dset->shared->ndims; - /* The last dimension in chunk_offset is always 0 */ - chunk_offset[space_ndims] = (hsize_t)0; + /* The last dimension in scaled is always 0 */ + scaled[space_ndims] = (hsize_t)0; /* Check if any old dimensions are 0, if so we do not have to do anything */ for(op_dim = 0; op_dim < (unsigned)space_ndims; op_dim++) @@ -4039,7 +4106,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) for(u = 0; u < space_ndims; u++) { elmts_per_chunk *= layout->u.chunk.dim[u]; chunk_dim[u] = layout->u.chunk.dim[u]; - shrunk_dim[u] = space_dim[u] < old_dim[u]; + shrunk_dim[u] = (space_dim[u] < old_dim[u]); } /* end for */ /* Create a dataspace for a chunk & set the extent */ @@ -4051,9 +4118,9 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) HDmemset(hyper_start, 0, sizeof(hyper_start)); /* Set up chunked I/O info object, for operations on chunks (in callback) - * Note that we only need to set chunk_offset once, as the array's address + * Note that we only need to set scaled once, as the array's address * will never change. */ - chk_store.chunk.offset = chunk_offset; + chk_store.chunk.scaled = scaled; H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, dxpl_cache, dxpl_id, &chk_store, NULL); /* Compose chunked index info struct */ @@ -4067,6 +4134,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) HDmemset(&udata, 0, sizeof udata); udata.common.layout = &layout->u.chunk; udata.common.storage = &layout->storage.u.chunk; + udata.common.scaled = scaled; udata.io_info = &chk_io_info; udata.idx_info = &idx_info; udata.space_dim = space_dim; @@ -4088,16 +4156,14 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) for(op_dim = 0; op_dim < (unsigned)space_ndims; op_dim++) { /* Calculate the largest offset of chunks that might need to be * modified in this dimension */ - max_mod_chunk_off[op_dim] = chunk_dim[op_dim] * ((old_dim[op_dim] - 1) - / chunk_dim[op_dim]); + max_mod_chunk_off[op_dim] = (old_dim[op_dim] - 1) / chunk_dim[op_dim]; /* Calculate the largest offset of chunks that might need to be * filled in this dimension */ if(0 == space_dim[op_dim]) max_fill_chunk_off[op_dim] = -1; else - max_fill_chunk_off[op_dim] = (hssize_t)(chunk_dim[op_dim] - * ((MIN(space_dim[op_dim], old_dim[op_dim]) - 1) + max_fill_chunk_off[op_dim] = (hssize_t)(((MIN(space_dim[op_dim], old_dim[op_dim]) - 1) / chunk_dim[op_dim])); if(shrunk_dim[op_dim]) { @@ -4105,14 +4171,11 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) * modified in this dimension. Note that this array contains * garbage for all dimensions which are not shrunk. These locations * must not be read from! */ - min_mod_chunk_off[op_dim] = chunk_dim[op_dim] * (space_dim[op_dim] - / chunk_dim[op_dim]); + min_mod_chunk_off[op_dim] = space_dim[op_dim] / chunk_dim[op_dim]; /* Determine if we need to fill chunks in this dimension */ - if((hssize_t)min_mod_chunk_off[op_dim] == max_fill_chunk_off[op_dim]) { + if((hssize_t)min_mod_chunk_off[op_dim] == max_fill_chunk_off[op_dim]) fill_dim[op_dim] = TRUE; - has_fill = TRUE; - } /* end if */ else fill_dim[op_dim] = FALSE; } /* end if */ @@ -4122,38 +4185,38 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) /* Main loop: fill or remove chunks */ for(op_dim = 0; op_dim < (unsigned)space_ndims; op_dim++) { + hbool_t dims_outside_fill[H5O_LAYOUT_NDIMS]; /* Dimensions in chunk offset outside fill dimensions */ + int ndims_outside_fill; /* Number of dimensions in chunk offset outside fill dimensions */ + hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ + /* Check if modification along this dimension is really necessary */ if(!shrunk_dim[op_dim]) continue; else { - HDassert((hsize_t) max_mod_chunk_off[op_dim] >= min_mod_chunk_off[op_dim]); + HDassert(max_mod_chunk_off[op_dim] >= min_mod_chunk_off[op_dim]); /* Reset the chunk offset indices */ - HDmemset(chunk_offset, 0, (space_ndims * sizeof(chunk_offset[0]))); - chunk_offset[op_dim] = min_mod_chunk_off[op_dim]; + HDmemset(scaled, 0, (space_ndims * sizeof(scaled[0]))); + scaled[op_dim] = min_mod_chunk_off[op_dim]; /* Initialize "dims_outside_fill" array */ ndims_outside_fill = 0; for(u = 0; u < space_ndims; u++) - if((hssize_t)chunk_offset[u] > max_fill_chunk_off[u]) { + if((hssize_t)scaled[u] > max_fill_chunk_off[u]) { dims_outside_fill[u] = TRUE; ndims_outside_fill++; } /* end if */ else dims_outside_fill[u] = FALSE; - - carry = FALSE; } /* end if */ + carry = FALSE; while(!carry) { int i; /* Local index variable */ - /* Calculate the index of this chunk */ - chk_io_info.store->chunk.index = H5VM_chunk_index(space_ndims, chunk_offset, layout->u.chunk.dim, layout->u.chunk.down_chunks); - if(0 == ndims_outside_fill) { HDassert(fill_dim[op_dim]); - HDassert(chunk_offset[op_dim] == min_mod_chunk_off[op_dim]); + HDassert(scaled[op_dim] == min_mod_chunk_off[op_dim]); /* Fill the unused parts of the chunk */ if(H5D__chunk_prune_fill(&udata) < 0) @@ -4168,7 +4231,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) hbool_t outside_dim = FALSE; for(u = 0; u < space_ndims; u++) - if(chunk_offset[u] >= space_dim[u]) { + if((scaled[u] * chunk_dim[u]) >= space_dim[u]) { outside_dim = TRUE; break; } /* end if */ @@ -4177,7 +4240,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) #endif /* NDEBUG */ /* Check if the chunk exists in cache or on disk */ - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chk_io_info.store->chunk.index, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, scaled, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk") /* Evict the entry from the cache if present, but do not flush @@ -4189,7 +4252,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) /* Remove the chunk from disk, if present */ if(H5F_addr_defined(chk_udata.chunk_block.offset)) { /* Update the offset in idx_udata */ - idx_udata.offset = chunk_offset; + idx_udata.scaled = scaled; /* Remove the chunk from disk */ if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) < 0) @@ -4200,19 +4263,19 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) /* Increment indices */ carry = TRUE; for(i = (int)(space_ndims - 1); i >= 0; --i) { - chunk_offset[i] += chunk_dim[i]; - if(chunk_offset[i] > (hsize_t) max_mod_chunk_off[i]) { + scaled[i]++; + if(scaled[i] > max_mod_chunk_off[i]) { /* Left maximum dimensions, "wrap around" and check if this * dimension is no longer outside the fill dimension */ if((unsigned)i == op_dim) { - chunk_offset[i] = min_mod_chunk_off[i]; + scaled[i] = min_mod_chunk_off[i]; if(dims_outside_fill[i] && fill_dim[i]) { dims_outside_fill[i] = FALSE; ndims_outside_fill--; } /* end if */ } /* end if */ else { - chunk_offset[i] = 0; + scaled[i] = 0; if(dims_outside_fill[i] && max_fill_chunk_off[i] >= 0) { dims_outside_fill[i] = FALSE; ndims_outside_fill--; @@ -4221,7 +4284,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) } /* end if */ else { /* Check if we just went outside the fill dimension */ - if(!dims_outside_fill[i] && (hssize_t)chunk_offset[i] > max_fill_chunk_off[i]) { + if(!dims_outside_fill[i] && (hssize_t)scaled[i] > max_fill_chunk_off[i]) { dims_outside_fill[i] = TRUE; ndims_outside_fill++; } /* end if */ @@ -4239,7 +4302,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) if(min_mod_chunk_off[op_dim] == 0) break; else - max_mod_chunk_off[op_dim] = min_mod_chunk_off[op_dim] - chunk_dim[op_dim]; + max_mod_chunk_off[op_dim] = min_mod_chunk_off[op_dim] - 1; } /* end for(op_dim=0...) */ /* Reset any cached chunk info for this dataset */ @@ -4282,7 +4345,7 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_ENTER_STATIC /* Compute the index for this chunk */ - chunk_index = H5VM_chunk_index(rank, chunk_rec->offset, udata->common.layout->dim, udata->common.layout->down_chunks); + chunk_index = H5VM_array_offset_pre(rank, udata->common.layout->down_chunks, chunk_rec->scaled); /* Set it in the userdata to return */ udata->chunk_addr[chunk_index] = chunk_rec->chunk_addr; @@ -4440,7 +4503,6 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) H5D_rdcc_ent_t *ent, *next; /*cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ - unsigned rank; /* Current # of dimensions */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4449,13 +4511,8 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) HDassert(dset && H5D_CHUNKED == dset->shared->layout.type); HDassert(dset->shared->layout.u.chunk.ndims > 0 && dset->shared->layout.u.chunk.ndims <= H5O_LAYOUT_NDIMS); - /* Get the rank */ - rank = dset->shared->layout.u.chunk.ndims - 1; - HDassert(rank > 0); - - /* 1-D dataset's chunks can't have their index change */ - if(rank == 1) - HGOTO_DONE(SUCCEED) + /* Check the rank */ + HDassert((dset->shared->layout.u.chunk.ndims - 1) > 1); /* Fill the DXPL cache values for later use */ if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) @@ -4463,18 +4520,14 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) /* Recompute the index for each cached chunk that is in a dataset */ for(ent = rdcc->head; ent; ent = next) { - hsize_t idx; /* Chunk index */ unsigned old_idx; /* Previous index number */ /* Get the pointer to the next cache entry */ next = ent->next; - /* Calculate the index of this chunk */ - idx = H5VM_chunk_index(rank, ent->offset, dset->shared->layout.u.chunk.dim, dset->shared->layout.u.chunk.down_chunks); - /* Compute the index for the chunk entry */ old_idx = ent->idx; /* Save for later */ - ent->idx = H5D_CHUNK_HASH(dset->shared, idx); + ent->idx = H5D__chunk_hash_val(dset->shared, ent->scaled); if(old_idx != ent->idx) { H5D_rdcc_ent_t *old_ent; /* Old cache entry */ @@ -4661,7 +4714,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Set up destination chunk callback information for insertion */ udata_dst.common.layout = udata->idx_info_dst->layout; udata_dst.common.storage = udata->idx_info_dst->storage; - udata_dst.common.offset = chunk_rec->offset; + udata_dst.common.scaled = chunk_rec->scaled; udata_dst.chunk_block.offset = HADDR_UNDEF; udata_dst.chunk_block.length = chunk_rec->nbytes; udata_dst.filter_mask = chunk_rec->filter_mask; @@ -5044,7 +5097,7 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Print information about this chunk */ HDfprintf(udata->stream, " 0x%08x %8Zu %10a [", chunk_rec->filter_mask, chunk_rec->nbytes, chunk_rec->chunk_addr); for(u = 0; u < udata->ndims; u++) - HDfprintf(udata->stream, "%s%Hd", (u ? ", " : ""), chunk_rec->offset[u]); + HDfprintf(udata->stream, "%s%Hu", (u ? ", " : ""), (chunk_rec->scaled[u] * udata->chunk_dim[u])); HDfputs("]\n", udata->stream); } /* end if */ @@ -5096,6 +5149,7 @@ H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) udata.stream = stream; udata.header_displayed = FALSE; udata.ndims = dset->shared->layout.u.chunk.ndims; + udata.chunk_dim = dset->shared->layout.u.chunk.dim; /* Iterate over index and dump chunk info */ if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_dump_index_cb, &udata) < 0) diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index b3dae7b..3da6b95 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -382,12 +382,56 @@ H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) /* Update the index values for the cached chunks for this dataset */ if(H5D_CHUNKED == dataset->shared->layout.type) { + hbool_t update_chunks = FALSE; /* Flag to indicate chunk cache update is needed */ + + /* Check if we need to track & update scaled dimension information */ + if(dataset->shared->ndims > 1) { + unsigned u; /* Local indicate variable */ + + /* Update scaled chunk information */ + for(u = 0; u < dataset->shared->ndims; u++) { + hsize_t scaled; /* Scaled value */ + + /* Compute the scaled dimension size value */ + scaled = size[u] / dataset->shared->layout.u.chunk.dim[u]; + + /* Check if scaled dimension size changed */ + if(scaled != dataset->shared->cache.chunk.scaled_dims[u]) { + hsize_t scaled_power2up; /* New size value, rounded to next power of 2 */ + + /* Update the scaled dimension size value for the current dimension */ + dataset->shared->cache.chunk.scaled_dims[u] = scaled; + + /* Check if algorithm for computing hash values will change */ + if((scaled > dataset->shared->cache.chunk.nslots && + dataset->shared->cache.chunk.scaled_dims[u] <= dataset->shared->cache.chunk.nslots) + || (scaled <= dataset->shared->cache.chunk.nslots && + dataset->shared->cache.chunk.scaled_dims[u] > dataset->shared->cache.chunk.nslots)) + update_chunks = TRUE; + + /* Check if the number of bits required to encode the scaled size value changed */ + if(dataset->shared->cache.chunk.scaled_power2up[u] != (scaled_power2up = H5VM_power2up(scaled))) { + /* Update the 'power2up' & 'encode_bits' values for the current dimension */ + dataset->shared->cache.chunk.scaled_power2up[u] = scaled_power2up; + dataset->shared->cache.chunk.scaled_encode_bits[u] = H5VM_log2_gen(scaled_power2up); + + /* Indicate that the chunk cache indices should be updated */ + update_chunks = TRUE; + } /* end if */ + } /* end if */ + } /* end for */ + } /* end if */ + /* Update general information for chunks */ if(H5D__chunk_set_info(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks") - /* Update the chunk cache indices */ - if(H5D__chunk_update_cache(dataset, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") + + /* Check for updating chunk cache indices */ + if(update_chunks) { + /* Update the chunk cache indices */ + if(H5D__chunk_update_cache(dataset, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") + } /* end if */ } /* end if */ /* Allocate space for the new parts of the dataset, if appropriate */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 23824e3..2289ac1 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2240,6 +2240,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) if(changed) { hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */ hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */ + hbool_t update_chunks = FALSE; /* Flag to indicate chunk cache update is needed */ unsigned u; /* Local index variable */ /* Determine if we are shrinking and/or expanding any dimensions */ @@ -2250,6 +2251,39 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) if(size[u] > curr_dims[u]) expand = TRUE; + /* Chunked storage specific checks */ + if(H5D_CHUNKED == dset->shared->layout.type && dset->shared->ndims > 1) { + hsize_t scaled; /* Scaled value */ + + /* Compute the scaled dimension size value */ + scaled = size[u] / dset->shared->layout.u.chunk.dim[u]; + + /* Check if scaled dimension size changed */ + if(scaled != dset->shared->cache.chunk.scaled_dims[u]) { + hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ + + /* Update the scaled dimension size value for the current dimension */ + dset->shared->cache.chunk.scaled_dims[u] = scaled; + + /* Check if algorithm for computing hash values will change */ + if((scaled > dset->shared->cache.chunk.nslots && + dset->shared->cache.chunk.scaled_dims[u] <= dset->shared->cache.chunk.nslots) + || (scaled <= dset->shared->cache.chunk.nslots && + dset->shared->cache.chunk.scaled_dims[u] > dset->shared->cache.chunk.nslots)) + update_chunks = TRUE; + + /* Check if the number of bits required to encode the scaled size value changed */ + if(dset->shared->cache.chunk.scaled_power2up[u] != (scaled_power2up = H5VM_power2up(scaled))) { + /* Update the 'power2up' & 'encode_bits' values for the current dimension */ + dset->shared->cache.chunk.scaled_power2up[u] = scaled_power2up; + dset->shared->cache.chunk.scaled_encode_bits[u] = H5VM_log2_gen(scaled_power2up); + + /* Indicate that the cached chunk indices need to be updated */ + update_chunks = TRUE; + } /* end if */ + } /* end if */ + } /* end if */ + /* Update the cached copy of the dataset's dimensions */ dset->shared->curr_dims[u] = size[u]; } /* end for */ @@ -2263,8 +2297,12 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) /* Set the cached chunk info */ if(H5D__chunk_set_info(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks") - if(H5D__chunk_update_cache(dset, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") + + /* Check if updating the chunk cache indices is necessary */ + if(update_chunks) + /* Update the chunk cache indices */ + if(H5D__chunk_update_cache(dset, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") } /* end if */ /* Allocate space for the new parts of the dataset, if appropriate */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 825c562..63faa5d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -860,7 +860,7 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ mspace = chunk_info->mspace; /* Look up address of chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk address") ctg_store.contig.dset_addr = udata.chunk_block.offset; } /* end else */ @@ -1200,8 +1200,7 @@ if(H5DEBUG(D)) HDassert(chunk_info->index == u); /* Pass in chunk's coordinates in a union. */ - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; + store.chunk.scaled = chunk_info->scaled; } /* end if */ /* Collective IO for this chunk, @@ -1588,8 +1587,7 @@ if(H5DEBUG(D)) H5D_chunk_ud_t udata; /* User data for querying chunk info */ /* Get address of chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, - chunk_info->coords, chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") chunk_addr = udata.chunk_block.offset; } /* end if */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 12e84b0..815dae4 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -61,8 +61,6 @@ (io_info)->op_type = H5D_IO_OP_READ; \ (io_info)->u.rbuf = buf -#define H5D_CHUNK_HASH(D, ADDR) H5F_addr_hash(ADDR, (D)->cache.chunk.nslots) - /* Flags for marking aspects of a dataset dirty */ #define H5D_MARK_SPACE 0x01 #define H5D_MARK_LAYOUT 0x02 @@ -165,8 +163,7 @@ typedef struct { } H5D_contig_storage_t; typedef struct { - hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */ - hsize_t *offset; /* Chunk's coordinates in elements */ + hsize_t *scaled; /* Scaled coordinates for a chunk */ } H5D_chunk_storage_t; typedef struct { @@ -239,7 +236,7 @@ typedef struct H5D_chk_idx_info_t { * The chunk's file address, filter mask and size on disk are not key values. */ typedef struct H5D_chunk_rec_t { - hsize_t offset[H5O_LAYOUT_NDIMS]; /* Logical offset to start */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Logical offset to start */ uint32_t nbytes; /* Size of stored data */ unsigned filter_mask; /* Excluded filters */ haddr_t chunk_addr; /* Address of chunk in file */ @@ -254,7 +251,7 @@ typedef struct H5D_chunk_common_ud_t { /* downward */ const H5O_layout_chunk_t *layout; /* Chunk layout description */ const H5O_storage_chunk_t *storage; /* Chunk storage description */ - const hsize_t *offset; /* Logical offset of chunk */ + const hsize_t *scaled; /* Scaled coordinates for a chunk */ } H5D_chunk_common_ud_t; /* B-tree callback info for various operations */ @@ -320,7 +317,7 @@ typedef struct H5D_chunk_ops_t { typedef struct H5D_chunk_info_t { hsize_t index; /* "Index" of chunk in dataset */ uint32_t chunk_points; /* Number of elements selected in chunk */ - hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of chunk in file dataset's dataspace */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled coordinates of chunk (in file dataset's dataspace) */ H5S_t *fspace; /* Dataspace describing chunk & selection in it */ hbool_t fspace_shared; /* Indicate that the file space for a chunk is shared and shouldn't be freed */ H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */ @@ -360,7 +357,7 @@ typedef struct H5D_chunk_map_t { /* Cached information about a particular chunk */ typedef struct H5D_chunk_cached_t { hbool_t valid; /*whether cache info is valid*/ - hsize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled offset of chunk*/ haddr_t addr; /*file address of chunk */ uint32_t nbytes; /*size of stored data */ unsigned filter_mask; /*excluded filters */ @@ -386,6 +383,11 @@ typedef struct H5D_rdcc_t { H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */ H5S_t *single_space; /* Dataspace for single element I/O on chunks */ H5D_chunk_info_t *single_chunk_info; /* Pointer to single chunk's info */ + + /* Cached information about scaled dataspace dimensions */ + hsize_t scaled_dims[H5S_MAX_RANK]; /* The scaled dim sizes */ + hsize_t scaled_power2up[H5S_MAX_RANK]; /* The scaled dim sizes, rounded up to next power of 2 */ + unsigned scaled_encode_bits[H5S_MAX_RANK]; /* The number of bits needed to encode the scaled dim sizes */ } H5D_rdcc_t; /* The raw data contiguous data cache */ @@ -494,7 +496,7 @@ typedef struct H5D_rdcc_ent_t { hbool_t locked; /*entry is locked in cache */ hbool_t dirty; /*needs to be written to disk? */ hbool_t deleted; /*chunk about to be deleted */ - hsize_t offset[H5O_LAYOUT_NDIMS]; /*chunk name */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled chunk 'name' (coordinates) */ uint32_t rd_count; /*bytes remaining to be read */ uint32_t wr_count; /*bytes remaining to be written */ H5F_block_t chunk_block; /*offset/length of chunk in file */ @@ -612,7 +614,7 @@ H5_DLL herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, - const hsize_t *chunk_offset, hsize_t chunk_idx, H5D_chunk_ud_t *udata); + const hsize_t *scaled, H5D_chunk_ud_t *udata); H5_DLL void *H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t relax); H5_DLL herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 0b8b76f..55e5b47 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -176,7 +176,7 @@ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_ad /* Functions that operate on indexed storage */ H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, - int indent, int fwidth, unsigned ndims); + int indent, int fwidth, unsigned ndims, const uint32_t *dim); #endif /* _H5Dprivate_H */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 4e57a19..9a5bfb3 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -244,7 +244,6 @@ #define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ HADDR_UNDEF==(X)+(haddr_t)(Z) || \ (X)+(haddr_t)(Z)<(X)) -#define H5F_addr_hash(X,M) ((unsigned)((X)%(M))) #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 diff --git a/src/H5VM.c b/src/H5VM.c index ffc657d..c546609 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -386,55 +386,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM_hyper_disjointp - * - * Purpose: Determines if two hyperslabs are disjoint. - * - * Return: Success: FALSE if they are not disjoint. - * TRUE if they are disjoint. - * - * Failure: A hyperslab of zero size is disjoint from all - * other hyperslabs. - * - * Programmer: Robb Matzke - * Thursday, October 16, 1997 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -htri_t -H5VM_hyper_disjointp(unsigned n, - const hsize_t *offset1, const uint32_t *size1, - const hsize_t *offset2, const uint32_t *size2) -{ - unsigned u; - htri_t ret_value = FALSE; /* Return value */ - - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(!n || !size1 || !size2) - HGOTO_DONE(TRUE) - - for(u = 0; u < n; u++) { - HDcompile_assert(sizeof(uint32_t) <= sizeof(hsize_t)); - - if(0 == size1[u] || 0 == size2[u]) - HGOTO_DONE(TRUE) - if(((offset1 ? offset1[u] : 0) < (offset2 ? offset2[u] : 0) && - ((offset1 ? offset1[u] : 0) + size1[u] <= (offset2 ? offset2[u] : 0))) || - ((offset2 ? offset2[u] : 0) < (offset1 ? offset1[u] : 0) && - ((offset2 ? offset2[u] : 0) + size2[u] <= (offset1 ? offset1[u] : 0)))) - HGOTO_DONE(TRUE) - } /* end for */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VM_hyper_disjointp() */ - - -/*------------------------------------------------------------------------- * Function: H5VM_hyper_fill * * Purpose: Similar to memset() except it operates on hyperslabs... @@ -1068,17 +1019,12 @@ H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) * Programmer: Quincey Koziol * Tuesday, June 22, 1999 * - * Modifications: - * Use precomputed accumulator array - * Quincey Koziol - * Saturday, April 26, 2003 - * *------------------------------------------------------------------------- */ hsize_t H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) { - int i; /*counter */ + unsigned u; /* Local index variable */ hsize_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1088,8 +1034,8 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) HDassert(offset); /* Compute offset in array */ - for(i = (int)(n - 1), ret_value = 0; i >= 0; --i) - ret_value += acc[i] * offset[i]; + for(u = 0, ret_value = 0; u < n; u++) + ret_value += acc[u] * offset[u]; FUNC_LEAVE_NOAPI(ret_value) } /* end H5VM_array_offset_pre() */ @@ -1157,7 +1103,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *coords) { @@ -1288,6 +1234,41 @@ H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, /*------------------------------------------------------------------------- + * Function: H5VM_chunk_scaled + * + * Purpose: Compute the scaled coordinates for a chunk offset + * + * Return: + * + * Programmer: Quincey Koziol + * Wednesday, November 19, 2014 + * + *------------------------------------------------------------------------- + */ +void +H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, + hsize_t *scaled) +{ + unsigned u; /* Local index variable */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(ndims <= H5VM_HYPER_NDIMS); + HDassert(coord); + HDassert(chunk); + HDassert(scaled); + + /* Compute the scaled coordinates for actual coordinates */ + /* (Note that the 'scaled' array is an 'OUT' parameter) */ + for(u = 0; u < ndims; u++) + scaled[u] = coord[u] / chunk[u]; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VM_chunk_scaled() */ + + +/*------------------------------------------------------------------------- * Function: H5VM_chunk_index_scaled * * Purpose: Given a coordinate offset (COORD), the size of each chunk diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 8ddb5ee..5d1e0c2 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -56,8 +56,6 @@ H5_DLL hsize_t H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, const hsize_t *offset, hsize_t *stride); -H5_DLL htri_t H5VM_hyper_disjointp(unsigned n, const hsize_t *offset1, - const uint32_t *size1, const hsize_t *offset2, const uint32_t *size2); H5_DLL htri_t H5VM_hyper_eq(unsigned n, const hsize_t *offset1, const hsize_t *size1, const hsize_t *offset2, const hsize_t *size2); @@ -87,10 +85,14 @@ H5_DLL hsize_t H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset); H5_DLL hsize_t H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset); +H5_DLL herr_t H5VM_array_calc_pre(hsize_t offset, unsigned n, + const hsize_t *down, hsize_t *coords); H5_DLL herr_t H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords); H5_DLL hsize_t H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, const hsize_t *down_nchunks); +H5_DLL void H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, + const uint32_t *chunk, hsize_t *scaled); H5_DLL hsize_t H5VM_chunk_index_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, const hsize_t *down_nchunks, hsize_t *scaled); H5_DLL ssize_t H5VM_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 617e614..ea7a9ca 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -329,6 +329,7 @@ main(int argc, char *argv[]) */ H5B_subid_t subtype = (H5B_subid_t)sig[H5_SIZEOF_MAGIC]; unsigned ndims; + uint32_t dim[H5O_LAYOUT_NDIMS]; switch(subtype) { case H5B_SNODE_ID: @@ -337,6 +338,7 @@ main(int argc, char *argv[]) HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); HDfprintf(stderr, "B-tree symbol table node usage:\n"); HDfprintf(stderr, "\th5debug
\n\n"); + HDexit(4); } /* end if */ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -347,12 +349,37 @@ main(int argc, char *argv[]) if(extra == 0) { HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); HDfprintf(stderr, "B-tree chunked storage node usage:\n"); - HDfprintf(stderr, "\th5debug <# of dimensions>\n"); + HDfprintf(stderr, "\th5debug <# of dimensions> ...\n"); HDexit(4); } /* end if */ + /* Build array of chunk dimensions */ ndims = (unsigned)extra; - status = H5D_btree_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims); + dim[0] = extra2; + if(ndims > 1) + dim[1] = extra3; + if(ndims > 2) + dim[2] = extra4; + + /* Check for dimension error */ + if(ndims > 3) { + HDfprintf(stderr, "ERROR: Only 3 dimensions support currently (fix h5debug)\n"); + HDfprintf(stderr, "B-tree chunked storage node usage:\n"); + HDfprintf(stderr, "\th5debug <# of dimensions> ...\n"); + HDexit(4); + } /* end for */ + for(u = 0; u < ndims; u++) + if(0 == dim[u]) { + HDfprintf(stderr, "ERROR: Chunk dimensions should be >0\n"); + HDfprintf(stderr, "B-tree chunked storage node usage:\n"); + HDfprintf(stderr, "\th5debug <# of dimensions> ...\n"); + HDexit(4); + } /* end if */ + + /* Set the last dimension (the element size) to zero */ + dim[ndims] = 0; + + status = H5D_btree_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims, dim); break; default: @@ -491,7 +518,7 @@ main(int argc, char *argv[]) const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); - /* Check for enough valid parameters */ + /* Check for enough valid parameters */ if(extra == 0) { HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); HDfprintf(stderr, "Extensible array header block usage:\n"); @@ -559,11 +586,11 @@ main(int argc, char *argv[]) const H5FA_class_t *cls = get_H5FA_class(sig); HDassert(cls); - /* Check for enough valid parameters */ + /* Check for enough valid parameters */ if(extra == 0) { - HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); + HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); HDfprintf(stderr, "Fixed array header block usage:\n"); - HDfprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ -- cgit v0.12 From a86910deac84fe71cedc02686195a9321b6a820e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 00:32:55 -0500 Subject: [svn-r27060] Description: Clean up obsolete and unsupported versions of GCC, and update for GCC 5.1 release. Tested on: Mac OSX/64 10.10.3 (amazon) w/C++, FORTRAN, serial, production & parallel (gcc 5.1 not available on other systems) --- config/gnu-flags | 251 ++++++++++++++++++++----------------------------------- 1 file changed, 90 insertions(+), 161 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 6c33808..ec7b9b2 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -19,10 +19,10 @@ # if the compiler is not GNU; otherwise `cc_flags_set' is set to `yes' # -# Get the compiler version in a way that works for gcc, egcs, and -# pgcc unless a compiler version is already known +# Get the compiler version in a way that works for gcc +# unless a compiler version is already known # -# cc_vendor: The compiler name: gcc, egcs, or pgcc +# cc_vendor: The compiler name: gcc # cc_version: Version number: 2.91.60, 2.7.2.1 # if test X = "X$cc_flags_set"; then @@ -55,61 +55,9 @@ if test X = "X$cc_flags_set"; then cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch` fi -# GCC compilers before gcc-2.8.1 have problems with `long long'. -if test gcc = "$cc_vendor" -a "$cc_vers_all" -lt 2008001; then - cat < `double' conversions. -elif test gcc = "$cc_vendor" -a "$cc_vers_all" -eq 2096000; then - cat < Date: Thu, 14 May 2015 11:51:20 -0500 Subject: [svn-r27064] HDFFV-9327: Refactor compiler flags to config file. Tested: local linux --- CMakeLists.txt | 259 +++------------------------------- MANIFEST | 17 +-- config/cmake/HDFCompilerFlags.cmake | 268 ++++++++++++++++++++++++++++++++++++ 3 files changed, 294 insertions(+), 250 deletions(-) create mode 100644 config/cmake/HDFCompilerFlags.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a3d537c..33b4bca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ endif () # dependencies to this variable so that external projects pick them up # # HDF5_EXTERNAL_LIB_PREFIX : -# If the parent project needs to install hdf libraries, but avoid +# If the parent project needs to install hdf libraries, but avoid # name conflicts with system versions, then a prefix may be added # to ensure that the correct versions configured are used. # @@ -71,8 +71,8 @@ endif () # # Setup all necessary overrides for zlib so that HDF5 uses our # # internally compiled zlib rather than any other version # if (HDF5_ENABLE_Z_LIB_SUPPORT) -# # We must tell the main HDF5 library that it depends on our zlib -# set (HDF5_LIB_DEPENDENCIES vtkzlib) +# # We must tell the main HDF5 library that it depends on our zlib +# set (HDF5_LIB_DEPENDENCIES vtkzlib) # # Override the zlib header file # if (VTK_USE_SYSTEM_ZLIB) # set (H5_ZLIB_HEADER "zlib.h") @@ -83,7 +83,7 @@ endif () # set (ZLIB_LIBRARIES vtkzlib) # endif (VTK_USE_SYSTEM_ZLIB) # endif (HDF5_ENABLE_Z_LIB_SUPPORT) -# +# # # Add the sub project # add_subdirectory (Utilities/hdf5-1.8) #----------------------------------------------------------------------------- @@ -264,7 +264,7 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use -# by other projects using FindHDF5. +# by other projects using FindHDF5. #----------------------------------------------------------------------------- if (NOT HDF5_EXPORTED_TARGETS) set (HDF5_EXPORTED_TARGETS "hdf5-targets") @@ -322,7 +322,7 @@ option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" O if (HDF5_ENABLE_COVERAGE) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") + set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") endif (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- @@ -331,7 +331,7 @@ endif (HDF5_ENABLE_COVERAGE) # option (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) # if (HDF5_ENABLE_USING_DMALLOC) # find_package (DMALLOC) -# set (H5_HAVE_DMALLOC DMALLOC_FOUND) +# set (H5_HAVE_DMALLOC DMALLOC_FOUND) # endif (HDF5_ENABLE_USING_DMALLOC) #----------------------------------------------------------------------------- @@ -339,7 +339,7 @@ endif (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) if (HDF5_ENABLE_USING_MEMCHECKER) - set (H5_USING_MEMCHECKER 1) + set (H5_USING_MEMCHECKER 1) endif (HDF5_ENABLE_USING_MEMCHECKER) #----------------------------------------------------------------------------- @@ -347,9 +347,9 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) #----------------------------------------------------------------------------- option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) if (HDF5_ENABLE_DEPRECATED_SYMBOLS) - set (H5_NO_DEPRECATED_SYMBOLS 0) + set (H5_NO_DEPRECATED_SYMBOLS 0) else (HDF5_ENABLE_DEPRECATED_SYMBOLS) - set (H5_NO_DEPRECATED_SYMBOLS 1) + set (H5_NO_DEPRECATED_SYMBOLS 1) endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #----------------------------------------------------------------------------- @@ -413,24 +413,6 @@ else (CMAKE_BUILD_TYPE MATCHES Debug) endif (CMAKE_BUILD_TYPE MATCHES Debug) #----------------------------------------------------------------------------- -# Compiler specific flags : Shouldn't there be compiler tests for these -#----------------------------------------------------------------------------- -if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") - else (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") - endif (CMAKE_BUILD_TYPE MATCHES Debug) -endif (CMAKE_COMPILER_IS_GNUCC) -if (CMAKE_COMPILER_IS_GNUCXX) - if (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") - else (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") - endif (CMAKE_BUILD_TYPE MATCHES Debug) -endif (CMAKE_COMPILER_IS_GNUCXX) - -#----------------------------------------------------------------------------- # Option to embed library info into executables #----------------------------------------------------------------------------- option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) @@ -438,214 +420,7 @@ if (HDF5_ENABLE_EMBEDDED_LIBINFO) set (H5_HAVE_EMBEDDED_LIBINFO 1) endif (HDF5_ENABLE_EMBEDDED_LIBINFO) -#----------------------------------------------------------------------------- -# Option to allow the user to disable compiler warnings -#----------------------------------------------------------------------------- -option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) -if (HDF5_DISABLE_COMPILER_WARNINGS) - # MSVC uses /w to suppress warnings. It also complains if another - # warning level is given, so remove it. - 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") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") - endif (MSVC) - if (WIN32) - add_definitions (-D_CRT_SECURE_NO_WARNINGS) - endif (WIN32) - # Borland uses -w- to suppress warnings. - if (BORLAND) - set (HDF5_WARNINGS_BLOCKED 1) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") - endif (BORLAND) - - # Most compilers use -w to suppress warnings. - if (NOT HDF5_WARNINGS_BLOCKED) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - endif (NOT HDF5_WARNINGS_BLOCKED) -endif (HDF5_DISABLE_COMPILER_WARNINGS) - -#----------------------------------------------------------------------------- -# CDash is configured to only allow 3000 warnings, so -# break into groups (from the config/gnu-flags file) -#----------------------------------------------------------------------------- -if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) - if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") - else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") - endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") - - # Append warning flags from gcc-3.2* case - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #set (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") - - # Append warning flags from gcc-3.3* case - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") - - # Append warning flags from gcc-3.4* case - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") - - # Append more extra warning flags that only gcc4.0+ know about - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") - - # Append more extra warning flags that only gcc 4.1+ know about - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") - - # Append more extra warning flags that only gcc 4.2+ know about - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") - - # Append more extra warning flags that only gcc 4.4+ know about - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") - - # Append more extra warning flags that only gcc 4.5+ know about - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") - - # Append more extra warning flags that only gcc 4.6+ know about - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") - - # Append more extra warning flags that only gcc 4.7+ know about - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") -endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable all warnings -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) -if (HDF5_ENABLE_ALL_WARNINGS) - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") - else (MSVC) - if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") - endif (CMAKE_COMPILER_IS_GNUCC) - endif (MSVC) -endif (HDF5_ENABLE_ALL_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) -if (HDF5_ENABLE_GROUPZERO_WARNINGS) - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - else (MSVC) - if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") - endif (CMAKE_COMPILER_IS_GNUCC) - endif (MSVC) -endif (HDF5_ENABLE_GROUPZERO_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) -if (HDF5_ENABLE_GROUPONE_WARNINGS) - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - else (MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPONE_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) -if (HDF5_ENABLE_GROUPTWO_WARNINGS) - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - else (MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPTWO_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) -if (HDF5_ENABLE_GROUPTHREE_WARNINGS) - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - else (MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) -if (HDF5_ENABLE_GROUPFOUR_WARNINGS) - if (NOT MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) -if (HDF5_ENABLE_GROUPFIVE_WARNINGS) - if (NOT MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) - -#----------------------------------------------------------------------------- -# This is in here to help some of the GCC based IDES like Eclipse -# and code blocks parse the compiler errors and warnings better. -#----------------------------------------------------------------------------- -if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -endif (CMAKE_COMPILER_IS_GNUCC) -if (CMAKE_COMPILER_IS_GNUCXX) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -endif (CMAKE_COMPILER_IS_GNUCXX) +include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) #----------------------------------------------------------------------------- # All libs/tests/examples need the main include directories @@ -722,7 +497,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) endif (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - + if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) endif (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) @@ -730,7 +505,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Option to use threadsafe -# Note: Currently CMake only allows configuring of threadsafe on +# Note: Currently CMake only allows configuring of threadsafe on # non-Cygwin WINDOWS. #----------------------------------------------------------------------------- if (WIN32) @@ -764,7 +539,7 @@ endif (WIN32) # ----------------------------------------------------------------------- # wrapper script variables -# +# #set (CFLAGS "${C_DEFINES}") #set (CXXFLAGS "${CXX_DEFINES}") @@ -811,7 +586,7 @@ if (BUILD_TESTING) option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) mark_as_advanced (HDF5_TEST_FHEAP_VFD) endif (HDF5_TEST_VFD) - + include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) endif (BUILD_TESTING) @@ -871,7 +646,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for # ----------------------------------------------------------------------- # wrapper script variables - # + # # set (FCFLAGS "${Fortran_DEFINES}") add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) @@ -908,7 +683,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") #----------------------------------------------------------------------------- -# Check if Fortran's default real is double precision. If it is and HL is +# Check if Fortran's default real is double precision. If it is and HL is # being built then configure should fail due to bug HDFFV-889. #----------------------------------------------------------------------------- if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB ) diff --git a/MANIFEST b/MANIFEST index 68f95d0..3fd7242 100644 --- a/MANIFEST +++ b/MANIFEST @@ -13,7 +13,7 @@ # access to either file, you may request a copy from help@hdfgroup.org. # #------------------------------------------------------------------------------ -# This is the list of files that are part of HDF5 source distribution. +# This is the list of files that are part of HDF5 source distribution. # All files have a `./' prefix and appear in lexicographic order. # Lines that end with _DO_NOT_DISTRIBUTE_ will not be included in a # release. Blank lines and comments are ignored. Comments must start @@ -574,7 +574,7 @@ ./src/H5Bdbg.c ./src/H5Bpkg.h ./src/H5Bprivate.h -./src/H5Bpublic.h +./src/H5Bpublic.h ./src/H5B2.c ./src/H5B2cache.c ./src/H5B2dbg.c @@ -582,7 +582,7 @@ ./src/H5B2int.c ./src/H5B2pkg.h ./src/H5B2private.h -./src/H5B2public.h +./src/H5B2public.h ./src/H5B2stat.c ./src/H5B2test.c ./src/H5C.c @@ -736,7 +736,7 @@ ./src/H5HFman.c ./src/H5HFpkg.h ./src/H5HFprivate.h -./src/H5HFpublic.h +./src/H5HFpublic.h ./src/H5HFsection.c ./src/H5HFspace.c ./src/H5HFstat.c @@ -1429,8 +1429,8 @@ ./tools/testfiles/tattrintsize.ddl ./tools/testfiles/tattrintsize.h5 ./tools/testfiles/tattrreg.h5 -./tools/testfiles/tattrreg.ddl -./tools/testfiles/tattrregR.ddl +./tools/testfiles/tattrreg.ddl +./tools/testfiles/tattrregR.ddl ./tools/testfiles/tbigdims.ddl ./tools/testfiles/tbigdims.h5 ./tools/testfiles/tbinary.h5 @@ -1469,8 +1469,8 @@ ./tools/testfiles/tcompound2.h5 ./tools/testfiles/tcompound_complex.h5 ./tools/testfiles/tdatareg.h5 -./tools/testfiles/tdatareg.ddl -./tools/testfiles/tdataregR.ddl +./tools/testfiles/tdatareg.ddl +./tools/testfiles/tdataregR.ddl ./tools/testfiles/tdeflate.ddl ./tools/testfiles/tdset-1.ddl ./tools/testfiles/tdset-2.ddl @@ -2397,6 +2397,7 @@ ./config/cmake/H5pubconf.h.in ./config/cmake/hdf5-config.cmake.in ./config/cmake/hdf5-config-version.cmake.in +./config/cmake/HDFCompilerFlags.cmake ./config/cmake/HDF5Macros.cmake ./config/cmake/libhdf5.settings.cmake.in ./config/cmake/mccacheinit.cmake diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake new file mode 100644 index 0000000..6f37a48 --- /dev/null +++ b/config/cmake/HDFCompilerFlags.cmake @@ -0,0 +1,268 @@ +#----------------------------------------------------------------------------- +# Compiler specific flags : Shouldn't there be compiler tests for these +#----------------------------------------------------------------------------- +if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -ftrapv -fno-common") + else (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} -fstdarg-opt") + endif () + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99 -ftrapv -fno-common") + else (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") + endif () + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCXX) + +#----------------------------------------------------------------------------- +# Option to allow the user to disable compiler warnings +#----------------------------------------------------------------------------- +option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) +if (HDF5_DISABLE_COMPILER_WARNINGS) + # MSVC uses /w to suppress warnings. It also complains if another + # warning level is given, so remove it. + 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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") + endif (MSVC) + if (WIN32) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif (WIN32) + # Borland uses -w- to suppress warnings. + if (BORLAND) + set (HDF5_WARNINGS_BLOCKED 1) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") + endif (BORLAND) + + # Most compilers use -w to suppress warnings. + if (NOT HDF5_WARNINGS_BLOCKED) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif (NOT HDF5_WARNINGS_BLOCKED) +endif (HDF5_DISABLE_COMPILER_WARNINGS) + +#----------------------------------------------------------------------------- +# CDash is configured to only allow 3000 warnings, so +# break into groups (from the config/gnu-flags file) +#----------------------------------------------------------------------------- +if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") + else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") + endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + # Append warning flags + # Don't use the '-Wtraditional' flag, we're way past having K&R C code + # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") + # Don't use the '-Wtraditional-conversion' flag, there's too many warnings + # from GCC's assert macro + # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") + + # Append warning flags from gcc-3.2* case + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wunreachable-code") + endif() + + # Append warning flags from gcc-3.3* case + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") + + # Append warning flags from gcc-3.4* case + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + + # Append more extra warning flags that only gcc4.0+ know about + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + + # Append more extra warning flags that only gcc 4.1+ know about + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + + # Append more extra warning flags that only gcc 4.2+ know about + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + + # Append more extra warning flags that only gcc 4.4+ know about + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + + # Append more extra warning flags that only gcc 4.5+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + endif() + + # Append more extra warning flags that only gcc 4.6+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") + endif() + + # Append more extra warning flags that only gcc 4.7+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + endif() + + # Append more extra warning flags that only gcc 4.8+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wsuggest-attribute=format") + endif() + + # Append more extra warning flags that only gcc 4.9+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdate-time -Wopenmp-simd") + endif() + + # (There was no release of gcc 5.0) + + # Append more extra warning flags that only gcc 5.1+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) + set (H5_CFLAGS6 "${H5_CFLAGS6} -Warray-bounds=2 -Wc99-c11-compat") + endif() + +endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable all warnings +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) +if (HDF5_ENABLE_ALL_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + else (MSVC) + if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + endif (CMAKE_COMPILER_IS_GNUCC) + endif (MSVC) +endif (HDF5_ENABLE_ALL_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) +if (HDF5_ENABLE_GROUPZERO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + else (MSVC) + if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + endif (CMAKE_COMPILER_IS_GNUCC) + endif (MSVC) +endif (HDF5_ENABLE_GROUPZERO_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) +if (HDF5_ENABLE_GROUPONE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPONE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) +if (HDF5_ENABLE_GROUPTWO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTWO_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) +if (HDF5_ENABLE_GROUPTHREE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) +if (HDF5_ENABLE_GROUPFOUR_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) +if (HDF5_ENABLE_GROUPFIVE_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPSIX_WARNINGS "Enable group six warnings" OFF) +if (HDF5_ENABLE_GROUPSIX_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS6}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPSIX_WARNINGS) + +#----------------------------------------------------------------------------- +# This is in here to help some of the GCC based IDES like Eclipse +# and code blocks parse the compiler errors and warnings better. +#----------------------------------------------------------------------------- +if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCXX) -- cgit v0.12 From e81f0ade7781aec1960d50202fb838e300da0f96 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:21:58 -0500 Subject: [svn-r27066] Description: Protect gcc 5 debugging options Tested on: MacOSX/64 10.10.3 (amazon) w/gcc 5.1 --- config/gnu-flags | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/gnu-flags b/config/gnu-flags index ec7b9b2..5f10519 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -111,7 +111,14 @@ case "$cc_vendor-$cc_version" in PROD_CPPFLAGS= # Debug - DEBUG_CFLAGS="-Og -g -ftrapv -fno-common" + case "$cc_vendor-$cc_version" in + gcc-5.*) + DEBUG_CFLAGS="-Og -g -ftrapv -fno-common" + ;; + *) + DEBUG_CFLAGS="-g" + ;; + esac #DEBUG_CFLAGS="$DEBUG_CFLAGS -fsanitize=undefined" DEBUG_CPPFLAGS= -- cgit v0.12 From 3d5e75b0930bc87589727ce941e3e1f79a36bf20 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:33:12 -0500 Subject: [svn-r27068] Description: Clean up the H5A interface code, to better align with v3 metadata cache changes. Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel --- src/H5A.c | 292 ++++++++++++++++++++++++++++++++++++++++++++++++++--- src/H5Abtree2.c | 132 ++++++++++++------------ src/H5Adense.c | 2 +- src/H5Aint.c | 307 ++++---------------------------------------------------- src/H5Apkg.h | 7 +- 5 files changed, 370 insertions(+), 370 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index d474234..3b993ec 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -21,7 +21,7 @@ #define H5O_PACKAGE /*suppress error about including H5Opkg */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5A_init_interface +#define H5_INTERFACE_INIT_FUNC H5A__init_interface /***********/ @@ -63,6 +63,9 @@ typedef struct H5A_iter_cb1 { /* Local Prototypes */ /********************/ +static herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id); +static herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id); +static ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf); /*********************/ /* Package Variables */ @@ -125,9 +128,9 @@ done: /*-------------------------------------------------------------------------- NAME - H5A_init_interface -- Initialize interface-specific information + H5A__init_interface -- Initialize interface-specific information USAGE - herr_t H5A_init_interface() + herr_t H5A__init_interface() RETURNS Non-negative on success/Negative on failure @@ -136,11 +139,11 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5A_init_interface(void) +H5A__init_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Create attribute ID type. @@ -150,7 +153,7 @@ H5A_init_interface(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_init_interface() */ +} /* end H5A__init_interface() */ /*-------------------------------------------------------------------------- @@ -407,7 +410,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_id) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from object header for attribute: '%s'", attr_name) /* Finish initializing attribute */ - if(H5A_open_common(&loc, attr) < 0) + if(H5A__open_common(&loc, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize attribute") /* Register the attribute and get an ID for it */ @@ -595,7 +598,7 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") /* Go write the actual data to the attribute */ - if((ret_value = H5A_write(attr, mem_type, buf, H5AC_dxpl_id)) < 0) + if((ret_value = H5A__write(attr, mem_type, buf, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") done: @@ -605,6 +608,120 @@ done: /*-------------------------------------------------------------------------- NAME + H5A__write + PURPOSE + Actually write out data to an attribute + USAGE + herr_t H5A__write (attr, mem_type, buf) + H5A_t *attr; IN: Attribute to write + const H5T_t *mem_type; IN: Memory datatype of buffer + const void *buf; IN: Buffer of data to write + RETURNS + Non-negative on success/Negative on failure + + DESCRIPTION + This function writes a complete attribute to disk. +--------------------------------------------------------------------------*/ +static herr_t +H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) +{ + uint8_t *tconv_buf = NULL; /* datatype conv buffer */ + hbool_t tconv_owned = FALSE; /* Whether the datatype conv buffer is owned by attribute */ + uint8_t *bkg_buf = NULL; /* temp conversion buffer */ + hssize_t snelmts; /* elements in attribute */ + size_t nelmts; /* elements in attribute */ + H5T_path_t *tpath = NULL; /* conversion information*/ + hid_t src_id = -1, dst_id = -1;/* temporary type atoms */ + size_t src_type_size; /* size of source type */ + size_t dst_type_size; /* size of destination type*/ + size_t buf_size; /* desired buffer size */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, attr->oloc.addr, FAIL) + + HDassert(attr); + HDassert(mem_type); + HDassert(buf); + + /* Get # of elements for attribute's dataspace */ + if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); + + /* If there's actually data elements for the attribute, make a copy of the data passed in */ + if(nelmts > 0) { + /* Get the memory and file datatype sizes */ + src_type_size = H5T_GET_SIZE(mem_type); + dst_type_size = H5T_GET_SIZE(attr->shared->dt); + + /* Convert memory buffer into disk buffer */ + /* Set up type conversion function */ + if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt, NULL, NULL, dxpl_id, FALSE))) + HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") + + /* Check for type conversion required */ + if(!H5T_path_noop(tpath)) { + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") + + /* Get the maximum buffer size needed and allocate it */ + buf_size = nelmts * MAX(src_type_size, dst_type_size); + if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") + if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") + + /* Copy the user's data into the buffer for conversion */ + HDmemcpy(tconv_buf, buf, (src_type_size * nelmts)); + + /* Perform datatype conversion */ + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") + + /* Free the previous attribute data buffer, if there is one */ + if(attr->shared->data) + attr->shared->data = H5FL_BLK_FREE(attr_buf, attr->shared->data); + + /* Set the pointer to the attribute data to the converted information */ + attr->shared->data = tconv_buf; + tconv_owned = TRUE; + } /* end if */ + /* No type conversion necessary */ + else { + HDassert(dst_type_size == src_type_size); + + /* Allocate the attribute buffer, if there isn't one */ + if(attr->shared->data == NULL) + if(NULL == (attr->shared->data = H5FL_BLK_MALLOC(attr_buf, dst_type_size * nelmts))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Copy the attribute data into the user's buffer */ + HDmemcpy(attr->shared->data, buf, (dst_type_size * nelmts)); + } /* end else */ + + /* Modify the attribute in the object header */ + if(H5O_attr_write(&(attr->oloc), dxpl_id, attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") + } /* end if */ + +done: + /* Release resources */ + if(src_id >= 0 && H5I_dec_ref(src_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(tconv_buf && !tconv_owned) + tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); + if(bkg_buf) + bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); + + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) +} /* H5A__write() */ + + +/*-------------------------------------------------------------------------- + NAME H5Aread PURPOSE Read in data from an attribute @@ -638,7 +755,7 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") /* Go write the actual data to the attribute */ - if((ret_value = H5A_read(attr, mem_type, buf, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5A__read(attr, mem_type, buf, H5AC_ind_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") done: @@ -648,6 +765,109 @@ done: /*-------------------------------------------------------------------------- NAME + H5A__read + PURPOSE + Actually read in data from an attribute + USAGE + herr_t H5A__read (attr, mem_type, buf) + H5A_t *attr; IN: Attribute to read + const H5T_t *mem_type; IN: Memory datatype of buffer + void *buf; IN: Buffer for data to read + RETURNS + Non-negative on success/Negative on failure + + DESCRIPTION + This function reads a complete attribute from disk. +--------------------------------------------------------------------------*/ +static herr_t +H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) +{ + uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ + uint8_t *bkg_buf = NULL; /* background buffer */ + hssize_t snelmts; /* elements in attribute */ + size_t nelmts; /* elements in attribute*/ + H5T_path_t *tpath = NULL; /* type conversion info */ + hid_t src_id = -1, dst_id = -1;/* temporary type atoms*/ + size_t src_type_size; /* size of source type */ + size_t dst_type_size; /* size of destination type */ + size_t buf_size; /* desired buffer size */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(attr); + HDassert(mem_type); + HDassert(buf); + + /* Create buffer for data to store on disk */ + if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); + + if(nelmts > 0) { + /* Get the memory and file datatype sizes */ + src_type_size = H5T_GET_SIZE(attr->shared->dt); + dst_type_size = H5T_GET_SIZE(mem_type); + + /* Check if the attribute has any data yet, if not, fill with zeroes */ + if(attr->obj_opened && !attr->shared->data) + HDmemset(buf, 0, (dst_type_size * nelmts)); + else { /* Attribute exists and has a value */ + /* Convert memory buffer into disk buffer */ + /* Set up type conversion function */ + if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type, NULL, NULL, dxpl_id, FALSE))) + HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") + + /* Check for type conversion required */ + if(!H5T_path_noop(tpath)) { + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") + + /* Get the maximum buffer size needed and allocate it */ + buf_size = nelmts * MAX(src_type_size, dst_type_size); + if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") + if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Copy the attribute data into the buffer for conversion */ + HDmemcpy(tconv_buf, attr->shared->data, (src_type_size * nelmts)); + + /* Perform datatype conversion. */ + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") + + /* Copy the converted data into the user's buffer */ + HDmemcpy(buf, tconv_buf, (dst_type_size * nelmts)); + } /* end if */ + /* No type conversion necessary */ + else { + HDassert(dst_type_size == src_type_size); + + /* Copy the attribute data into the user's buffer */ + HDmemcpy(buf, attr->shared->data, (dst_type_size * nelmts)); + } /* end else */ + } /* end else */ + } /* end if */ + +done: + /* Release resources */ + if(src_id >= 0 && H5I_dec_ref(src_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(tconv_buf) + tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); + if(bkg_buf) + bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5A__read() */ + + +/*-------------------------------------------------------------------------- + NAME H5Aget_space PURPOSE Gets a copy of the dataspace for an attribute @@ -799,7 +1019,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer") /* Call private function in turn */ - if(0 > (ret_value = H5A_get_name(my_attr, buf_size, buf))) + if(0 > (ret_value = H5A__get_name(my_attr, buf_size, buf))) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get attribute name") done: @@ -807,6 +1027,52 @@ done: } /* H5Aget_name() */ +/*-------------------------------------------------------------------------- + NAME + H5A__get_name + PURPOSE + Private function for H5Aget_name. Gets a copy of the name for an + attribute + RETURNS + This function returns the length of the attribute's name (which may be + longer than 'buf_size') on success or negative for failure. + DESCRIPTION + This function retrieves the name of an attribute for an attribute ID. + Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string + terminator. If the name of the attribute is longer than 'buf_size'-1, + the string terminator is stored in the last position of the buffer to + properly terminate the string. +--------------------------------------------------------------------------*/ +static ssize_t +H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) +{ + size_t copy_len, nbytes; + ssize_t ret_value; + + FUNC_ENTER_STATIC_NOERR + + /* get the real attribute length */ + nbytes = HDstrlen(attr->shared->name); + HDassert((ssize_t)nbytes >= 0); /*overflow, pretty unlikely --rpm*/ + + /* compute the string length which will fit into the user's buffer */ + copy_len = MIN(buf_size - 1, nbytes); + + /* Copy all/some of the name */ + if(buf && copy_len > 0) { + HDmemcpy(buf, attr->shared->name, copy_len); + + /* Terminate the string */ + buf[copy_len]='\0'; + } /* end if */ + + /* Set return value */ + ret_value = (ssize_t)nbytes; + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5A_get_name() */ + + /*------------------------------------------------------------------------- * Function: H5Aget_name_by_idx * @@ -942,7 +1208,7 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") /* Get the attribute information */ - if(H5A_get_info(attr, ainfo) < 0) + if(H5A__get_info(attr, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info") done: @@ -996,7 +1262,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the attribute information */ - if(H5A_get_info(attr, ainfo) < 0) + if(H5A__get_info(attr, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info") done: @@ -1058,7 +1324,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the attribute information */ - if(H5A_get_info(attr, ainfo) < 0) + if(H5A__get_info(attr, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info") done: diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 9b7dba6..5e74e55 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -79,27 +79,27 @@ typedef struct H5A_fh_ud_cmp_t { /* v2 B-tree function callbacks */ /* v2 B-tree driver callbacks for 'creation order' index */ -static herr_t H5A_dense_btree2_corder_store(void *native, const void *udata); -static herr_t H5A_dense_btree2_corder_compare(const void *rec1, const void *rec2); -static herr_t H5A_dense_btree2_corder_encode(uint8_t *raw, const void *native, +static herr_t H5A__dense_btree2_corder_store(void *native, const void *udata); +static herr_t H5A__dense_btree2_corder_compare(const void *rec1, const void *rec2); +static herr_t H5A__dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5A_dense_btree2_corder_decode(const uint8_t *raw, void *native, +static herr_t H5A__dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5A_dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, +static herr_t H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, int indent, int fwidth, const void *record, const void *_udata); /* v2 B-tree driver callbacks for 'name' index */ -static herr_t H5A_dense_btree2_name_store(void *native, const void *udata); -static herr_t H5A_dense_btree2_name_compare(const void *rec1, const void *rec2); -static herr_t H5A_dense_btree2_name_encode(uint8_t *raw, const void *native, +static herr_t H5A__dense_btree2_name_store(void *native, const void *udata); +static herr_t H5A__dense_btree2_name_compare(const void *rec1, const void *rec2); +static herr_t H5A__dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5A_dense_btree2_name_decode(const uint8_t *raw, void *native, +static herr_t H5A__dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5A_dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, +static herr_t H5A__dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, int indent, int fwidth, const void *record, const void *_udata); /* Fractal heap function callbacks */ -static herr_t H5A_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); +static herr_t H5A__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); /*********************/ @@ -112,11 +112,11 @@ const H5B2_class_t H5A_BT2_NAME[1]={{ /* B-tree class information */ sizeof(H5A_dense_bt2_name_rec_t), /* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5A_dense_btree2_name_store, /* Record storage callback */ - H5A_dense_btree2_name_compare, /* Record comparison callback */ - H5A_dense_btree2_name_encode, /* Record encoding callback */ - H5A_dense_btree2_name_decode, /* Record decoding callback */ - H5A_dense_btree2_name_debug, /* Record debugging callback */ + H5A__dense_btree2_name_store, /* Record storage callback */ + H5A__dense_btree2_name_compare, /* Record comparison callback */ + H5A__dense_btree2_name_encode, /* Record encoding callback */ + H5A__dense_btree2_name_decode, /* Record decoding callback */ + H5A__dense_btree2_name_debug, /* Record debugging callback */ NULL, /* Create debugging context */ NULL /* Destroy debugging context */ }}; @@ -128,11 +128,11 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */ sizeof(H5A_dense_bt2_corder_rec_t),/* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5A_dense_btree2_corder_store, /* Record storage callback */ - H5A_dense_btree2_corder_compare, /* Record comparison callback */ - H5A_dense_btree2_corder_encode, /* Record encoding callback */ - H5A_dense_btree2_corder_decode, /* Record decoding callback */ - H5A_dense_btree2_corder_debug, /* Record debugging callback */ + H5A__dense_btree2_corder_store, /* Record storage callback */ + H5A__dense_btree2_corder_compare, /* Record comparison callback */ + H5A__dense_btree2_corder_encode, /* Record encoding callback */ + H5A__dense_btree2_corder_decode, /* Record decoding callback */ + H5A__dense_btree2_corder_debug, /* Record debugging callback */ NULL, /* Create debugging context */ NULL /* Destroy debugging context */ }}; @@ -150,7 +150,7 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */ /*------------------------------------------------------------------------- - * Function: H5A_dense_fh_name_cmp + * Function: H5A__dense_fh_name_cmp * * Purpose: Compares the name of a attribute in a fractal heap to another * name @@ -164,14 +164,14 @@ 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 UNUSED obj_len, void *_udata) +H5A__dense_fh_name_cmp(const void *obj, size_t UNUSED 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 */ hbool_t took_ownership = FALSE; /* Whether the "found" operator took ownership of the attribute */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + 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))) @@ -200,11 +200,11 @@ done: H5O_msg_free(H5O_ATTR_ID, attr); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_fh_name_cmp() */ +} /* end H5A__dense_fh_name_cmp() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_name_store + * Function: H5A__dense_btree2_name_store * * Purpose: Store user information into native record for v2 B-tree * @@ -217,12 +217,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_name_store(void *_nrecord, const void *_udata) +H5A__dense_btree2_name_store(void *_nrecord, const void *_udata) { const H5A_bt2_ud_ins_t *udata = (const H5A_bt2_ud_ins_t *)_udata; H5A_dense_bt2_name_rec_t *nrecord = (H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->id = udata->id; @@ -231,11 +231,11 @@ H5A_dense_btree2_name_store(void *_nrecord, const void *_udata) nrecord->hash = udata->common.name_hash; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_name_store() */ +} /* H5A__dense_btree2_name_store() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_name_compare + * Function: H5A__dense_btree2_name_compare * * Purpose: Compare two native information records, according to some key * @@ -249,13 +249,13 @@ H5A_dense_btree2_name_store(void *_nrecord, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) +H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) { const H5A_bt2_ud_common_t *bt2_udata = (const H5A_bt2_ud_common_t *)_bt2_udata; const H5A_dense_bt2_name_rec_t *bt2_rec = (const H5A_dense_bt2_name_rec_t *)_bt2_rec; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(bt2_udata); @@ -294,7 +294,7 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) HDassert(fheap); /* Check if the user's attribute and the B-tree's attribute have the same name */ - status = H5HF_op(fheap, bt2_udata->dxpl_id, &bt2_rec->id, H5A_dense_fh_name_cmp, &fh_udata); + status = H5HF_op(fheap, bt2_udata->dxpl_id, &bt2_rec->id, H5A__dense_fh_name_cmp, &fh_udata); HDassert(status >= 0); /* Callback will set comparison value */ @@ -302,11 +302,11 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) } /* end else */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_dense_btree2_name_compare() */ +} /* H5A__dense_btree2_name_compare() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_name_encode + * Function: H5A__dense_btree2_name_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -319,11 +319,11 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN); @@ -333,11 +333,11 @@ H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct UINT32ENCODE(raw, nrecord->hash) FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_name_encode() */ +} /* H5A__dense_btree2_name_encode() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_name_decode + * Function: H5A__dense_btree2_name_decode * * Purpose: Decode raw disk form of record into native form * @@ -350,11 +350,11 @@ H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) { H5A_dense_bt2_name_rec_t *nrecord = (H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN); @@ -364,11 +364,11 @@ H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct UINT32DECODE(raw, nrecord->hash) FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_name_decode() */ +} /* H5A__dense_btree2_name_decode() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_name_debug + * Function: H5A__dense_btree2_name_debug * * Purpose: Debug native form of record * @@ -381,23 +381,23 @@ H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5A__dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int indent, int fwidth, const void *_nrecord, const void UNUSED *_udata) { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u, %08lx}\n", indent, "", fwidth, "Record:", (hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder, (unsigned long)nrecord->hash); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_name_debug() */ +} /* H5A__dense_btree2_name_debug() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_corder_store + * Function: H5A__dense_btree2_corder_store * * Purpose: Store user information into native record for v2 B-tree * @@ -410,12 +410,12 @@ H5A_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dx *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_corder_store(void *_nrecord, const void *_udata) +H5A__dense_btree2_corder_store(void *_nrecord, const void *_udata) { const H5A_bt2_ud_ins_t *udata = (const H5A_bt2_ud_ins_t *)_udata; H5A_dense_bt2_corder_rec_t *nrecord = (H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->id = udata->id; @@ -423,11 +423,11 @@ H5A_dense_btree2_corder_store(void *_nrecord, const void *_udata) nrecord->corder = udata->common.corder; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_corder_store() */ +} /* H5A__dense_btree2_corder_store() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_corder_compare + * Function: H5A__dense_btree2_corder_compare * * Purpose: Compare two native information records, according to some key * @@ -441,13 +441,13 @@ H5A_dense_btree2_corder_store(void *_nrecord, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) +H5A__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) { const H5A_bt2_ud_common_t *bt2_udata = (const H5A_bt2_ud_common_t *)_bt2_udata; const H5A_dense_bt2_corder_rec_t *bt2_rec = (const H5A_dense_bt2_corder_rec_t *)_bt2_rec; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(bt2_udata); @@ -462,11 +462,11 @@ H5A_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) ret_value = 0; FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_dense_btree2_corder_compare() */ +} /* H5A__dense_btree2_corder_compare() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_corder_encode + * Function: H5A__dense_btree2_corder_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -479,11 +479,11 @@ H5A_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN); @@ -492,11 +492,11 @@ H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED * UINT32ENCODE(raw, nrecord->corder) FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_corder_encode() */ +} /* H5A__dense_btree2_corder_encode() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_corder_decode + * Function: H5A__dense_btree2_corder_decode * * Purpose: Decode raw disk form of record into native form * @@ -509,11 +509,11 @@ H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED * *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) { H5A_dense_bt2_corder_rec_t *nrecord = (H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN); @@ -522,11 +522,11 @@ H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED * UINT32DECODE(raw, nrecord->corder) FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_corder_decode() */ +} /* H5A__dense_btree2_corder_decode() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_btree2_corder_debug + * Function: H5A__dense_btree2_corder_debug * * Purpose: Debug native form of record * @@ -539,17 +539,17 @@ H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED * *------------------------------------------------------------------------- */ static herr_t -H5A_dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int indent, int fwidth, const void *_nrecord, const void UNUSED *_udata) { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u}\n", indent, "", fwidth, "Record:", (hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5A_dense_btree2_corder_debug() */ +} /* H5A__dense_btree2_corder_debug() */ diff --git a/src/H5Adense.c b/src/H5Adense.c index e0499f5..674ab5d 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -1082,7 +1082,7 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) H5A_info_t ainfo; /* Info for attribute */ /* Get the attribute information */ - if(H5A_get_info(fh_udata.attr, &ainfo) < 0) + if(H5A__get_info(fh_udata.attr, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5_ITER_ERROR, "unable to get attribute info") /* Make the application callback */ diff --git a/src/H5Aint.c b/src/H5Aint.c index bfc8eaf..84f7ecd 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -92,7 +92,7 @@ typedef struct { static herr_t H5A__compact_build_table_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/); -static herr_t H5A_dense_build_table_cb(const H5A_t *attr, void *_udata); +static herr_t H5A__dense_build_table_cb(const H5A_t *attr, void *_udata); static int H5A__attr_cmp_name_inc(const void *attr1, const void *attr2); static int H5A__attr_cmp_name_dec(const void *attr1, const void *attr2); static int H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2); @@ -283,13 +283,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_open_common + * Function: H5A__open_common * * Purpose: * Finishes initializing an attributes the open * * Usage: - * herr_t H5A_open_common(loc, name, dxpl_id) + * herr_t H5A__open_common(loc, name, dxpl_id) * const H5G_loc_t *loc; IN: Pointer to group location for object * H5A_t *attr; IN/OUT: Pointer to attribute to initialize * @@ -301,11 +301,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_open_common(const H5G_loc_t *loc, H5A_t *attr) +H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(loc); @@ -336,7 +336,7 @@ H5A_open_common(const H5G_loc_t *loc, H5A_t *attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_open_common() */ +} /* H5A__open_common() */ /*------------------------------------------------------------------------- @@ -383,7 +383,7 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to load attribute info from object header") /* Finish initializing attribute */ - if(H5A_open_common(&obj_loc, attr) < 0) + if(H5A__open_common(&obj_loc, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to initialize attribute") /* Set return value */ @@ -448,7 +448,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to load attribute info from object header") /* Finish initializing attribute */ - if(H5A_open_common(loc, attr) < 0) + if(H5A__open_common(loc, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to initialize attribute") /* Set return value */ @@ -468,223 +468,6 @@ done: } /* H5A_open_by_name() */ -/*-------------------------------------------------------------------------- - NAME - H5A_write - PURPOSE - Actually write out data to an attribute - USAGE - herr_t H5A_write (attr, mem_type, buf) - H5A_t *attr; IN: Attribute to write - const H5T_t *mem_type; IN: Memory datatype of buffer - const void *buf; IN: Buffer of data to write - RETURNS - Non-negative on success/Negative on failure - - DESCRIPTION - This function writes a complete attribute to disk. ---------------------------------------------------------------------------*/ -herr_t -H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) -{ - uint8_t *tconv_buf = NULL; /* datatype conv buffer */ - hbool_t tconv_owned = FALSE; /* Whether the datatype conv buffer is owned by attribute */ - uint8_t *bkg_buf = NULL; /* temp conversion buffer */ - hssize_t snelmts; /* elements in attribute */ - size_t nelmts; /* elements in attribute */ - H5T_path_t *tpath = NULL; /* conversion information*/ - hid_t src_id = -1, dst_id = -1;/* temporary type atoms */ - size_t src_type_size; /* size of source type */ - size_t dst_type_size; /* size of destination type*/ - size_t buf_size; /* desired buffer size */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, attr->oloc.addr, FAIL) - - HDassert(attr); - HDassert(mem_type); - HDassert(buf); - - /* Get # of elements for attribute's dataspace */ - if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); - - /* If there's actually data elements for the attribute, make a copy of the data passed in */ - if(nelmts > 0) { - /* Get the memory and file datatype sizes */ - src_type_size = H5T_GET_SIZE(mem_type); - dst_type_size = H5T_GET_SIZE(attr->shared->dt); - - /* Convert memory buffer into disk buffer */ - /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") - - /* Check for type conversion required */ - if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") - - /* Get the maximum buffer size needed and allocate it */ - buf_size = nelmts * MAX(src_type_size, dst_type_size); - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") - - /* Copy the user's data into the buffer for conversion */ - HDmemcpy(tconv_buf, buf, (src_type_size * nelmts)); - - /* Perform datatype conversion */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") - - /* Free the previous attribute data buffer, if there is one */ - if(attr->shared->data) - attr->shared->data = H5FL_BLK_FREE(attr_buf, attr->shared->data); - - /* Set the pointer to the attribute data to the converted information */ - attr->shared->data = tconv_buf; - tconv_owned = TRUE; - } /* end if */ - /* No type conversion necessary */ - else { - HDassert(dst_type_size == src_type_size); - - /* Allocate the attribute buffer, if there isn't one */ - if(attr->shared->data == NULL) - if(NULL == (attr->shared->data = H5FL_BLK_MALLOC(attr_buf, dst_type_size * nelmts))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Copy the attribute data into the user's buffer */ - HDmemcpy(attr->shared->data, buf, (dst_type_size * nelmts)); - } /* end else */ - - /* Modify the attribute in the object header */ - if(H5O_attr_write(&(attr->oloc), dxpl_id, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") - } /* end if */ - -done: - /* Release resources */ - if(src_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(tconv_buf && !tconv_owned) - tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); - if(bkg_buf) - bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* H5A_write() */ - - -/*-------------------------------------------------------------------------- - NAME - H5A_read - PURPOSE - Actually read in data from an attribute - USAGE - herr_t H5A_read (attr, mem_type, buf) - H5A_t *attr; IN: Attribute to read - const H5T_t *mem_type; IN: Memory datatype of buffer - void *buf; IN: Buffer for data to read - RETURNS - Non-negative on success/Negative on failure - - DESCRIPTION - This function reads a complete attribute from disk. ---------------------------------------------------------------------------*/ -herr_t -H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) -{ - uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ - uint8_t *bkg_buf = NULL; /* background buffer */ - hssize_t snelmts; /* elements in attribute */ - size_t nelmts; /* elements in attribute*/ - H5T_path_t *tpath = NULL; /* type conversion info */ - hid_t src_id = -1, dst_id = -1;/* temporary type atoms*/ - size_t src_type_size; /* size of source type */ - size_t dst_type_size; /* size of destination type */ - size_t buf_size; /* desired buffer size */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(attr); - HDassert(mem_type); - HDassert(buf); - - /* Create buffer for data to store on disk */ - if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); - - if(nelmts > 0) { - /* Get the memory and file datatype sizes */ - src_type_size = H5T_GET_SIZE(attr->shared->dt); - dst_type_size = H5T_GET_SIZE(mem_type); - - /* Check if the attribute has any data yet, if not, fill with zeroes */ - if(attr->obj_opened && !attr->shared->data) - HDmemset(buf, 0, (dst_type_size * nelmts)); - else { /* Attribute exists and has a value */ - /* Convert memory buffer into disk buffer */ - /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") - - /* Check for type conversion required */ - if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") - - /* Get the maximum buffer size needed and allocate it */ - buf_size = nelmts * MAX(src_type_size, dst_type_size); - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Copy the attribute data into the buffer for conversion */ - HDmemcpy(tconv_buf, attr->shared->data, (src_type_size * nelmts)); - - /* Perform datatype conversion. */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") - - /* Copy the converted data into the user's buffer */ - HDmemcpy(buf, tconv_buf, (dst_type_size * nelmts)); - } /* end if */ - /* No type conversion necessary */ - else { - HDassert(dst_type_size == src_type_size); - - /* Copy the attribute data into the user's buffer */ - HDmemcpy(buf, attr->shared->data, (dst_type_size * nelmts)); - } /* end else */ - } /* end else */ - } /* end if */ - -done: - /* Release resources */ - if(src_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(tconv_buf) - tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); - if(bkg_buf) - bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_read() */ - - /*------------------------------------------------------------------------- * Function: H5A_get_space * @@ -826,54 +609,8 @@ done: } /* end H5Aget_create_plist() */ -/*-------------------------------------------------------------------------- - NAME - H5A_get_name - PURPOSE - Private function for H5Aget_name. Gets a copy of the name for an - attribute - RETURNS - This function returns the length of the attribute's name (which may be - longer than 'buf_size') on success or negative for failure. - DESCRIPTION - This function retrieves the name of an attribute for an attribute ID. - Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string - terminator. If the name of the attribute is longer than 'buf_size'-1, - the string terminator is stored in the last position of the buffer to - properly terminate the string. ---------------------------------------------------------------------------*/ -ssize_t -H5A_get_name(H5A_t *attr, size_t buf_size, char *buf) -{ - size_t copy_len, nbytes; - ssize_t ret_value; - - FUNC_ENTER_NOAPI_NOERR - - /* get the real attribute length */ - nbytes = HDstrlen(attr->shared->name); - HDassert((ssize_t)nbytes >= 0); /*overflow, pretty unlikely --rpm*/ - - /* compute the string length which will fit into the user's buffer */ - copy_len = MIN(buf_size - 1, nbytes); - - /* Copy all/some of the name */ - if(buf && copy_len > 0) { - HDmemcpy(buf, attr->shared->name, copy_len); - - /* Terminate the string */ - buf[copy_len]='\0'; - } /* end if */ - - /* Set return value */ - ret_value = (ssize_t)nbytes; - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_get_name() */ - - /*------------------------------------------------------------------------- - * Function: H5A_get_info + * Function: H5A__get_info * * Purpose: Retrieve information about an attribute. * @@ -886,7 +623,7 @@ H5A_get_name(H5A_t *attr, size_t buf_size, char *buf) *------------------------------------------------------------------------- */ herr_t -H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo) +H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo) { FUNC_ENTER_NOAPI_NOERR @@ -907,7 +644,7 @@ H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo) } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5A_get_info() */ +} /* end H5A__get_info() */ /*------------------------------------------------------------------------- @@ -1347,7 +1084,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_build_table_cb + * Function: H5A__dense_build_table_cb * * Purpose: Callback routine for building table of attributes from dense * attribute storage. @@ -1362,12 +1099,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A_dense_build_table_cb(const H5A_t *attr, void *_udata) +H5A__dense_build_table_cb(const H5A_t *attr, void *_udata) { H5A_dense_bt_ud_t *udata = (H5A_dense_bt_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(attr); @@ -1387,7 +1124,7 @@ H5A_dense_build_table_cb(const H5A_t *attr, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_build_table_cb() */ +} /* end H5A__dense_build_table_cb() */ /*------------------------------------------------------------------------- @@ -1453,7 +1190,7 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, /* Build iterator operator */ attr_op.op_type = H5A_ATTR_OP_LIB; - attr_op.u.lib_op = H5A_dense_build_table_cb; + attr_op.u.lib_op = H5A__dense_build_table_cb; /* Iterate over the links in the group, building a table of the link messages */ if(H5A_dense_iterate(f, dxpl_id, (hid_t)0, ainfo, H5_INDEX_NAME, @@ -1689,7 +1426,7 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, H5A_info_t ainfo; /* Info for attribute */ /* Get the attribute information */ - if(H5A_get_info(atable->attrs[u], &ainfo) < 0) + if(H5A__get_info(atable->attrs[u], &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5_ITER_ERROR, "unable to get attribute info") /* Make the application callback */ @@ -2257,7 +1994,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_post_copy_file_cb + * Function: H5A__dense_post_copy_file_cb * * Purpose: Callback routine for copying a dense attribute from SRC to DST. * @@ -2271,13 +2008,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A_dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) +H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) { H5A_dense_file_cp_ud_t *udata = (H5A_dense_file_cp_ud_t *)_udata; H5A_t *attr_dst = NULL; herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(attr_src); @@ -2313,7 +2050,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close destination attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_post_copy_file_cb() */ +} /* end H5A__dense_post_copy_file_cb() */ /*------------------------------------------------------------------------- @@ -2354,7 +2091,7 @@ H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo udata.oloc_dst = dst_oloc; attr_op.op_type = H5A_ATTR_OP_LIB; - attr_op.u.lib_op = H5A_dense_post_copy_file_cb; + attr_op.u.lib_op = H5A__dense_post_copy_file_cb; if(H5A_dense_iterate(src_oloc->file, dxpl_id, (hid_t)0, ainfo_src, H5_INDEX_NAME, diff --git a/src/H5Apkg.h b/src/H5Apkg.h index f587f81..f656214 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -192,12 +192,9 @@ H5_DLL H5A_t *H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name, hid_t lapl_id, hid_t dxpl_id); H5_DLL H5A_t *H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5A_open_common(const H5G_loc_t *loc, H5A_t *attr); -H5_DLL herr_t H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id); -H5_DLL herr_t H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id); -H5_DLL ssize_t H5A_get_name(H5A_t *attr, size_t buf_size, char *buf); +H5_DLL herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr); H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr); -H5_DLL herr_t H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo); +H5_DLL herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo); H5_DLL hid_t H5A_get_type(H5A_t *attr); H5_DLL hid_t H5A_get_space(H5A_t *attr); H5_DLL hid_t H5A_get_create_plist(H5A_t* attr); -- cgit v0.12 From acdef5f665b210d39444d9b2c230419f99104524 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:38:35 -0500 Subject: [svn-r27070] Description: Clean up the H5B interface code, to better align with v3 metadata cache changes. Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel --- src/H5B.c | 110 ++++++++++++++++++++++++++++----------------------------- src/H5Bcache.c | 7 ++-- src/H5Bdbg.c | 8 ++--- src/H5Bpkg.h | 4 +-- 4 files changed, 65 insertions(+), 64 deletions(-) diff --git a/src/H5B.c b/src/H5B.c index 621209f..765a57e 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -134,7 +134,7 @@ typedef struct H5B_iter_ud_t { } H5B_info_ud_t; /* Convenience struct for the arguments needed to unprotect a b-tree after a - * call to H5B_iterate_helper() or H5B_split() */ + * call to H5B__iterate_helper() or H5B__split() */ typedef struct H5B_ins_ud_t { H5B_t *bt; /* B-tree */ haddr_t addr; /* B-tree address */ @@ -145,7 +145,7 @@ typedef struct H5B_ins_ud_t { /********************/ /* Local Prototypes */ /********************/ -static H5B_ins_t H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, +static H5B_ins_t H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8_t *lt_key, hbool_t *lt_key_changed, @@ -153,13 +153,13 @@ static H5B_ins_t H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, uint8_t *rt_key, hbool_t *rt_key_changed, H5B_ins_ud_t *split_bt_ud/*out*/); -static herr_t H5B_insert_child(H5B_t *bt, unsigned *bt_flags, +static herr_t H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key); -static herr_t H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, +static herr_t H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_t *split_bt_ud/*out*/); -static H5B_t * H5B_copy(const H5B_t *old_bt); +static H5B_t * H5B__copy(const H5B_t *old_bt); /*********************/ @@ -258,7 +258,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache") #ifdef H5B_DEBUG - H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); + H5B__assert(f, dxpl_id, *addr_p, shared->type, udata); #endif done: @@ -269,7 +269,7 @@ done: } /* end if */ if(bt) /* Destroy B-tree node */ - if(H5B_node_dest(bt) < 0) + if(H5B__node_dest(bt) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") } /* end if */ @@ -375,7 +375,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_split + * Function: H5B__split * * Purpose: Split a single node into two nodes. The old node will * contain the left children and the new node will contain the @@ -397,7 +397,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, +H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_t *split_bt_ud/*out*/) { H5P_genplist_t *dx_plist; /* Data transfer property list */ @@ -407,7 +407,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, double split_ratios[3]; /* B-tree split ratios */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -446,7 +446,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, side = "LEFT"; else side = "MIDDLE"; - fprintf(H5DEBUG(B), "H5B_split: %3u {%5.3f,%5.3f,%5.3f} %6s", + fprintf(H5DEBUG(B), "H5B__split: %3u {%5.3f,%5.3f,%5.3f} %6s", shared->two_k, split_ratios[0], split_ratios[1], split_ratios[2], side); } #endif @@ -539,7 +539,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_split() */ +} /* end H5B__split() */ /*------------------------------------------------------------------------- @@ -601,7 +601,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to locate root of B-tree") /* Insert the object */ - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &bt_ud, type, lt_key, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &bt_ud, type, lt_key, <_key_changed, md_key, udata, rt_key, &rt_key_changed, &split_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key") @@ -638,7 +638,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void */ /* Make a copy of the old root information */ - if(NULL == (new_root_bt = H5B_copy(bt_ud.bt))) + if(NULL == (new_root_bt = H5B__copy(bt_ud.bt))) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to copy old root") /* Unprotect the old root so we can move it. Also force it to be marked @@ -677,7 +677,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void done: if(ret_value < 0) - if(new_root_bt && H5B_node_dest(new_root_bt) < 0) + if(new_root_bt && H5B__node_dest(new_root_bt) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to free B-tree root node"); if(bt_ud.bt) @@ -690,7 +690,7 @@ done: #ifdef H5B_DEBUG if(ret_value >= 0) - H5B_assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, dxpl_id, addr, type, udata); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -698,7 +698,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_insert_child + * Function: H5B__insert_child * * Purpose: Insert a child to the left or right of child[IDX] depending * on whether ANCHOR is H5B_INS_LEFT or H5B_INS_RIGHT. The BT @@ -713,13 +713,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, +H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ uint8_t *base; /* Base offset for move */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(bt); HDassert(bt_flags); @@ -771,7 +771,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, /*------------------------------------------------------------------------- - * Function: H5B_insert_helper + * Function: H5B__insert_helper * * Purpose: Inserts the item UDATA into the tree rooted at ADDR and having * the specified type. @@ -802,7 +802,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, +H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8_t *lt_key, hbool_t *lt_key_changed, uint8_t *md_key, void *udata, @@ -820,7 +820,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, H5B_ins_t my_ins = H5B_INS_ERROR; H5B_ins_t ret_value = H5B_INS_ERROR; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments @@ -904,7 +904,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, H5B_NKEY(bt,shared,idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -950,7 +950,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -1005,7 +1005,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert subtree") @@ -1064,7 +1064,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * If this node is full then split it before inserting the new child. */ if(bt->nchildren == shared->two_k) { - if(H5B_split(f, dxpl_id, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) + if(H5B__split(f, dxpl_id, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node") if(idx < bt->nchildren) { tmp_bt = bt; @@ -1081,7 +1081,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, } /* end else */ /* Insert the child */ - if(H5B_insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0) + if(H5B__insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child") } /* end else-if */ @@ -1119,7 +1119,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_iterate_helper + * Function: H5B__iterate_helper * * Purpose: Calls the list callback for each leaf node of the * B-tree, passing it the caller's UDATA structure. @@ -1133,7 +1133,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1143,7 +1143,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add unsigned u; /* Local index variable */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1170,7 +1170,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add /* Iterate over node's children */ for(u = 0; u < bt->nchildren && ret_value == H5_ITER_CONT; u++) { if(bt->level > 0) - ret_value = H5B_iterate_helper(f, dxpl_id, type, bt->child[u], op, udata); + ret_value = H5B__iterate_helper(f, dxpl_id, type, bt->child[u], op, udata); else ret_value = (*op)(f, dxpl_id, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata); if(ret_value < 0) @@ -1182,7 +1182,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_iterate_helper() */ +} /* end H5B__iterate_helper() */ /*------------------------------------------------------------------------- @@ -1217,7 +1217,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HDassert(udata); /* Iterate over the B-tree records */ - if((ret_value = H5B_iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); FUNC_LEAVE_NOAPI(ret_value) @@ -1225,7 +1225,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, /*------------------------------------------------------------------------- - * Function: H5B_remove_helper + * Function: H5B__remove_helper * * Purpose: The recursive part of removing an item from a B-tree. The * sub B-tree that is being considered is located at ADDR and @@ -1249,7 +1249,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, +H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, int level, uint8_t *lt_key/*out*/, hbool_t *lt_key_changed/*out*/, void *udata, uint8_t *rt_key/*out*/, hbool_t *rt_key_changed/*out*/) @@ -1263,7 +1263,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type int cmp = 1; /* Key comparison value */ H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI(H5B_INS_ERROR) + FUNC_ENTER_STATIC HDassert(f); HDassert(H5F_addr_defined(addr)); @@ -1308,7 +1308,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDassert(idx < bt->nchildren); if(bt->level > 0) { /* We're at an internal node -- call recursively */ - if((int)(ret_value = H5B_remove_helper(f, dxpl_id, + if((int)(ret_value = H5B__remove_helper(f, dxpl_id, bt->child[idx], type, level + 1, H5B_NKEY(bt, shared, idx)/*out*/, lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/, rt_key_changed/*out*/)) < 0) @@ -1555,7 +1555,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_remove_helper() */ +} /* end H5B__remove_helper() */ /*------------------------------------------------------------------------- @@ -1594,12 +1594,12 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDassert(H5F_addr_defined(addr)); /* The actual removal */ - if(H5B_remove_helper(f, dxpl_id, addr, type, 0, lt_key, <_key_changed, + if(H5B__remove_helper(f, dxpl_id, addr, type, 0, lt_key, <_key_changed, udata, rt_key, &rt_key_changed) == H5B_INS_ERROR) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree") #ifdef H5B_DEBUG - H5B_assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, dxpl_id, addr, type, udata); #endif done: FUNC_LEAVE_NOAPI(ret_value) @@ -1789,7 +1789,7 @@ H5B_shared_free(void *_shared) /*------------------------------------------------------------------------- - * Function: H5B_copy + * Function: H5B__copy * * Purpose: Deep copies an existing H5B_t node. * @@ -1804,13 +1804,13 @@ H5B_shared_free(void *_shared) *------------------------------------------------------------------------- */ static H5B_t * -H5B_copy(const H5B_t *old_bt) +H5B__copy(const H5B_t *old_bt) { H5B_t *new_node = NULL; H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_t *ret_value; - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC /* * Check arguments. @@ -1853,11 +1853,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_copy() */ +} /* end H5B__copy() */ /*------------------------------------------------------------------------- - * Function: H5B_get_info_helper + * Function: H5B__get_info_helper * * Purpose: Walks the B-tree nodes, getting information for all of them. * @@ -1870,7 +1870,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, const H5B_info_ud_t *info_udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1883,7 +1883,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad haddr_t left_child; /* Address of left-most child in node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1951,7 +1951,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad /* Check for another "row" of B-tree nodes to iterate over */ if(level > 0) { /* Keep following the left-most child until we reach a leaf node. */ - if(H5B_get_info_helper(f, dxpl_id, type, left_child, info_udata) < 0) + if(H5B__get_info_helper(f, dxpl_id, type, left_child, info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to list B-tree node") } /* end if */ @@ -1960,7 +1960,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_get_info_helper() */ +} /* end H5B__get_info_helper() */ /*------------------------------------------------------------------------- @@ -2001,13 +2001,13 @@ H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, info_udata.udata = udata; /* Iterate over the B-tree nodes */ - if(H5B_get_info_helper(f, dxpl_id, type, addr, &info_udata) < 0) + if(H5B__get_info_helper(f, dxpl_id, type, addr, &info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADITER, FAIL, "B-tree iteration failed") /* Iterate over the B-tree records, making any "leaf" callbacks */ /* (Only if operator defined) */ if(op) - if((ret_value = H5B_iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); done: @@ -2072,7 +2072,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_node_dest + * Function: H5B__node_dest * * Purpose: Destroy/release a B-tree node * @@ -2086,9 +2086,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_node_dest(H5B_t *bt) +H5B__node_dest(H5B_t *bt) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* check arguments */ HDassert(bt); @@ -2100,5 +2100,5 @@ H5B_node_dest(H5B_t *bt) bt = H5FL_FREE(H5B_t, bt); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5B_node_dest() */ +} /* end H5B__node_dest() */ diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 2992986..07b594d 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -115,6 +115,7 @@ H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(H5F_addr_defined(addr)); HDassert(udata); + /* Allocate the B-tree node in memory */ if(NULL == (bt = H5FL_MALLOC(H5B_t))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate B-tree struct") HDmemset(&bt->cache_info, 0, sizeof(H5AC_info_t)); @@ -141,7 +142,7 @@ H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* magic number */ if(HDmemcmp(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree signature") + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature") p += 4; /* node type and level */ @@ -185,7 +186,7 @@ H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) done: if(!ret_value && bt) - if(H5B_node_dest(bt) < 0) + if(H5B__node_dest(bt) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -328,7 +329,7 @@ H5B__dest(H5F_t *f, H5B_t *bt) } /* end if */ /* Destroy B-tree node */ - if(H5B_node_dest(bt) < 0) + if(H5B__node_dest(bt) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") done: diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 3c81c26..526a647 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -156,7 +156,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_assert + * Function: H5B__assert * * Purpose: Verifies that the tree is structured correctly. * @@ -171,7 +171,7 @@ done: */ #ifdef H5B_DEBUG herr_t -H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void *udata) +H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void *udata) { H5B_t *bt = NULL; H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -189,7 +189,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void struct child_t *next; } *head = NULL, *tail = NULL, *prev = NULL, *cur = NULL, *tmp = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE if(0 == ncalls++) { if(H5DEBUG(B)) @@ -285,6 +285,6 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_assert() */ +} /* end H5B__assert() */ #endif /* H5B_DEBUG */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 598b122..374fcb5 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -88,9 +88,9 @@ H5FL_EXTERN(H5B_t); /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5B_node_dest(H5B_t *bt); +H5_DLL herr_t H5B__node_dest(H5B_t *bt); #ifdef H5B_DEBUG -herr_t H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, +herr_t H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void *udata); #endif -- cgit v0.12 From 775a54c19a86e0c0fcd3c5589d0248c015719250 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:46:00 -0500 Subject: [svn-r27071] Description: Clean up H5B2 interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux 2.6.* (jam) w/serial & parallel --- src/H5B2.c | 78 ++++---- src/H5B2cache.c | 40 ++-- src/H5B2dbg.c | 31 +-- src/H5B2hdr.c | 86 ++++----- src/H5B2int.c | 526 +++++++++++++++++++++++++-------------------------- src/H5B2pkg.h | 88 ++++----- src/H5B2stat.c | 2 +- src/H5B2test.c | 110 +++++------ tools/misc/h5debug.c | 6 +- 9 files changed, 485 insertions(+), 482 deletions(-) diff --git a/src/H5B2.c b/src/H5B2.c index 7d7345e..0c0f24f 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -146,7 +146,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat HDcompile_assert(H5B2_NUM_BTREE_ID == NELMTS(H5B2_client_class_g)); /* Create shared v2 B-tree header */ - if(HADDR_UNDEF == (hdr_addr = H5B2_hdr_create(f, dxpl_id, cparam, ctx_udata))) + if(HADDR_UNDEF == (hdr_addr = H5B2__hdr_create(f, dxpl_id, cparam, ctx_udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't create v2 B-tree header") /* Create v2 B-tree wrapper */ @@ -161,11 +161,11 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat /* Point v2 B-tree wrapper at header and bump it's ref count */ bt2->hdr = hdr; - if(H5B2_hdr_incr(bt2->hdr) < 0) + if(H5B2__hdr_incr(bt2->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment reference count on shared v2 B-tree header") /* Increment # of files using this v2 B-tree header */ - if(H5B2_hdr_fuse_incr(bt2->hdr) < 0) + if(H5B2__hdr_fuse_incr(bt2->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment file reference count on shared v2 B-tree header") /* Set file pointer for this v2 B-tree open context */ @@ -229,11 +229,11 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) /* Point v2 B-tree wrapper at header */ bt2->hdr = hdr; - if(H5B2_hdr_incr(bt2->hdr) < 0) + if(H5B2__hdr_incr(bt2->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment reference count on shared v2 B-tree header") /* Increment # of files using this v2 B-tree header */ - if(H5B2_hdr_fuse_incr(bt2->hdr) < 0) + if(H5B2__hdr_fuse_incr(bt2->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment file reference count on shared v2 B-tree header") /* Set file pointer for this v2 B-tree open context */ @@ -287,28 +287,28 @@ H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata) /* Check if the root node is allocated yet */ if(!H5F_addr_defined(hdr->root.addr)) { /* Create root node as leaf node in B-tree */ - if(H5B2_create_leaf(hdr, dxpl_id, &(hdr->root)) < 0) + if(H5B2__create_leaf(hdr, dxpl_id, &(hdr->root)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create root node") } /* end if */ /* Check if we need to split the root node (equiv. to a 1->2 node split) */ else if(hdr->root.node_nrec == hdr->node_info[hdr->depth].split_nrec) { /* Split root node */ - if(H5B2_split_root(hdr, dxpl_id) < 0) + if(H5B2__split_root(hdr, dxpl_id) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split root node") } /* end if */ /* Attempt to insert record into B-tree */ if(hdr->depth > 0) { - if(H5B2_insert_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, udata) < 0) + if(H5B2__insert_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node") } /* end if */ else { - if(H5B2_insert_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata) < 0) + if(H5B2__insert_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node") } /* end else */ /* Mark B-tree header as dirty */ - if(H5B2_hdr_dirty(hdr) < 0) + if(H5B2__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark B-tree header dirty") done: @@ -385,7 +385,7 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) /* Iterate through records */ if(hdr->root.node_nrec > 0) { /* Iterate through nodes */ - if((ret_value = H5B2_iterate_node(hdr, dxpl_id, hdr->depth, &hdr->root, op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, dxpl_id, hdr->depth, &hdr->root, op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); } /* end if */ @@ -422,7 +422,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ - unsigned depth; /* Current depth of the tree */ + uint16_t depth; /* Current depth of the tree */ int cmp; /* Comparison value of records */ unsigned idx; /* Location of record which matches key */ H5B2_nodepos_t curr_pos; /* Position of the current node */ @@ -479,11 +479,11 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Locate node pointer for child */ - cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); if(cmp > 0) idx++; @@ -542,11 +542,11 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate record */ - cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); if(cmp != 0) { /* Unlock leaf node */ @@ -622,7 +622,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ - unsigned depth; /* Current depth of the tree */ + uint16_t depth; /* Current depth of the tree */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -662,7 +662,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, unsigned u; /* Local index variable */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Search for record with correct index */ @@ -734,7 +734,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check index */ @@ -798,7 +798,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, if(hdr->depth > 0) { hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ - if(H5B2_remove_internal(hdr, dxpl_id, &depth_decreased, NULL, hdr->depth, + if(H5B2__remove_internal(hdr, dxpl_id, &depth_decreased, NULL, hdr->depth, &(hdr->cache_info), NULL, H5B2_POS_ROOT, &hdr->root, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") @@ -817,7 +817,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, } /* end for */ } /* end if */ else { - if(H5B2_remove_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata, op, op_data) < 0) + if(H5B2__remove_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -825,7 +825,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, hdr->root.all_nrec--; /* Mark B-tree header as dirty */ - if(H5B2_hdr_dirty(hdr) < 0) + if(H5B2__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark B-tree header dirty") done: @@ -880,7 +880,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, if(hdr->depth > 0) { hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ - if(H5B2_remove_internal_by_idx(hdr, dxpl_id, &depth_decreased, NULL, hdr->depth, + if(H5B2__remove_internal_by_idx(hdr, dxpl_id, &depth_decreased, NULL, hdr->depth, &(hdr->cache_info), NULL, &hdr->root, H5B2_POS_ROOT, idx, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") @@ -899,7 +899,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, } /* end for */ } /* end if */ else { - if(H5B2_remove_leaf_by_idx(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, (unsigned)idx, op, op_data) < 0) + if(H5B2__remove_leaf_by_idx(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, (unsigned)idx, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -907,7 +907,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hdr->root.all_nrec--; /* Mark B-tree header as dirty */ - if(H5B2_hdr_dirty(hdr) < 0) + if(H5B2__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark B-tree header dirty") done: @@ -994,11 +994,11 @@ H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, /* Attempt to find neighbor record in B-tree */ if(hdr->depth > 0) { - if(H5B2_neighbor_internal(hdr, dxpl_id, hdr->depth, &hdr->root, NULL, range, udata, op, op_data) < 0) + if(H5B2__neighbor_internal(hdr, dxpl_id, hdr->depth, &hdr->root, NULL, range, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree internal node") } /* end if */ else { - if(H5B2_neighbor_leaf(hdr, dxpl_id, &hdr->root, NULL, range, udata, op, op_data) < 0) + if(H5B2__neighbor_leaf(hdr, dxpl_id, &hdr->root, NULL, range, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree leaf node") } /* end else */ @@ -1034,7 +1034,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ H5B2_nodepos_t curr_pos; /* Position of current node */ - unsigned depth; /* Current depth of the tree */ + uint16_t depth; /* Current depth of the tree */ int cmp; /* Comparison value of records */ unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1070,11 +1070,11 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Locate node pointer for child */ - cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); if(cmp > 0) idx++; @@ -1142,11 +1142,11 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, hbool_t changed = FALSE;/* Whether the 'modify' callback changed the record */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate record */ - cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); if(cmp != 0) { /* Unlock leaf node */ @@ -1238,7 +1238,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) HDassert(bt2->f); /* Decrement file reference & check if this is the last open v2 B-tree using the shared B-tree header */ - if(0 == H5B2_hdr_fuse_decr(bt2->hdr)) { + if(0 == H5B2__hdr_fuse_decr(bt2->hdr)) { /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -1283,22 +1283,22 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) hdr->f = bt2->f; /* Decrement the reference count on the B-tree header */ - /* (don't put in H5B2_hdr_fuse_decr() as the B-tree header may be evicted + /* (don't put in H5B2__hdr_fuse_decr() as the B-tree header may be evicted * immediately -QAK) */ - if(H5B2_hdr_decr(bt2->hdr) < 0) + if(H5B2__hdr_decr(bt2->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement reference count on shared v2 B-tree header") /* Delete v2 B-tree, starting with header (unprotects header) */ - if(H5B2_hdr_delete(hdr, dxpl_id) < 0) + if(H5B2__hdr_delete(hdr, dxpl_id) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree") } /* end if */ else { /* Decrement the reference count on the B-tree header */ - /* (don't put in H5B2_hdr_fuse_decr() as the B-tree header may be evicted + /* (don't put in H5B2__hdr_fuse_decr() as the B-tree header may be evicted * immediately -QAK) */ - if(H5B2_hdr_decr(bt2->hdr) < 0) + if(H5B2__hdr_decr(bt2->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement reference count on shared v2 B-tree header") } /* end else */ @@ -1368,7 +1368,7 @@ HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); hdr->f = f; /* Delete v2 B-tree now, starting with header (unprotects header) */ - if(H5B2_hdr_delete(hdr, dxpl_id) < 0) + if(H5B2__hdr_delete(hdr, dxpl_id) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree") hdr = NULL; } /* end if */ diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 1e2a6a3..9e01c03 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -173,7 +173,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(udata); /* Allocate new B-tree header and reset cache info */ - if(NULL == (hdr = H5B2_hdr_alloc(udata->f))) + if(NULL == (hdr = H5B2__hdr_alloc(udata->f))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header") /* Wrap the local buffer for serialized header info */ @@ -238,7 +238,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Initialize B-tree header info */ cparam.cls = H5B2_client_class_g[id]; - if(H5B2_hdr_init(hdr, &cparam, udata->ctx_udata, depth) < 0) + if(H5B2__hdr_init(hdr, &cparam, udata->ctx_udata, depth) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't initialize B-tree header info") /* Set the B-tree header's address */ @@ -252,7 +252,7 @@ done: if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_BTREE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && hdr) - if(H5B2_hdr_free(hdr) < 0) + if(H5B2__hdr_free(hdr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, NULL, "can't release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -282,7 +282,7 @@ H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, FUNC_ENTER_STATIC - /* check arguments */ + /* Check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(hdr); @@ -399,7 +399,7 @@ H5B2__cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr) } /* end if */ /* Release B-tree header info */ - if(H5B2_hdr_free(hdr) < 0) + if(H5B2__hdr_free(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree header info") done: @@ -464,7 +464,7 @@ H5B2__cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ { FUNC_ENTER_STATIC_NOERR - /* check arguments */ + /* Check arguments */ HDassert(f); HDassert(hdr); HDassert(size_ptr); @@ -519,7 +519,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) udata->hdr->f = f; /* Increment ref. count on B-tree header */ - if(H5B2_hdr_incr(udata->hdr) < 0) + if(H5B2__hdr_incr(udata->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header") /* Share B-tree information */ @@ -601,7 +601,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) done: if(!ret_value && internal) - if(H5B2_internal_free(internal) < 0) + if(H5B2__internal_free(internal) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) @@ -628,7 +628,7 @@ H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t add FUNC_ENTER_STATIC - /* check arguments */ + /* Check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(internal); @@ -742,7 +742,7 @@ H5B2__cache_internal_dest(H5F_t *f, H5B2_internal_t *internal) } /* end if */ /* Release v2 b-tree internal node */ - if(H5B2_internal_free(internal) < 0) + if(H5B2__internal_free(internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree internal node") done: @@ -807,7 +807,7 @@ H5B2__cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal { FUNC_ENTER_STATIC_NOERR - /* check arguments */ + /* Check arguments */ HDassert(internal); HDassert(internal->hdr); HDassert(size_ptr); @@ -854,14 +854,14 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata /* Allocate new leaf node and reset cache info */ if(NULL == (leaf = H5FL_MALLOC(H5B2_leaf_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed") HDmemset(&leaf->cache_info, 0, sizeof(H5AC_info_t)); /* Set the B-tree header's file context for this operation */ udata->hdr->f = udata->f; /* Increment ref. count on B-tree header */ - if(H5B2_hdr_incr(udata->hdr) < 0) + if(H5B2__hdr_incr(udata->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header") /* Share B-tree header information */ @@ -875,12 +875,12 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata /* Magic number */ if(HDmemcmp(p, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node signature") + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature") p += H5_SIZEOF_MAGIC; /* Version */ if(*p++ != H5B2_LEAF_VERSION) - HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node version") + HGOTO_ERROR(H5E_BTREE, H5E_BADRANGE, NULL, "wrong B-tree leaf node version") /* B-tree type */ if(*p++ != (uint8_t)udata->hdr->cls->id) @@ -888,7 +888,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata /* Allocate space for the native keys in memory */ if(NULL == (leaf->leaf_native = (uint8_t *)H5FL_FAC_MALLOC(udata->hdr->node_info[0].nat_rec_fac))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree leaf native keys") + HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree leaf native keys") /* Set the number of records in the leaf */ leaf->nrec = udata->nrec; @@ -905,7 +905,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata native += udata->hdr->cls->nrec_size; } /* end for */ - /* Compute checksum on internal node */ + /* Compute checksum on leaf node */ computed_chksum = H5_checksum_metadata(udata->hdr->page, (size_t)(p - (const uint8_t *)udata->hdr->page), 0); /* Metadata checksum */ @@ -923,7 +923,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata done: if(!ret_value && leaf) - if(H5B2_leaf_free(leaf) < 0) + if(H5B2__leaf_free(leaf) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) @@ -950,7 +950,7 @@ H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H FUNC_ENTER_STATIC - /* check arguments */ + /* Check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(leaf); @@ -1050,7 +1050,7 @@ H5B2__cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf) } /* end if */ /* Destroy v2 b-tree leaf node */ - if(H5B2_leaf_free(leaf) < 0) + if(H5B2__leaf_free(leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") done: diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 3e5d55a..50283f8 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -74,7 +74,7 @@ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_debug + * Function: H5B2__hdr_debug * * Purpose: Prints debugging info about a B-tree header. * @@ -87,7 +87,7 @@ *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header info */ @@ -97,7 +97,7 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -185,11 +185,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_debug() */ +} /* end H5B2__hdr_debug() */ /*------------------------------------------------------------------------- - * Function: H5B2_int_debug + * Function: H5B2__int_debug * * Purpose: Prints debugging info about a B-tree internal node * @@ -202,7 +202,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ @@ -213,7 +213,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -251,7 +251,9 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, /* * Load the B-tree internal node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, addr, nrec, depth, H5AC_READ))) + H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); + H5_CHECK_OVERFLOW(depth, unsigned, uint16_t); + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, addr, (uint16_t)nrec, (uint16_t)depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Print opening message */ @@ -317,11 +319,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_int_debug() */ +} /* end H5B2__int_debug() */ /*------------------------------------------------------------------------- - * Function: H5B2_leaf_debug + * Function: H5B2__leaf_debug * * Purpose: Prints debugging info about a B-tree leaf node * @@ -334,7 +336,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ @@ -345,7 +347,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, char temp_str[128]; /* Temporary string, for formatting */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -383,7 +385,8 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, /* * Load the B-tree leaf node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, addr, nrec, H5AC_READ))) + H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, addr, (uint16_t)nrec, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Print opening message */ @@ -430,5 +433,5 @@ done: HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_leaf_debug() */ +} /* end H5B2__leaf_debug() */ diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index d28c263..97b979e 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -94,7 +94,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); /*------------------------------------------------------------------------- - * Function: H5B2_hdr_init + * Function: H5B2__hdr_init * * Purpose: Allocate & initialize B-tree header info * @@ -107,7 +107,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, +H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, uint16_t depth) { size_t sz_max_nrec; /* Temporary variable for range checking */ @@ -115,7 +115,7 @@ H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -215,15 +215,15 @@ HDmemset(hdr->page, 0, hdr->node_size); done: if(ret_value < 0) - if(H5B2_hdr_free(hdr) < 0) + if(H5B2__hdr_free(hdr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free shared v2 B-tree info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_init() */ +} /* end H5B2__hdr_init() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_alloc + * Function: H5B2__hdr_alloc * * Purpose: Allocate B-tree header * @@ -236,12 +236,12 @@ done: *------------------------------------------------------------------------- */ H5B2_hdr_t * -H5B2_hdr_alloc(H5F_t *f) +H5B2__hdr_alloc(H5F_t *f) { H5B2_hdr_t *hdr = NULL; /* v2 B-tree header */ H5B2_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -265,11 +265,11 @@ H5B2_hdr_alloc(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_alloc() */ +} /* end H5B2__hdr_alloc() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_create + * Function: H5B2__hdr_create * * Purpose: Create new fractal heap header * @@ -282,13 +282,13 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, +H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata) { H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -297,11 +297,11 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, HDassert(cparam); /* Allocate v2 B-tree header */ - if(NULL == (hdr = H5B2_hdr_alloc(f))) + if(NULL == (hdr = H5B2__hdr_alloc(f))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed for B-tree header") /* Initialize shared B-tree info */ - if(H5B2_hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0) + if(H5B2__hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info") /* Allocate space for the header on disk */ @@ -317,15 +317,15 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, done: if(!H5F_addr_defined(ret_value) && hdr) - if(H5B2_hdr_free(hdr) < 0) + if(H5B2__hdr_free(hdr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, HADDR_UNDEF, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_create() */ +} /* end H5B2__hdr_create() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_incr + * Function: H5B2__hdr_incr * * Purpose: Increment reference count on B-tree header * @@ -338,11 +338,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_incr(H5B2_hdr_t *hdr) +H5B2__hdr_incr(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(hdr); @@ -357,11 +357,11 @@ H5B2_hdr_incr(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_incr_hdr() */ +} /* end H5B2__hdr_incr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_decr + * Function: H5B2__hdr_decr * * Purpose: Decrement reference count on B-tree header * @@ -374,11 +374,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_decr(H5B2_hdr_t *hdr) +H5B2__hdr_decr(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -394,11 +394,11 @@ H5B2_hdr_decr(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_decr() */ +} /* end H5B2__hdr_decr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_fuse_incr + * Function: H5B2__hdr_fuse_incr * * Purpose: Increment file reference count on shared v2 B-tree header * @@ -411,7 +411,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) +H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -422,11 +422,11 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) hdr->file_rc++; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5B2_hdr_fuse_incr() */ +} /* end H5B2__hdr_fuse_incr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_fuse_decr + * Function: H5B2__hdr_fuse_decr * * Purpose: Decrement file reference count on shared v2 B-tree header * @@ -439,7 +439,7 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) *------------------------------------------------------------------------- */ size_t -H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr) +H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -451,11 +451,11 @@ H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr) hdr->file_rc--; FUNC_LEAVE_NOAPI(hdr->file_rc) -} /* end H5B2_hdr_fuse_decr() */ +} /* end H5B2__hdr_fuse_decr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_dirty + * Function: H5B2__hdr_dirty * * Purpose: Mark B-tree header as dirty * @@ -468,11 +468,11 @@ H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr) *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_dirty(H5B2_hdr_t *hdr) +H5B2__hdr_dirty(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -483,11 +483,11 @@ H5B2_hdr_dirty(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_dirty() */ +} /* end H5B2__hdr_dirty() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_free + * Function: H5B2__hdr_free * * Purpose: Free B-tree header info * @@ -500,11 +500,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_free(H5B2_hdr_t *hdr) +H5B2__hdr_free(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -557,11 +557,11 @@ H5B2_hdr_free(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_free() */ +} /* end H5B2__hdr_free() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_delete + * Function: H5B2__hdr_delete * * Purpose: Delete a v2 B-tree, starting with the header * @@ -574,12 +574,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) +H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) { unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting v2 B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -600,7 +600,7 @@ H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Delete all nodes in B-tree */ if(H5F_addr_defined(hdr->root.addr)) - if(H5B2_delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr->remove_op, hdr->remove_op_data) < 0) + if(H5B2__delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr->remove_op, hdr->remove_op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete B-tree nodes") /* Indicate that the heap header should be deleted & file space freed */ @@ -612,5 +612,5 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_delete() */ +} /* end H5B2__hdr_delete() */ diff --git a/src/H5B2int.c b/src/H5B2int.c index 310aef1..96636d5 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -61,29 +61,29 @@ /********************/ /* Helper functions */ -static herr_t H5B2_create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *node_ptr, unsigned depth); -static herr_t H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +static herr_t H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -static herr_t H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +static herr_t H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal, unsigned idx); -static herr_t H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +static herr_t H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -static herr_t H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +static herr_t H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -static herr_t H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +static herr_t H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -static herr_t H5B2_swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +static herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc); +static herr_t H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, + H5B2_node_ptr_t *node_ptr, uint16_t depth); #ifdef H5B2_DEBUG -static herr_t H5B2_assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf); -static herr_t H5B2_assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t *leaf2); -static herr_t H5B2_assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal); -static herr_t H5B2_assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2); +static herr_t H5B2__assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf); +static herr_t H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t *leaf2); +static herr_t H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal); +static herr_t H5B2__assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2); #endif /* H5B2_DEBUG */ /*********************/ @@ -112,7 +112,7 @@ H5FL_SEQ_EXTERN(H5B2_node_info_t); /*------------------------------------------------------------------------- - * Function: H5B2_locate_record + * Function: H5B2__locate_record * * Purpose: Performs a binary search to locate a record in a sorted * array of records. @@ -133,14 +133,14 @@ H5FL_SEQ_EXTERN(H5B2_node_info_t); *------------------------------------------------------------------------- */ int -H5B2_locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, +H5B2__locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, const uint8_t *native, const void *udata, unsigned *idx) { unsigned lo = 0, hi; /* Low & high index values */ unsigned my_idx = 0; /* Final index value */ int cmp = -1; /* Key comparison value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR hi = nrec; while(lo < hi && cmp) { @@ -154,11 +154,11 @@ H5B2_locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, *idx = my_idx; FUNC_LEAVE_NOAPI(cmp) -} /* end H5B2_locate_record */ +} /* end H5B2__locate_record */ /*------------------------------------------------------------------------- - * Function: H5B2_split1 + * Function: H5B2__split1 * * Purpose: Perform a 1->2 node split * @@ -172,7 +172,7 @@ H5B2_locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, *------------------------------------------------------------------------- */ static herr_t -H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { @@ -187,7 +187,7 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -206,7 +206,7 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Create new internal node */ internal->node_ptrs[idx + 1].all_nrec = internal->node_ptrs[idx + 1].node_nrec = 0; - if(H5B2_create_internal(hdr, dxpl_id, &(internal->node_ptrs[idx + 1]), (depth - 1)) < 0) + if(H5B2__create_internal(hdr, dxpl_id, &(internal->node_ptrs[idx + 1]), (uint16_t)(depth - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new internal node") /* Setup information for unlocking child nodes */ @@ -215,9 +215,9 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Protect both leaves */ - if(NULL == (left_int = H5B2_protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (left_int = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_int = H5B2_protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (right_int = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for child nodes */ @@ -235,7 +235,7 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Create new leaf node */ internal->node_ptrs[idx + 1].all_nrec = internal->node_ptrs[idx + 1].node_nrec = 0; - if(H5B2_create_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx + 1])) < 0) + if(H5B2__create_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx + 1])) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new leaf node") /* Setup information for unlocking child nodes */ @@ -244,9 +244,9 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Protect both leaves */ - if(NULL == (left_leaf = H5B2_protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2_protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -322,14 +322,14 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, *parent_cache_info_flags_ptr |= H5AC__DIRTIED_FLAG; #ifdef H5B2_DEBUG - H5B2_assert_internal((hsize_t)0, hdr, internal); + H5B2__assert_internal((hsize_t)0, hdr, internal); if(depth > 1) { - H5B2_assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)right_child); - H5B2_assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)left_child); + H5B2__assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)right_child); + H5B2__assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)left_child); } /* end if */ else { - H5B2_assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)right_child); - H5B2_assert_leaf(hdr, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf(hdr, (H5B2_leaf_t *)right_child); } /* end else */ #endif /* H5B2_DEBUG */ @@ -341,11 +341,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_split1() */ +} /* end H5B2__split1() */ /*------------------------------------------------------------------------- - * Function: H5B2_split_root + * Function: H5B2__split_root * * Purpose: Split the root node * @@ -359,7 +359,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) +H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) { H5B2_internal_t *new_root = NULL; /* Pointer to new root node */ unsigned new_root_flags = H5AC__NO_FLAGS_SET; /* Cache flags for new root node */ @@ -368,7 +368,7 @@ H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) unsigned u_max_nrec_size; /* Temporary variable for range checking */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -399,18 +399,18 @@ H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Create new internal node to use as root */ hdr->root.node_nrec = 0; - if(H5B2_create_internal(hdr, dxpl_id, &(hdr->root), hdr->depth) < 0) + if(H5B2__create_internal(hdr, dxpl_id, &(hdr->root), hdr->depth) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new internal node") /* Protect new root node */ - if(NULL == (new_root = H5B2_protect_internal(hdr, dxpl_id, hdr->root.addr, hdr->root.node_nrec, hdr->depth, H5AC_WRITE))) + if(NULL == (new_root = H5B2__protect_internal(hdr, dxpl_id, hdr->root.addr, hdr->root.node_nrec, hdr->depth, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set first node pointer in root node to old root node pointer info */ new_root->node_ptrs[0] = old_root_ptr; /* Split original root node */ - if(H5B2_split1(hdr, dxpl_id, hdr->depth, &(hdr->root), NULL, new_root, &new_root_flags, 0) < 0) + if(H5B2__split1(hdr, dxpl_id, hdr->depth, &(hdr->root), NULL, new_root, &new_root_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split old root node") done: @@ -419,11 +419,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_split_root() */ +} /* end H5B2__split_root() */ /*------------------------------------------------------------------------- - * Function: H5B2_redistribute2 + * Function: H5B2__redistribute2 * * Purpose: Redistribute records between two nodes * @@ -437,7 +437,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -450,7 +450,7 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -467,9 +467,9 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_internal = H5B2_protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_internal = H5B2_protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -492,9 +492,9 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_leaf = H5B2_protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2_protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -507,14 +507,14 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, } /* end else */ #ifdef H5B2_DEBUG - H5B2_assert_internal((hsize_t)0, hdr, internal); + H5B2__assert_internal((hsize_t)0, hdr, internal); if(depth > 1) { - H5B2_assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)right_child); - H5B2_assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)left_child); + H5B2__assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)right_child); + H5B2__assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)left_child); } /* end if */ else { - H5B2_assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)right_child); - H5B2_assert_leaf(hdr, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf(hdr, (H5B2_leaf_t *)right_child); } /* end else */ #endif /* H5B2_DEBUG */ @@ -627,14 +627,14 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, } /* end else */ #ifdef H5B2_DEBUG - H5B2_assert_internal((hsize_t)0, hdr, internal); + H5B2__assert_internal((hsize_t)0, hdr, internal); if(depth > 1) { - H5B2_assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)right_child); - H5B2_assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)left_child); + H5B2__assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)right_child); + H5B2__assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)left_child); } /* end if */ else { - H5B2_assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)right_child); - H5B2_assert_leaf(hdr, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf(hdr, (H5B2_leaf_t *)right_child); } /* end else */ #endif /* H5B2_DEBUG */ @@ -646,11 +646,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_redistribute2() */ +} /* end H5B2__redistribute2() */ /*------------------------------------------------------------------------- - * Function: H5B2_redistribute3 + * Function: H5B2__redistribute3 * * Purpose: Redistribute records between three nodes * @@ -664,7 +664,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ @@ -684,7 +684,7 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -704,11 +704,11 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_internal = H5B2_protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (middle_internal = H5B2_protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_internal = H5B2_protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for child nodes */ @@ -737,11 +737,11 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_leaf = H5B2_protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (middle_leaf = H5B2_protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2_protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for child nodes */ @@ -1009,17 +1009,17 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, } #endif /* QAK */ #ifdef H5B2_DEBUG - H5B2_assert_internal((hsize_t)0, hdr, internal); + H5B2__assert_internal((hsize_t)0, hdr, internal); if(depth > 1) { - H5B2_assert_internal2(internal->node_ptrs[idx - 1].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)middle_child); - H5B2_assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)middle_child, (H5B2_internal_t *)left_child); - H5B2_assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)middle_child, (H5B2_internal_t *)right_child); - H5B2_assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)middle_child); + H5B2__assert_internal2(internal->node_ptrs[idx - 1].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)middle_child); + H5B2__assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)middle_child, (H5B2_internal_t *)left_child); + H5B2__assert_internal2(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)middle_child, (H5B2_internal_t *)right_child); + H5B2__assert_internal2(internal->node_ptrs[idx + 1].all_nrec, hdr, (H5B2_internal_t *)right_child, (H5B2_internal_t *)middle_child); } /* end if */ else { - H5B2_assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)middle_child); - H5B2_assert_leaf2(hdr, (H5B2_leaf_t *)middle_child, (H5B2_leaf_t *)right_child); - H5B2_assert_leaf(hdr, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)middle_child); + H5B2__assert_leaf2(hdr, (H5B2_leaf_t *)middle_child, (H5B2_leaf_t *)right_child); + H5B2__assert_leaf(hdr, (H5B2_leaf_t *)right_child); } /* end else */ #endif /* H5B2_DEBUG */ @@ -1033,11 +1033,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_redistribute3() */ +} /* end H5B2__redistribute3() */ /*------------------------------------------------------------------------- - * Function: H5B2_merge2 + * Function: H5B2__merge2 * * Purpose: Perform a 2->1 node merge * @@ -1052,7 +1052,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { @@ -1065,7 +1065,7 @@ H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -1084,9 +1084,9 @@ H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_internal = H5B2_protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_internal = H5B2_protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for accessing child node information */ @@ -1109,9 +1109,9 @@ H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock left & right B-tree child nodes */ - if(NULL == (left_leaf = H5B2_protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2_protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for accessing child node information */ @@ -1169,11 +1169,11 @@ H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, *parent_cache_info_flags_ptr |= H5AC__DIRTIED_FLAG; #ifdef H5B2_DEBUG - H5B2_assert_internal((hsize_t)0, hdr, internal); + H5B2__assert_internal((hsize_t)0, hdr, internal); if(depth > 1) - H5B2_assert_internal(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child); + H5B2__assert_internal(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)left_child); else - H5B2_assert_leaf(hdr, (H5B2_leaf_t *)left_child); + H5B2__assert_leaf(hdr, (H5B2_leaf_t *)left_child); #endif /* H5B2_DEBUG */ done: @@ -1186,11 +1186,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_merge2() */ +} /* end H5B2__merge2() */ /*------------------------------------------------------------------------- - * Function: H5B2_merge3 + * Function: H5B2__merge3 * * Purpose: Perform a 3->2 node merge * @@ -1205,7 +1205,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { @@ -1225,7 +1225,7 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -1246,11 +1246,11 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_internal = H5B2_protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (middle_internal = H5B2_protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") - if(NULL == (right_internal = H5B2_protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for accessing child node information */ @@ -1279,11 +1279,11 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, right_addr = internal->node_ptrs[idx + 1].addr; /* Lock B-tree child nodes */ - if(NULL == (left_leaf = H5B2_protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC_WRITE))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, left_addr, internal->node_ptrs[idx - 1].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (middle_leaf = H5B2_protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, middle_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") - if(NULL == (right_leaf = H5B2_protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, right_addr, internal->node_ptrs[idx + 1].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for accessing child node information */ @@ -1391,14 +1391,14 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, *parent_cache_info_flags_ptr |= H5AC__DIRTIED_FLAG; #ifdef H5B2_DEBUG - H5B2_assert_internal((hsize_t)0, hdr, internal); + H5B2__assert_internal((hsize_t)0, hdr, internal); if(depth > 1) { - H5B2_assert_internal2(internal->node_ptrs[idx - 1].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)middle_child); - H5B2_assert_internal(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)middle_child); + H5B2__assert_internal2(internal->node_ptrs[idx - 1].all_nrec, hdr, (H5B2_internal_t *)left_child, (H5B2_internal_t *)middle_child); + H5B2__assert_internal(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)middle_child); } /* end if */ else { - H5B2_assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)middle_child); - H5B2_assert_leaf(hdr, (H5B2_leaf_t *)middle_child); + H5B2__assert_leaf2(hdr, (H5B2_leaf_t *)left_child, (H5B2_leaf_t *)middle_child); + H5B2__assert_leaf(hdr, (H5B2_leaf_t *)middle_child); } /* end else */ #endif /* H5B2_DEBUG */ @@ -1414,11 +1414,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_merge3() */ +} /* end H5B2__merge3() */ /*------------------------------------------------------------------------- - * Function: H5B2_swap_leaf + * Function: H5B2__swap_leaf * * Purpose: Swap a record in a node with a record in a leaf node * @@ -1433,7 +1433,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc) { @@ -1443,7 +1443,7 @@ H5B2_swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, uint8_t *child_native; /* Pointer to child's native records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -1460,7 +1460,7 @@ H5B2_swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, child_addr = internal->node_ptrs[idx].addr; /* Lock B-tree child nodes */ - if(NULL == (child_internal = H5B2_protect_internal(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE))) + if(NULL == (child_internal = H5B2__protect_internal(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, (uint16_t)(depth - 1), H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* More setup for accessing child node information */ @@ -1475,7 +1475,7 @@ H5B2_swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, child_addr = internal->node_ptrs[idx].addr; /* Lock B-tree child node */ - if(NULL == (child_leaf = H5B2_protect_leaf(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) + if(NULL == (child_leaf = H5B2__protect_leaf(hdr, dxpl_id, child_addr, internal->node_ptrs[idx].node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* More setup for accessing child node information */ @@ -1492,11 +1492,11 @@ H5B2_swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, *internal_flags_ptr |= H5AC__DIRTIED_FLAG; #ifdef H5B2_DEBUG - H5B2_assert_internal((hsize_t)0, hdr, internal); + H5B2__assert_internal((hsize_t)0, hdr, internal); if(depth > 1) - H5B2_assert_internal(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)child); + H5B2__assert_internal(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)child); else - H5B2_assert_leaf(hdr, (H5B2_leaf_t *)child); + H5B2__assert_leaf(hdr, (H5B2_leaf_t *)child); #endif /* H5B2_DEBUG */ done: @@ -1505,11 +1505,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_swap_leaf() */ +} /* end H5B2__swap_leaf() */ /*------------------------------------------------------------------------- - * Function: H5B2_insert_leaf + * Function: H5B2__insert_leaf * * Purpose: Adds a new record to a B-tree leaf node. * @@ -1522,7 +1522,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ @@ -1530,7 +1530,7 @@ H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -1538,7 +1538,7 @@ H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Must have a leaf node with enough space to insert a record now */ @@ -1553,7 +1553,7 @@ H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, idx = 0; else { /* Find correct location to insert this record */ - if((cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx)) == 0) + if((cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx)) == 0) HGOTO_ERROR(H5E_BTREE, H5E_EXISTS, FAIL, "record is already in B-tree") if(cmp > 0) idx++; @@ -1601,11 +1601,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_insert_leaf() */ +} /* H5B2__insert_leaf() */ /*------------------------------------------------------------------------- - * Function: H5B2_insert_internal + * Function: H5B2__insert_internal * * Purpose: Adds a new record to a B-tree node. * @@ -1618,7 +1618,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata) { @@ -1628,7 +1628,7 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_nodepos_t next_pos = H5B2_POS_MIDDLE; /* Position of node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -1637,7 +1637,7 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Split or redistribute child node pointers, if necessary */ @@ -1647,7 +1647,7 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, size_t split_nrec; /* Number of records to split node at */ /* Locate node pointer for child */ - if((cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx)) == 0) + if((cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx)) == 0) HGOTO_ERROR(H5E_BTREE, H5E_EXISTS, FAIL, "record is already in B-tree") if(cmp > 0) idx++; @@ -1668,22 +1668,22 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Attempt to redistribute records among children */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec < split_nrec)) { - if(H5B2_redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_split1(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec < split_nrec)) { - if(H5B2_redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_split1(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ @@ -1691,11 +1691,11 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec < split_nrec) || (internal->node_ptrs[idx - 1].node_nrec < split_nrec))) { - if(H5B2_redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_split1(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ @@ -1703,7 +1703,7 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Locate node pointer for child (after split/redistribute) */ /* Actually, this can be easily updated (for 2-node redistrib.) and shouldn't require re-searching */ - if((cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx)) == 0) + if((cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx)) == 0) HGOTO_ERROR(H5E_BTREE, H5E_EXISTS, FAIL, "record is already in B-tree") if(cmp > 0) idx++; @@ -1727,11 +1727,11 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Attempt to insert node */ if(depth > 1) { - if(H5B2_insert_internal(hdr, dxpl_id, (depth - 1), &internal_flags, &internal->node_ptrs[idx], next_pos, udata) < 0) + if(H5B2__insert_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], next_pos, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node") } /* end if */ else { - if(H5B2_insert_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], next_pos, udata) < 0) + if(H5B2__insert_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], next_pos, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node") } /* end else */ @@ -1747,11 +1747,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_insert_internal() */ +} /* H5B2__insert_internal() */ /*------------------------------------------------------------------------- - * Function: H5B2_create_leaf + * Function: H5B2__create_leaf * * Purpose: Creates empty leaf node of a B-tree and update node pointer * to point to it. @@ -1765,12 +1765,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr) +H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr) { H5B2_leaf_t *leaf = NULL; /* Pointer to new leaf node created */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -1784,7 +1784,7 @@ H5B2_create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr) HDmemset(&leaf->cache_info, 0, sizeof(H5AC_info_t)); /* Increment ref. count on B-tree header */ - if(H5B2_hdr_incr(hdr) < 0) + if(H5B2__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, FAIL, "can't increment ref. count on B-tree header") /* Share B-tree header information */ @@ -1811,16 +1811,16 @@ HDmemset(leaf->leaf_native, 0, hdr->cls->nrec_size * hdr->node_info[0].max_nrec) done: if(ret_value < 0) { if(leaf) - if(H5B2_leaf_free(leaf) < 0) + if(H5B2__leaf_free(leaf) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree leaf node") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_create_leaf() */ +} /* H5B2__create_leaf() */ /*------------------------------------------------------------------------- - * Function: H5B2_protect_leaf + * Function: H5B2__protect_leaf * * Purpose: "Protect" an leaf node in the metadata cache * @@ -1833,13 +1833,13 @@ done: *------------------------------------------------------------------------- */ H5B2_leaf_t * -H5B2_protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, unsigned nrec, +H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, uint16_t nrec, H5AC_protect_t rw) { H5B2_leaf_cache_ud_t udata; /* User-data for callback */ H5B2_leaf_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -1856,11 +1856,11 @@ H5B2_protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, unsigned nrec, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_protect_leaf() */ +} /* H5B2__protect_leaf() */ /*------------------------------------------------------------------------- - * Function: H5B2_create_internal + * Function: H5B2__create_internal * * Purpose: Creates empty internal node of a B-tree and update node pointer * to point to it. @@ -1874,13 +1874,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr, - unsigned depth) +H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr, + uint16_t depth) { H5B2_internal_t *internal = NULL; /* Pointer to new internal node created */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -1895,7 +1895,7 @@ H5B2_create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr, HDmemset(&internal->cache_info, 0, sizeof(H5AC_info_t)); /* Increment ref. count on B-tree header */ - if(H5B2_hdr_incr(hdr) < 0) + if(H5B2__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, FAIL, "can't increment ref. count on B-tree header") /* Share B-tree header information */ @@ -1917,7 +1917,7 @@ HDmemset(internal->node_ptrs, 0, sizeof(H5B2_node_ptr_t) * (hdr->node_info[depth /* Set number of records & depth of the node */ internal->nrec = 0; - internal->depth = (uint16_t)depth; + internal->depth = depth; /* Allocate space on disk for the internal node */ if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) @@ -1930,16 +1930,16 @@ HDmemset(internal->node_ptrs, 0, sizeof(H5B2_node_ptr_t) * (hdr->node_info[depth done: if(ret_value < 0) { if(internal) - if(H5B2_internal_free(internal) < 0) + if(H5B2__internal_free(internal) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree internal node") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_create_internal() */ +} /* H5B2__create_internal() */ /*------------------------------------------------------------------------- - * Function: H5B2_protect_internal + * Function: H5B2__protect_internal * * Purpose: "Protect" an internal node in the metadata cache * @@ -1952,13 +1952,13 @@ done: *------------------------------------------------------------------------- */ H5B2_internal_t * -H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, - unsigned nrec, unsigned depth, H5AC_protect_t rw) +H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, + uint16_t nrec, uint16_t depth, H5AC_protect_t rw) { H5B2_internal_cache_ud_t udata; /* User data to pass through to cache 'deserialize' callback */ H5B2_internal_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -1968,8 +1968,8 @@ H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, /* Set up user data for callback */ udata.f = hdr->f; udata.hdr = hdr; - H5_CHECKED_ASSIGN(udata.nrec, uint16_t, nrec, unsigned) - H5_CHECKED_ASSIGN(udata.depth, uint16_t, depth, unsigned) + udata.nrec = nrec; + udata.depth = depth; /* Protect the internal node */ if(NULL == (ret_value = (H5B2_internal_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_INT, addr, &udata, rw))) @@ -1977,11 +1977,11 @@ H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_protect_internal() */ +} /* H5B2__protect_internal() */ /*------------------------------------------------------------------------- - * Function: H5B2_iterate_node + * Function: H5B2__iterate_node * * Purpose: Iterate over all the records from a B-tree node, in "in-order" * order, making a callback for each record. @@ -1998,7 +1998,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, const H5B2_node_ptr_t *curr_node, H5B2_operator_t op, void *op_data) { const H5AC_class_t *curr_node_class = NULL; /* Pointer to current node's class info */ @@ -2009,7 +2009,7 @@ H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned u; /* Local index */ herr_t ret_value = H5_ITER_CONT; /* Iterator return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2021,7 +2021,7 @@ H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal; /* Pointer to internal node */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -2040,7 +2040,7 @@ H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -2065,7 +2065,7 @@ H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, for(u = 0; u < curr_node->node_nrec && !ret_value; u++) { /* Descend into child node, if current node is an internal node */ if(depth > 0) { - if((ret_value = H5B2_iterate_node(hdr, dxpl_id, (depth - 1), &(node_ptrs[u]), op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(node_ptrs[u]), op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); } /* end if */ @@ -2078,7 +2078,7 @@ H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Descend into last child node, if current node is an internal node */ if(!ret_value && depth > 0) { - if((ret_value = H5B2_iterate_node(hdr, dxpl_id, (depth - 1), &(node_ptrs[u]), op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(node_ptrs[u]), op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); } /* end if */ @@ -2090,11 +2090,11 @@ done: native = (uint8_t *)H5FL_FAC_FREE(hdr->node_info[depth].nat_rec_fac, native); FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_iterate_node() */ +} /* H5B2__iterate_node() */ /*------------------------------------------------------------------------- - * Function: H5B2_remove_leaf + * Function: H5B2__remove_leaf * * Purpose: Removes a record from a B-tree leaf node. * @@ -2107,7 +2107,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata, H5B2_remove_t op, void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ @@ -2116,7 +2116,7 @@ H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2125,7 +2125,7 @@ H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, /* Lock current B-tree node */ leaf_addr = curr_node_ptr->addr; - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check number of records */ @@ -2133,7 +2133,7 @@ H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, HDassert(leaf->nrec == curr_node_ptr->node_nrec); /* Find correct location to remove this record */ - if(H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx) != 0) + if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx) != 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "record is not in B-tree") /* Check for invalidating the min/max record for the tree */ @@ -2190,11 +2190,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_remove_leaf() */ +} /* H5B2__remove_leaf() */ /*------------------------------------------------------------------------- - * Function: H5B2_remove_internal + * Function: H5B2__remove_internal * * Purpose: Removes a record from a B-tree node. * @@ -2207,8 +2207,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, - void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info, +H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, + void *swap_loc, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data) { @@ -2223,7 +2223,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, hbool_t collapsed_root = FALSE; /* Whether the root was collapsed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2234,7 +2234,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Lock current B-tree node */ internal_addr = curr_node_ptr->addr; - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Determine the correct number of records to merge at */ @@ -2246,7 +2246,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, ((internal->node_ptrs[0].node_nrec + internal->node_ptrs[1].node_nrec) <= ((merge_nrec * 2) + 1))) { /* Merge children of root node */ - if(H5B2_merge2(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") @@ -2281,7 +2281,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, if(swap_loc) idx = 0; else { - cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); if(cmp >= 0) idx++; } /* end else */ @@ -2300,27 +2300,27 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* (NOTE: These 2-node redistributions should actually get the * record to promote from the node with more records. - QAK) */ - /* (NOTE: This code is the same in both H5B2_remove_internal() and - * H5B2_remove_internal_by_idx(), fix bugs in both places! - QAK) + /* (NOTE: This code is the same in both H5B2__remove_internal() and + * H5B2__remove_internal_by_idx(), fix bugs in both places! - QAK) */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec > merge_nrec)) { - if(H5B2_redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_merge2(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec > merge_nrec)) { - if(H5B2_redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_merge2(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ @@ -2328,11 +2328,11 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec > merge_nrec) || (internal->node_ptrs[idx - 1].node_nrec > merge_nrec))) { - if(H5B2_redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_merge3(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ @@ -2343,7 +2343,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, idx = 0; else { /* Actually, this can be easily updated (for 2-node redistrib.) and shouldn't require re-searching */ - cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); if(cmp >= 0) idx++; } /* end else */ @@ -2358,7 +2358,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Swap record to delete with record from leaf, if we are the last internal node */ if(swap_loc && depth == 1) - if(H5B2_swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) + if(H5B2__swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSWAP, FAIL, "Can't swap records in B-tree") /* Set pointers for advancing to child node */ @@ -2381,12 +2381,12 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Attempt to remove record from child node */ if(depth > 1) { - if(H5B2_remove_internal(hdr, dxpl_id, depth_decreased, swap_loc, depth - 1, + if(H5B2__remove_internal(hdr, dxpl_id, depth_decreased, swap_loc, (uint16_t)(depth - 1), new_cache_info, new_cache_info_flags_ptr, next_pos, new_node_ptr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") } /* end if */ else { - if(H5B2_remove_leaf(hdr, dxpl_id, new_node_ptr, next_pos, udata, op, op_data) < 0) + if(H5B2__remove_leaf(hdr, dxpl_id, new_node_ptr, next_pos, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -2398,7 +2398,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, internal_flags |= H5AC__DIRTIED_FLAG; #ifdef H5B2_DEBUG - H5B2_assert_internal((!collapsed_root ? (curr_node_ptr->all_nrec - 1) : new_node_ptr->all_nrec), hdr, internal); + H5B2__assert_internal((!collapsed_root ? (curr_node_ptr->all_nrec - 1) : new_node_ptr->all_nrec), hdr, internal); #endif /* H5B2_DEBUG */ done: @@ -2407,11 +2407,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_remove_internal() */ +} /* H5B2__remove_internal() */ /*------------------------------------------------------------------------- - * Function: H5B2_remove_leaf_by_idx + * Function: H5B2__remove_leaf_by_idx * * Purpose: Removes a record from a B-tree leaf node, according to the * offset in the B-tree records. @@ -2425,7 +2425,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, unsigned idx, H5B2_remove_t op, void *op_data) { @@ -2434,7 +2434,7 @@ H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned leaf_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting leaf node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2443,7 +2443,7 @@ H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Lock B-tree leaf node */ leaf_addr = curr_node_ptr->addr; - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, leaf_addr, curr_node_ptr->node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check number of records */ @@ -2505,11 +2505,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_remove_leaf_by_idx() */ +} /* H5B2__remove_leaf_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5B2_remove_internal_by_idx + * Function: H5B2__remove_internal_by_idx * * Purpose: Removes a record from a B-tree node, according to the offset * in the B-tree records @@ -2523,8 +2523,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - hbool_t *depth_decreased, void *swap_loc, unsigned depth, +H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, + hbool_t *depth_decreased, void *swap_loc, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, H5B2_remove_t op, void *op_data) @@ -2540,7 +2540,7 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t collapsed_root = FALSE; /* Whether the root was collapsed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2551,7 +2551,7 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Lock current B-tree node */ internal_addr = curr_node_ptr->addr; - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, internal_addr, curr_node_ptr->node_nrec, depth, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") HDassert(internal->nrec == curr_node_ptr->node_nrec); HDassert(depth == hdr->depth || internal->nrec > 1); @@ -2566,7 +2566,7 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, HDassert(depth == hdr->depth); /* Merge children of root node */ - if(H5B2_merge2(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") @@ -2643,27 +2643,27 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* (NOTE: These 2-node redistributions should actually get the * record to promote from the node with more records. - QAK) */ - /* (NOTE: This code is the same in both H5B2_remove_internal() and - * H5B2_remove_internal_by_idx(), fix bugs in both places! - QAK) + /* (NOTE: This code is the same in both H5B2__remove_internal() and + * H5B2__remove_internal_by_idx(), fix bugs in both places! - QAK) */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec > merge_nrec)) { - if(H5B2_redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_merge2(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec > merge_nrec)) { - if(H5B2_redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_merge2(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ @@ -2671,11 +2671,11 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec > merge_nrec) || (internal->node_ptrs[idx - 1].node_nrec > merge_nrec))) { - if(H5B2_redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2_merge3(hdr, dxpl_id, depth, curr_node_ptr, + if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ @@ -2730,7 +2730,7 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Swap record to delete with record from leaf, if we are the last internal node */ if(swap_loc && depth == 1) - if(H5B2_swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) + if(H5B2__swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSWAP, FAIL, "can't swap records in B-tree") /* Set pointers for advancing to child node */ @@ -2753,12 +2753,12 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Attempt to remove record from child node */ if(depth > 1) { - if(H5B2_remove_internal_by_idx(hdr, dxpl_id, depth_decreased, swap_loc, depth - 1, + if(H5B2__remove_internal_by_idx(hdr, dxpl_id, depth_decreased, swap_loc, (uint16_t)(depth - 1), new_cache_info, new_cache_info_flags_ptr, new_node_ptr, next_pos, n, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") } /* end if */ else { - if(H5B2_remove_leaf_by_idx(hdr, dxpl_id, new_node_ptr, next_pos, (unsigned)n, op, op_data) < 0) + if(H5B2__remove_leaf_by_idx(hdr, dxpl_id, new_node_ptr, next_pos, (unsigned)n, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -2770,7 +2770,7 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, internal_flags |= H5AC__DIRTIED_FLAG; #ifdef H5B2_DEBUG - H5B2_assert_internal((!collapsed_root ? (curr_node_ptr->all_nrec - 1) : new_node_ptr->all_nrec), hdr, internal); + H5B2__assert_internal((!collapsed_root ? (curr_node_ptr->all_nrec - 1) : new_node_ptr->all_nrec), hdr, internal); #endif /* H5B2_DEBUG */ done: @@ -2779,11 +2779,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_remove_internal_by_idx() */ +} /* H5B2__remove_internal_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5B2_neighbor_leaf + * Function: H5B2__neighbor_leaf * * Purpose: Locate a record relative to the specified information in a * B-tree leaf node and return that information by filling in @@ -2809,7 +2809,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *udata, H5B2_found_t op, void *op_data) { @@ -2818,7 +2818,7 @@ H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_pt int cmp = 0; /* Comparison value of records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2827,11 +2827,11 @@ H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_pt HDassert(op); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate node pointer for child */ - cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); if(cmp > 0) idx++; else @@ -2865,11 +2865,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_neighbor_leaf() */ +} /* H5B2__neighbor_leaf() */ /*------------------------------------------------------------------------- - * Function: H5B2_neighbor_internal + * Function: H5B2__neighbor_internal * * Purpose: Locate a record relative to the specified information in a * B-tree internal node and return that information by filling in @@ -2895,7 +2895,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *udata, H5B2_found_t op, void *op_data) { @@ -2904,7 +2904,7 @@ H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, int cmp = 0; /* Comparison value of records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2914,11 +2914,11 @@ H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, HDassert(op); /* Lock current B-tree node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, curr_node_ptr->node_nrec, depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Locate node pointer for child */ - cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); if(cmp > 0) idx++; @@ -2936,11 +2936,11 @@ H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Attempt to find neighboring record */ if(depth > 1) { - if(H5B2_neighbor_internal(hdr, dxpl_id, depth - 1, &internal->node_ptrs[idx], neighbor_loc, comp, udata, op, op_data) < 0) + if(H5B2__neighbor_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal->node_ptrs[idx], neighbor_loc, comp, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree internal node") } /* end if */ else { - if(H5B2_neighbor_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], neighbor_loc, comp, udata, op, op_data) < 0) + if(H5B2__neighbor_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], neighbor_loc, comp, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree leaf node") } /* end else */ @@ -2950,11 +2950,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_neighbor_internal() */ +} /* H5B2__neighbor_internal() */ /*------------------------------------------------------------------------- - * Function: H5B2_delete_node + * Function: H5B2__delete_node * * Purpose: Iterate over all the nodes in a B-tree node deleting them * after they no longer have any children @@ -2968,7 +2968,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, const H5B2_node_ptr_t *curr_node, H5B2_remove_t op, void *op_data) { const H5AC_class_t *curr_node_class = NULL; /* Pointer to current node's class info */ @@ -2976,7 +2976,7 @@ H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, uint8_t *native; /* Pointers to node's native records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -2987,7 +2987,7 @@ H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned u; /* Local index */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_WRITE))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -2997,14 +2997,14 @@ H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Descend into children */ for(u = 0; u < internal->nrec + (unsigned)1; u++) - if(H5B2_delete_node(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[u]), op, op_data) < 0) + if(H5B2__delete_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node descent failed") } /* end if */ else { H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC_WRITE))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -3031,11 +3031,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_delete_node() */ +} /* H5B2__delete_node() */ /*------------------------------------------------------------------------- - * Function: H5B2_node_size + * Function: H5B2__node_size * * Purpose: Iterate over all the records from a B-tree node, collecting * btree storage info. @@ -3048,13 +3048,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, const H5B2_node_ptr_t *curr_node, hsize_t *btree_size) { H5B2_internal_t *internal = NULL; /* Pointer to internal node */ herr_t ret_value = SUCCEED; /* Iterator return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(hdr); @@ -3063,7 +3063,7 @@ H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, HDassert(depth > 0); /* Lock the current B-tree node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Recursively descend into child nodes, if we are above the "twig" level in the B-tree */ @@ -3072,7 +3072,7 @@ H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Descend into children */ for(u = 0; u < internal->nrec + (unsigned)1; u++) - if(H5B2_node_size(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[u]), btree_size) < 0) + if(H5B2__node_size(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), btree_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ else /* depth is 1: count all the leaf nodes from this node */ @@ -3086,11 +3086,11 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_node_size() */ +} /* H5B2__node_size() */ /*------------------------------------------------------------------------- - * Function: H5B2_internal_free + * Function: H5B2__internal_free * * Purpose: Destroys a B-tree internal node in memory. * @@ -3103,11 +3103,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_internal_free(H5B2_internal_t *internal) +H5B2__internal_free(H5B2_internal_t *internal) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -3123,7 +3123,7 @@ H5B2_internal_free(H5B2_internal_t *internal) internal->node_ptrs = (H5B2_node_ptr_t *)H5FL_FAC_FREE(internal->hdr->node_info[internal->depth].node_ptr_fac, internal->node_ptrs); /* Decrement ref. count on B-tree header */ - if(H5B2_hdr_decr(internal->hdr) < 0) + if(H5B2__hdr_decr(internal->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement ref. count on B-tree header") /* Free B-tree internal node info */ @@ -3131,11 +3131,11 @@ H5B2_internal_free(H5B2_internal_t *internal) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_internal_free() */ +} /* end H5B2__internal_free() */ /*------------------------------------------------------------------------- - * Function: H5B2_leaf_free + * Function: H5B2__leaf_free * * Purpose: Destroys a B-tree leaf node in memory. * @@ -3148,11 +3148,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_leaf_free(H5B2_leaf_t *leaf) +H5B2__leaf_free(H5B2_leaf_t *leaf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -3164,7 +3164,7 @@ H5B2_leaf_free(H5B2_leaf_t *leaf) leaf->leaf_native = (uint8_t *)H5FL_FAC_FREE(leaf->hdr->node_info[0].nat_rec_fac, leaf->leaf_native); /* Decrement ref. count on B-tree header */ - if(H5B2_hdr_decr(leaf->hdr) < 0) + if(H5B2__hdr_decr(leaf->hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement ref. count on B-tree header") /* Free B-tree leaf node info */ @@ -3172,12 +3172,12 @@ H5B2_leaf_free(H5B2_leaf_t *leaf) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_leaf_free() */ +} /* end H5B2__leaf_free() */ #ifdef H5B2_DEBUG /*------------------------------------------------------------------------- - * Function: H5B2_assert_leaf + * Function: H5B2__assert_leaf * * Purpose: Verify than a leaf node is mostly sane * @@ -3190,17 +3190,17 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf) +H5B2__assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf) { /* General sanity checking on node */ HDassert(leaf->nrec <= hdr->node_info->split_nrec); return(0); -} /* end H5B2_assert_leaf() */ +} /* end H5B2__assert_leaf() */ /*------------------------------------------------------------------------- - * Function: H5B2_assert_leaf2 + * Function: H5B2__assert_leaf2 * * Purpose: Verify than a leaf node is mostly sane * @@ -3213,17 +3213,17 @@ H5B2_assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf) *------------------------------------------------------------------------- */ static herr_t -H5B2_assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t UNUSED *leaf2) +H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t UNUSED *leaf2) { /* General sanity checking on node */ HDassert(leaf->nrec <= hdr->node_info->split_nrec); return(0); -} /* end H5B2_assert_leaf2() */ +} /* end H5B2__assert_leaf2() */ /*------------------------------------------------------------------------- - * Function: H5B2_assert_internal + * Function: H5B2__assert_internal * * Purpose: Verify than an internal node is mostly sane * @@ -3236,7 +3236,7 @@ H5B2_assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_lea *------------------------------------------------------------------------- */ static herr_t -H5B2_assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal) +H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal) { hsize_t tot_all_nrec; /* Total number of records at or below this node */ uint16_t u, v; /* Local index variables */ @@ -3260,11 +3260,11 @@ H5B2_assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_ HDassert(tot_all_nrec == parent_all_nrec); return(0); -} /* end H5B2_assert_internal() */ +} /* end H5B2__assert_internal() */ /*------------------------------------------------------------------------- - * Function: H5B2_assert_internal2 + * Function: H5B2__assert_internal2 * * Purpose: Verify than internal nodes are mostly sane * @@ -3277,7 +3277,7 @@ H5B2_assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_ *------------------------------------------------------------------------- */ static herr_t -H5B2_assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2) +H5B2__assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2) { hsize_t tot_all_nrec; /* Total number of records at or below this node */ uint16_t u, v; /* Local index variables */ @@ -3303,6 +3303,6 @@ H5B2_assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2 HDassert(tot_all_nrec == parent_all_nrec); return(0); -} /* end H5B2_assert_internal2() */ +} /* end H5B2__assert_internal2() */ #endif /* H5B2_DEBUG */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 3ea9534..72476eb 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -228,15 +228,15 @@ typedef struct H5B2_hdr_cache_ud_t { typedef struct H5B2_internal_cache_ud_t { H5F_t *f; /* File that v2 b-tree header is within */ H5B2_hdr_t *hdr; /* v2 B-tree header */ - unsigned nrec; /* Number of records in node to load */ - unsigned depth; /* Depth of node to load */ + uint16_t nrec; /* Number of records in node to load */ + uint16_t depth; /* Depth of node to load */ } H5B2_internal_cache_ud_t; /* Callback info for loading a free space leaf node into the cache */ typedef struct H5B2_leaf_cache_ud_t { H5F_t *f; /* File that v2 b-tree header is within */ H5B2_hdr_t *hdr; /* v2 B-tree header */ - unsigned nrec; /* Number of records in node to load */ + uint16_t nrec; /* Number of records in node to load */ } H5B2_leaf_cache_ud_t; #ifdef H5B2_TESTING @@ -281,88 +281,88 @@ extern const H5B2_class_t *const H5B2_client_class_g[H5B2_NUM_BTREE_ID]; /******************************/ /* Routines for managing B-tree header info */ -H5_DLL H5B2_hdr_t *H5B2_hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, +H5_DLL H5B2_hdr_t *H5B2__hdr_alloc(H5F_t *f); +H5_DLL haddr_t H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata); -H5_DLL herr_t H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, +H5_DLL herr_t H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, uint16_t depth); -H5_DLL herr_t H5B2_hdr_incr(H5B2_hdr_t *hdr); -H5_DLL herr_t H5B2_hdr_decr(H5B2_hdr_t *hdr); -H5_DLL herr_t H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr); -H5_DLL size_t H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr); -H5_DLL herr_t H5B2_hdr_dirty(H5B2_hdr_t *hdr); -H5_DLL herr_t H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5B2__hdr_incr(H5B2_hdr_t *hdr); +H5_DLL herr_t H5B2__hdr_decr(H5B2_hdr_t *hdr); +H5_DLL herr_t H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr); +H5_DLL size_t H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr); +H5_DLL herr_t H5B2__hdr_dirty(H5B2_hdr_t *hdr); +H5_DLL herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id); /* Routines for operating on leaf nodes */ -H5B2_leaf_t *H5B2_protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, - unsigned nrec, H5AC_protect_t rw); +H5B2_leaf_t *H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, + uint16_t nrec, H5AC_protect_t rw); /* Routines for operating on internal nodes */ -H5_DLL H5B2_internal_t *H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - haddr_t addr, unsigned nrec, unsigned depth, H5AC_protect_t rw); +H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, + haddr_t addr, uint16_t nrec, uint16_t depth, H5AC_protect_t rw); /* Routines for allocating nodes */ -H5_DLL herr_t H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5B2_create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr); /* Routines for releasing structures */ -H5_DLL herr_t H5B2_hdr_free(H5B2_hdr_t *hdr); -H5_DLL herr_t H5B2_leaf_free(H5B2_leaf_t *l); -H5_DLL herr_t H5B2_internal_free(H5B2_internal_t *i); +H5_DLL herr_t H5B2__hdr_free(H5B2_hdr_t *hdr); +H5_DLL herr_t H5B2__leaf_free(H5B2_leaf_t *l); +H5_DLL herr_t H5B2__internal_free(H5B2_internal_t *i); /* Routines for inserting records */ -H5_DLL herr_t H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - unsigned depth, unsigned *parent_cache_info_flags_ptr, +H5_DLL herr_t H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, + uint16_t depth, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata); -H5_DLL herr_t H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata); /* Routines for iterating over nodes/records */ -H5_DLL herr_t H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5_DLL herr_t H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, const H5B2_node_ptr_t *curr_node, H5B2_operator_t op, void *op_data); -H5_DLL herr_t H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, - unsigned depth, const H5B2_node_ptr_t *curr_node, hsize_t *op_data); +H5_DLL herr_t H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, + uint16_t depth, const H5B2_node_ptr_t *curr_node, hsize_t *op_data); /* Routines for locating records */ -H5_DLL int H5B2_locate_record(const H5B2_class_t *type, unsigned nrec, +H5_DLL int H5B2__locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, const uint8_t *native, const void *udata, unsigned *idx); -H5_DLL herr_t H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - unsigned depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, +H5_DLL herr_t H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, + uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *udata, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *udata, H5B2_found_t op, void *op_data); /* Routines for removing records */ -H5_DLL herr_t H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - hbool_t *depth_decreased, void *swap_loc, unsigned depth, - H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, +H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, + hbool_t *depth_decreased, void *swap_loc, uint16_t depth, + H5AC_info_t *parent_cache_info, hbool_t *parent_cache_info_dirtied_ptr, H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - hbool_t *depth_decreased, void *swap_loc, unsigned depth, - H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, +H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, + hbool_t *depth_decreased, void *swap_loc, uint16_t depth, + H5AC_info_t *parent_cache_info, hbool_t *parent_cache_info_dirtied_ptr, + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t idx, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, unsigned idx, H5B2_remove_t op, void *op_data); /* Routines for deleting nodes */ -H5_DLL herr_t H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5_DLL herr_t H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, const H5B2_node_ptr_t *curr_node, H5B2_remove_t op, void *op_data); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t obj_addr); -H5_DLL herr_t H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr); -H5_DLL herr_t H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr); diff --git a/src/H5B2stat.c b/src/H5B2stat.c index 5d159ed..bdb4a1f 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -139,7 +139,7 @@ H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) *btree_size += hdr->node_size; else /* Iterate through nodes */ - if(H5B2_node_size(hdr, dxpl_id, hdr->depth, &hdr->root, btree_size) < 0) + if(H5B2__node_size(hdr, dxpl_id, hdr->depth, &hdr->root, btree_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ diff --git a/src/H5B2test.c b/src/H5B2test.c index 8507d6e..d3149a7 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -61,15 +61,15 @@ typedef struct H5B2_test_ctx_t { /* Local Prototypes */ /********************/ -static void *H5B2_test_crt_context(void *udata); -static herr_t H5B2_test_dst_context(void *ctx); -static herr_t H5B2_test_store(void *nrecord, const void *udata); -static herr_t H5B2_test_compare(const void *rec1, const void *rec2); -static herr_t H5B2_test_encode(uint8_t *raw, const void *nrecord, void *ctx); -static herr_t H5B2_test_decode(const uint8_t *raw, void *nrecord, void *ctx); -static herr_t H5B2_test_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, +static void *H5B2__test_crt_context(void *udata); +static herr_t H5B2__test_dst_context(void *ctx); +static herr_t H5B2__test_store(void *nrecord, const void *udata); +static herr_t H5B2__test_compare(const void *rec1, const void *rec2); +static herr_t H5B2__test_encode(uint8_t *raw, const void *nrecord, void *ctx); +static herr_t H5B2__test_decode(const uint8_t *raw, void *nrecord, void *ctx); +static herr_t H5B2__test_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, int indent, int fwidth, const void *record, const void *_udata); -static void *H5B2_test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr); +static void *H5B2__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr); /*********************/ @@ -80,15 +80,15 @@ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */ H5B2_TEST_ID, /* Type of B-tree */ "H5B2_TEST_ID", /* Name of B-tree class */ sizeof(hsize_t), /* Size of native record */ - H5B2_test_crt_context, /* Create client callback context */ - H5B2_test_dst_context, /* Destroy client callback context */ - H5B2_test_store, /* Record storage callback */ - H5B2_test_compare, /* Record comparison callback */ - H5B2_test_encode, /* Record encoding callback */ - H5B2_test_decode, /* Record decoding callback */ - H5B2_test_debug, /* Record debugging callback */ - H5B2_test_crt_dbg_context, /* Create debugging context */ - H5B2_test_dst_context /* Destroy debugging context */ + H5B2__test_crt_context, /* Create client callback context */ + H5B2__test_dst_context, /* Destroy client callback context */ + H5B2__test_store, /* Record storage callback */ + H5B2__test_compare, /* Record comparison callback */ + H5B2__test_encode, /* Record encoding callback */ + H5B2__test_decode, /* Record decoding callback */ + H5B2__test_debug, /* Record debugging callback */ + H5B2__test_crt_dbg_context, /* Create debugging context */ + H5B2__test_dst_context /* Destroy debugging context */ }}; @@ -107,7 +107,7 @@ H5FL_DEFINE_STATIC(H5B2_test_ctx_t); /*------------------------------------------------------------------------- - * Function: H5B2_test_crt_context + * Function: H5B2__test_crt_context * * Purpose: Create client callback context * @@ -120,13 +120,13 @@ H5FL_DEFINE_STATIC(H5B2_test_ctx_t); *------------------------------------------------------------------------- */ static void * -H5B2_test_crt_context(void *_f) +H5B2__test_crt_context(void *_f) { H5F_t *f = (H5F_t *)_f; /* User data for building callback context */ H5B2_test_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -143,11 +143,11 @@ H5B2_test_crt_context(void *_f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_test_crt_context() */ +} /* H5B2__test_crt_context() */ /*------------------------------------------------------------------------- - * Function: H5B2_test_dst_context + * Function: H5B2__test_dst_context * * Purpose: Destroy client callback context * @@ -160,11 +160,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_test_dst_context(void *_ctx) +H5B2__test_dst_context(void *_ctx) { H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(ctx); @@ -173,11 +173,11 @@ H5B2_test_dst_context(void *_ctx) ctx = H5FL_FREE(H5B2_test_ctx_t, ctx); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_test_dst_context() */ +} /* H5B2__test_dst_context() */ /*------------------------------------------------------------------------- - * Function: H5B2_test_store + * Function: H5B2__test_store * * Purpose: Store native information into record for B-tree * @@ -190,18 +190,18 @@ H5B2_test_dst_context(void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5B2_test_store(void *nrecord, const void *udata) +H5B2__test_store(void *nrecord, const void *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR *(hsize_t *)nrecord = *(const hsize_t *)udata; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_test_store() */ +} /* H5B2__test_store() */ /*------------------------------------------------------------------------- - * Function: H5B2_test_compare + * Function: H5B2__test_compare * * Purpose: Compare two native information records, according to some key * @@ -215,16 +215,16 @@ H5B2_test_store(void *nrecord, const void *udata) *------------------------------------------------------------------------- */ static herr_t -H5B2_test_compare(const void *rec1, const void *rec2) +H5B2__test_compare(const void *rec1, const void *rec2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI((herr_t)(*(const hssize_t *)rec1 - *(const hssize_t *)rec2)) -} /* H5B2_test_compare() */ +} /* H5B2__test_compare() */ /*------------------------------------------------------------------------- - * Function: H5B2_test_encode + * Function: H5B2__test_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -237,11 +237,11 @@ H5B2_test_compare(const void *rec1, const void *rec2) *------------------------------------------------------------------------- */ static herr_t -H5B2_test_encode(uint8_t *raw, const void *nrecord, void *_ctx) +H5B2__test_encode(uint8_t *raw, const void *nrecord, void *_ctx) { H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(ctx); @@ -249,11 +249,11 @@ H5B2_test_encode(uint8_t *raw, const void *nrecord, void *_ctx) H5F_ENCODE_LENGTH_LEN(raw, *(const hsize_t *)nrecord, ctx->sizeof_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_test_encode() */ +} /* H5B2__test_encode() */ /*------------------------------------------------------------------------- - * Function: H5B2_test_decode + * Function: H5B2__test_decode * * Purpose: Decode raw disk form of record into native form * @@ -266,11 +266,11 @@ H5B2_test_encode(uint8_t *raw, const void *nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5B2_test_decode(const uint8_t *raw, void *nrecord, void *_ctx) +H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx) { H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(ctx); @@ -278,11 +278,11 @@ H5B2_test_decode(const uint8_t *raw, void *nrecord, void *_ctx) H5F_DECODE_LENGTH_LEN(raw, *(hsize_t *)nrecord, ctx->sizeof_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_test_decode() */ +} /* H5B2__test_decode() */ /*------------------------------------------------------------------------- - * Function: H5B2_test_debug + * Function: H5B2__test_debug * * Purpose: Debug native form of record * @@ -295,11 +295,11 @@ H5B2_test_decode(const uint8_t *raw, void *nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5B2__test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int indent, int fwidth, const void *record, const void UNUSED *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert (record); @@ -307,11 +307,11 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, *(const hsize_t *)record); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_test_debug() */ +} /* H5B2__test_debug() */ /*------------------------------------------------------------------------- - * Function: H5B2_test_crt_dbg_context + * Function: H5B2__test_crt_dbg_context * * Purpose: Create context for debugging callback * @@ -324,12 +324,12 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, *------------------------------------------------------------------------- */ static void * -H5B2_test_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) +H5B2__test_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) { H5B2_test_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -346,7 +346,7 @@ H5B2_test_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_test_crt_dbg_context() */ +} /* H5B2__test_crt_dbg_context() */ /*------------------------------------------------------------------------- @@ -397,7 +397,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ - unsigned depth; /* Current depth of the tree */ + uint16_t depth; /* Current depth of the tree */ int cmp; /* Comparison value of records */ unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ @@ -430,11 +430,11 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Locate node pointer for child */ - cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); if(cmp > 0) idx++; @@ -470,11 +470,11 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate record */ - cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); + cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); /* Unlock current node */ if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) @@ -499,7 +499,7 @@ done: * * Purpose: Determine the depth of a node holding a record in the B-tree * - * Note: Just a simple wrapper around the H5B2_get_node_info_test() routine + * Note: Just a simple wrapper around the H5B2__get_node_info_test() routine * * Return: Success: non-negative depth of the node where the record * was found diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index ea7a9ca..87c112a 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -394,7 +394,7 @@ main(int argc, char *argv[]) const H5B2_class_t *cls = get_H5B2_class(sig); HDassert(cls); - status = H5B2_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, cls, (haddr_t)extra); + status = H5B2__hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, cls, (haddr_t)extra); } else if(!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -412,7 +412,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4); + status = H5B2__int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4); } else if(!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -429,7 +429,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2_leaf_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3); + status = H5B2__leaf_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3); } else if(!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* -- cgit v0.12 From 7206d78c523553b6192ac7d6befd54656d070130 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:48:50 -0500 Subject: [svn-r27072] Description: Clean up H5B interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5ACprivate.h | 50 ++----- src/H5C.c | 385 ++++++++++++++++++++---------------------------------- src/H5Cpkg.h | 34 ++--- src/H5Cprivate.h | 52 ++++---- 4 files changed, 203 insertions(+), 318 deletions(-) diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 0a958b0..cf4c122 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -340,7 +340,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id; H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, - unsigned * status_ptr); + unsigned *status_ptr); H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); H5_DLL herr_t H5AC_pin_protected_entry(void *thing); @@ -350,57 +350,35 @@ H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5AC_unpin_entry(void *thing); H5_DLL herr_t H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, - const H5AC_class_t *type, haddr_t addr, - void *thing, unsigned flags); +H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, + haddr_t addr, void *thing, unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5AC_mark_entry_dirty(void *thing); H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, - haddr_t old_addr, haddr_t new_addr); - + haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id); - H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, - const H5AC_class_t *type, haddr_t addr, - unsigned flags); - + const H5AC_class_t *type, haddr_t addr, unsigned flags); H5_DLL herr_t H5AC_set_sync_point_done_callback(H5C_t *cache_ptr, void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl)); - H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)); H5_DLL herr_t H5AC_stats(const H5F_t *f); - H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); - H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, - H5AC_cache_config_t *config_ptr); - -H5_DLL herr_t H5AC_get_cache_size(H5AC_t * cache_ptr, - size_t * max_size_ptr, - size_t * min_clean_size_ptr, - size_t * cur_size_ptr, - int32_t * cur_num_entries_ptr); - -H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, - double * hit_rate_ptr); - -H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr); - + H5AC_cache_config_t *config_ptr); +H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, + size_t *min_clean_size_ptr, size_t *cur_size_ptr, int32_t *cur_num_entries_ptr); +H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr); +H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr); H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, - H5AC_cache_config_t *config_ptr); - -H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr); - -H5_DLL herr_t H5AC_close_trace_file( H5AC_t * cache_ptr); - -H5_DLL herr_t H5AC_open_trace_file(H5AC_t * cache_ptr, - const char * trace_file_name); + H5AC_cache_config_t *config_ptr); +H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); +H5_DLL herr_t H5AC_close_trace_file(H5AC_t *cache_ptr); +H5_DLL herr_t H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name); H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag); - H5_DLL herr_t H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag); - H5_DLL herr_t H5AC_ignore_tags(H5F_t * f); #ifdef H5_HAVE_PARALLEL diff --git a/src/H5C.c b/src/H5C.c index a28364a..3f11493 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -229,6 +229,8 @@ const H5C_class_t epoch_marker_class = /* size = */ &H5C_epoch_marker_size }; + + /*************************************************************************** * Class functions for H5C__EPOCH_MAKER_TYPE: * @@ -255,6 +257,8 @@ done: FUNC_LEAVE_NOAPI(ret_value) } + + static herr_t H5C_epoch_marker_flush(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, @@ -274,6 +278,8 @@ done: FUNC_LEAVE_NOAPI(ret_value) } + + static herr_t H5C_epoch_marker_dest(H5F_t UNUSED * f, void UNUSED * thing) @@ -784,7 +790,7 @@ H5C_apply_candidate_list(H5F_t * f, entries_flushed++; #if ( H5C_APPLY_CANDIDATE_LIST__DEBUG > 1 ) - HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank, + HDfprintf(stdout, "%s:%d: flushing 0x%llx.\n", FUNC, mpi_rank, (long long)flush_ptr->addr); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ @@ -1604,48 +1610,38 @@ H5C_expunge_entry(H5F_t * f, FUNC_ENTER_NOAPI(FAIL) - HDassert( f ); - HDassert( f->shared ); + HDassert(f); + HDassert(f->shared); cache_ptr = f->shared->cache; - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( type ); - HDassert( type->clear ); - HDassert( type->dest ); - HDassert( H5F_addr_defined(addr) ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(type); + HDassert(type->clear); + HDassert(type->dest); + HDassert(H5F_addr_defined(addr)); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( H5C_validate_lru_list(cache_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "LRU extreme sanity check failed on entry.\n"); - } + if(H5C_validate_lru_list(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "LRU extreme sanity check failed on entry.\n"); #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + /* Look for entry in cache */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - - if ( ( entry_ptr == NULL ) || ( entry_ptr->type != type ) ) { - + if((entry_ptr == NULL) || (entry_ptr->type != type)) /* the target doesn't exist in the cache, so we are done. */ HGOTO_DONE(SUCCEED) - } - - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->type == type ); - - if ( entry_ptr->is_protected ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \ - "Target entry is protected.") - } - if ( entry_ptr->is_pinned ) { + HDassert(entry_ptr->addr == addr); + HDassert(entry_ptr->type == type); - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \ - "Target entry is pinned.") - } + /* Check for entry being pinned or protected */ + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is protected.") + if(entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is pinned.") /* Pass along 'free file space' flag to cache client */ entry_ptr->free_file_space_on_destroy = ( (flags & H5C__FREE_FILE_SPACE_FLAG) != 0 ); @@ -1670,17 +1666,13 @@ H5C_expunge_entry(H5F_t * f, } done: - #if H5C_DO_EXTREME_SANITY_CHECKS - if ( H5C_validate_lru_list(cache_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "LRU extreme sanity check failed on exit.\n"); - } + if(H5C_validate_lru_list(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "LRU extreme sanity check failed on exit.\n"); #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_expunge_entry() */ @@ -1965,8 +1957,8 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign FALSE); if ( status < 0 ) { - /* This shouldn't happen -- if it does, we are toast - * so just scream and die. + /* This shouldn't happen -- if it does, + * we are toast so just scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "dirty pinned entry flush failed.") @@ -1983,7 +1975,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign * aren't trying to do a destroy here, so that * is not an issue. */ - if(entry_ptr->flush_dep_height == curr_flush_dep_height ){ + if(entry_ptr->flush_dep_height == curr_flush_dep_height ) { #if H5C_DO_SANITY_CHECKS flushed_entries_count++; flushed_entries_size += entry_ptr->size; @@ -1998,8 +1990,8 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign FALSE); if ( status < 0 ) { - /* This shouldn't happen -- if it does, we are - * toast so just scream and die. + /* This shouldn't happen -- if it does, + * we are toast so just scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "Can't flush entry.") @@ -2111,7 +2103,7 @@ H5C_flush_to_min_clean(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id) { - H5C_t * cache_ptr; + H5C_t * cache_ptr; herr_t result; hbool_t first_flush = TRUE; hbool_t write_permitted; @@ -2396,41 +2388,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_cache_hit_rate(H5C_t * cache_ptr, - double * hit_rate_ptr) - +H5C_get_cache_hit_rate(H5C_t * cache_ptr, double * hit_rate_ptr) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { - + if((cache_ptr == NULL ) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") - } - - if ( hit_rate_ptr == NULL ) { - + if(hit_rate_ptr == NULL) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad hit_rate_ptr on entry.") - } - HDassert( cache_ptr->cache_hits >= 0 ); - HDassert( cache_ptr->cache_accesses >= cache_ptr->cache_hits ); - - if ( cache_ptr->cache_accesses > 0 ) { + HDassert(cache_ptr->cache_hits >= 0); + HDassert(cache_ptr->cache_accesses >= cache_ptr->cache_hits); + if(cache_ptr->cache_accesses > 0) *hit_rate_ptr = ((double)(cache_ptr->cache_hits)) / ((double)(cache_ptr->cache_accesses)); - - } else { - + else *hit_rate_ptr = 0.0f; - } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_get_cache_hit_rate() */ @@ -2686,10 +2665,10 @@ H5C_insert_entry(H5F_t * f, herr_t result; hbool_t first_flush = TRUE; hbool_t insert_pinned; - hbool_t flush_last; + hbool_t flush_last; #ifdef H5_HAVE_PARALLEL - hbool_t flush_collectively; -#endif + hbool_t flush_collectively; +#endif /* H5_HAVE_PARALLEL */ hbool_t set_flush_marker; hbool_t write_permitted = TRUE; size_t empty_space; @@ -2731,7 +2710,7 @@ H5C_insert_entry(H5F_t * f, flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); #ifdef H5_HAVE_PARALLEL flush_collectively = ( (flags & H5C__FLUSH_COLLECTIVELY_FLAG) != 0 ); -#endif +#endif /* H5_HAVE_PARALLEL */ entry_ptr = (H5C_cache_entry_t *)thing; @@ -2741,19 +2720,12 @@ H5C_insert_entry(H5F_t * f, H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) - if ( test_entry_ptr != NULL ) { - - if ( test_entry_ptr == entry_ptr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \ - "entry already in cache.") - - } else { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \ - "duplicate entry in cache.") - } - } + if(test_entry_ptr != NULL) { + if(test_entry_ptr == entry_ptr) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "entry already in cache.") + else + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "duplicate entry in cache.") + } /* end if */ #ifndef NDEBUG entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; @@ -2829,28 +2801,17 @@ H5C_insert_entry(H5F_t * f, } } - if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { - + if(cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; - - } else { - + else empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; - } - - if ( ( cache_ptr->evictions_enabled ) - && + if ( ( cache_ptr->evictions_enabled ) && ( ( (cache_ptr->index_size + entry_ptr->size) > - cache_ptr->max_cache_size - ) + cache_ptr->max_cache_size) || - ( - ( ( empty_space + cache_ptr->clean_index_size ) < - cache_ptr->min_clean_size ) - ) - ) - ) { + ( ( ( empty_space + cache_ptr->clean_index_size ) < + cache_ptr->min_clean_size ) ) ) ) { size_t space_needed; @@ -3364,11 +3325,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * JRM -- 11/5/08 - * On review this function looks like no change is needed to - * support the new clean_index_size and dirty_index_size - * fields of H5C_t. - * *------------------------------------------------------------------------- */ herr_t @@ -3377,11 +3333,11 @@ H5C_move_entry(H5C_t * cache_ptr, haddr_t old_addr, haddr_t new_addr) { + H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * test_entry_ptr = NULL; #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS hbool_t was_dirty; #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - H5C_cache_entry_t * entry_ptr = NULL; - H5C_cache_entry_t * test_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS hbool_t removed_entry_from_slist = FALSE; #endif /* H5C_DO_SANITY_CHECKS */ @@ -3881,10 +3837,7 @@ H5C_protect(H5F_t * f, } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - if ( (flags & H5C__READ_ONLY_FLAG) != 0 ) - { - read_only = TRUE; - } + read_only = ( (flags & H5C__READ_ONLY_FLAG) != 0 ); /* first check to see if the target is in cache */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, NULL) @@ -3895,7 +3848,7 @@ H5C_protect(H5F_t * f, if(entry_ptr->type != type) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, NULL, "incorrect cache entry type") - #if H5C_DO_TAGGING_SANITY_CHECKS +#if H5C_DO_TAGGING_SANITY_CHECKS /* The entry is already in the cache, but make sure that the tag value being passed in via dxpl is still legal. This will ensure that had the entry NOT been in the cache, tagging was still set up correctly @@ -3918,8 +3871,8 @@ H5C_protect(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "tag verification failed"); } /* end if */ - #endif - +#endif + hit = TRUE; thing = (void *)entry_ptr; @@ -3958,21 +3911,15 @@ H5C_protect(H5F_t * f, } } - if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { - + if(cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; - - } else { - + else empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; - } - /* try to free up if necceary and if evictions are permitted. Note * that if evictions are enabled, we will call H5C_make_space_in_cache() * regardless if the min_free_space requirement is not met. */ - if ( ( cache_ptr->evictions_enabled ) && ( ( (cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size) @@ -3984,12 +3931,9 @@ H5C_protect(H5F_t * f, size_t space_needed; - if ( empty_space <= entry_ptr->size ) { - + if(empty_space <= entry_ptr->size) cache_ptr->cache_full = TRUE; - } - if ( cache_ptr->check_write_permitted != NULL ) { result = (cache_ptr->check_write_permitted)(f, @@ -4195,25 +4139,18 @@ H5C_protect(H5F_t * f, * into complience. */ - if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { - + if(cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; - - } else { - + else empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; - } - if ( ( cache_ptr->index_size > cache_ptr->max_cache_size ) || ( ( empty_space + cache_ptr->clean_index_size ) < cache_ptr->min_clean_size) ) { - if ( cache_ptr->index_size > cache_ptr->max_cache_size ) { - + if(cache_ptr->index_size > cache_ptr->max_cache_size) cache_ptr->cache_full = TRUE; - } result = H5C_make_space_in_cache(f, primary_dxpl_id, secondary_dxpl_id, @@ -4651,9 +4588,7 @@ H5C_set_prefix(H5C_t * cache_ptr, char * prefix) cache_ptr->prefix[H5C__PREFIX_LEN - 1] = '\0'; done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_set_prefix() */ @@ -5564,7 +5499,7 @@ H5C_unprotect(H5F_t * f, void * thing, unsigned int flags) { - H5C_t * cache_ptr; + H5C_t * cache_ptr; hbool_t deleted; hbool_t dirtied; hbool_t set_flush_marker; @@ -5582,13 +5517,13 @@ H5C_unprotect(H5F_t * f, FUNC_ENTER_NOAPI(FAIL) - deleted = ( (flags & H5C__DELETED_FLAG) != 0 ); - dirtied = ( (flags & H5C__DIRTIED_FLAG) != 0 ); - set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); - pin_entry = ( (flags & H5C__PIN_ENTRY_FLAG) != 0 ); - unpin_entry = ( (flags & H5C__UNPIN_ENTRY_FLAG) != 0 ); - free_file_space = ( (flags & H5C__FREE_FILE_SPACE_FLAG) != 0 ); - take_ownership = ( (flags & H5C__TAKE_OWNERSHIP_FLAG) != 0 ); + deleted = ((flags & H5C__DELETED_FLAG) != 0); + dirtied = ((flags & H5C__DIRTIED_FLAG) != 0); + set_flush_marker = ((flags & H5C__SET_FLUSH_MARKER_FLAG) != 0); + pin_entry = ((flags & H5C__PIN_ENTRY_FLAG) != 0); + unpin_entry = ((flags & H5C__UNPIN_ENTRY_FLAG) != 0); + free_file_space = ((flags & H5C__FREE_FILE_SPACE_FLAG) != 0); + take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); HDassert( f ); HDassert( f->shared ); @@ -5632,49 +5567,39 @@ H5C_unprotect(H5F_t * f, * the ro_ref_counter. Don't actually unprotect until the ref count * drops to zero. */ - if ( entry_ptr->ro_ref_count > 1 ) { - - HDassert( entry_ptr->is_protected ); - HDassert( entry_ptr->is_read_only ); - - if ( dirtied ) { + if(entry_ptr->ro_ref_count > 1) { + /* Sanity check */ + HDassert(entry_ptr->is_protected); + HDassert(entry_ptr->is_read_only); - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "Read only entry modified(1)??") - } + if(dirtied) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") + /* Reduce the RO ref count */ (entry_ptr->ro_ref_count)--; /* Pin or unpin the entry as requested. */ - if ( pin_entry ) { - + if(pin_entry) { /* Pin the entry from a client */ if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") - - } else if ( unpin_entry ) { - + } else if(unpin_entry) { /* Unpin the entry from a client */ if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") - - } + } /* end if */ } else { + if(entry_ptr->is_read_only) { + /* Sanity check */ + HDassert(entry_ptr->ro_ref_count == 1); - if ( entry_ptr->is_read_only ) { - - HDassert( entry_ptr->ro_ref_count == 1 ); - - if ( dirtied ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "Read only entry modified(2)??") - } + if(dirtied) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") entry_ptr->is_read_only = FALSE; entry_ptr->ro_ref_count = 0; - } + } /* end if */ #ifdef H5_HAVE_PARALLEL /* When the H5C code is used to implement the metadata cache in the @@ -5692,47 +5617,36 @@ H5C_unprotect(H5F_t * f, * are contiguous, with only one dirty flag, we have to let the supplied * functions deal with the reseting the is_dirty flag. */ - if ( entry_ptr->clear_on_unprotect ) { - - HDassert( entry_ptr->is_dirty ); + if(entry_ptr->clear_on_unprotect) { + /* Sanity check */ + HDassert(entry_ptr->is_dirty); entry_ptr->clear_on_unprotect = FALSE; - - if ( ! dirtied ) { - + if(!dirtied) clear_entry = TRUE; - } - } + } /* end if */ #endif /* H5_HAVE_PARALLEL */ - if ( ! (entry_ptr->is_protected) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "Entry already unprotected??") - } - - /* mark the entry as dirty if appropriate */ - entry_ptr->is_dirty = ( (entry_ptr->is_dirty) || dirtied ); + if(!entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Entry already unprotected??") - if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) { + /* Mark the entry as dirty if appropriate */ + entry_ptr->is_dirty = (entry_ptr->is_dirty || dirtied); + /* Update index for newly dirtied entry */ + if(was_clean && entry_ptr->is_dirty) H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) - } /* Pin or unpin the entry as requested. */ - if ( pin_entry ) { - + if(pin_entry) { /* Pin the entry from a client */ if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") - - } else if ( unpin_entry ) { - + } else if(unpin_entry) { /* Unpin the entry from a client */ if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") - - } + } /* end if */ /* H5C__UPDATE_RP_FOR_UNPROTECT will place the unprotected entry on * the pinned entry list if entry_ptr->is_pinned is TRUE. @@ -5744,16 +5658,11 @@ H5C_unprotect(H5F_t * f, /* if the entry is dirty, 'or' its flush_marker with the set flush flag, * and then add it to the skip list if it isn't there already. */ - - if ( entry_ptr->is_dirty ) { - + if(entry_ptr->is_dirty) { entry_ptr->flush_marker |= set_flush_marker; - - if ( ! (entry_ptr->in_slist) ) { - + if(!entry_ptr->in_slist) H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) - } - } + } /* end if */ /* this implementation of the "deleted" option is a bit inefficient, as * we re-insert the entry to be deleted into the replacement policy @@ -5798,10 +5707,8 @@ H5C_unprotect(H5F_t * f, entry_ptr->free_file_space_on_destroy = free_file_space; /* Set the "take ownership" flag for the flush, if needed */ - if ( take_ownership) { - + if(take_ownership) flush_flags |= H5C__TAKE_OWNERSHIP_FLAG; - } if ( H5C_flush_single_entry(f, primary_dxpl_id, @@ -7854,7 +7761,6 @@ H5C_flush_invalidate_cache(H5F_t * f, * may be created by the flush call backs. Thus it is possible * that the slist will not be empty after we finish the scan. */ - if ( cache_ptr->slist_len == 0 ) { node_ptr = NULL; @@ -7875,7 +7781,6 @@ H5C_flush_invalidate_cache(H5F_t * f, HDassert( next_entry_ptr->in_slist ); } - #if H5C_DO_SANITY_CHECKS /* Depending on circumstances, H5C_flush_single_entry() will * remove dirty entries from the slist as it flushes them. @@ -7886,10 +7791,12 @@ H5C_flush_invalidate_cache(H5F_t * f, initial_slist_size = cache_ptr->slist_size; /* There is also the possibility that entries will be - * dirtied, resized, and/or moved as the result of - * calls to the flush callbacks. We use the slist_len_increase - * and slist_size_increase increase fields in struct H5C_t - * to track these changes for purpose of sanity checking. + * dirtied, resized, moved, and/or removed from the cache + * as the result of calls to the flush callbacks. We use + * the slist_len_increase and slist_size_increase increase + * fields in struct H5C_t to track these changes for purpose + * of sanity checking. + * * To this end, we must zero these fields before we start * the pass through the slist. */ @@ -7988,7 +7895,7 @@ H5C_flush_invalidate_cache(H5F_t * f, ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) ) { - #if H5C_DO_SANITY_CHECKS +#if H5C_DO_SANITY_CHECKS /* update actual_slist_len & actual_slist_size before * the flush. Note that the entry will be removed * from the slist after the flush, and thus may be @@ -8001,7 +7908,7 @@ H5C_flush_invalidate_cache(H5F_t * f, */ actual_slist_len++; actual_slist_size += entry_ptr->size; - #endif /* H5C_DO_SANITY_CHECKS */ +#endif /* H5C_DO_SANITY_CHECKS */ if ( entry_ptr->is_protected ) { @@ -8028,8 +7935,8 @@ H5C_flush_invalidate_cache(H5F_t * f, FALSE); if ( status < 0 ) { - /* This shouldn't happen -- if it does, we are toast - * so just scream and die. + /* This shouldn't happen -- if it does, we + * are toast so just scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -8054,8 +7961,8 @@ H5C_flush_invalidate_cache(H5F_t * f, TRUE); if ( status < 0 ) { - /* This shouldn't happen -- if it does, we are toast so - * just scream and die. + /* This shouldn't happen -- if it does, we + * are toast so just scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -8123,8 +8030,9 @@ H5C_flush_invalidate_cache(H5F_t * f, if ( entry_ptr->is_protected ) { - /* we have major problems -- but lets flush and destroy - * everything we can before we flag an error. + /* we have major problems -- but lets flush and + * destroy everything we can before we flag an + * error. */ protected_entries++; @@ -8148,8 +8056,8 @@ H5C_flush_invalidate_cache(H5F_t * f, TRUE); if ( status < 0 ) { - /* This shouldn't happen -- if it does, we are toast so - * just scream and die. + /* This shouldn't happen -- if it does, + * we are toast so just scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -8304,10 +8212,10 @@ done: * primary_dxpl_id, and secondary_dxpl_id are all irrelevent, * and the call can't be part of a sequence of flushes. * - * If the caller knows the address of the TBBT node at + * If the caller knows the address of the skip list node at * which the target entry resides, it can avoid a lookup * by supplying that address in the tgt_node_ptr parameter. - * If this parameter is NULL, the function will do a TBBT + * If this parameter is NULL, the function will do a skip list * search for the entry instead. * * The function does nothing silently if there is no entry @@ -8332,9 +8240,9 @@ H5C_flush_single_entry(H5F_t * f, hbool_t del_entry_from_slist_on_destroy) { H5C_t * cache_ptr = f->shared->cache; - hbool_t destroy; - hbool_t clear_only; - hbool_t take_ownership; + hbool_t destroy; /* external flag */ + hbool_t clear_only; /* external flag */ + hbool_t take_ownership; /* external flag */ hbool_t was_dirty; hbool_t destroy_entry; herr_t status; @@ -8351,12 +8259,13 @@ H5C_flush_single_entry(H5F_t * f, HDassert( H5F_addr_defined(addr) ); HDassert( first_flush_ptr ); - destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); - clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); - take_ownership = ( (flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); + /* setup external flags from the flags parameter */ + destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); + clear_only = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); /* Set the flag for destroying the entry, based on the 'take ownership' - * and 'destroy' flags + * and 'destroy' flags */ if(take_ownership) destroy_entry = FALSE; @@ -8366,6 +8275,7 @@ H5C_flush_single_entry(H5F_t * f, /* attempt to find the target entry in the hash table */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) + /* run initial sanity checks */ #if H5C_DO_SANITY_CHECKS if ( entry_ptr != NULL ) { @@ -8526,11 +8436,10 @@ H5C_flush_single_entry(H5F_t * f, #if H5C_DO_SANITY_CHECKS if ( ( entry_ptr->is_dirty ) && ( cache_ptr->check_write_permitted == NULL ) && - ( ! (cache_ptr->write_permitted) ) ) { + ( ! (cache_ptr->write_permitted) ) ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Write when writes are always forbidden!?!?!") - } #endif /* H5C_DO_SANITY_CHECKS */ if ( destroy ) { @@ -8598,12 +8507,11 @@ H5C_flush_single_entry(H5F_t * f, * If that ceases to be the case, further * tests will be necessary. */ - if ( cache_ptr->aux_ptr != NULL ) { + if ( cache_ptr->aux_ptr != NULL ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "resize/move in serialize occured in parallel case.") - } } #endif /* H5_HAVE_PARALLEL */ } @@ -8701,6 +8609,7 @@ H5C_flush_single_entry(H5F_t * f, } + /* reset the flush_in progress flag */ entry_ptr->flush_in_progress = FALSE; } @@ -8740,10 +8649,6 @@ done: * * Programmer: John Mainzer, 5/18/04 * - * QAK -- 1/31/08 - * Added initialization for the new free_file_space_on_destroy - * field. - * *------------------------------------------------------------------------- */ static void * @@ -8941,7 +8846,6 @@ H5C_make_space_in_cache(H5F_t * f, if ( write_permitted ) { initial_list_len = cache_ptr->LRU_list_len; - entry_ptr = cache_ptr->LRU_tail_ptr; if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { @@ -8997,6 +8901,7 @@ H5C_make_space_in_cache(H5F_t * f, cache_ptr->entries_scanned_to_make_space++; } #endif /* H5C_COLLECT_CACHE_STATS */ + result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 0fdaa79..ae6bdad 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -177,8 +177,8 @@ * entry is flushed to disk. * * - * In cases where memory is plentiful, and performance is an issue, it - * is useful to disable all cache evictions, and thereby postpone metadata + * In cases where memory is plentiful, and performance is an issue, it may + * be useful to disable all cache evictions, and thereby postpone metadata * writes. The following field is used to implement this. * * evictions_enabled: Boolean flag that is initialized to TRUE. When @@ -283,14 +283,14 @@ * some optimizations when I get to it. * * num_last_entries: The number of entries in the cache that can only be - * flushed after all other entries in the cache have - * been flushed. At this time, this will only ever be - * one entry (the superblock), and the code has been - * protected with HDasserts to enforce this. This restraint - * can certainly be relaxed in the future if the need for - * multiple entries being flushed last arises, though - * explicit tests for that case should be added when said - * HDasserts are removed. + * flushed after all other entries in the cache have + * been flushed. At this time, this will only ever be + * one entry (the superblock), and the code has been + * protected with HDasserts to enforce this. This restraint + * can certainly be relaxed in the future if the need for + * multiple entries being flushed last arises, though + * explicit tests for that case should be added when said + * HDasserts are removed. * * With the addition of the fractal heap, the cache must now deal with * the case in which entries may be dirtied, moved, or have their sizes @@ -354,7 +354,8 @@ * flush. * * Since pinned entries cannot be evicted, they must be kept on a pinned - * entry list, instead of being entrusted to the replacement policy code. + * entry list (pel), instead of being entrusted to the replacement policy + * code. * * Maintaining the pinned entry list requires the following fields: * @@ -382,7 +383,8 @@ * * While there has been interest in several replacement policies for * this cache, the initial development schedule is tight. Thus I have - * elected to support only a modified LRU policy for the first cut. + * elected to support only a modified LRU (least recently used) policy + * for the first cut. * * To further simplify matters, I have simply included the fields needed * by the modified LRU in this structure. When and if we add support for @@ -679,7 +681,7 @@ * equal to the array index has been evicted from the cache in * the current epoch. * - * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells * are used to record the number of times an entry with type * id equal to the array index has been moved in the current * epoch. @@ -714,7 +716,7 @@ * with type id equal to the array index has been flushed while * pinned in the current epoch. * - * pinned_cleared: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * pinned_clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The * cells are used to record the number of times an entry * with type id equal to the array index has been cleared while * pinned in the current epoch. @@ -2350,7 +2352,7 @@ if ( (cache_ptr)->index_size != \ HDassert( (new_size) <= (cache_ptr)->slist_size ); \ HDassert( ( (cache_ptr)->slist_len > 1 ) || \ ( (cache_ptr)->slist_size == (new_size) ) ); \ -} /* H5C__REMOVE_ENTRY_FROM_SLIST */ +} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ #else /* H5C_DO_SANITY_CHECKS */ @@ -2371,7 +2373,7 @@ if ( (cache_ptr)->index_size != \ HDassert( (new_size) <= (cache_ptr)->slist_size ); \ HDassert( ( (cache_ptr)->slist_len > 1 ) || \ ( (cache_ptr)->slist_size == (new_size) ) ); \ -} /* H5C__REMOVE_ENTRY_FROM_SLIST */ +} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ #endif /* H5C_DO_SANITY_CHECKS */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 38b9469..c9679f4 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -292,16 +292,15 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * dirtied while protected. * * This field is set to FALSE in the protect call, and may - * be set to TRUE by the - * H5C_mark_entry_dirty() - * call at an time prior to the unprotect call. + * be set to TRUE by the H5C_mark_entry_dirty() call at any + * time prior to the unprotect call. * - * The H5C_mark_entry_dirty() call exists - * as a convenience function for the fractal heap code which - * may not know if an entry is protected or pinned, but knows - * that is either protected or pinned. The dirtied field was - * added as in the parallel case, it is necessary to know - * whether a protected entry was dirty prior to the protect call. + * The H5C_mark_entry_dirty() call exists as a convenience + * function for the fractal heap code which may not know if + * an entry is protected or pinned, but knows that is either + * protected or pinned. The dirtied field was added as in + * the parallel case, it is necessary to know whether a + * protected entry is dirty prior to the protect call. * * is_protected: Boolean flag indicating whether this entry is protected * (or locked, to use more conventional terms). When it is @@ -372,21 +371,22 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * the entry is flushed for whatever reason. * * flush_me_last: Boolean flag indicating that this entry should not be - * flushed from the cache until all other entries without - * the flush_me_last flag set have been flushed. + * flushed from the cache until all other entries without + * the flush_me_last flag set have been flushed. * * flush_me_collectively: Boolean flag indicating that this entry needs - * to be flushed collectively when in a parallel - * situation. + * to be flushed collectively when in a parallel situation. * - * Note: At this time, the flush_me_last and flush_me_collectively - * flags will only be applied to one entry, the superblock, - * and the code utilizing these flags is protected with HDasserts - * to enforce this. This restraint can certainly be relaxed in - * the future if the the need for multiple entries getting flushed - * last or collectively arises, though the code allowing for that - * will need to be expanded and tested appropriately if that - * functionality is desired. + * Note: + * + * At this time, the flush_me_last and flush_me_collectively + * flags will only be applied to one entry, the superblock, + * and the code utilizing these flags is protected with HDasserts + * to enforce this. This restraint can certainly be relaxed in + * the future if the the need for multiple entries getting flushed + * last or collectively arises, though the code allowing for that + * will need to be expanded and tested appropriately if that + * functionality is desired. * * clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used * to implement the metadata cache In the parallel case, only @@ -608,7 +608,7 @@ typedef struct H5C_cache_entry_t #ifdef H5_HAVE_PARALLEL hbool_t flush_me_collectively; hbool_t clear_on_unprotect; - hbool_t flush_immediately; + hbool_t flush_immediately; #endif /* H5_HAVE_PARALLEL */ hbool_t flush_in_progress; hbool_t destroy_in_progress; @@ -617,10 +617,10 @@ typedef struct H5C_cache_entry_t /* fields supporting the 'flush dependency' feature: */ struct H5C_cache_entry_t * flush_dep_parent; - uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS]; - unsigned flush_dep_height; - hbool_t pinned_from_client; - hbool_t pinned_from_cache; + uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS]; + unsigned flush_dep_height; + hbool_t pinned_from_client; + hbool_t pinned_from_cache; /* fields supporting the hash table: */ -- cgit v0.12 From 9c9ac47ceb35345a4661f0f6038a13b0c90df0c3 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:51:31 -0500 Subject: [svn-r27073] Description: Clean up H5D interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5Dchunk.c | 4 ++-- src/H5Defl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index ea3557c..5d8ea4a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -319,8 +319,8 @@ H5FL_BLK_DEFINE_STATIC(chunk); *------------------------------------------------------------------------- */ herr_t -H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset, - uint32_t data_size, const void *buf) +H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, + hsize_t *offset, uint32_t data_size, const void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ diff --git a/src/H5Defl.c b/src/H5Defl.c index 6707568..1ae7a23 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -288,7 +288,7 @@ H5D__efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") if((fd = HDopen(efl->slot[u].name, O_RDONLY, 0)) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file") - if(HDlseek(fd, (off_t)(efl->slot[u].offset + skip), SEEK_SET) < 0) + if(HDlseek(fd, (HDoff_t)(efl->slot[u].offset + skip), SEEK_SET) < 0) HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file") #ifndef NDEBUG tempto_read = MIN(efl->slot[u].size-skip, (hsize_t)size); @@ -378,7 +378,7 @@ H5D__efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b else HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file") } /* end if */ - if(HDlseek(fd, (off_t)(efl->slot[u].offset + skip), SEEK_SET) < 0) + if(HDlseek(fd, (HDoff_t)(efl->slot[u].offset + skip), SEEK_SET) < 0) HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file") #ifndef NDEBUG tempto_write = MIN(efl->slot[u].size - skip, (hsize_t)size); -- cgit v0.12 From d0de32fc3adc28c7a20ee07928eeeee522d4fcf5 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:54:30 -0500 Subject: [svn-r27074] Description: Clean up H5EA interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5EA.c | 14 ++++++------ src/H5EAcache.c | 26 ++--------------------- src/H5EAdbg.c | 30 +++++++++++++------------- src/H5EAhdr.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/H5EApkg.h | 21 ++++++++++-------- test/earray.c | 1 - 6 files changed, 101 insertions(+), 57 deletions(-) diff --git a/src/H5EA.c b/src/H5EA.c index b790590..37682e7 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -148,7 +148,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array info") /* Lock the array header into memory */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Point extensible array wrapper at header and bump it's ref count */ @@ -168,7 +168,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); CATCH - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") if(!ret_value) if(ea && H5EA_close(ea, dxpl_id) < 0) @@ -209,7 +209,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) #ifdef QAK HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); #endif /* QAK */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for pending array deletion */ @@ -237,7 +237,7 @@ HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); CATCH - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") if(!ret_value) if(ea && H5EA_close(ea, dxpl_id) < 0) @@ -1048,7 +1048,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(ea->f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, NULL, H5AC_WRITE))) + if(NULL == (hdr = H5EA__hdr_protect(ea->f, dxpl_id, ea_addr, NULL, H5AC_WRITE))) H5E_THROW(H5E_CANTLOAD, "unable to load extensible array header") /* Set the shared array header's file context for this operation */ @@ -1112,7 +1112,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) #ifdef QAK HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); #endif /* QAK */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for files using shared array header */ @@ -1131,7 +1131,7 @@ HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); CATCH /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PRIV) /* end H5EA_delete() */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 1d40283..57d69a4 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -43,7 +43,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -577,6 +577,7 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ haddr_t arr_addr; /* Address of array header in the file */ + size_t u; /* Local index variable */ /* Sanity check */ HDassert(f); @@ -638,8 +639,6 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) /* Decode data block addresses in index block */ if(iblock->ndblk_addrs > 0) { - size_t u; /* Local index variable */ - /* Decode addresses of data blocks in index block */ for(u = 0; u < iblock->ndblk_addrs; u++) H5F_addr_decode(f, &p, &iblock->dblk_addrs[u]); @@ -647,8 +646,6 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) /* Decode super block addresses in index block */ if(iblock->nsblk_addrs > 0) { - size_t u; /* Local index variable */ - /* Decode addresses of super blocks in index block */ for(u = 0; u < iblock->nsblk_addrs; u++) H5F_addr_decode(f, &p, &iblock->sblk_addrs[u]); @@ -872,11 +869,7 @@ H5EA__cache_iblock_notify(H5AC_notify_action_t action, H5EA_iblock_t *iblock)) break; default: -#ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ } /* end switch */ CATCH @@ -1300,11 +1293,7 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, H5EA_sblock_t *sblock)) break; default: -#ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ } /* end switch */ CATCH @@ -1662,11 +1651,7 @@ H5EA__cache_dblock_notify(H5AC_notify_action_t action, H5EA_dblock_t *dblock)) break; default: -#ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ } /* end switch */ CATCH @@ -1791,9 +1776,6 @@ H5EA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(udata && udata->hdr && udata->parent); -#ifdef QAK -HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); -#endif /* QAK */ /* Allocate the extensible array data block page */ if(NULL == (dblk_page = H5EA__dblk_page_alloc(udata->hdr, udata->parent))) @@ -2014,11 +1996,7 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, H5EA_dblk_page_t *dblk break; default: -#ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ } /* end switch */ CATCH diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index b9a5bad..60b9ecd 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -119,7 +119,7 @@ H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Print opening message */ @@ -171,7 +171,7 @@ H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_debug() */ @@ -196,9 +196,9 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, i int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr)) /* Local variables */ - H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ - H5EA_iblock_t *iblock = NULL; /* Extensible array index block */ - void *dbg_ctx = NULL; /* Extensible array context */ + H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ + H5EA_iblock_t *iblock = NULL; /* Extensible array index block */ + void *dbg_ctx = NULL; /* Extensible array context */ /* Check arguments */ HDassert(f); @@ -218,7 +218,7 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, i } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Sanity check */ @@ -296,7 +296,7 @@ CATCH H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") if(iblock && H5EA__iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__iblock_debug() */ @@ -321,9 +321,9 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr)) /* Local variables */ - H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ - H5EA_sblock_t *sblock = NULL; /* Extensible array super block */ - void *dbg_ctx = NULL; /* Extensible array context */ + H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ + H5EA_sblock_t *sblock = NULL; /* Extensible array super block */ + void *dbg_ctx = NULL; /* Extensible array context */ /* Check arguments */ HDassert(f); @@ -343,7 +343,7 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect super block */ @@ -388,7 +388,7 @@ CATCH H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__sblock_debug() */ @@ -415,7 +415,7 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde /* Local variables */ H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ H5EA_dblock_t *dblock = NULL; /* Extensible array data block */ - void *dbg_ctx = NULL; /* Extensible array context */ + void *dbg_ctx = NULL; /* Extensible array context */ size_t u; /* Local index variable */ /* Check arguments */ @@ -437,7 +437,7 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect data block */ @@ -471,7 +471,7 @@ CATCH H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") if(dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__dblock_debug() */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index d5f3538..136cf1e 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -612,6 +612,70 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */ /*------------------------------------------------------------------------- + * Function: H5EA__hdr_protect + * + * Purpose: Convenience wrapper around protecting extensible array header + * + * Return: Non-NULL pointer to index block on success/NULL on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 31 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PKG, ERR, +H5EA_hdr_t *, NULL, NULL, +H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, + H5AC_protect_t rw)) + + /* Local variables */ + + /* Sanity check */ + HDassert(f); + HDassert(H5F_addr_defined(ea_addr)); + + /* Protect the header */ + if(NULL == (ret_value = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, rw))) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) + +CATCH + +END_FUNC(PKG) /* end H5EA__hdr_protect() */ + + +/*------------------------------------------------------------------------- + * Function: H5EA__hdr_unprotect + * + * Purpose: Convenience wrapper around unprotecting extensible array header + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 1 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PKG, ERR, +herr_t, SUCCEED, FAIL, +H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) + + /* Local variables */ + + /* Sanity check */ + HDassert(hdr); + + /* Unprotect the header */ + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array hdr, address = %llu", (unsigned long long)hdr->addr) + +CATCH + +END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ + + +/*------------------------------------------------------------------------- * Function: H5EA__hdr_delete * * Purpose: Delete an extensible array, starting with the header @@ -665,7 +729,7 @@ HDfprintf(stderr, "%s: hdr->idx_blk_addr = %a\n", FUNC, hdr->idx_blk_addr); CATCH /* Unprotect the header, deleting it if an error hasn't occurred */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5EA__hdr_unprotect(hdr, dxpl_id, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_delete() */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index fc15e72..d89a35e 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -302,11 +302,12 @@ struct H5EA_t { /* Metadata cache callback user data types */ -/* Info needed for loading data block page */ -typedef struct H5EA_dblk_page_cache_ud_t { +/* Info needed for loading super block */ +typedef struct H5EA_sblock_cache_ud_t { H5EA_hdr_t *hdr; /* Shared extensible array information */ - H5EA_sblock_t *parent; /* Pointer to parent object for data block page (super block) */ -} H5EA_dblk_page_cache_ud_t; + H5EA_iblock_t *parent; /* Pointer to parent object for super block (index block) */ + unsigned sblk_idx; /* Index of super block */ +} H5EA_sblock_cache_ud_t; /* Info needed for loading data block */ typedef struct H5EA_dblock_cache_ud_t { @@ -315,12 +316,11 @@ typedef struct H5EA_dblock_cache_ud_t { size_t nelmts; /* Number of elements in data block */ } H5EA_dblock_cache_ud_t; -/* Info needed for loading super block */ -typedef struct H5EA_sblock_cache_ud_t { +/* Info needed for loading data block page */ +typedef struct H5EA_dblk_page_cache_ud_t { H5EA_hdr_t *hdr; /* Shared extensible array information */ - H5EA_iblock_t *parent; /* Pointer to parent object for super block (index block) */ - unsigned sblk_idx; /* Index of super block */ -} H5EA_sblock_cache_ud_t; + H5EA_sblock_t *parent; /* Pointer to parent object for data block page (super block) */ +} H5EA_dblk_page_cache_ud_t; #ifdef H5EA_TESTING typedef struct H5EA__ctx_cb_t { @@ -377,6 +377,9 @@ H5_DLL herr_t H5EA__hdr_decr(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr); H5_DLL size_t H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_modified(H5EA_hdr_t *hdr); +H5_DLL H5EA_hdr_t *H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, + void *ctx_udata, H5AC_protect_t rw); +H5_DLL herr_t H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id); H5_DLL herr_t H5EA__hdr_dest(H5EA_hdr_t *hdr); diff --git a/test/earray.c b/test/earray.c index 2d0a399..2135281 100644 --- a/test/earray.c +++ b/test/earray.c @@ -190,7 +190,6 @@ const H5AC_class_t H5AC_EARRAY_TEST[1] = {{ (H5AC_size_func_t)earray_cache_test_size, }}; - /*------------------------------------------------------------------------- * Function: init_cparam -- cgit v0.12 From 668be45b5678fc38c58fbb657c04b557c7baffe7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 20:57:34 -0500 Subject: [svn-r27075] Description: Clean up H5F interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5F.c | 2 +- src/H5Fdeprec.c | 2 +- src/H5Fint.c | 4 ++-- src/H5Fpkg.h | 8 ++++---- src/H5Fsuper.c | 46 +++++++++++++++++++++++----------------------- src/H5Fsuper_cache.c | 19 +++++++++++++++---- 6 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 672c631..3cdb604 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1380,7 +1380,7 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) HDmemset(finfo, 0, sizeof(*finfo)); /* Get the size of the superblock and any superblock extensions */ - if(H5F_super_size(f, H5AC_ind_dxpl_id, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) + if(H5F__super_size(f, H5AC_ind_dxpl_id, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock sizes") /* Get the size of any persistent free space */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index c5a500a..7e2ea17 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -181,7 +181,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) HDmemset(finfo, 0, sizeof(*finfo)); /* Get the size of the superblock extension */ - if(H5F_super_size(f, H5AC_ind_dxpl_id, NULL, &finfo->super_ext_size) < 0) + if(H5F__super_size(f, H5AC_ind_dxpl_id, NULL, &finfo->super_ext_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock extension size") /* Check for SOHM info */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 31f4176..775c91f 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1074,7 +1074,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, /* Initialize information about the superblock and allocate space for it */ /* (Writes superblock extension messages, if there are any) */ - if(H5F_super_init(file, dxpl_id) < 0) + if(H5F__super_init(file, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to allocate file superblock") /* Create and open the root group */ @@ -1085,7 +1085,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group") } else if (1 == shared->nrefs) { /* Read the superblock if it hasn't been read before. */ - if(H5F_super_read(file, dxpl_id) < 0) + if(H5F__super_read(file, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") /* Open the root group */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 53fe0d9..a645fd3 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -306,10 +306,10 @@ 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); /* 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 dxpl_id); -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); +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 dxpl_id); +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); /* Superblock extension related routines */ H5_DLL herr_t H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr); diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 845ab8c..6db631e 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -237,7 +237,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_super_read + * Function: H5F__super_read * * Purpose: Reads the superblock from the file or from the BUF. If * ADDR is a valid address, then it reads it from the file. @@ -254,17 +254,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_read(H5F_t *f, hid_t dxpl_id) +H5F__super_read(H5F_t *f, hid_t dxpl_id) { H5P_genplist_t *dxpl; /* DXPL object */ - H5F_super_t * sblock = NULL; /* superblock structure */ + H5F_super_t * sblock = NULL; /* Superblock structure */ unsigned sblock_flags = H5AC__NO_FLAGS_SET; /* flags used in superblock unprotect call */ haddr_t super_addr; /* Absolute address of superblock */ - H5AC_protect_t rw; /* read/write permissions for file */ + H5AC_protect_t rw; /* Read/write permissions for file */ hbool_t dirtied = FALSE; /* Bool for sblock protect call */ - herr_t ret_value = SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) /* Get the DXPL plist object for DXPL ID */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) @@ -291,7 +291,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id) /* Look up the superblock */ if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &dirtied, rw))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "unable to load superblock") + HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") /* Mark the superblock dirty if it was modified during loading or VFD indicated to do so */ if((H5AC_WRITE == rw) && (dirtied || H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_SBLK_LOAD))) @@ -299,7 +299,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id) /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTPIN, FAIL, "unable to pin superblock") + HGOTO_ERROR(H5E_FILE, H5E_CANTPIN, FAIL, "unable to pin superblock") /* Set the pointer to the pinned superblock */ f->shared->sblock = sblock; @@ -307,14 +307,14 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id) done: /* Release the superblock */ if(sblock && H5AC_unprotect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0) - HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock") + HDONE_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5F_super_read() */ +} /* end H5F__super_read() */ /*------------------------------------------------------------------------- - * Function: H5F_super_init + * Function: H5F__super_init * * Purpose: Allocates the superblock for the file and initializes * information about the superblock in memory. Writes extension @@ -330,7 +330,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_init(H5F_t *f, hid_t dxpl_id) +H5F__super_init(H5F_t *f, hid_t dxpl_id) { H5F_super_t *sblock = NULL; /* Superblock cache structure */ hbool_t sblock_in_cache = FALSE; /* Whether the superblock has been inserted into the metadata cache */ @@ -344,7 +344,7 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id) hbool_t ext_created = FALSE; /* Whether the extension has been created */ herr_t ret_value = SUCCEED; /* Return Value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) /* Allocate space for the superblock */ if(NULL == (sblock = H5FL_CALLOC(H5F_super_t))) @@ -594,7 +594,7 @@ done: } /* end if */ else /* Free superblock */ - if(H5F_super_free(sblock) < 0) + if(H5F__super_free(sblock) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to destroy superblock") /* Reset variables in file structure */ @@ -603,7 +603,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5F_super_init() */ +} /* end H5F__super_init() */ /*------------------------------------------------------------------------- @@ -641,7 +641,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_super_free + * Function: H5F__super_free * * Purpose: Destroyer the file's superblock * @@ -654,9 +654,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_free(H5F_super_t *sblock) +H5F__super_free(H5F_super_t *sblock) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(sblock); @@ -668,11 +668,11 @@ H5F_super_free(H5F_super_t *sblock) sblock = (H5F_super_t *)H5FL_FREE(H5F_super_t, sblock); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5F_super_free() */ +} /* H5F__super_free() */ /*------------------------------------------------------------------------- - * Function: H5F_super_size + * Function: H5F__super_size * * Purpose: Get storage size of the superblock and superblock extension * @@ -685,11 +685,11 @@ H5F_super_free(H5F_super_t *sblock) *------------------------------------------------------------------------- */ herr_t -H5F_super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size) +H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -725,7 +725,7 @@ H5F_super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_size() */ +} /* H5F__super_size() */ /*------------------------------------------------------------------------- diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 5737ce4..1e8675c 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -13,6 +13,17 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*------------------------------------------------------------------------- + * + * Created: H5Fsuper_cache.c + * Aug 15 2009 + * Quincey Koziol + * + * Purpose: Implement file superblock & driver info metadata cache methods. + * + *------------------------------------------------------------------------- + */ + /****************/ /* Module Setup */ /****************/ @@ -133,7 +144,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) FUNC_ENTER_NOAPI_NOINIT - /* check arguments */ + /* Check arguments */ HDassert(f); HDassert(H5F_addr_eq(addr, 0)); HDassert(dirtied); @@ -618,7 +629,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) done: /* Release the [possibly partially initialized] superblock on errors */ if(!ret_value && sblock) - if(H5F_super_free(sblock) < 0) + if(H5F__super_free(sblock) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTFREE, NULL, "unable to destroy superblock data") FUNC_LEAVE_NOAPI(ret_value) @@ -779,7 +790,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, * ultimately match it. */ if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") - H5F_addr_encode(f, &p, rel_eof + sblock->base_addr); + H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); /* Retrieve information for root group */ if(NULL == (root_oloc = H5G_oloc(f->shared->root_grp))) @@ -887,7 +898,7 @@ H5F_sblock_dest(H5F_t UNUSED *f, H5F_super_t* sblock) HDassert(sblock); /* Free superblock */ - if(H5F_super_free(sblock) < 0) + if(H5F__super_free(sblock) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to destroy superblock") done: -- cgit v0.12 From 71bc00a0b50e803a7d4076c6f2249fa1c2c3670e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:00:27 -0500 Subject: [svn-r27076] Description: Clean up H5FA interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5FA.c | 20 ++++++++--------- src/H5FAcache.c | 15 ++++++------- src/H5FAdbg.c | 10 ++++----- src/H5FAdblock.c | 30 +++++++++++--------------- src/H5FAhdr.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/H5FApkg.h | 14 ++++++------ 6 files changed, 107 insertions(+), 48 deletions(-) diff --git a/src/H5FA.c b/src/H5FA.c index 128999a..1acb10b 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -141,7 +141,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array info") /* Lock the array header into memory */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Point fixed array wrapper at header and bump it's ref count */ @@ -161,7 +161,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); CATCH - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") if(!ret_value) if(fa && H5FA_close(fa, dxpl_id) < 0) @@ -201,7 +201,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) #ifdef H5FA_DEBUG HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); #endif /* H5FA_DEBUG */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for pending array deletion */ @@ -229,7 +229,7 @@ HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); CATCH - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") if(!ret_value) if(fa && H5FA_close(fa, dxpl_id) < 0) @@ -351,7 +351,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx); #endif /* H5FA_DEBUG */ /* Create the data block */ - hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty, hdr->cparam.nelmts); + hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty); if(!H5F_addr_defined(hdr->dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create fixed array data block") } /* end if */ @@ -359,7 +359,7 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx HDassert(idx < hdr->cparam.nelmts); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, hdr->stats.nelmts, H5AC_WRITE))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paging data block */ @@ -467,7 +467,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); else { /* Get the data block */ HDassert(H5F_addr_defined(hdr->dblk_addr)); - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, hdr->stats.nelmts, H5AC_READ))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paged data block */ @@ -592,7 +592,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(fa->f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, NULL, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(fa->f, dxpl_id, fa_addr, NULL, H5AC_WRITE))) H5E_THROW(H5E_CANTLOAD, "unable to load fixed array header") /* Set the shared array header's file context for this operation */ @@ -655,7 +655,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) #ifdef H5FA_DEBUG HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); #endif /* H5FA_DEBUG */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for files using shared array header */ @@ -674,7 +674,7 @@ HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); CATCH /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PRIV) /* end H5FA_delete() */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index cb156db..2f07cd6 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -16,6 +16,8 @@ /*------------------------------------------------------------------------- * * Created: H5FAcache.c + * Jul 2 2009 + * Quincey Koziol * * Purpose: Implement fixed array metadata cache methods. * @@ -41,7 +43,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -517,10 +519,10 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) /* Sanity check */ HDassert(f); HDassert(H5F_addr_defined(addr)); - HDassert(udata && udata->hdr && udata->nelmts > 0); + HDassert(udata && udata->hdr); /* Allocate the fixed array data block */ - if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr, udata->nelmts))) + if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block") /* Set the fixed array data block's information */ @@ -575,9 +577,9 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) if(!dblock->npages) { /* Decode elements in data block */ /* Convert from raw elements on disk into native elements in memory */ - if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, (size_t)udata->nelmts, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, (size_t)udata->hdr->stats.nelmts, udata->hdr->cb_ctx) < 0) H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements") - p += (udata->nelmts * udata->hdr->cparam.raw_elmt_size); + p += (udata->hdr->stats.nelmts * udata->hdr->cparam.raw_elmt_size); } /* end if */ /* Sanity check */ @@ -868,9 +870,6 @@ H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(udata && udata->hdr && udata->nelmts > 0); -#ifdef QAK -HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); -#endif /* QAK */ /* Allocate the fixed array data block page */ if(NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts))) diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index eb5e32e..d5239d3 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -117,7 +117,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Print opening message */ @@ -150,7 +150,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__hdr_debug() */ @@ -198,11 +198,11 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, hdr->cparam.nelmts, H5AC_READ))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -280,7 +280,7 @@ CATCH H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context") if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__dblock_debug() */ diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 9efc2bc..e6e0e74 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -102,14 +102,14 @@ H5FL_BLK_DEFINE(fa_page_init); */ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, -H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts)) +H5FA__dblock_alloc(H5FA_hdr_t *hdr)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* fixed array data block */ /* Check arguments */ HDassert(hdr); - HDassert(nelmts > 0); + HDassert(hdr->cparam.nelmts > 0); /* Allocate memory for the data block */ if(NULL == (dblock = H5FL_CALLOC(H5FA_dblock_t))) @@ -124,9 +124,9 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts)) dblock->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; /* Check if this data block should be paged */ - if(nelmts > dblock->dblk_page_nelmts) { + if(hdr->cparam.nelmts > dblock->dblk_page_nelmts) { /* Compute number of pages */ - hsize_t npages = ((nelmts + dblock->dblk_page_nelmts) - 1) / dblock->dblk_page_nelmts; + hsize_t npages = ((hdr->cparam.nelmts + dblock->dblk_page_nelmts) - 1) / dblock->dblk_page_nelmts; /* Safely assign the number of pages */ H5_CHECKED_ASSIGN(dblock->npages, size_t, npages, hsize_t); @@ -146,10 +146,10 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts)) dblock->dblk_page_size = (dblock->dblk_page_nelmts * hdr->cparam.raw_elmt_size) + H5FA_SIZEOF_CHKSUM; /* Compute the # of elements on last page */ - if(0 == nelmts % dblock->dblk_page_nelmts) + if(0 == hdr->cparam.nelmts % dblock->dblk_page_nelmts) dblock->last_page_nelmts = dblock->dblk_page_nelmts; else - dblock->last_page_nelmts = (size_t)(nelmts % dblock->dblk_page_nelmts); + dblock->last_page_nelmts = (size_t)(hdr->cparam.nelmts % dblock->dblk_page_nelmts); } /* end if */ else { hsize_t dblk_size = hdr->cparam.nelmts * hdr->cparam.cls->nat_elmt_size; @@ -186,24 +186,22 @@ END_FUNC(PKG) /* end H5FA__dblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty, - hsize_t nelmts)) +H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* fixed array data block */ haddr_t dblock_addr; /* fixed array data block address */ #ifdef H5FA_DEBUG -HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, hdr->stats.nelmts, nelmts); +HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, hdr->stats.nelmts, hdr->cparam.nelmts); #endif /* H5FA_DEBUG */ /* Sanity check */ HDassert(hdr); HDassert(hdr_dirty); - HDassert(nelmts > 0); /* Allocate the data block */ - if(NULL == (dblock = H5FA__dblock_alloc(hdr, nelmts))) + if(NULL == (dblock = H5FA__dblock_alloc(hdr))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block") /* Set size of data block on disk */ @@ -265,7 +263,7 @@ END_FUNC(PKG) /* end H5FA__dblock_create() */ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, - hsize_t dblk_nelmts, H5AC_protect_t rw)) + H5AC_protect_t rw)) /* Local variables */ H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */ @@ -277,11 +275,9 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Sanity check */ HDassert(hdr); HDassert(H5F_addr_defined(dblk_addr)); - HDassert(dblk_nelmts); /* Set up user data */ udata.hdr = hdr; - udata.nelmts = dblk_nelmts; /* Protect the data block */ if(NULL == (ret_value = (H5FA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, rw))) @@ -340,8 +336,7 @@ END_FUNC(PKG) /* end H5FA__dblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, - hsize_t dblk_nelmts)) +H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* Pointer to data block */ @@ -353,10 +348,9 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Sanity check */ HDassert(hdr); HDassert(H5F_addr_defined(dblk_addr)); - HDassert(dblk_nelmts > 0); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, dblk_nelmts, H5AC_WRITE))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if data block is paged */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 23a554a..5970ff0 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -393,6 +393,70 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */ /*------------------------------------------------------------------------- + * Function: H5FA__hdr_protect + * + * Purpose: Convenience wrapper around protecting fixed array header + * + * Return: Non-NULL pointer to index block on success/NULL on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 12 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PKG, ERR, +H5FA_hdr_t *, NULL, NULL, +H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, + H5AC_protect_t rw)) + + /* Local variables */ + + /* Sanity check */ + HDassert(f); + HDassert(H5F_addr_defined(fa_addr)); + + /* Protect the header */ + if(NULL == (ret_value = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, rw))) + H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) + +CATCH + +END_FUNC(PKG) /* end H5FA__hdr_protect() */ + + +/*------------------------------------------------------------------------- + * Function: H5FA__hdr_unprotect + * + * Purpose: Convenience wrapper around unprotecting fixed array header + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 12 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PKG, ERR, +herr_t, SUCCEED, FAIL, +H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) + + /* Local variables */ + + /* Sanity check */ + HDassert(hdr); + + /* Unprotect the header */ + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array hdr, address = %llu", (unsigned long long)hdr->addr) + +CATCH + +END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ + + +/*------------------------------------------------------------------------- * Function: H5FA__hdr_delete * * Purpose: Delete a fixed array, starting with the header @@ -436,7 +500,7 @@ HDfprintf(stderr, "%s: hdr->dblk_addr = %a\n", FUNC, hdr->dblk_addr); #endif /* H5FA_DEBUG */ /* Delete Fixed Array Data block */ - if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr, hdr->cparam.nelmts) < 0) + if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block") } /* end if */ diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 20d30c3..7101f0b 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -199,13 +199,12 @@ struct H5FA_t { /* Info needed for loading data block */ typedef struct H5FA_dblock_cache_ud_t { H5FA_hdr_t *hdr; /* Shared fixed array information */ - hsize_t nelmts; /* Number of elements in data block */ } H5FA_dblock_cache_ud_t; /* Info needed for loading data block page */ typedef struct H5FA_dblk_page_cache_ud_t { H5FA_hdr_t *hdr; /* Shared fixed array information */ - size_t nelmts; /* Number of elements in data block page */ + size_t nelmts; /* Number of elements in data block page */ } H5FA_dblk_page_cache_ud_t; @@ -244,19 +243,22 @@ H5_DLL herr_t H5FA__hdr_decr(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr); H5_DLL size_t H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_modified(H5FA_hdr_t *hdr); +H5_DLL H5FA_hdr_t *H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, + void *ctx_udata, H5AC_protect_t rw); +H5_DLL herr_t H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id); H5_DLL herr_t H5FA__hdr_dest(H5FA_hdr_t *hdr); /* Data block routines */ -H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts); -H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty, hsize_t nelmts); +H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr); +H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty); H5_DLL unsigned H5FA__dblock_sblk_idx(const H5FA_hdr_t *hdr, hsize_t idx); H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_addr, hsize_t dblk_nelmts, H5AC_protect_t rw); + haddr_t dblk_addr, H5AC_protect_t rw); H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_addr, hsize_t dblk_nelmts); + haddr_t dblk_addr); H5_DLL herr_t H5FA__dblock_dest(H5FA_dblock_t *dblock); /* Data block page routines */ -- cgit v0.12 From cd1620238c73d616c8ec3c773337e7733b47d3f2 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:02:54 -0500 Subject: [svn-r27077] Description: Clean up H5FD interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5FD.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++------ src/H5FDfamily.c | 38 +++++++++++++++++-------------------- src/H5FDprivate.h | 2 +- src/H5Fsuper_cache.c | 20 ++------------------ 4 files changed, 67 insertions(+), 46 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 0e4d840..c4ee11f 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -540,11 +540,11 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD_sb_encode() */ /*------------------------------------------------------------------------- - * Function: H5FD_sb_decode + * Function: H5FD__sb_decode * * Purpose: Decodes the driver information block. * @@ -556,20 +556,61 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) +static herr_t +H5FD__sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(file && file->cls); + + /* Decode driver information */ if(file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sb_decode() */ +} /* end H5FD__sb_decode() */ + + +/*------------------------------------------------------------------------- + * Function: H5FD_sb_load + * + * Purpose: Validate and decode the driver information block. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Friday, July 19, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(file && file->cls); + + /* Check if driver matches driver information saved. Unfortunately, we can't push this + * function to each specific driver because we're checking if the driver is correct. + */ + if(!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family")) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "family driver should be used") + if(!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi")) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "multi driver should be used") + + /* Decode driver information */ + if(H5FD__sb_decode(file, name, buf) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode driver information") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_sb_load() */ /*------------------------------------------------------------------------- diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index e79e1cf..8660f1f 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -587,26 +587,25 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha * h5repart is being used to change member file size. h5repart will open * files for read and write. When the files are closed, metadata will be * flushed to the files and updated to this new size */ - if(file->mem_newsize) { + if(file->mem_newsize) file->memb_size = file->pmem_size = file->mem_newsize; - HGOTO_DONE(ret_value) - } /* end if */ - - /* Default - use the saved member size */ - if(file->pmem_size == H5F_FAMILY_DEFAULT) - file->pmem_size = msize; + else { + /* Default - use the saved member size */ + if(file->pmem_size == H5F_FAMILY_DEFAULT) + file->pmem_size = msize; - /* Check if member size from file access property is correct */ - if(msize != file->pmem_size) { - char err_msg[128]; + /* Check if member size from file access property is correct */ + if(msize != file->pmem_size) { + char err_msg[128]; - HDsnprintf(err_msg, sizeof(err_msg), "Family member size should be %lu. But the size from file access property is %lu", (unsigned long)msize, (unsigned long)file->pmem_size); - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, err_msg) - } /* end if */ + HDsnprintf(err_msg, sizeof(err_msg), "Family member size should be %lu. But the size from file access property is %lu", (unsigned long)msize, (unsigned long)file->pmem_size); + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, err_msg) + } /* end if */ - /* Update member file size to the size saved in the superblock. - * That's the size intended to be. */ - file->memb_size = msize; + /* Update member file size to the size saved in the superblock. + * That's the size intended to be. */ + file->memb_size = msize; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -686,14 +685,11 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, /* Check for new family file size. It's used by h5repart only. */ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_NEWSIZE_NAME) > 0) { - hsize_t fam_newsize = 0; /* New member size, when repartitioning */ - /* Get the new family file size */ - if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &fam_newsize) < 0) + if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &file->mem_newsize) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get new family member size") - /* Store information for later */ - file->mem_newsize = fam_newsize; /* New member size passed in through property */ + /* Set flag for later */ file->repart_members = TRUE; } /* end if */ diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 20e9a79..0a7fe6c 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -109,7 +109,7 @@ H5_DLL herr_t H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, ha H5_DLL H5FD_class_t *H5FD_get_class(hid_t id); H5_DLL hsize_t H5FD_sb_size(H5FD_t *file); H5_DLL herr_t H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf); -H5_DLL herr_t H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf); +H5_DLL herr_t H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf); H5_DLL void *H5FD_fapl_get(H5FD_t *file); H5_DLL herr_t H5FD_fapl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info); H5_DLL herr_t H5FD_fapl_close(hid_t driver_id, void *fapl); diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 1e8675c..46ebe6e 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -382,14 +382,6 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) drv_name[8] = '\0'; p += 8; /* advance past name/version */ - /* Check if driver matches driver information saved. Unfortunately, we can't push this - * function to each specific driver because we're checking if the driver is correct. - */ - if(!HDstrncmp(drv_name, "NCSAfami", (size_t)8) && HDstrcmp(lf->cls->name, "family")) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "family driver should be used") - if(!HDstrncmp(drv_name, "NCSAmult", (size_t)8) && HDstrcmp(lf->cls->name, "multi")) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "multi driver should be used") - /* Read in variable-sized portion of driver info block */ if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE + drv_variable_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "set end of space allocation request failed") @@ -397,7 +389,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read file driver information") /* Decode driver information */ - if(H5FD_sb_decode(lf, drv_name, p) < 0) + if(H5FD_sb_load(lf, drv_name, p) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to decode driver information") } /* end if */ } /* end if */ @@ -546,16 +538,8 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo, dxpl_id)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "driver info message not present") - /* Check if driver matches driver information saved. Unfortunately, we can't push this - * function to each specific driver because we're checking if the driver is correct. - */ - if(!HDstrncmp(drvinfo.name, "NCSAfami", (size_t)8) && HDstrcmp(lf->cls->name, "family")) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "family driver should be used") - if(!HDstrncmp(drvinfo.name, "NCSAmult", (size_t)8) && HDstrcmp(lf->cls->name, "multi")) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "multi driver should be used") - /* Decode driver information */ - if(H5FD_sb_decode(lf, drvinfo.name, drvinfo.buf) < 0) + if(H5FD_sb_load(lf, drvinfo.name, drvinfo.buf) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to decode driver information") /* Reset driver info message */ -- cgit v0.12 From 8fd9d6b53f44b12204ea2bcd34eeedd3f3d54603 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:04:33 -0500 Subject: [svn-r27078] Description: Clean up H5FS interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5FS.c | 24 ++++++++++++------------ src/H5FScache.c | 14 ++++++-------- src/H5FSpkg.h | 4 ++-- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/H5FS.c b/src/H5FS.c index 9dcf081..67ec838 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -123,7 +123,7 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl /* * Allocate free space structure */ - if(NULL == (fspace = H5FS_new(f, nclasses, classes, cls_init_udata))) + if(NULL == (fspace = H5FS__new(f, nclasses, classes, cls_init_udata))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space free list") /* Initialize creation information for free space manager */ @@ -161,7 +161,7 @@ HDfprintf(stderr, "%s: fspace = %p, fspace->addr = %a\n", FUNC, fspace, fspace-> done: if(!ret_value && fspace) - if(H5FS_hdr_dest(fspace) < 0) + if(H5FS__hdr_dest(fspace) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space header") #ifdef H5FS_DEBUG @@ -573,7 +573,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_va /*------------------------------------------------------------------------- - * Function: H5FS_new + * Function: H5FS__new * * Purpose: Create new free space manager structure * @@ -586,14 +586,14 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_va *------------------------------------------------------------------------- */ H5FS_t * -H5FS_new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[], +H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata) { H5FS_t *fspace = NULL; /* Free space manager */ size_t u; /* Local index variable */ H5FS_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(nclasses == 0 || (nclasses > 0 && classes)); @@ -631,7 +631,7 @@ H5FS_new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[ /* Initialize non-zero information for new free space manager */ fspace->addr = HADDR_UNDEF; - fspace->hdr_size = H5FS_HEADER_SIZE(f); + fspace->hdr_size = (size_t)H5FS_HEADER_SIZE(f); fspace->sect_addr = HADDR_UNDEF; /* Set return value */ @@ -649,7 +649,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_new() */ +} /* H5FS__new() */ /*------------------------------------------------------------------------- @@ -763,7 +763,7 @@ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fsp HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin free space header") } /* end if */ else { - if(H5FS_hdr_dest(fspace) < 0) + if(H5FS__hdr_dest(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCLOSEOBJ, FAIL, "unable to destroy free space header") } /* end else */ } /* end if */ @@ -1005,7 +1005,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FS_hdr_dest + * Function: H5FS__hdr_dest * * Purpose: Destroys a free space header in memory. * @@ -1018,12 +1018,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_hdr_dest(H5FS_t *fspace) +H5FS__hdr_dest(H5FS_t *fspace) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1047,7 +1047,7 @@ H5FS_hdr_dest(H5FS_t *fspace) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_hdr_dest() */ +} /* end H5FS__hdr_dest() */ /*------------------------------------------------------------------------- diff --git a/src/H5FScache.c b/src/H5FScache.c index 306a3fd..5ab788e 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -38,7 +38,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ @@ -167,7 +167,7 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(udata); /* Allocate a new free space manager */ - if(NULL == (fspace = H5FS_new(udata->f, udata->nclasses, udata->classes, udata->cls_init_udata))) + if(NULL == (fspace = H5FS__new(udata->f, udata->nclasses, udata->classes, udata->cls_init_udata))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set free space manager's internal information */ @@ -260,7 +260,7 @@ done: if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && fspace) - if(H5FS_hdr_dest(fspace) < 0) + if(H5FS__hdr_dest(fspace) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space header") FUNC_LEAVE_NOAPI(ret_value) @@ -463,7 +463,7 @@ H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace) } /* end if */ /* Destroy free space header */ - if(H5FS_hdr_dest(fspace) < 0) + if(H5FS__hdr_dest(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header") done: @@ -865,14 +865,12 @@ H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); /* Iterate over all the bins */ - for(bin = 0; bin < sinfo->nbins; bin++) { + for(bin = 0; bin < sinfo->nbins; bin++) /* Check if there are any sections in this bin */ - if(sinfo->bins[bin].bin_list) { + if(sinfo->bins[bin].bin_list) /* Iterate over list of section size nodes for bin */ if(H5SL_iterate(sinfo->bins[bin].bin_list, H5FS_sinfo_serialize_node_cb, &udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes") - } /* end if */ - } /* end for */ /* Compute checksum */ metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index b6c240e..78afde8 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -221,7 +221,7 @@ H5FL_EXTERN(H5FS_t); /******************************/ /* Free space manager header routines */ -H5_DLL H5FS_t *H5FS_new(const H5F_t *f, uint16_t nclasses, +H5_DLL H5FS_t *H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata); H5_DLL herr_t H5FS_incr(H5FS_t *fspace); H5_DLL herr_t H5FS_decr(H5FS_t *fspace); @@ -231,7 +231,7 @@ H5_DLL herr_t H5FS_dirty(H5FS_t *fspace); H5_DLL H5FS_sinfo_t *H5FS_sinfo_new(H5F_t *f, H5FS_t *fspace); /* Routines for destroying structures */ -H5_DLL herr_t H5FS_hdr_dest(H5FS_t *hdr); +H5_DLL herr_t H5FS__hdr_dest(H5FS_t *hdr); H5_DLL herr_t H5FS_sinfo_dest(H5FS_sinfo_t *sinfo); /* Sanity check routines */ -- cgit v0.12 From 5c437fa51fa9dde519316b4597cd0b6e8e2caf3d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:06:09 -0500 Subject: [svn-r27079] Description: Clean up H5G interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5Gcache.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 15dbf65..d1923a6 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -145,10 +145,10 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* Allocate symbol table data structures */ if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - sym->node_size = H5G_NODE_SIZE(f); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + sym->node_size = (size_t)(H5G_NODE_SIZE(f)); if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Wrap the local buffer for serialized node info */ if(NULL == (wb = H5WB_wrap(node_buf, sizeof(node_buf)))) @@ -167,12 +167,12 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* magic */ if(HDmemcmp(p, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node signature") - p += 4; + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node signature") + p += H5_SIZEOF_MAGIC; /* version */ if(H5G_NODE_VERS != *p++) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node version") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node version") /* reserved */ p++; @@ -182,7 +182,7 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* entries */ if(H5G__ent_decode_vec(f, &p, sym->entry, sym->nsyms) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries") /* Set return value */ ret_value = sym; @@ -248,7 +248,7 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_ /* magic number */ HDmemcpy(p, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC); - p += 4; + p += H5_SIZEOF_MAGIC; /* version number */ *p++ = H5G_NODE_VERS; -- cgit v0.12 From 8cc79c08258778fe1aa2780b4c5dc330640fd227 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:08:27 -0500 Subject: [svn-r27080] Description: Clean up H5HF interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5HFcache.c | 950 +++++++++++++++++++++----------------------------------- 1 file changed, 355 insertions(+), 595 deletions(-) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 0f73c68..e5ea437 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -40,7 +40,7 @@ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -75,8 +75,8 @@ /********************/ /* Local encode/decode routines */ -static herr_t H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable); -static herr_t H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable); +static herr_t H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable); +static herr_t H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable); /* Metadata cache (H5AC) callbacks */ static H5HF_hdr_t *H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); @@ -98,28 +98,16 @@ static herr_t H5HF_cache_dblock_notify(H5C_notify_action_t action, H5HF_direct_t static herr_t H5HF_cache_dblock_size(const H5F_t *f, const H5HF_direct_t *dblock, size_t *size_ptr); -/*********************************/ /* Debugging Function Prototypes */ -/*********************************/ #ifndef NDEBUG -static herr_t H5HF_cache_verify_hdr_descendants_clean(H5F_t *f, - hid_t dxpl_id, - H5HF_hdr_t * hdr, - hbool_t *clean_ptr); -static herr_t H5HF_cache_verify_iblock_descendants_clean(H5F_t *f, - hid_t dxpl_id, - H5HF_indirect_t * iblock, - unsigned * iblock_status_ptr, - hbool_t *clean_ptr); -static herr_t H5HF_cache_verify_iblocks_dblocks_clean(H5F_t *f, - H5HF_indirect_t * iblock, - hbool_t *clean_ptr, - hbool_t *has_dblocks_ptr); -static herr_t H5HF_cache_verify_descendant_iblocks_clean(H5F_t *f, - hid_t dxpl_id, - H5HF_indirect_t * iblock, - hbool_t *clean_ptr, - hbool_t *has_iblocks_ptr); +static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, + H5HF_hdr_t *hdr, hbool_t *clean); +static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, + H5HF_indirect_t *iblock, unsigned *iblock_status, hbool_t *clean); +static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, + H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_dblocks); +static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, + H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_iblocks); #endif /* NDEBUG */ @@ -176,7 +164,7 @@ H5FL_BLK_DEFINE(direct_block); /*------------------------------------------------------------------------- - * Function: H5HF_dtable_decode + * Function: H5HF__dtable_decode * * Purpose: Decodes the metadata for a doubling table * @@ -191,9 +179,9 @@ H5FL_BLK_DEFINE(direct_block); *------------------------------------------------------------------------- */ static herr_t -H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) +H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments */ HDassert(f); @@ -222,11 +210,11 @@ H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) UINT16DECODE(*pp, dtable->curr_root_rows); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_decode() */ +} /* end H5HF__dtable_decode() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_encode + * Function: H5HF__dtable_encode * * Purpose: Encodes the metadata for a doubling table * @@ -241,9 +229,9 @@ H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) *------------------------------------------------------------------------- */ static herr_t -H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) +H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments */ HDassert(f); @@ -272,7 +260,7 @@ H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) UINT16ENCODE(*pp, dtable->curr_root_rows); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_encode() */ +} /* end H5HF__dtable_encode() */ /*------------------------------------------------------------------------- @@ -313,7 +301,7 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate space for the fractal heap data structure */ if(NULL == (hdr = H5HF_hdr_alloc(udata->f))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Wrap the local buffer for serialized header info */ if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) @@ -335,12 +323,12 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Magic number */ if(HDmemcmp(p, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap header signature") + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap header signature") p += H5_SIZEOF_MAGIC; /* Version */ if(*p++ != H5HF_HDR_VERSION) - HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap header version") + HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap header version") /* General heap information */ UINT16DECODE(p, hdr->id_len); /* Heap ID length */ @@ -373,7 +361,7 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5F_DECODE_LENGTH(udata->f, p, hdr->tiny_nobjs); /* Managed objects' doubling-table info */ - if(H5HF_dtable_decode(hdr->f, &p, &(hdr->man_dtable)) < 0) + if(H5HF__dtable_decode(hdr->f, &p, &(hdr->man_dtable)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, NULL, "unable to encode managed obj. doubling table info") /* Sanity check */ @@ -443,11 +431,11 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Verify checksum */ if(stored_chksum != computed_chksum) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap header") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap header") /* Finish initialization of heap header */ if(H5HF_hdr_finish_init(hdr) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't finish initializing shared fractal heap header") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't finish initializing shared fractal heap header") /* Set return value */ ret_value = hdr; @@ -499,30 +487,27 @@ H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5H uint32_t metadata_chksum; /* Computed metadata checksum value */ #ifndef NDEBUG - /* verify that flush dependencies are working correctly. Do this +{ + /* Verify that flush dependencies are working correctly. Do this * by verifying that either: * * 1) the header has a root iblock, and that the root iblock and all - * of its children are clean, or + * of its children are clean, or * - * 2) The header has a root dblock, which is clean, or + * 2) The header has a root dblock, which is clean, or * * 3) The heap is empty, and thus the header has neither a root - * iblock no a root dblock. In this case, the flush ordering + * iblock no a root dblock. In this case, the flush ordering * constraint is met by default. * - * Do this with a call to H5HF_cache_verify_hdr_descendants_clean(). + * Do this with a call to H5HF__cache_verify_hdr_descendants_clean(). */ hbool_t descendants_clean = TRUE; - if ( H5HF_cache_verify_hdr_descendants_clean(f, dxpl_id, hdr, - &descendants_clean) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "can't verify hdr descendants clean.") - - HDassert( descendants_clean ); - + if(H5HF__cache_verify_hdr_descendants_clean(f, dxpl_id, hdr, &descendants_clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") + HDassert(descendants_clean); +} #endif /* NDEBUG */ /* Set the shared heap header's file context for this operation */ @@ -557,8 +542,8 @@ H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5H /* (bit 0: "huge" object IDs have wrapped) */ /* (bit 1: checksum direct blocks) */ heap_flags = 0; - heap_flags |= (hdr->huge_ids_wrapped ? H5HF_HDR_FLAGS_HUGE_ID_WRAPPED : 0); - heap_flags |= (hdr->checksum_dblocks ? H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS : 0); + heap_flags = (uint8_t)(heap_flags | (hdr->huge_ids_wrapped ? H5HF_HDR_FLAGS_HUGE_ID_WRAPPED : 0)); + heap_flags = (uint8_t)(heap_flags | (hdr->checksum_dblocks ? H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS : 0)); *p++ = heap_flags; /* "Huge" object information */ @@ -581,7 +566,7 @@ H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5H H5F_ENCODE_LENGTH(f, p, hdr->tiny_nobjs); /* Managed objects' doubling-table info */ - if(H5HF_dtable_encode(hdr->f, &p, &(hdr->man_dtable)) < 0) + if(H5HF__dtable_encode(hdr->f, &p, &(hdr->man_dtable)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "unable to encode managed obj. doubling table info") /* Check for I/O filter information to encode */ @@ -780,7 +765,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate space for the fractal heap indirect block */ if(NULL == (iblock = H5FL_CALLOC(H5HF_indirect_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Get the pointer to the shared heap header */ hdr = udata->par_info->hdr; @@ -791,7 +776,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Share common heap information */ iblock->hdr = hdr; if(H5HF_hdr_incr(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ iblock->rc = 0; @@ -818,17 +803,17 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Magic number */ if(HDmemcmp(p, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap indirect block signature") + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap indirect block signature") p += H5_SIZEOF_MAGIC; /* Version */ if(*p++ != H5HF_IBLOCK_VERSION) - HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap direct block version") + HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap direct block version") /* Address of heap that owns this block */ H5F_addr_decode(udata->f, &p, &heap_addr); if(H5F_addr_ne(heap_addr, hdr->heap_addr)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect heap header address for direct block") + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect heap header address for direct block") /* Address of parent block */ iblock->parent = udata->par_info->iblock; @@ -856,9 +841,10 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate & decode child block entry tables */ HDassert(iblock->nrows > 0); if(NULL == (iblock->ents = H5FL_SEQ_MALLOC(H5HF_indirect_ent_t, (size_t)(iblock->nrows * hdr->man_dtable.cparam.width)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for direct entries") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for direct entries") + if(hdr->filter_len > 0) { - unsigned dir_rows; /* Number of direct rows in this indirect block */ + unsigned dir_rows; /* Number of direct rows in this indirect block */ /* Compute the number of direct rows for this indirect block */ dir_rows = MIN(iblock->nrows, hdr->man_dtable.max_direct_rows); @@ -869,6 +855,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end if */ else iblock->filt_ents = NULL; + for(u = 0; u < (iblock->nrows * hdr->man_dtable.cparam.width); u++) { /* Decode child block address */ H5F_addr_decode(udata->f, &p, &(iblock->ents[u].addr)); @@ -903,7 +890,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end for */ /* Sanity check */ - HDassert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */ + HDassert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */ /* Compute checksum on indirect block */ computed_chksum = H5_checksum_metadata(buf, (size_t)(p - (const uint8_t *)buf), 0); @@ -916,7 +903,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Verify checksum */ if(stored_chksum != computed_chksum) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block") /* Check if we have any indirect block children */ if(iblock->nrows > hdr->man_dtable.max_direct_rows) { @@ -986,31 +973,26 @@ H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, size_t u; /* Local index variable */ #ifndef NDEBUG - /* verify that flush dependencies are working correctly. Do this +{ + /* Verify that flush dependencies are working correctly. Do this * by verifying that all children of this iblock are clean. */ hbool_t descendants_clean = TRUE; unsigned iblock_status; - if ( H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0 ) - + if(H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") - /* since the current iblock is the guest of honor in a flush, we know + /* since the current iblock is the guest of honor in a flush, we know * that it is locked into the cache for the duration of the call. Hence - * there is no need to check to see if it is pinned or protected, or to + * there is no need to check to see if it is pinned or protected, or to * protect it if it is not. */ - - if ( H5HF_cache_verify_iblock_descendants_clean(f, dxpl_id, - iblock, &iblock_status, - &descendants_clean) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "can't verify descendants clean.") + if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, iblock, &iblock_status, &descendants_clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") HDassert(descendants_clean); - +} #endif /* NDEBUG */ /* Get the pointer to the shared heap header */ @@ -1276,99 +1258,78 @@ H5HF_cache_iblock_notify(H5C_notify_action_t action, H5HF_indirect_t *iblock) HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->hdr); - if ( action == H5C_NOTIFY_ACTION_BEFORE_EVICT ) - HDassert((iblock->parent == iblock->fd_parent) || - ((NULL == iblock->parent) && (iblock->fd_parent))); + + if(action == H5AC_NOTIFY_ACTION_BEFORE_EVICT) + HDassert((iblock->parent == iblock->fd_parent) || ((NULL == iblock->parent) && (iblock->fd_parent))); else - HDassert(iblock->parent == iblock->fd_parent); + HDassert(iblock->parent == iblock->fd_parent); /* further sanity checks */ - if ( iblock->parent == NULL ) { - - /* Either this is the root iblock, or the parent pointer is */ + if(iblock->parent == NULL) { + /* Either this is the root iblock, or the parent pointer is */ /* invalid. Since we save a copy of the parent pointer on */ /* the insertion event, it doesn't matter if the parent pointer */ /* is invalid just before eviction. However, we will not be */ /* able to function if it is invalid on the insertion event. */ - /* Scream and die if this is the case. */ - - HDassert((action == H5C_NOTIFY_ACTION_BEFORE_EVICT) || - (iblock->block_off == 0)); + /* Scream and die if this is the case. */ + HDassert((action == H5C_NOTIFY_ACTION_BEFORE_EVICT) || (iblock->block_off == 0)); - /* pointer from hdr to root iblock will not be set up unless */ - /* the fractal heap has already pinned the hdr. Do what */ + /* pointer from hdr to root iblock will not be set up unless */ + /* the fractal heap has already pinned the hdr. Do what */ /* sanity checking we can. */ - - if ( ( iblock->block_off == 0 ) && - ( iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED ) ) + if((iblock->block_off == 0) && (iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED)) HDassert(iblock->hdr->root_iblock == iblock); - - } else { - /* if this is a child iblock, verify that the pointers are */ + } /* end if */ + else { + /* if this is a child iblock, verify that the pointers are */ /* either uninitialized or set up correctly. */ H5HF_indirect_t *par_iblock = iblock->parent; unsigned indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ HDassert(par_iblock->child_iblocks); - HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width)); + HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width)); /* Compute index in parent's child iblock pointer array */ - indir_idx = iblock->par_entry - - (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width); + indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width); - /* The pointer to iblock in the parent may not be set yet -- */ + /* The pointer to iblock in the parent may not be set yet -- */ /* verify that it is either NULL, or that it has been set to */ /* iblock. */ - HDassert((NULL == par_iblock->child_iblocks[indir_idx]) || - (par_iblock->child_iblocks[indir_idx] == iblock)); - } - - switch ( action ) - { - case H5C_NOTIFY_ACTION_AFTER_INSERT: - if ( iblock->parent ) /* this is a child iblock */ - { - /* create flush dependency with parent iblock */ - if(H5AC_create_flush_dependency(iblock->parent, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \ - "unable to create flush dependency") - } - else /* this is the root iblock */ - { - /* create flush dependency with header */ - if(H5AC_create_flush_dependency(iblock->hdr, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \ - "unable to create flush dependency") - } - break; - - case H5C_NOTIFY_ACTION_BEFORE_EVICT: - if ( iblock->fd_parent ) /* this is a child iblock */ - { - /* destroy flush dependency with parent iblock */ - if(H5AC_destroy_flush_dependency(iblock->fd_parent, - iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \ - "unable to destroy flush dependency") - } - else /* this is the root iblock */ - { - /* destroy flush dependency with header */ - if(H5AC_destroy_flush_dependency(iblock->hdr, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \ - "unable to destroy flush dependency") - - } - break; - - default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "unknown action from metadata cache") - break; - } + HDassert((NULL == par_iblock->child_iblocks[indir_idx]) || (par_iblock->child_iblocks[indir_idx] == iblock)); + } /* end else */ + + switch(action) { + case H5AC_NOTIFY_ACTION_AFTER_INSERT: + if(iblock->parent) { /* this is a child iblock */ + /* create flush dependency with parent iblock */ + if(H5AC_create_flush_dependency(iblock->parent, iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end if */ + else { /* this is the root iblock */ + /* create flush dependency with header */ + if(H5AC_create_flush_dependency(iblock->hdr, iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end else */ + break; + + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: + if(iblock->fd_parent) { /* this is a child iblock */ + /* destroy flush dependency with parent iblock */ + if(H5AC_destroy_flush_dependency(iblock->fd_parent, iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + } /* end if */ + else { /* this is the root iblock */ + /* destroy flush dependency with header */ + if(H5AC_destroy_flush_dependency(iblock->hdr, iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + } /* end else */ + break; + + default: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown action from metadata cache") + break; + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1424,8 +1385,8 @@ H5HF_cache_iblock_size(const H5F_t UNUSED *f, const H5HF_indirect_t *iblock, siz static H5HF_direct_t * H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) { - H5HF_dblock_cache_ud_t *udata = (H5HF_dblock_cache_ud_t *)_udata; /* pointer to user data */ H5HF_hdr_t *hdr; /* Shared fractal heap information */ + H5HF_dblock_cache_ud_t *udata = (H5HF_dblock_cache_ud_t *)_udata; /* User data for callback */ H5HF_parent_t *par_info; /* Pointer to parent information */ H5HF_direct_t *dblock = NULL; /* Direct block info */ const uint8_t *p; /* Pointer into raw data buffer */ @@ -1443,7 +1404,7 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate space for the fractal heap direct block */ if(NULL == (dblock = H5FL_MALLOC(H5HF_direct_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDmemset(&dblock->cache_info, 0, sizeof(H5AC_info_t)); /* Get the pointer to the shared heap header */ @@ -1456,7 +1417,7 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Share common heap information */ dblock->hdr = hdr; if(H5HF_hdr_incr(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ dblock->size = udata->dblock_size; @@ -1473,7 +1434,7 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ void *read_buf; /* Pointer to buffer to read in */ size_t read_size; /* Size of filtered direct block to read */ - unsigned filter_mask; /* Excluded filters for direct block */ + unsigned filter_mask; /* Excluded filters for direct block */ /* Check for root direct block */ if(par_info->iblock == NULL) { @@ -1525,17 +1486,17 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Magic number */ if(HDmemcmp(p, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap direct block signature") + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong fractal heap direct block signature") p += H5_SIZEOF_MAGIC; /* Version */ if(*p++ != H5HF_DBLOCK_VERSION) - HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap direct block version") + HGOTO_ERROR(H5E_HEAP, H5E_VERSION, NULL, "wrong fractal heap direct block version") /* Address of heap that owns this block (just for file integrity checks) */ H5F_addr_decode(udata->f, &p, &heap_addr); if(H5F_addr_ne(heap_addr, hdr->heap_addr)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect heap header address for direct block") + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect heap header address for direct block") /* Address of parent block */ dblock->parent = par_info->iblock; @@ -1973,57 +1934,43 @@ H5HF_cache_dblock_notify(H5C_notify_action_t action, H5HF_direct_t *dblock) HDassert(dblock); HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(dblock->hdr); - HDassert((dblock->fd_parent) || - ((dblock->hdr->man_dtable.curr_root_rows == 0) && - (dblock->block_off == (hsize_t)0))); - - switch ( action ) - { - case H5C_NOTIFY_ACTION_AFTER_INSERT: - HDassert(dblock->parent == dblock->fd_parent); - - if ( dblock->parent ) /* this is a leaf dblock */ - { - /* create flush dependency with parent iblock */ - if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \ - "unable to create flush dependency") - } - else /* this is a root dblock */ - { - /* create flush dependency with header */ - if(H5AC_create_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \ - "unable to create flush dependency") - } - break; - - case H5C_NOTIFY_ACTION_BEFORE_EVICT: + HDassert((dblock->fd_parent) || + ((dblock->hdr->man_dtable.curr_root_rows == 0) && (dblock->block_off == (hsize_t)0))); + + switch(action) { + case H5AC_NOTIFY_ACTION_AFTER_INSERT: + HDassert(dblock->parent == dblock->fd_parent); + if(dblock->parent) { /* this is a leaf dblock */ + /* create flush dependency with parent iblock */ + if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end if */ + else { /* this is a root dblock */ + /* create flush dependency with header */ + if(H5AC_create_flush_dependency(dblock->hdr, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end else */ + break; + + case H5AC_NOTIFY_ACTION_BEFORE_EVICT: HDassert((dblock->parent == dblock->fd_parent) || - ((NULL == dblock->parent) && (dblock->fd_parent))); - if ( dblock->fd_parent ) /* this is a leaf dblock */ - { - /* destroy flush dependency with parent iblock */ - if(H5AC_destroy_flush_dependency(dblock->fd_parent, - dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \ - "unable to destroy flush dependency") - } - else /* this is a root dblock */ - { - /* destroy flush dependency with header */ - if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \ - "unable to destroy flush dependency") - - } - break; - - default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "unknown action from metadata cache") - break; - } + ((NULL == dblock->parent) && (dblock->fd_parent))); + if(dblock->fd_parent) { /* this is a leaf dblock */ + /* destroy flush dependency with parent iblock */ + if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + } /* end if */ + else { /* this is a root dblock */ + /* destroy flush dependency with header */ + if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + } /* end else */ + break; + + default: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown action from metadata cache") + break; + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -2063,11 +2010,11 @@ H5HF_cache_dblock_size(const H5F_t UNUSED *f, const H5HF_direct_t *dblock, size_ /*------------------------------------------------------------------------ - * Function: H5HF_cache_verify_hdr_descendants_clean + * Function: H5HF__cache_verify_hdr_descendants_clean * * Purpose: Sanity checking routine that verifies that all indirect * and direct blocks that are descendants of the supplied - * instance of H5HF_hdr_t are clean. Set *clean_ptr to + * instance of H5HF_hdr_t are clean. Set *clean to * TRUE if this is the case, and to FALSE otherwise. * * Return: Non-negative on success/Negative on failure @@ -2079,41 +2026,26 @@ H5HF_cache_dblock_size(const H5F_t UNUSED *f, const H5HF_direct_t *dblock, size_ */ #ifndef NDEBUG static herr_t -H5HF_cache_verify_hdr_descendants_clean(H5F_t *f, - hid_t dxpl_id, - H5HF_hdr_t * hdr, - hbool_t *clean_ptr) +H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, + H5HF_hdr_t * hdr, hbool_t *clean) { - hbool_t in_cache; - hbool_t type_ok; - hbool_t root_iblock_in_cache = FALSE; - hbool_t unprotect_root_iblock = FALSE; - unsigned hdr_status = 0; - unsigned root_iblock_status = 0; - unsigned root_dblock_status = 0; - H5HF_indirect_t * root_iblock = NULL; - haddr_t hdr_addr; - haddr_t root_iblock_addr = HADDR_UNDEF; - haddr_t root_dblock_addr; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) + haddr_t hdr_addr; /* Address of header */ + unsigned hdr_status = 0; /* Header cache entry status */ + herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC + + /* Sanity checks */ HDassert(f); HDassert(hdr); HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert((const H5AC_class_t *)(hdr->cache_info.type) == \ - &(H5AC_FHEAP_HDR[0])); - HDassert(clean_ptr); - + HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + HDassert(clean); hdr_addr = hdr->cache_info.addr; - HDassert(hdr_addr == hdr->heap_addr); - if ( H5AC_get_entry_status(f, hdr_addr, &hdr_status) < 0 ) - + if(H5AC_get_entry_status(f, hdr_addr, &hdr_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get hdr status") - HDassert(hdr_status & H5AC_ES__IN_CACHE); /* We have three basic scenarios we have to deal with: @@ -2146,64 +2078,50 @@ H5HF_cache_verify_hdr_descendants_clean(H5F_t *f, * Since the former case is far and away the most common, we don't * worry too much about efficiency in the second case. */ - - if ( ( hdr->root_iblock ) || - ( ( hdr->man_dtable.curr_root_rows > 0 ) && - ( HADDR_UNDEF != hdr->man_dtable.table_addr ) ) ) { - - root_iblock = hdr->root_iblock; - - /* make note of the on disk address of the root iblock */ - - if ( root_iblock == NULL ) { - + if(hdr->root_iblock || + ((hdr->man_dtable.curr_root_rows > 0) && + (HADDR_UNDEF != hdr->man_dtable.table_addr))) { + H5HF_indirect_t *root_iblock = hdr->root_iblock; + haddr_t root_iblock_addr; + unsigned root_iblock_status = 0; + hbool_t root_iblock_in_cache; + + /* make note of the on disk address of the root iblock */ + if(root_iblock == NULL) /* hdr->man_dtable.table_addr must contain address of root * iblock. Check to see if it is in cache. If it is, * protect it and put its address in root_iblock. */ root_iblock_addr = hdr->man_dtable.table_addr; - - } else { - + else root_iblock_addr = root_iblock->addr; - } /* get the status of the root iblock */ HDassert(root_iblock_addr != HADDR_UNDEF); + if(H5AC_get_entry_status(f, root_iblock_addr, &root_iblock_status) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get root iblock status") - if ( H5AC_get_entry_status(f, root_iblock_addr, - &root_iblock_status) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, \ - "can't get root iblock status") - - root_iblock_in_cache = ( (root_iblock_status & H5AC_ES__IN_CACHE) != 0 ); - + root_iblock_in_cache = ( (root_iblock_status & H5AC_ES__IN_CACHE) != 0); HDassert(root_iblock_in_cache || (root_iblock == NULL)); - if ( ! root_iblock_in_cache ) { /* we are done */ - - *clean_ptr = TRUE; - - } else if ( root_iblock_status & H5AC_ES__IS_DIRTY ) { - - *clean_ptr = FALSE; - - } else { /* must examine children */ + if(!root_iblock_in_cache) /* we are done */ + *clean = TRUE; + else if(root_iblock_status & H5AC_ES__IS_DIRTY) + *clean = FALSE; + else { /* must examine children */ + hbool_t unprotect_root_iblock = FALSE; /* At this point, the root iblock may be pinned, protected, * both, or neither, and we may or may not have a pointer * to root iblock in memory. * - * Before we call H5HF_cache_verify_iblock_descendants_clean(), + * Before we call H5HF__cache_verify_iblock_descendants_clean(), * we must ensure that the root iblock is either pinned or * protected or both, and that we have a pointer to it. * Do this as follows: */ - if ( root_iblock == NULL ) { /* we don't have ptr to root iblock */ - - if ( 0 == (root_iblock_status & H5AC_ES__IS_PROTECTED) ) { - + if(root_iblock == NULL) { /* we don't have ptr to root iblock */ + if(0 == (root_iblock_status & H5AC_ES__IS_PROTECTED)) { /* just protect the root iblock -- this will give us * the pointer we need to proceed, and ensure that * it is locked into the metadata cache for the @@ -2214,21 +2132,11 @@ H5HF_cache_verify_hdr_descendants_clean(H5F_t *f, * in this case, since we know that the entry is in cache, * we can pass NULL udata. */ - - root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, - H5AC_FHEAP_IBLOCK, - root_iblock_addr, - NULL, H5AC_READ); - - if ( NULL == root_iblock ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, \ - "H5AC_protect() faild.") - + if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") unprotect_root_iblock = TRUE; - - } else { - + } /* end if */ + else { /* the root iblock is protected, and we have no * legitimate way of getting a pointer to it. * @@ -2263,25 +2171,20 @@ H5HF_cache_verify_hdr_descendants_clean(H5F_t *f, * code, I expect that we will use this approach until it * causes problems, or we think of a better way. */ - if ( H5AC_get_entry_ptr_from_addr(f, root_iblock_addr, - (void **)(&root_iblock)) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, \ - "H5AC_get_entry_ptr_from_addr() failed.") - + if(H5AC_get_entry_ptr_from_addr(f, root_iblock_addr, (void **)(&root_iblock)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() failed.") HDassert(root_iblock); - } - } else /* root_iblock != NULL */ { - + } /* end else */ + } /* end if */ + else { /* root_iblock != NULL */ /* we have the pointer to the root iblock. Protect it * if it is neither pinned nor protected -- otherwise we * are ready to go. */ H5HF_indirect_t * iblock = NULL; - if ( ( (root_iblock_status & H5AC_ES__IS_PINNED) == 0 ) && - ( (root_iblock_status & H5AC_ES__IS_PROTECTED) == 0 ) ) { - + if(((root_iblock_status & H5AC_ES__IS_PINNED) == 0) && + ((root_iblock_status & H5AC_ES__IS_PROTECTED) == 0)) { /* the root iblock is neither pinned nor protected -- hence * we must protect it before we proceed * @@ -2290,82 +2193,49 @@ H5HF_cache_verify_hdr_descendants_clean(H5F_t *f, * in this case, since we know that the entry is in cache, * we can pass NULL udata. */ - - iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, - H5AC_FHEAP_IBLOCK, - root_iblock_addr, - NULL, H5AC_READ); - - if ( NULL == iblock ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, \ - "H5AC_protect() faild.") - + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") unprotect_root_iblock = TRUE; - HDassert(iblock == root_iblock); - - } - } + } /* end if */ + } /* end else */ /* at this point, one way or another, the root iblock is locked * in memory for the duration of the call. Do some sanity checks, - * and then call H5HF_cache_verify_iblock_descendants_clean(). + * and then call H5HF__cache_verify_iblock_descendants_clean(). */ + HDassert(hdr->root_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(hdr->root_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(hdr->root_iblock->cache_info.magic == \ - H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert((const H5AC_class_t *)(hdr->root_iblock->cache_info.type) \ - == &(H5AC_FHEAP_IBLOCK[0])); - - if ( H5HF_cache_verify_iblock_descendants_clean(f, dxpl_id, - root_iblock, &root_iblock_status, - clean_ptr) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "can't verify root iblock & descendants clean.") - + if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, root_iblock, &root_iblock_status, clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify root iblock & descendants clean.") /* unprotect the root indirect block if required */ - if ( unprotect_root_iblock ) { - + if(unprotect_root_iblock) { HDassert(root_iblock); - - if ( H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, - root_iblock_addr, root_iblock, - H5AC__NO_FLAGS_SET) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, \ - "H5AC_unprotect() faild.") - } - } - } else if ( ( hdr->man_dtable.curr_root_rows == 0 ) && - ( HADDR_UNDEF != hdr->man_dtable.table_addr ) ) { + if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, root_iblock, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") + } /* end if */ + } /* end else */ + } /* end if */ + else if((hdr->man_dtable.curr_root_rows == 0) && + (HADDR_UNDEF != hdr->man_dtable.table_addr)) { + haddr_t root_dblock_addr; + unsigned root_dblock_status = 0; + hbool_t in_cache; + hbool_t type_ok; /* this is scenario 2 -- we have a root dblock */ - root_dblock_addr = hdr->man_dtable.table_addr; + if(H5AC_get_entry_status(f, root_dblock_addr, &root_dblock_status) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get root dblock status") - if ( H5AC_get_entry_status(f, root_dblock_addr, - &root_dblock_status) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, \ - "can't get root dblock status") - - if ( root_dblock_status & H5AC_ES__IN_CACHE ) { - - if ( H5AC_verify_entry_type(f, root_dblock_addr, - &H5AC_FHEAP_DBLOCK[0], - &in_cache, &type_ok) < 0 ) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, - "can't check dblock type") - + if(root_dblock_status & H5AC_ES__IN_CACHE) { + if(H5AC_verify_entry_type(f, root_dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type") HDassert(in_cache); - - if ( !type_ok ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "root dblock addr doesn't refer to a dblock?!?") + if(!type_ok) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock addr doesn't refer to a dblock?!?") /* If a root dblock is in cache, it must have a flush * dependency relationship with the header, and it @@ -2376,45 +2246,34 @@ H5HF_cache_verify_hdr_descendants_clean(H5F_t *f, * the root iblock is a child in some flush dependency * relationship. */ - if ( 0 == (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD) ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "root dblock in cache and not a flush dep child.") - - if ( 0 != (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT) ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "root dblock in cache and is a flush dep parent.") - - - *clean_ptr = ! (root_dblock_status & H5AC_ES__IS_DIRTY); - - } else { /* root dblock not in cache */ - - *clean_ptr = TRUE; - } - } else { + if(0 == (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and not a flush dep child.") + if(0 != (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and is a flush dep parent.") + + *clean = ! (root_dblock_status & H5AC_ES__IS_DIRTY); + } /* end if */ + else /* root dblock not in cache */ + *clean = TRUE; + } /* end else-if */ + else /* this is scenario 3 -- the fractal heap is empty, and we * have nothing to do. */ - *clean_ptr = TRUE; - } + *clean = TRUE; done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5HF_cache_verify_hdr_descendants_clean() */ - +} /* H5HF__cache_verify_hdr_descendants_clean() */ #endif /* NDEBUG */ /*------------------------------------------------------------------------ - * Function: H5HF_cache_verify_iblock_descendants_clean + * Function: H5HF__cache_verify_iblock_descendants_clean * * Purpose: Sanity checking routine that verifies that all indirect * and direct blocks that are decendents of the supplied - * instance of H5HF_indirect_t are clean. Set *clean_ptr + * instance of H5HF_indirect_t are clean. Set *clean * to TRUE if this is the case, and to FALSE otherwise. * * In passing, the function also does a cursory check to @@ -2433,7 +2292,7 @@ done: * met. * * Note that this function and - * H5HF_cache_verify_descendant_iblocks_clean() are + * H5HF__cache_verify_descendant_iblocks_clean() are * recursive co-routines. * * Return: Non-negative on success/Negative on failure @@ -2445,72 +2304,49 @@ done: */ #ifndef NDEBUG static herr_t -H5HF_cache_verify_iblock_descendants_clean(H5F_t *f, - hid_t dxpl_id, - H5HF_indirect_t * iblock, - unsigned * iblock_status_ptr, - hbool_t *clean_ptr) +H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, + H5HF_indirect_t *iblock, unsigned *iblock_status, hbool_t *clean) { hbool_t has_dblocks = FALSE; hbool_t has_iblocks = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(f); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert((const H5AC_class_t *)(iblock->cache_info.type) == \ - &(H5AC_FHEAP_IBLOCK[0])); - HDassert(iblock_status_ptr); - HDassert(clean_ptr); - HDassert(*clean_ptr); - - if ( ( *clean_ptr ) && - ( H5HF_cache_verify_iblocks_dblocks_clean(f, iblock, clean_ptr, - &has_dblocks) < 0 ) ) + HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(iblock_status); + HDassert(clean); + HDassert(*clean); + + if((*clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, iblock, clean, &has_dblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify dblocks clean.") - if ( ( *clean_ptr ) && - ( H5HF_cache_verify_descendant_iblocks_clean(f, dxpl_id, iblock, - clean_ptr, &has_iblocks) < 0 ) ) + if((*clean) && H5HF__cache_verify_descendant_iblocks_clean(f, dxpl_id, iblock, clean, &has_iblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify iblocks clean.") - if ( ( NULL == iblock_status_ptr ) && - ( H5AC_get_entry_status(f, iblock->addr, iblock_status_ptr) < 0 ) ) - + if((NULL == iblock_status) && H5AC_get_entry_status(f, iblock->addr, iblock_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") /* verify that flush dependency setup is plausible */ - - if ( 0 == (*iblock_status_ptr & H5AC_ES__IS_FLUSH_DEP_CHILD) ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "iblock is not a flush dep child.") - - if ( ( ( has_dblocks || has_iblocks ) ) && - ( 0 == (*iblock_status_ptr & H5AC_ES__IS_FLUSH_DEP_PARENT) ) ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "iblock has children and is not a flush dep parent.") - - if ( ( ( has_dblocks || has_iblocks ) ) && - ( 0 == (*iblock_status_ptr & H5AC_ES__IS_PINNED) ) ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "iblock has children and is not pinned.") + if(0 == (*iblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "iblock is not a flush dep child.") + if(((has_dblocks || has_iblocks)) && (0 == (*iblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT))) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "iblock has children and is not a flush dep parent.") + if(((has_dblocks || has_iblocks)) && (0 == (*iblock_status & H5AC_ES__IS_PINNED))) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "iblock has children and is not pinned.") done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5HF_cache_verify_iblock_descendants_clean() */ - +} /* H5HF__cache_verify_iblock_descendants_clean() */ #endif /* NDEBUG */ /*------------------------------------------------------------------------ - * Function: H5HF_cache_verify_iblocks_dblocks_clean + * Function: H5HF__cache_verify_iblocks_dblocks_clean * * Purpose: Sanity checking routine that attempts to verify that all * direct blocks pointed to by the supplied indirect block @@ -2538,71 +2374,53 @@ done: */ #ifndef NDEBUG static herr_t -H5HF_cache_verify_iblocks_dblocks_clean(H5F_t *f, - H5HF_indirect_t * iblock, - hbool_t *clean_ptr, - hbool_t *has_dblocks_ptr) +H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, H5HF_indirect_t *iblock, + hbool_t *clean, hbool_t *has_dblocks) { - hbool_t in_cache; - hbool_t type_ok; - unsigned i; unsigned num_direct_rows; unsigned max_dblock_index; - haddr_t dblock_addr; - unsigned dblock_status = 0; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(f); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(clean_ptr); - HDassert(*clean_ptr); - HDassert(has_dblocks_ptr); + HDassert(clean); + HDassert(*clean); + HDassert(has_dblocks); i = 0; - - num_direct_rows = - MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); - - HDassert(num_direct_rows <= iblock->nrows ); - - max_dblock_index = - (num_direct_rows * iblock->hdr->man_dtable.cparam.width) - 1; - - while ( ( *clean_ptr ) && ( i <= max_dblock_index ) ) { + num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); + HDassert(num_direct_rows <= iblock->nrows); + max_dblock_index = (num_direct_rows * iblock->hdr->man_dtable.cparam.width) - 1; + while((*clean) && (i <= max_dblock_index)) { + haddr_t dblock_addr; dblock_addr = iblock->ents[i].addr; + if(H5F_addr_defined(dblock_addr)) { + hbool_t in_cache; + hbool_t type_ok; - if ( H5F_addr_defined(dblock_addr) ) { - - if ( H5AC_verify_entry_type(f, dblock_addr, &H5AC_FHEAP_DBLOCK[0], - &in_cache, &type_ok) < 0 ) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, - "can't check dblock type") - - if ( in_cache ) { /* dblock is in cache */ - - if ( ! type_ok ) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "dblock addr doesn't refer to a dblock?!?") + if(H5AC_verify_entry_type(f, dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type") - if ( H5AC_get_entry_status(f, dblock_addr, - &dblock_status) < 0 ) + if(in_cache) { /* dblock is in cache */ + unsigned dblock_status = 0; - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, - "can't get dblock status") + if(!type_ok) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock addr doesn't refer to a dblock?!?") - HDassert(dblock_status & H5AC_ES__IN_CACHE ); + if(H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get dblock status") + HDassert(dblock_status & H5AC_ES__IN_CACHE); - *has_dblocks_ptr = TRUE; - - if ( dblock_status & H5AC_ES__IS_DIRTY ) { - - *clean_ptr = FALSE; - } + *has_dblocks = TRUE; + if(dblock_status & H5AC_ES__IS_DIRTY) + *clean = FALSE; /* If a child dblock is in cache, it must have a flush * dependency relationship with this iblock, and it @@ -2613,33 +2431,26 @@ H5HF_cache_verify_iblocks_dblocks_clean(H5F_t *f, * the child iblock is a child in some flush dependency * relationship. */ - if ( 0 == (dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD) ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "dblock in cache and not a flush dep child.") + if(0 == (dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and not a flush dep child.") - if ( 0 != (dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT) ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "dblock in cache and is a flush dep parent.") + if(0 != (dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and is a flush dep parent.") - } - } + } /* end if */ + } /* end if */ i++; - } + } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5HF_cache_verify_iblocks_dblocks_clean() */ - +} /* H5HF__cache_verify_iblocks_dblocks_clean() */ #endif /* NDEBUG */ /*------------------------------------------------------------------------ - * Function: H5HF_cache_verify_descendant_iblocks_clean + * Function: H5HF__cache_verify_descendant_iblocks_clean * * Purpose: Sanity checking routine that attempts to verify that all * direct blocks pointed to by the supplied indirect block @@ -2667,70 +2478,52 @@ done: */ #ifndef NDEBUG static herr_t -H5HF_cache_verify_descendant_iblocks_clean(H5F_t *f, - hid_t dxpl_id, - H5HF_indirect_t * iblock, - hbool_t *clean_ptr, - hbool_t *has_iblocks_ptr) +H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, + H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_iblocks) { - hbool_t unprotect_child_iblock; - unsigned i; unsigned first_iblock_index; unsigned last_iblock_index; unsigned num_direct_rows; - unsigned child_iblock_status = 0; - haddr_t child_iblock_addr; - H5HF_indirect_t * child_iblock_ptr; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(f); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(iblock->cache_info.type == &(H5AC_FHEAP_IBLOCK[0])); - HDassert(clean_ptr); - HDassert(*clean_ptr); - HDassert(has_iblocks_ptr); - - num_direct_rows = - MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); - - HDassert(num_direct_rows <= iblock->nrows ); + HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(clean); + HDassert(*clean); + HDassert(has_iblocks); + num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); + HDassert(num_direct_rows <= iblock->nrows); first_iblock_index = num_direct_rows * iblock->hdr->man_dtable.cparam.width; - last_iblock_index = - (iblock->nrows * iblock->hdr->man_dtable.cparam.width) - 1; + last_iblock_index = (iblock->nrows * iblock->hdr->man_dtable.cparam.width) - 1; i = first_iblock_index; + while((*clean) && (i <= last_iblock_index)) { + haddr_t child_iblock_addr = iblock->ents[i].addr; - while ( ( *clean_ptr ) && ( i <= last_iblock_index ) ) { - - child_iblock_addr = iblock->ents[i].addr; - - if ( H5F_addr_defined(child_iblock_addr) ) { + if(H5F_addr_defined(child_iblock_addr)) { + unsigned child_iblock_status = 0; - if ( H5AC_get_entry_status(f, child_iblock_addr, - &child_iblock_status) < 0 ) + if(H5AC_get_entry_status(f, child_iblock_addr, &child_iblock_status) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, \ - "can't get iblock status") + if(child_iblock_status & H5AC_ES__IN_CACHE) { + *has_iblocks = TRUE; + if(child_iblock_status & H5AC_ES__IS_DIRTY) + *clean = FALSE; - if ( child_iblock_status & H5AC_ES__IN_CACHE ) { - - *has_iblocks_ptr = TRUE; - - if ( child_iblock_status & H5AC_ES__IS_DIRTY ) { - - *clean_ptr = FALSE; - } - - /* if the child iblock is in cache and *clean_ptr is TRUE, + /* if the child iblock is in cache and *clean is TRUE, * we must continue to explore down the fractal heap tree * structure to verify that all descendant blocks are either * clean, or not in the metadata cache. We do this with a * recursive call to - * H5HF_cache_verify_iblock_descendants_clean(). + * H5HF__cache_verify_iblock_descendants_clean(). * However, we can't make this call unless the child iblock * is somehow locked into the cache -- typically via either * pinning or protecting. @@ -2776,102 +2569,69 @@ H5HF_cache_verify_descendant_iblocks_clean(H5F_t *f, * expect that we will use this approach until it causes * problems, or we think of a better way. */ - if ( *clean_ptr ) { - - child_iblock_ptr = NULL; - unprotect_child_iblock = FALSE; + if(*clean) { + H5HF_indirect_t *child_iblock = NULL; + hbool_t unprotect_child_iblock = FALSE; - if ( 0 == (child_iblock_status & H5AC_ES__IS_PINNED)) { - + if(0 == (child_iblock_status & H5AC_ES__IS_PINNED)) { /* child iblock is not pinned */ - - if (0 == (child_iblock_status & H5AC_ES__IS_PROTECTED)){ - + if(0 == (child_iblock_status & H5AC_ES__IS_PROTECTED)) { /* child iblock is unprotected, and unpinned */ /* protect it. Note that the udata is only */ /* used in the load callback. While the */ /* fractal heap makes heavy use of the udata */ /* in this case, since we know that the */ /* entry is in cache, we can pass NULL udata */ - child_iblock_ptr = (H5HF_indirect_t *) - H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, - child_iblock_addr, - NULL, H5AC_READ); - - if ( NULL == child_iblock_ptr ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, \ - "H5AC_protect() faild.") + if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") unprotect_child_iblock = TRUE; - - } else { - + } /* end if */ + else { /* child iblock is protected -- use */ /* H5AC_get_entry_ptr_from_addr() to get a */ /* pointer to the entry. This is very slimy -- */ /* come up with a better solution. */ - if ( H5AC_get_entry_ptr_from_addr(f, - child_iblock_addr, - (void **)(&child_iblock_ptr)) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, \ - "H5AC_get_entry_ptr_from_addr() faild.") - - HDassert ( child_iblock_ptr ); - } - } else { + if(H5AC_get_entry_ptr_from_addr(f, child_iblock_addr, (void **)(&child_iblock)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() faild.") + HDassert(child_iblock); + } /* end else */ + } /* end if */ + else { /* child iblock is pinned -- look it up in the */ /* parent iblocks child_iblocks array. */ - HDassert(iblock->child_iblocks); - - child_iblock_ptr = - iblock->child_iblocks[i - first_iblock_index]; - } + child_iblock = iblock->child_iblocks[i - first_iblock_index]; + } /* end else */ /* At this point, one way or another we should have * a pointer to the child iblock. Verify that we * that we have the correct one. */ - HDassert(child_iblock_ptr); - HDassert(child_iblock_ptr->cache_info.magic == - H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(child_iblock_ptr->cache_info.type == - H5AC_FHEAP_IBLOCK); - HDassert(child_iblock_ptr->addr == child_iblock_addr); + HDassert(child_iblock); + HDassert(child_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(child_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(child_iblock->addr == child_iblock_addr); /* now make the recursive call */ - if ( H5HF_cache_verify_iblock_descendants_clean(f, dxpl_id, - child_iblock_ptr, &child_iblock_status, - clean_ptr) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, \ - "can't verify child iblock clean.") + if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, child_iblock, &child_iblock_status, clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify child iblock clean.") /* if we protected the child iblock, unprotect it now */ - if ( unprotect_child_iblock ) { - - if ( H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, - child_iblock_addr, child_iblock_ptr, - H5AC__NO_FLAGS_SET) < 0 ) - - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, \ - "H5AC_unprotect() faild.") + if(unprotect_child_iblock) { + if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, child_iblock, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") - } - } - } - } + } /* end if */ + } /* end if */ + } /* end if */ + } /* end if */ i++; - } + } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5HF_cache_verify_descendant_iblocks_clean() */ - +} /* H5HF__cache_verify_descendant_iblocks_clean() */ #endif /* NDEBUG */ -- cgit v0.12 From 2e9d48a551045d958b193d9d7a9964ef18b75dda Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:10:46 -0500 Subject: [svn-r27081] Description: Clean up H5HL interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5HLcache.c | 43 ++++++++++++++++++++++--------------------- src/H5HLpkg.h | 6 +++--- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 6576284..d946815 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -121,7 +121,7 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{ /*------------------------------------------------------------------------- - * Function: H5HL_fl_deserialize + * Function: H5HL__fl_deserialize * * Purpose: Deserialize the free list for a heap data block * @@ -134,13 +134,13 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{ *------------------------------------------------------------------------- */ static herr_t -H5HL_fl_deserialize(H5HL_t *heap) +H5HL__fl_deserialize(H5HL_t *heap) { H5HL_free_t *fl = NULL, *tail = NULL; /* Heap free block nodes */ hsize_t free_block; /* Offset of free block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(heap); @@ -188,11 +188,11 @@ done: fl = H5FL_FREE(H5HL_free_t, fl); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_fl_deserialize() */ +} /* end H5HL__fl_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HL_fl_serialize + * Function: H5HL__fl_serialize * * Purpose: Serialize the free list for a heap data block * @@ -206,11 +206,11 @@ done: *------------------------------------------------------------------------- */ static void -H5HL_fl_serialize(const H5HL_t *heap) +H5HL__fl_serialize(const H5HL_t *heap) { H5HL_free_t *fl; /* Pointer to heap free list node */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check arguments */ HDassert(heap); @@ -231,7 +231,7 @@ H5HL_fl_serialize(const H5HL_t *heap) } /* end for */ FUNC_LEAVE_NOAPI_VOID -} /* end H5HL_fl_serialize() */ +} /* end H5HL__fl_serialize() */ /*------------------------------------------------------------------------- @@ -300,11 +300,11 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate space in memory for the heap */ if(NULL == (heap = H5HL_new(udata->sizeof_size, udata->sizeof_addr, udata->sizeof_prfx))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap structure") + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap structure") /* Allocate the heap prefix */ if(NULL == (prfx = H5HL_prfx_new(heap))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap prefix") + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap prefix") /* Store the prefix's address & length */ heap->prfx_addr = udata->prfx_addr; @@ -315,8 +315,9 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Free list head */ H5F_DECODE_LENGTH_LEN(p, heap->free_block, udata->sizeof_size); - if(heap->free_block != H5HL_FREE_NULL && heap->free_block >= heap->dblk_size) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap free list") + + if((heap->free_block != H5HL_FREE_NULL) && (heap->free_block >= heap->dblk_size)) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap free list") /* Heap data address */ H5F_addr_decode_len(udata->sizeof_addr, &p, &(heap->dblk_addr)); @@ -349,7 +350,7 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end else */ /* Build free list */ - if(H5HL_fl_deserialize(heap) < 0) + if(H5HL__fl_deserialize(heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ else @@ -455,7 +456,7 @@ H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, } /* end if */ /* Serialize the free list into the heap data's image */ - H5HL_fl_serialize(heap); + H5HL__fl_serialize(heap); /* Copy the heap data block into the cache image */ HDmemcpy(p, heap->dblk_image, heap->dblk_size); @@ -634,7 +635,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) FUNC_ENTER_NOAPI_NOINIT - /* check arguments */ + /* Check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(udata); @@ -644,7 +645,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate space in memory for the heap data block */ if(NULL == (dblk = H5HL_dblk_new(udata->heap))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") /* Check for heap still retaining image */ if(NULL == udata->heap->dblk_image) { @@ -657,7 +658,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read local heap data block") /* Build free list */ - if(H5HL_fl_deserialize(udata->heap) < 0) + if(H5HL__fl_deserialize(udata->heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ @@ -671,7 +672,7 @@ done: /* Release the [possibly partially initialized] local heap on errors */ if(!ret_value && dblk) if(H5HL_dblk_dest(dblk) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block") + HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block") FUNC_LEAVE_NOAPI(ret_value) } /* end H5HL_datablock_load() */ @@ -714,7 +715,7 @@ H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; /* Serialize the free list into the heap data's image */ - H5HL_fl_serialize(heap); + H5HL__fl_serialize(heap); /* Write the data block to the file */ if(H5F_block_write(f, H5FD_MEM_LHEAP, heap->dblk_addr, heap->dblk_size, dxpl_id, heap->dblk_image) < 0) @@ -754,7 +755,7 @@ H5HL_datablock_dest(H5F_t *f, void *_thing) FUNC_ENTER_NOAPI_NOINIT - /* check arguments */ + /* Check arguments */ HDassert(dblk); HDassert(dblk->heap); HDassert(!dblk->heap->single_cache_obj); @@ -804,7 +805,7 @@ H5HL_datablock_clear(H5F_t *f, void *_thing, hbool_t destroy) FUNC_ENTER_NOAPI_NOINIT - /* check arguments */ + /* Check arguments */ HDassert(dblk); /* Mark local heap data block as clean */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index bf9be2c..880cc05 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -114,9 +114,9 @@ struct H5HL_dblk_t { /* Struct for heap prefix */ struct H5HL_prfx_t { - H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ - /* first field in structure */ - H5HL_t *heap; /* Pointer to heap for prefix */ + H5AC_info_t cache_info; /* Information for H5AC cache functions, */ + /* _must_ be first field in structure */ + H5HL_t *heap; /* Pointer to heap for prefix */ }; /* Callback information for loading local heap prefix from disk */ -- cgit v0.12 From 197fa23dae4262f07b9f79e40e4719298c0aefec Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:12:24 -0500 Subject: [svn-r27082] Description: Clean up H5O interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5Ocache.c | 88 ++++++++++++++++++++++++++------------------------------ src/H5Omessage.c | 42 +++++++++++++-------------- 2 files changed, 61 insertions(+), 69 deletions(-) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index b1d94d8..3ccdf11 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -81,15 +81,15 @@ static herr_t H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_ static herr_t H5O_cache_chk_size(const H5F_t *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr); /* Chunk proxy routines */ -static herr_t H5O_chunk_proxy_dest(H5O_chunk_proxy_t *chunk_proxy); +static herr_t H5O__chunk_proxy_dest(H5O_chunk_proxy_t *chunk_proxy); /* Chunk routines */ -static herr_t H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, +static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, H5O_common_cache_ud_t *udata, hbool_t *dirty); -static herr_t H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno); +static herr_t H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno); /* Misc. routines */ -static herr_t H5O_add_cont_msg(H5O_cont_msgs_t *cont_msg_info, +static herr_t H5O__add_cont_msg(H5O_cont_msgs_t *cont_msg_info, const H5O_cont_t *cont); @@ -193,7 +193,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate space for the object header data structure */ if(NULL == (oh = H5FL_CALLOC(H5O_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* File-specific, non-stored information */ oh->sizeof_size = H5F_SIZEOF_SIZE(udata->common.f); @@ -333,7 +333,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) buf = read_buf; /* Parse the first chunk */ - if(H5O_chunk_deserialize(oh, udata->common.addr, oh->chunk0_size, buf, &(udata->common), &oh->cache_info.is_dirty) < 0) + if(H5O__chunk_deserialize(oh, udata->common.addr, oh->chunk0_size, buf, &(udata->common), &oh->cache_info.is_dirty) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk") /* Note that we've loaded the object header from the file */ @@ -350,7 +350,7 @@ done: /* Release the [possibly partially initialized] object header on errors */ if(!ret_value && oh) if(H5O_free(oh) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header data") + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header data") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_load() */ @@ -480,7 +480,7 @@ H5O_assert(oh); HDassert((size_t)(p - oh->chunk[0].image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); /* Serialize messages for this chunk */ - if(H5O_chunk_serialize(f, oh, (unsigned)0) < 0) + if(H5O__chunk_serialize(f, oh, (unsigned)0) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize first object header chunk") /* Write the chunk out */ @@ -522,7 +522,7 @@ H5O_dest(H5F_t *f, H5O_t *oh) FUNC_ENTER_NOAPI_NOINIT - /* check args */ + /* Check arguments */ HDassert(oh); HDassert(oh->rc == 0); @@ -585,7 +585,7 @@ H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy) FUNC_ENTER_NOAPI_NOINIT - /* check args */ + /* Check arguments */ HDassert(oh); #ifdef H5_HAVE_PARALLEL @@ -603,16 +603,13 @@ H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy) for ( i = 0; i < oh->nchunks; i++ ) { - if ( H5O_chunk_serialize(f, oh, i) < 0 ) { - - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, - "unable to serialize object header chunk") - } + if(H5O__chunk_serialize(f, oh, i) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk") } } #endif /* H5_HAVE_PARALLEL */ - /* Mark messages as clean */ + /* Mark messages stored with the object header (i.e. messages in chunk 0) as clean */ for(u = 0; u < oh->nmesgs; u++) oh->mesg[u].dirty = FALSE; @@ -722,7 +719,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(udata->common.cont_msg_info); /* Parse the chunk */ - if(H5O_chunk_deserialize(udata->oh, udata->common.addr, udata->size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) + if(H5O__chunk_deserialize(udata->oh, udata->common.addr, udata->size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize object header chunk") /* Set the fields for the chunk proxy */ @@ -737,8 +734,8 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) chk_proxy->oh = udata->oh; chk_proxy->chunkno = udata->chunkno; - /* Sanity check that the chunk representation we have in memory is the same - * as the one being brought in from disk. + /* Sanity check that the chunk representation we have in memory is + * the same as the one being brought in from disk. */ HDassert(0 == HDmemcmp(buf, chk_proxy->oh->chunk[chk_proxy->chunkno].image, chk_proxy->oh->chunk[chk_proxy->chunkno].size)); } /* end else */ @@ -757,7 +754,7 @@ done: /* Release the [possibly partially initialized] object header on errors */ if(!ret_value && chk_proxy) - if(H5O_chunk_proxy_dest(chk_proxy) < 0) + if(H5O__chunk_proxy_dest(chk_proxy) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header chunk proxy") FUNC_LEAVE_NOAPI(ret_value) @@ -788,7 +785,7 @@ H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, /* flush */ if(chk_proxy->cache_info.is_dirty) { /* Serialize messages for this chunk */ - if(H5O_chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) + if(H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header continuation chunk") /* Write the chunk out */ @@ -850,7 +847,7 @@ H5O_cache_chk_dest(H5F_t *f, H5O_chunk_proxy_t *chk_proxy) } /* end if */ /* Destroy object header chunk proxy */ - if(H5O_chunk_proxy_dest(chk_proxy) < 0) + if(H5O__chunk_proxy_dest(chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk proxy") done: @@ -903,18 +900,13 @@ H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t destroy) FUNC_ENTER_NOAPI_NOINIT - /* check args */ + /* Check arguments */ HDassert(chk_proxy); #ifdef H5_HAVE_PARALLEL - if ( ( chk_proxy->oh->cache_info.is_dirty ) && ( ! destroy ) ) { - - if ( H5O_chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0 ) { - - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, - "unable to serialize object header chunk") - } - } + if((chk_proxy->oh->cache_info.is_dirty) && (!destroy)) + if(H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk") #endif /* H5_HAVE_PARALLEL */ /* Mark messages in chunk as clean */ @@ -966,7 +958,7 @@ H5O_cache_chk_size(const H5F_t UNUSED *f, const H5O_chunk_proxy_t *chk_proxy, si /*------------------------------------------------------------------------- - * Function: H5O_add_cont_msg + * Function: H5O__add_cont_msg * * Purpose: Add information from a continuation message to the list of * continuation messages in the object header @@ -981,12 +973,12 @@ H5O_cache_chk_size(const H5F_t UNUSED *f, const H5O_chunk_proxy_t *chk_proxy, si *------------------------------------------------------------------------- */ static herr_t -H5O_add_cont_msg(H5O_cont_msgs_t *cont_msg_info, const H5O_cont_t *cont) +H5O__add_cont_msg(H5O_cont_msgs_t *cont_msg_info, const H5O_cont_t *cont) { size_t contno; /* Continuation message index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(cont_msg_info); @@ -1011,11 +1003,11 @@ H5O_add_cont_msg(H5O_cont_msgs_t *cont_msg_info, const H5O_cont_t *cont) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_add_cont_msg() */ +} /* H5O__add_cont_msg() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_deserialize + * Function: H5O__chunk_deserialize * * Purpose: Deserialize a chunk for an object header * @@ -1029,7 +1021,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, +H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, H5O_common_cache_ud_t *udata, hbool_t *dirty) { const uint8_t *p; /* Pointer into buffer to decode */ @@ -1042,7 +1034,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, #endif /* NDEBUG */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(oh); @@ -1063,7 +1055,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, } /* end if */ /* Init the chunk data info */ - chunkno = oh->nchunks++; + chunkno = (unsigned)oh->nchunks++; oh->chunk[chunkno].gap = 0; if(chunkno == 0) { /* First chunk's 'image' includes room for the object header prefix */ @@ -1294,7 +1286,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, oh->mesg[curmesg].native = cont; /* Add to continuation messages left to interpret */ - if(H5O_add_cont_msg(udata->cont_msg_info, cont) < 0) + if(H5O__add_cont_msg(udata->cont_msg_info, cont) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't add continuation message") /* Mark the message & chunk as dirty if the message was changed by decoding */ @@ -1350,11 +1342,11 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_chunk_deserialize() */ +} /* H5O__chunk_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_serialize + * Function: H5O__chunk_serialize * * Purpose: Serialize a chunk for an object header * @@ -1368,13 +1360,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) +H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) { H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(f); @@ -1415,11 +1407,11 @@ H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_chunk_serialize() */ +} /* H5O__chunk_serialize() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_proxy_dest + * Function: H5O__chunk_proxy_dest * * Purpose: Destroy a chunk proxy object * @@ -1433,11 +1425,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_chunk_proxy_dest(H5O_chunk_proxy_t *chk_proxy) +H5O__chunk_proxy_dest(H5O_chunk_proxy_t *chk_proxy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(chk_proxy); diff --git a/src/H5Omessage.c b/src/H5Omessage.c index f70fa72..d361194 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -73,10 +73,10 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5O_msg_reset_real(const H5O_msg_class_t *type, void *native); -static herr_t H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, +static herr_t H5O__msg_reset_real(const H5O_msg_class_t *type, void *native); +static herr_t H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned *oh_modified, void *_udata/*in,out*/); -static herr_t H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, +static herr_t H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, unsigned update_flags); @@ -224,7 +224,7 @@ H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *t HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create new message") /* Copy the information for the message */ - if(H5O_copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) + if(H5O__copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -426,7 +426,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty } /* end if */ /* Copy the information for the message */ - if(H5O_copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) + if(H5O__copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -586,7 +586,7 @@ H5O_msg_reset(unsigned type_id, void *native) HDassert(type); /* Call the "real" reset routine */ - if(H5O_msg_reset_real(type, native) < 0) + if(H5O__msg_reset_real(type, native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "unable to reset object header") done: @@ -595,7 +595,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_reset_real + * Function: H5O__msg_reset_real * * Purpose: Some message data structures have internal fields that * need to be freed. This function does that if appropriate @@ -610,11 +610,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_msg_reset_real(const H5O_msg_class_t *type, void *native) +H5O__msg_reset_real(const H5O_msg_class_t *type, void *native) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(type); @@ -630,7 +630,7 @@ H5O_msg_reset_real(const H5O_msg_class_t *type, void *native) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_reset_real() */ +} /* end H5O__msg_reset_real() */ /*------------------------------------------------------------------------- @@ -719,7 +719,7 @@ H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) HDassert(type); if(msg_native) { - H5O_msg_reset_real(type, msg_native); + H5O__msg_reset_real(type, msg_native); if(NULL != (type->free)) (type->free)(msg_native); else @@ -1049,7 +1049,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_remove_cb + * Function: H5O__msg_remove_cb * * Purpose: Object header iterator callback routine to remove messages * of a particular type that match a particular sequence number, @@ -1064,14 +1064,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, +H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ htri_t try_remove = FALSE; /* Whether to try removing a message */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); @@ -1109,7 +1109,7 @@ H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_remove_cb() */ +} /* end H5O__msg_remove_cb() */ /*------------------------------------------------------------------------- @@ -1160,7 +1160,7 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, /* Iterate over the messages, deleting appropriate one(s) */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_msg_remove_cb; + op.u.lib_op = H5O__msg_remove_cb; if(H5O_msg_iterate_real(f, oh, type, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "error iterating over messages") @@ -1950,7 +1950,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy_mesg + * Function: H5O__copy_mesg * * Purpose: Make a copy of the native object for an object header's * native message info @@ -1963,7 +1963,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, +H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, unsigned update_flags) { @@ -1972,7 +1972,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -1986,7 +1986,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Reset existing native information for the header's message */ - H5O_msg_reset_real(type, idx_msg->native); + H5O__msg_reset_real(type, idx_msg->native); /* Copy the native object for the message */ if(NULL == (idx_msg->native = (type->copy)(mesg, idx_msg->native))) @@ -2015,7 +2015,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_mesg() */ +} /* end H5O__copy_mesg() */ /*------------------------------------------------------------------------- -- cgit v0.12 From 20aa56082576cbe9319759c808baf06bef55994f Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:14:13 -0500 Subject: [svn-r27083] Description: Clean up H5SM interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5SMcache.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 9955f39..2e69899 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -13,6 +13,17 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*------------------------------------------------------------------------- + * + * Created: H5SMcache.c + * Nov 13 2006 + * James Laird + * + * Purpose: Implement shared message metadata cache methods. + * + *------------------------------------------------------------------------- + */ + /****************/ /* Module Setup */ /****************/ @@ -68,6 +79,7 @@ static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t UNUSED *list, siz /*********************/ /* Package Variables */ /*********************/ + /* H5SM inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_SOHM_TABLE[1] = {{ H5AC_SOHM_TABLE_ID, @@ -136,7 +148,7 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) /* Allocate space for the master table in memory */ if(NULL == (table = H5FL_CALLOC(H5SM_master_table_t))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed") /* Read number of indexes and version from file superblock */ table->num_indexes = H5F_SOHM_NINDEXES(f); @@ -172,7 +184,7 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) /* Allocate space for the index headers in memory*/ if(NULL == (table->indexes = (H5SM_index_header_t *)H5FL_ARR_MALLOC(H5SM_index_header_t, (size_t)table->num_indexes))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed for SOHM indexes") + HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed for SOHM indexes") /* Read in the index headers */ for(x = 0; x < table->num_indexes; ++x) { @@ -230,7 +242,7 @@ done: HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && table) if(H5SM_table_free(table) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CANTFREE, NULL, "unable to destroy sohm table") + HDONE_ERROR(H5E_SOHM, H5E_CANTFREE, NULL, "unable to destroy sohm table") FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM_table_load() */ @@ -363,7 +375,7 @@ H5SM_table_dest(H5F_t UNUSED *f, H5SM_master_table_t* table) FUNC_ENTER_NOAPI_NOINIT - /* Sanity check */ + /* Check arguments */ HDassert(table); HDassert(table->indexes); @@ -429,7 +441,7 @@ H5SM_table_size(const H5F_t UNUSED *f, const H5SM_master_table_t *table, size_t { FUNC_ENTER_NOAPI_NOINIT_NOERR - /* check arguments */ + /* Check arguments */ HDassert(f); HDassert(table); HDassert(size_ptr); @@ -470,18 +482,17 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) FUNC_ENTER_NOAPI_NOINIT - /* Sanity check */ + /* Check arguments */ HDassert(udata->header); /* Allocate space for the SOHM list data structure */ if(NULL == (list = H5FL_MALLOC(H5SM_list_t))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed") HDmemset(&list->cache_info, 0, sizeof(H5AC_info_t)); /* Allocate list in memory as an array*/ - if((list->messages = (H5SM_sohm_t *)H5FL_ARR_MALLOC(H5SM_sohm_t, udata->header->list_max)) == NULL) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "file allocation failed for SOHM list") - + if(NULL == (list->messages = (H5SM_sohm_t *)H5FL_ARR_MALLOC(H5SM_sohm_t, udata->header->list_max))) + HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "file allocation failed for SOHM list") list->header = udata->header; /* Wrap the local buffer for serialized list index info */ @@ -701,9 +712,7 @@ H5SM_list_clear(H5F_t *f, H5SM_list_t *list, hbool_t destroy) FUNC_ENTER_NOAPI_NOINIT - /* - * Check arguments. - */ + /* Check arguments */ HDassert(list); /* Reset the dirty flag. */ -- cgit v0.12 From 8be8a708a3ab5b84ef39ce1dca726ca1aa611af6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 14 May 2015 21:16:09 -0500 Subject: [svn-r27084] Description: Clean up cache tests, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel --- src/H5trace.c | 4 +- test/cache.c | 1342 +++++++++++++------------------------------------- test/cache_api.c | 58 ++- test/cache_common.c | 122 ++--- test/cache_common.h | 36 +- test/cache_tagging.c | 61 +-- testpar/t_cache.c | 367 ++++---------- 7 files changed, 549 insertions(+), 1441 deletions(-) diff --git a/src/H5trace.c b/src/H5trace.c index 6634a2a..e6a091c 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -2348,7 +2348,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) unsigned long iul = va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ fprintf(out, "%lu", iul); - asize[argno] = iul; + asize[argno] = (hssize_t)iul; } /* end else */ break; @@ -2372,7 +2372,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) unsigned long long iull = va_arg(ap, unsigned long long); /*lint !e732 Loss of sign not really occuring */ fprintf(out, "%llu", iull); - asize[argno] = iull; + asize[argno] = (hssize_t)iull; } /* end else */ break; diff --git a/test/cache.c b/test/cache.c index 8725b31..eb17fcc 100644 --- a/test/cache.c +++ b/test/cache.c @@ -2984,7 +2984,6 @@ static unsigned check_flush_cache(void) { const char * fcn_name = "check_flush_cache"; - hbool_t show_progress = FALSE; H5F_t * file_ptr = NULL; TESTING("H5C_flush_cache() functionality"); @@ -2998,11 +2997,6 @@ check_flush_cache(void) if ( pass ) { - if ( show_progress ) { - - HDfprintf(stdout, "%s: reseting entries.\n", fcn_name); - } - reset_entries(); file_ptr = setup_cache((size_t)(2 * 1024 * 1024), @@ -3015,12 +3009,6 @@ check_flush_cache(void) if ( pass ) { - if ( show_progress ) { - - HDfprintf(stdout, "%s: calling check_flush_cache__empty_cache().\n", - fcn_name); - } - check_flush_cache__empty_cache(file_ptr); } @@ -3030,45 +3018,21 @@ check_flush_cache(void) if ( pass ) { - if ( show_progress ) { - - HDfprintf(stdout, "%s: calling check_flush_cache__single_entry().\n", - fcn_name); - } - check_flush_cache__single_entry(file_ptr); } if ( pass ) { - if ( show_progress ) { - - HDfprintf(stdout, "%s: calling check_flush_cache__multi_entry().\n", - fcn_name); - } - check_flush_cache__multi_entry(file_ptr); } if ( pass ) { - if ( show_progress ) { - - HDfprintf(stdout, "%s: calling check_flush_cache__flush_ops().\n", - fcn_name); - } - check_flush_cache__flush_ops(file_ptr); } if ( pass ) { - if ( show_progress ) { - - HDfprintf(stdout, "%s: calling takedown_cache().\n", - fcn_name); - } - takedown_cache(file_ptr, FALSE, FALSE); } @@ -6406,17 +6370,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 4, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -6504,17 +6468,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 4, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -6602,17 +6566,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -6732,17 +6696,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -6874,17 +6838,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -6903,17 +6867,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ FALSE, @@ -7093,17 +7057,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -7122,17 +7086,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -7210,7 +7174,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -7239,7 +7203,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -7369,17 +7333,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -7398,17 +7362,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 6, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ + /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -7486,7 +7450,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -7515,7 +7479,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -7671,7 +7635,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -7700,7 +7664,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -7808,7 +7772,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -7837,7 +7801,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL }, + { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL }, { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, @@ -8072,17 +8036,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 4, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8101,17 +8065,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8130,17 +8094,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8159,17 +8123,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8188,17 +8152,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8217,17 +8181,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8246,17 +8210,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 4, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8519,17 +8483,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 4, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8548,17 +8512,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8577,17 +8541,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8606,17 +8570,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8635,17 +8599,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8664,17 +8628,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8693,17 +8657,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 4, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, - { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL }, + { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8833,17 +8797,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8862,17 +8826,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -8920,17 +8884,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -9031,17 +8995,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -9060,17 +9024,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -9118,17 +9082,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0}, /* num_flush_ops = */ 3, /* flush_ops = */ - /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, + /* op_code: type: idx: flag: size: order_ptr: */ + { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL }, + { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } }, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -9207,11 +9171,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, int check_size, struct fo_flush_entry_check check[]) { - const char * fcn_name = "check_flush_cache__flush_op_test"; H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - hbool_t show_progress = FALSE; - hbool_t verbose = FALSE; herr_t result; int i; int j; @@ -9223,12 +9184,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, test_num); #endif - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: running sanity checks on entry(1).\n", - fcn_name, test_num, (int)pass); - } - if ( cache_ptr == NULL ) { pass = FALSE; @@ -9256,12 +9211,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, failure_mssg = msg; } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: running sanity checks on entry(2).\n", - fcn_name, test_num, (int)pass); - } - i = 0; while ( ( pass ) && ( i < spec_size ) ) { @@ -9284,12 +9233,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, i++; } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: running sanity checks on entry(3).\n", - fcn_name, test_num, (int)pass); - } - i = 0; while ( ( pass ) && ( i < check_size ) ) { @@ -9327,54 +9270,18 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, i++; } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Setting up the test.\n", - fcn_name, test_num, (int)pass); - } - i = 0; while ( ( pass ) && ( i < spec_size ) ) { if ( spec[i].insert_flag ) { - if ( show_progress ) { - - HDfprintf(stdout, - "%s:%d: Inserting entry(%d,%d) with flags 0x%x.\n", - fcn_name, test_num, - (int)(spec[i].entry_type), - (int)(spec[i].entry_index), - (unsigned)spec[i].flags); - } - insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].flags); } else { - if ( show_progress ) { - - HDfprintf(stdout, - "%s:%d: Protecting entry(%d,%d).\n", - fcn_name, test_num, - (int)(spec[i].entry_type), - (int)(spec[i].entry_index)); - } - protect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index); - if ( show_progress ) { - - HDfprintf(stdout, - "%s:%d: Unprotecting entry(%d,%d) with flags 0x%x ns = %d.\n", - fcn_name, test_num, - (int)(spec[i].entry_type), - (int)(spec[i].entry_index), - (unsigned)spec[i].flags, - (int)(spec[i].new_size)); - } - if(spec[i].resize_flag) resize_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].new_size, TRUE); @@ -9420,12 +9327,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Running the test.\n", - fcn_name, test_num, (int)pass); - } - if ( pass ) { result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, @@ -9441,11 +9342,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Checking test results(1).\n", - fcn_name, test_num, (int)pass); - } i = 0; while ( ( pass ) && ( i < spec_size ) ) @@ -9484,12 +9380,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, i++; } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Checking test results(2).\n", - fcn_name, test_num, (int)pass); - } - if ( pass ) { i = 0; @@ -9608,12 +9498,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Checking test results(3).\n", - fcn_name, test_num, (int)pass); - } - if ( pass ) { if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) @@ -9642,13 +9526,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } /* clean up the cache to prep for the next test */ - - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Cleaning up after test(1).\n", - fcn_name, test_num, (int)pass); - } - if ( pass ) { result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, @@ -9668,16 +9545,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, ( cache_ptr->dirty_index_size != 0 ) ) { pass = FALSE; - - if ( verbose ) { - - HDfprintf(stdout, "%s:%d: il/is/cis/dis = %lld/%lld/%lld/%lld.\n", - fcn_name, test_num, - (long long)(cache_ptr->index_len), - (long long)(cache_ptr->index_size), - (long long)(cache_ptr->clean_index_size), - (long long)(cache_ptr->dirty_index_size)); - } HDsnprintf(msg, (size_t)128, "Unexpected cache len/size/cs/ds after cleanup in flush op test #%d.", test_num); @@ -9686,12 +9553,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Cleaning up after test(2).\n", - fcn_name, test_num, (int)pass); - } - i = 0; while ( ( pass ) && ( i < spec_size ) ) { @@ -9708,12 +9569,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, i++; } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Cleaning up after test(3).\n", - fcn_name, test_num, (int)pass); - } - i = 0; while ( ( pass ) && ( i < check_size ) ) { @@ -9730,11 +9585,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, i++; } - if ( show_progress ) { - - HDfprintf(stdout, "%s:%d:%d: Done.\n", fcn_name, test_num, (int)pass); - } - return; } /* check_flush_cache__flush_op_test() */ @@ -10893,8 +10743,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) static void check_flush_cache__single_entry(H5F_t * file_ptr) { - const char * fcn_name = "check_flush_cache__single_entry"; - hbool_t show_progress = FALSE; H5C_t * cache_ptr = file_ptr->shared->cache; if ( cache_ptr == NULL ) { @@ -10911,10 +10759,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 1); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -10929,18 +10773,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 2); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -10955,18 +10791,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 3); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -10981,18 +10809,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 4); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11007,18 +10827,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 5); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11033,18 +10845,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 6); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11059,18 +10863,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 7); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11085,18 +10881,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 8); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11111,18 +10899,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 9); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11138,18 +10918,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 10); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11165,18 +10937,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 11); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11192,18 +10956,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 12); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11219,18 +10975,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 13); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11246,18 +10994,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 14); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11273,18 +11013,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 15); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11301,18 +11033,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 16); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11329,18 +11053,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 17); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11355,18 +11071,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 18); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11381,18 +11089,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 19); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11407,18 +11107,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 20); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11433,18 +11125,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 21); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11459,18 +11143,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 22); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11485,18 +11161,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 23); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11511,18 +11179,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 24); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11537,18 +11197,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 25); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11564,18 +11216,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 26); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11591,18 +11235,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 27); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11618,18 +11254,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 28); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11645,18 +11273,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 29); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11672,18 +11292,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 30); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11699,18 +11311,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 31); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11727,18 +11331,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 32); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11755,18 +11351,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 33); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11781,18 +11369,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 34); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11807,18 +11387,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 35); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11833,18 +11405,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 36); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11859,18 +11423,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 37); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11885,18 +11441,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 38); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11911,18 +11459,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 39); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11937,18 +11477,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 40); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11963,18 +11495,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 41); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -11990,18 +11514,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 42); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12017,18 +11533,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 43); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12044,18 +11552,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 44); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12071,18 +11571,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 45); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12098,18 +11590,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 46); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12125,18 +11609,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 47); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12153,18 +11629,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 48); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12181,18 +11649,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 49); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12207,18 +11667,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 50); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12233,18 +11685,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 51); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12259,18 +11703,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 52); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12285,18 +11721,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 53); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12311,18 +11739,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 54); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12337,18 +11757,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 55); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12363,18 +11775,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 56); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12389,18 +11793,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 57); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12416,18 +11812,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 58); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12443,18 +11831,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 59); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12470,18 +11850,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 60); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12497,18 +11869,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ FALSE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 61); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12524,18 +11888,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 62); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12551,18 +11907,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ TRUE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 63); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12579,18 +11927,10 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } if ( pass ) { - if ( show_progress ) { - HDfprintf(stdout, "%s: running test %d.\n", fcn_name, 64); - } - check_flush_cache__single_entry_test ( /* file_ptr */ file_ptr, @@ -12607,10 +11947,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* expected_flushed */ FALSE, /* expected_destroyed */ TRUE ); - - if ( show_progress ) { - HDfprintf(stdout, "%s: pass = %d.\n", fcn_name, (int)pass); - } } @@ -12957,11 +12293,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) i = 0; while ( ( pass ) && ( i < 256 ) ) { - - if ( show_progress ) { - HDfprintf(stdout, "%s: running pinned test %d.\n", fcn_name, i); - } - check_flush_cache__pinned_single_entry_test ( /* file_ptr */ file_ptr, @@ -13618,7 +12949,6 @@ check_get_entry_status(void) * * Modifications: * - * None. * *------------------------------------------------------------------------- */ @@ -13705,29 +13035,29 @@ check_expunge_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 2."); failure_mssg = msg; - } else if ( !in_cache || is_dirty || is_protected || is_pinned ) { + } else if ( !in_cache || is_dirty || is_protected || is_pinned ) { - pass = FALSE; - HDsnprintf(msg, (size_t)128, "Unexpected status 2."); - failure_mssg = msg; + pass = FALSE; + HDsnprintf(msg, (size_t)128, "Unexpected status 2."); + failure_mssg = msg; } else if ( ( ! entry_ptr->loaded ) || ( entry_ptr->cleared ) || ( entry_ptr->flushed ) || ( entry_ptr->destroyed ) ) { - pass = FALSE; - HDsnprintf(msg, (size_t)128, "Unexpected entry history 2."); - failure_mssg = msg; + pass = FALSE; + HDsnprintf(msg, (size_t)128, "Unexpected entry history 2."); + failure_mssg = msg; - } + } } /* Expunge the entry and then verify that it is no longer in the cache. @@ -13749,29 +13079,29 @@ check_expunge_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 3."); failure_mssg = msg; - } else if ( in_cache ) { + } else if ( in_cache ) { - pass = FALSE; - HDsnprintf(msg, (size_t)128, "Unexpected status 3."); - failure_mssg = msg; + pass = FALSE; + HDsnprintf(msg, (size_t)128, "Unexpected status 3."); + failure_mssg = msg; } else if ( ( ! entry_ptr->loaded ) || ( ! entry_ptr->cleared ) || ( entry_ptr->flushed ) || ( ! entry_ptr->destroyed ) ) { - pass = FALSE; - HDsnprintf(msg, (size_t)128, "Unexpected entry history 3."); - failure_mssg = msg; + pass = FALSE; + HDsnprintf(msg, (size_t)128, "Unexpected entry history 3."); + failure_mssg = msg; - } + } } /* now repeat the process with a different entry. On unprotect @@ -13791,14 +13121,14 @@ check_expunge_entry(void) &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 4."); failure_mssg = msg; - } else if ( in_cache ) { + } else if ( in_cache ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 4."); @@ -13813,7 +13143,7 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected entry history 4."); failure_mssg = msg; - } + } } /* protect the entry to force the cache to load it, and then unprotect @@ -13834,14 +13164,14 @@ check_expunge_entry(void) &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 5."); failure_mssg = msg; - } else if ( !in_cache || !is_dirty || is_protected || is_pinned ) { + } else if ( !in_cache || !is_dirty || is_protected || is_pinned ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 5."); @@ -13856,7 +13186,7 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected entry history 5."); failure_mssg = msg; - } + } } /* Expunge the entry and then verify that it is no longer in the cache. @@ -13879,14 +13209,14 @@ check_expunge_entry(void) &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "H5C_get_entry_status() reports failure 6."); failure_mssg = msg; - } else if ( in_cache ) { + } else if ( in_cache ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected status 6."); @@ -13901,7 +13231,7 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected entry history 6."); failure_mssg = msg; - } + } } if ( pass ) { @@ -14408,13 +13738,13 @@ check_move_entry(void) * * At present, we should do the following tests: * - * 1) move a clean, unprotected, unpinned entry. + * 1) Move a clean, unprotected, unpinned entry. * - * 2) move a dirty, unprotected, unpinned entry. + * 2) Move a dirty, unprotected, unpinned entry. * - * 3) move a clean, unprotected, pinned entry. + * 3) Move a clean, unprotected, pinned entry. * - * 4) move a dirty, unprotected, pinned entry. + * 4) Move a dirty, unprotected, pinned entry. * * In all cases, the entry should have moved to its * new location, and have been marked dirty if it wasn't @@ -14787,7 +14117,7 @@ check_resize_entry(void) base_addr = entries[LARGE_ENTRY_TYPE]; entry_ptr = &(base_addr[0]); - entry_size = LARGE_ENTRY_SIZE; + entry_size = LARGE_ENTRY_SIZE; } } @@ -15668,6 +14998,7 @@ check_resize_entry(void) } if ( pass ) { + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DELETED_FLAG); @@ -15724,7 +15055,6 @@ check_resize_entry(void) * * Modifications: * - * None. * *------------------------------------------------------------------------- */ @@ -16542,6 +15872,7 @@ check_flush_protected_err(void) * * Modifications: * + * *------------------------------------------------------------------------- */ @@ -23360,6 +22691,7 @@ check_auto_cache_resize_disable(void) /* flush the cache and destroy all entries so we start from a known point */ flush_cache(file_ptr, TRUE, FALSE, FALSE); + } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -23586,6 +22918,7 @@ check_auto_cache_resize_disable(void) /* flush the cache and destroy all entries so we start from a known point */ flush_cache(file_ptr, TRUE, FALSE, FALSE); + } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -23819,6 +23152,7 @@ check_auto_cache_resize_disable(void) /* flush the cache and destroy all entries so we start from a known point */ flush_cache(file_ptr, TRUE, FALSE, FALSE); + } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -33778,5 +33112,5 @@ main(void) nerrs += check_notify_cb(); return(nerrs > 0); -} +} /* main() */ diff --git a/test/cache_api.c b/test/cache_api.c index 8f556be..51dda99 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -32,15 +32,15 @@ /* private function declarations: */ -static void check_fapl_mdc_api_calls(void); +static unsigned check_fapl_mdc_api_calls(void); -static void check_file_mdc_api_calls(void); +static unsigned check_file_mdc_api_calls(void); -static void mdc_api_call_smoke_check(int express_test); +static unsigned mdc_api_call_smoke_check(int express_test); -static void check_fapl_mdc_api_errs(void); +static unsigned check_fapl_mdc_api_errs(void); -static void check_file_mdc_api_errs(void); +static unsigned check_file_mdc_api_errs(void); /**************************************************************************/ @@ -67,7 +67,7 @@ static void check_file_mdc_api_errs(void); * *------------------------------------------------------------------------- */ -static void +static unsigned check_fapl_mdc_api_calls(void) { const char * fcn_name = "check_fapl_mdc_api_calls()"; @@ -489,6 +489,8 @@ check_fapl_mdc_api_calls(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_fapl_mdc_api_calls() */ @@ -516,7 +518,7 @@ check_fapl_mdc_api_calls(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_file_mdc_api_calls(void) { const char * fcn_name = "check_file_mdc_api_calls()"; @@ -839,6 +841,8 @@ check_file_mdc_api_calls(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_file_mdc_api_calls() */ @@ -865,7 +869,7 @@ check_file_mdc_api_calls(void) #define NUM_DSETS 6 #define NUM_RANDOM_ACCESSES 200000 -static void +static unsigned mdc_api_call_smoke_check(int express_test) { const char * fcn_name = "mdc_api_call_smoke_check()"; @@ -1004,7 +1008,7 @@ mdc_api_call_smoke_check(int express_test) HDfprintf(stdout, " Long tests disabled.\n"); - return; + return 0; } pass = TRUE; @@ -1105,7 +1109,7 @@ mdc_api_call_smoke_check(int express_test) sprintf(dset_name, "/dset%03d", i); dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, - dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); + dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { @@ -1329,9 +1333,9 @@ mdc_api_call_smoke_check(int express_test) } n++; - } + /* close the file spaces we are done with */ i = 1; while ( ( pass ) && ( i < NUM_DSETS ) ) @@ -1450,7 +1454,6 @@ mdc_api_call_smoke_check(int express_test) } n++; - } /* close file space 0 */ @@ -1515,6 +1518,8 @@ mdc_api_call_smoke_check(int express_test) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* mdc_api_call_smoke_check() */ @@ -3015,7 +3020,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = *------------------------------------------------------------------------- */ -static void +static unsigned check_fapl_mdc_api_errs(void) { const char * fcn_name = "check_fapl_mdc_api_errs()"; @@ -3065,7 +3070,7 @@ check_fapl_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( ( pass ) && - ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) || + ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0) || ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) { pass = FALSE; @@ -3167,6 +3172,8 @@ check_fapl_mdc_api_errs(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_fapl_mdc_api_errs() */ @@ -3186,7 +3193,7 @@ check_fapl_mdc_api_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_file_mdc_api_errs(void) { const char * fcn_name = "check_file_mdc_api_errs()"; @@ -3504,6 +3511,8 @@ check_file_mdc_api_errs(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_file_mdc_api_errs() */ @@ -3527,28 +3536,35 @@ check_file_mdc_api_errs(void) int main(void) { + unsigned nerrs = 0; int express_test; H5open(); express_test = GetTestExpress(); + printf("===================================\n"); + printf("Cache API tests\n"); + printf(" express_test = %d\n", express_test); + printf("===================================\n"); + + #if 1 - check_fapl_mdc_api_calls(); + nerrs += check_fapl_mdc_api_calls(); #endif #if 1 - check_file_mdc_api_calls(); + nerrs += check_file_mdc_api_calls(); #endif #if 1 - mdc_api_call_smoke_check(express_test); + nerrs += mdc_api_call_smoke_check(express_test); #endif #if 1 - check_fapl_mdc_api_errs(); + nerrs += check_fapl_mdc_api_errs(); #endif #if 1 - check_file_mdc_api_errs(); + nerrs += check_file_mdc_api_errs(); #endif - return(0); + return( nerrs > 0 ); } /* main() */ diff --git a/test/cache_common.c b/test/cache_common.c index 0231a11..7b1a158 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -151,7 +151,7 @@ static herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); static herr_t notify_notify(H5C_notify_action_t action, void *thing); -test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = +test_entry_t *entries[NUMBER_OF_ENTRY_TYPES] = { pico_entries, nano_entries, @@ -166,7 +166,7 @@ test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = notify_entries }; -test_entry_t * orig_entries[NUMBER_OF_ENTRY_TYPES] = +test_entry_t *orig_entries[NUMBER_OF_ENTRY_TYPES] = { orig_pico_entries, orig_nano_entries, @@ -241,7 +241,7 @@ const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] = NOTIFY_ALT_BASE_ADDR }; -const char * entry_type_names[NUMBER_OF_ENTRY_TYPES] = +const char *entry_type_names[NUMBER_OF_ENTRY_TYPES] = { "pico entries -- 1 B", "nano entries -- 4 B", @@ -375,7 +375,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, -/* address translation funtions: */ +/* address translation functions: */ /*------------------------------------------------------------------------- @@ -393,8 +393,8 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, */ void addr_to_type_and_index(haddr_t addr, - int32_t * type_ptr, - int32_t * index_ptr) + int32_t *type_ptr, + int32_t *index_ptr) { int i; int32_t type; @@ -453,52 +453,8 @@ addr_to_type_and_index(haddr_t addr, } /* addr_to_type_and_index() */ - -#if 0 /* This function has never been used, but we may want it - * some time. Lets keep it for now. - */ -/*------------------------------------------------------------------------- - * Function: type_and_index_to_addr - * - * Purpose: Given a type and index of an entry, compute the associated - * addr and return that value. - * - * Return: computed addr - * - * Programmer: John Mainzer - * 6/10/04 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -haddr_t -type_and_index_to_addr(int32_t type, - int32_t idx) -{ - haddr_t addr; - - HDassert( ( type >= 0 ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( idx >= 0 ) && ( idx <= max_indices[type] ) ); - - addr = base_addrs[type] + (((haddr_t)idx) * entry_sizes[type]); - - HDassert( addr == (entries[type])[idx].addr ); - - if ( (entries[type])[idx].at_main_addr ) { - - HDassert( addr == (entries[type])[idx].main_addr ); - - } else { - - HDassert( addr == (entries[type])[idx].alt_addr ); - } - - return(addr); -} /* type_and_index_to_addr() */ - -#endif +/* Call back functions: */ /*------------------------------------------------------------------------- @@ -522,9 +478,9 @@ type_and_index_to_addr(int32_t type, */ herr_t -check_write_permitted(const H5F_t UNUSED * f, +check_write_permitted(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, - hbool_t * write_permitted_ptr) + hbool_t *write_permitted_ptr) { HDassert( write_permitted_ptr ); @@ -1273,14 +1229,13 @@ notify_size(H5F_t * f, void * thing, size_t * size_ptr) * *------------------------------------------------------------------------- */ - static herr_t notify(H5C_notify_action_t action, void *thing) { test_entry_t * entry_ptr; - test_entry_t * base_addr; + test_entry_t *base_addr; - HDassert( thing ); + HDassert(thing); entry_ptr = (test_entry_t *)thing; base_addr = entries[entry_ptr->type]; @@ -1642,8 +1597,7 @@ execute_flush_op(H5F_t * file_ptr, break; case FLUSH_OP__MOVE: - move_entry(cache_ptr, op_ptr->type, op_ptr->idx, - op_ptr->flag); + move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); break; case FLUSH_OP__ORDER: @@ -1745,8 +1699,8 @@ reset_entries(void) { int j; - max_index = max_indices[i]; entry_size = entry_sizes[i]; + max_index = max_indices[i]; base_addr = entries[i]; orig_base_addr = orig_entries[i]; @@ -2693,7 +2647,6 @@ setup_cache(size_t max_cache_size, cache_ptr->ignore_tags = TRUE; H5C_stats__reset(cache_ptr); - ret_val = file_ptr; } @@ -2888,32 +2841,25 @@ flush_cache(H5F_t * file_ptr, verify_unprotected(); if(pass) { - H5C_t * cache_ptr = NULL; + H5C_t * cache_ptr; herr_t result = 0; HDassert(file_ptr); cache_ptr = file_ptr->shared->cache; - if(destroy_entries) { - + if(destroy_entries) result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); - } - else { - + else result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); - } - - if(dump_stats) { + if(dump_stats) H5C_stats(cache_ptr, "test cache", dump_detailed_stats); - } if(result < 0) { - pass = FALSE; failure_mssg = "error in H5C_flush_cache()."; } @@ -3016,24 +2962,19 @@ insert_entry(H5F_t * file_ptr, (int)(entry_ptr->addr != entry_ptr->header.addr)); #endif } - HDassert( entry_ptr->cache_ptr == NULL ); + HDassert(entry_ptr->cache_ptr == NULL); entry_ptr->cache_ptr = cache_ptr; - if ( insert_pinned ) { - - HDassert( entry_ptr->header.is_pinned ); - - } else { - - HDassert( ! ( entry_ptr->header.is_pinned ) ); - - } + if(insert_pinned) + HDassert(entry_ptr->header.is_pinned); + else + HDassert(!(entry_ptr->header.is_pinned)); entry_ptr->is_pinned = insert_pinned; entry_ptr->pinned_from_client = insert_pinned; - HDassert( entry_ptr->header.is_dirty ); - HDassert( ((entry_ptr->header).type)->id == type ); + HDassert(entry_ptr->header.is_dirty); + HDassert(((entry_ptr->header).type)->id == type); } return; @@ -3541,8 +3482,8 @@ unprotect_entry(H5F_t * file_ptr, HDassert( entry_ptr->header.is_protected ); HDassert( entry_ptr->is_protected ); - pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0 ); - unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0 ); + pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0); + unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0); HDassert ( ! ( pin_flag_set && unpin_flag_set ) ); HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) ); @@ -3586,13 +3527,13 @@ unprotect_entry(H5F_t * file_ptr, if ( pin_flag_set ) { - HDassert ( entry_ptr->header.is_pinned ); + HDassert(entry_ptr->header.is_pinned); entry_ptr->pinned_from_client = TRUE; entry_ptr->is_pinned = TRUE; } else if ( unpin_flag_set ) { - HDassert ( entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache ); + HDassert(entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache); entry_ptr->pinned_from_client = FALSE; entry_ptr->is_pinned = entry_ptr->pinned_from_cache; @@ -4245,7 +4186,7 @@ row_major_scan_backward(H5F_t * file_ptr, if ( ( pass ) && ( (idx + lag) >= 0 ) && ( ( idx + lag) <= max_indices[type] ) ) { - switch ( (idx + lag) %4 ) { + switch ( (idx + lag) % 4 ) { case 0: if ( (entries[type])[idx+lag].is_dirty ) { @@ -4274,7 +4215,7 @@ row_major_scan_backward(H5F_t * file_ptr, } break; - case 3: /* we just did an insrt */ + case 3: /* we just did an insert */ unprotect_entry(file_ptr, type, idx + lag, H5C__DELETED_FLAG); break; @@ -5113,7 +5054,6 @@ check_and_validate_cache_hit_rate(hid_t file_id, int64_t min_accesses, double min_hit_rate) { - /* const char * fcn_name = "check_and_validate_cache_hit_rate()"; */ herr_t result; int64_t cache_hits = 0; int64_t cache_accesses = 0; @@ -5247,7 +5187,6 @@ check_and_validate_cache_size(hid_t file_id, int32_t * cur_num_entries_ptr, hbool_t dump_data) { - /* const char * fcn_name = "check_and_validate_cache_size()"; */ herr_t result; size_t expected_max_size; size_t max_size; @@ -5434,7 +5373,6 @@ validate_mdc_config(hid_t file_id, hbool_t compare_init, int test_num) { - /* const char * fcn_name = "validate_mdc_config()"; */ static char msg[256]; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; diff --git a/test/cache_common.h b/test/cache_common.h index 1165de4..a309fa4 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -314,19 +314,19 @@ typedef struct test_entry_t hbool_t destroyed; /* entry has been destroyed since the * last time it was reset. */ - int flush_dep_par_type; /* Entry type of flush dependency parent */ - int flush_dep_par_idx; /* Index of flush dependency parent */ - uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS]; + int flush_dep_par_type; /* Entry type of flush dependency parent */ + int flush_dep_par_idx; /* Index of flush dependency parent */ + uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS]; /* flush dependency heights of flush * dependency children */ - unsigned flush_dep_height; /* flush dependency height of entry */ - hbool_t pinned_from_client; /* entry was pinned by client call */ - hbool_t pinned_from_cache; /* entry was pinned by cache internally */ - unsigned flush_order; /* Order that entry was flushed in */ + unsigned flush_dep_height; /* flush dependency height of entry */ + hbool_t pinned_from_client; /* entry was pinned by client call */ + hbool_t pinned_from_cache; /* entry was pinned by cache internally */ + unsigned flush_order; /* Order that entry was flushed in */ - unsigned notify_after_insert_count; /* Count of times that entry was inserted in cache */ - unsigned notify_before_evict_count; /* Count of times that entry was removed in cache */ + unsigned notify_after_insert_count; /* Count of times that entry was inserted in cache */ + unsigned notify_before_evict_count; /* Count of times that entry was removed in cache */ } test_entry_t; /* The following are cut down test versions of the hash table manipulation @@ -410,6 +410,7 @@ if ( ( (cache_ptr) == NULL ) || \ } \ } + /* Macros used in H5AC level tests */ #define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \ @@ -424,26 +425,26 @@ if ( ( (cache_ptr) == NULL ) || \ ( (a).set_initial_size == (b).set_initial_size ) ) && \ ( ( ! cmp_init_size ) || \ ( (a).initial_size == (b).initial_size ) ) && \ - ( (a).min_clean_fraction == (b).min_clean_fraction ) && \ + ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \ ( (a).max_size == (b).max_size ) && \ ( (a).min_size == (b).min_size ) && \ ( (a).epoch_length == (b).epoch_length ) && \ ( (a).incr_mode == (b).incr_mode ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (a).increment == (b).increment ) && \ + ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \ ( (a).apply_max_increment == (b).apply_max_increment ) && \ ( (a).max_increment == (b).max_increment ) && \ ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ + ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \ ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (a).decrement == (b).decrement ) && \ + ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \ ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ ( (a).max_decrement == (b).max_decrement ) && \ ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ - ( (a).empty_reserve == (b).empty_reserve ) && \ + ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) && \ ( (a).dirty_bytes_threshold == (b).dirty_bytes_threshold ) && \ ( (a).metadata_write_strategy == (b).metadata_write_strategy ) ) @@ -538,7 +539,6 @@ herr_t check_write_permitted(const H5F_t * f, hid_t dxpl_id, hbool_t * write_permitted_ptr); - /* callback table extern */ extern const H5C_class_t types[NUMBER_OF_ENTRY_TYPES]; diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 30ca1de..9209f6d 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -117,91 +117,91 @@ print_entry_type_to_screen(int id) switch (id) { case 0: - printf("B-tree Node"); + printf("B-tree Node(0)"); break; case 1: - printf("Symbol Table Node"); + printf("Symbol Table Node(1)"); break; case 2: - printf("Local Heap Prefix"); + printf("Local Heap Prefix(2)"); break; case 3: - printf("Local Heap Data Block"); + printf("Local Heap Data Block(3)"); break; case 4: - printf("Global Heap"); + printf("Global Heap(4)"); break; case 5: - printf("Object Header"); + printf("Object Header(5)"); break; case 6: - printf("Object Header Chunk"); + printf("Object Header Chunk(6)"); break; case 7: - printf("v2 B-tree Header"); + printf("v2 B-tree Header(7)"); break; case 8: - printf("v2 B-tree Internal Node"); + printf("v2 B-tree Internal Node(8)"); break; case 9: - printf("v2 B-tree Leaf Node"); + printf("v2 B-tree Leaf Node(9)"); break; case 10: - printf("Fractal Heap Header"); + printf("Fractal Heap Header(10)"); break; case 11: - printf("Fractal Heap Direct Block"); + printf("Fractal Heap Direct Block(11)"); break; case 12: - printf("Fractal Heap Indirect Block"); + printf("Fractal Heap Indirect Block(12)"); break; case 13: - printf("Free Space Header"); + printf("Free Space Header(13)"); break; case 14: - printf("Free Space Section"); + printf("Free Space Section(14)"); break; case 15: - printf("Shared Object Header Message Master Table"); + printf("Shared Object Header Message Master Table(15)"); break; case 16: - printf("Shared Message Index Stored As A List"); + printf("Shared Message Index Stored As A List(16)"); break; case 17: - printf("Extensible Array Header"); + printf("Extensible Array Header(17)"); break; case 18: - printf("Extensible Array Index Block"); + printf("Extensible Array Index Block(18)"); break; case 19: - printf("Extensible Array Super Block"); + printf("Extensible Array Super Block(19)"); break; case 20: - printf("Extensible Array Data Block"); + printf("Extensible Array Data Block(20)"); break; case 21: - printf("Extensible Array Data Block Page"); + printf("Extensible Array Data Block Page(21)"); break; case 22: - printf("Chunk Proxy"); + printf("Chunk Proxy(22)"); break; case 23: - printf("Fixed Array Header"); + printf("Fixed Array Header(23)"); break; case 24: - printf("Fixed Array Data Block"); + printf("Fixed Array Data Block(24)"); break; case 25: - printf("Fixed Array Data Block Page"); + printf("Fixed Array Data Block Page(25)"); break; case 26: - printf("File Superblock"); + printf("File Superblock(26)"); break; case 27: - printf("Test Entry"); + printf("Test Entry(27)"); break; case 28: - printf("Number of Types"); + printf("Number of Types(28)"); break; default: printf("*Unknown*"); @@ -434,7 +434,8 @@ static int verify_tag(hid_t fid, int id, haddr_t tag) } /* for */ - if (found == FALSE) TEST_ERROR; + if (found == FALSE) + TEST_ERROR; return 0; diff --git a/testpar/t_cache.c b/testpar/t_cache.c index f526a8b..d36f34f 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -20,31 +20,22 @@ #include "h5test.h" #include "testpar.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" - -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ - -#include "H5Cpkg.h" #define H5AC_PACKAGE /*suppress error about including H5ACpkg */ +#define H5C_PACKAGE /*suppress error about including H5Cpkg */ +#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #include "H5ACpkg.h" +#include "H5Cpkg.h" +#include "H5Fpkg.h" +#include "H5Iprivate.h" -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#include "H5Fpkg.h" int nerrors = 0; int failures = 0; hbool_t verbose = TRUE; /* used to control error messages */ -#if 0 -/* So far we haven't needed this, but that may change. - * Keep it around for now - */ -hid_t noblock_dxpl_id=(-1); -#endif #define NFILENAME 2 #define PARATESTFILE filenames[0] @@ -169,7 +160,7 @@ struct datum hbool_t global_pinned; hbool_t local_pinned; hbool_t cleared; - hbool_t flushed; + hbool_t flushed; int reads; int writes; int index; @@ -466,20 +457,20 @@ static hbool_t trace_file_check(int metadata_write_strategy); #ifdef NOT_USED /***************************************************************************** * - * Function: print_stats() + * Function: print_stats() * - * Purpose: Print the rudementary stats maintained by t_cache. + * Purpose: Print the rudementary stats maintained by t_cache. * - * This is a debugging function, which will not normally - * be run as part of t_cache. + * This is a debugging function, which will not normally + * be run as part of t_cache. * - * Return: void + * Return: void * - * Programmer: JRM -- 4/17/06 + * Programmer: JRM -- 4/17/06 * * Modifications: * - * None. + * None. * *****************************************************************************/ @@ -487,16 +478,16 @@ static void print_stats(void) { HDfprintf(stdout, - "%d: datum clears / pinned clears / destroys = %ld / %ld / %ld\n", + "%d: datum clears / pinned clears / destroys = %ld / %ld / %ld\n", world_mpi_rank, datum_clears, datum_pinned_clears, - datum_destroys ); + datum_destroys ); HDfprintf(stdout, - "%d: datum flushes / pinned flushes / loads = %ld / %ld / %ld\n", + "%d: datum flushes / pinned flushes / loads = %ld / %ld / %ld\n", world_mpi_rank, datum_flushes, datum_pinned_flushes, - datum_loads ); + datum_loads ); HDfprintf(stdout, - "%d: pins: global / global dirty / local = %ld / %ld / %ld\n", - world_mpi_rank, global_pins, global_dirty_pins, local_pins); + "%d: pins: global / global dirty / local = %ld / %ld / %ld\n", + world_mpi_rank, global_pins, global_dirty_pins, local_pins); HDfflush(stdout); return; @@ -504,6 +495,7 @@ print_stats(void) } /* print_stats() */ #endif /* NOT_USED */ + /***************************************************************************** * * Function: reset_stats() @@ -793,7 +785,7 @@ init_data(void) data[i].global_pinned = FALSE; data[i].local_pinned = FALSE; data[i].cleared = FALSE; - data[i].flushed = FALSE; + data[i].flushed = FALSE; data[i].reads = 0; data[i].writes = 0; data[i].index = i; @@ -883,12 +875,7 @@ do_express_test(void) * * Programmer: JRM -- 5/10/06 * - * Modifications: - * - * None. - * *****************************************************************************/ - static void do_sync(void) { @@ -960,12 +947,7 @@ do_sync(void) * * Programmer: JRM -- 1/3/06 * - * Modifications: - * - * None. - * *****************************************************************************/ - static int get_max_nerrors(void) { @@ -1105,7 +1087,6 @@ recv_mssg(struct mssg_t *mssg_ptr, * 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) @@ -1250,7 +1231,7 @@ setup_derived_types(void) } /* setup_derived_types */ - + /***************************************************************************** * * Function: takedown_derived_types() @@ -1264,12 +1245,7 @@ setup_derived_types(void) * * Programmer: JRM -- 12/22/05 * - * Modifications: - * - * None. - * *****************************************************************************/ - static hbool_t takedown_derived_types(void) { @@ -1311,12 +1287,7 @@ takedown_derived_types(void) * * Programmer: JRM -- 5/5/10 * - * Modifications: - * - * None. - * *****************************************************************************/ - static hbool_t reset_server_counters(void) { @@ -1394,7 +1365,6 @@ reset_server_counters(void) * Updated for sync message. * *****************************************************************************/ - static hbool_t server_main(void) { @@ -1593,11 +1563,11 @@ serve_read_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, - "%d:%s: proc %d read invalid entry. idx/base_addr = %d/0x%llx.\n", - world_mpi_rank, fcn_name, - mssg_ptr->src, + "%d:%s: proc %d read invalid entry. idx/base_addr = %d/%a.\n", + world_mpi_rank, fcn_name, + mssg_ptr->src, target_index, - (long long)(data[target_index].base_addr)); + data[target_index].base_addr); } } else { @@ -1648,7 +1618,7 @@ serve_read_request(struct mssg_t * mssg_ptr) } /* serve_read_request() */ - + /***************************************************************************** * * Function: serve_sync_request() @@ -1669,12 +1639,7 @@ serve_read_request(struct mssg_t * mssg_ptr) * * Programmer: JRM -- 5/10/06 * - * Modifications: - * - * None. - * *****************************************************************************/ - static hbool_t serve_sync_request(struct mssg_t * mssg_ptr) { @@ -2678,58 +2643,66 @@ load_datum(H5F_t UNUSED *f, world_mpi_rank, fcn_name); } #if 0 /* This has been useful debugging code -- keep it for now. */ - if ( mssg.req != READ_REQ_REPLY_CODE ) { - - HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n", - world_mpi_rank, fcn_name); - HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", - world_mpi_rank, fcn_name, (int)(mssg.req)); - } + if ( mssg.req != READ_REQ_REPLY_CODE ) { - if ( mssg.src != world_server_mpi_rank ) { + HDfprintf(stdout, + "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n", + world_mpi_rank, fcn_name); + HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", + world_mpi_rank, fcn_name, (int)(mssg.req)); + } - HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n", - world_mpi_rank, fcn_name); - } + if ( mssg.src != world_server_mpi_rank ) { - if ( mssg.dest != world_mpi_rank ) { + HDfprintf(stdout, + "%d:%s: mssg.src != world_server_mpi_rank.\n", + world_mpi_rank, fcn_name); + } - HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n", - world_mpi_rank, fcn_name); - } + if ( mssg.dest != world_mpi_rank ) { - if ( mssg.base_addr != entry_ptr->base_addr ) { + HDfprintf(stdout, + "%d:%s: mssg.dest != world_mpi_rank.\n", + world_mpi_rank, fcn_name); + } - HDfprintf(stdout, - "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", - world_mpi_rank, fcn_name); - HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", - world_mpi_rank, fcn_name, mssg.base_addr); - HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n", - world_mpi_rank, fcn_name, 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, fcn_name); + HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", + world_mpi_rank, fcn_name, mssg.base_addr); + HDfprintf(stdout, + "%d:%s: entry_ptr->base_addr = %a.\n", + world_mpi_rank, fcn_name, + entry_ptr->base_addr); + } - if ( mssg.len != entry_ptr->len ) { + if ( mssg.len != entry_ptr->len ) { - HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n", - world_mpi_rank, fcn_name); - HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", - world_mpi_rank, fcn_name, mssg.len); - } + HDfprintf(stdout, + "%d:%s: mssg.len != entry_ptr->len.\n", + world_mpi_rank, fcn_name); + HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", + world_mpi_rank, fcn_name, mssg.len); + } - if ( mssg.ver < entry_ptr->ver ) { + if ( mssg.ver < entry_ptr->ver ) { - HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n", - world_mpi_rank, fcn_name); - } + HDfprintf(stdout, + "%d:%s: mssg.ver < entry_ptr->ver.\n", + world_mpi_rank, fcn_name); + } - if ( mssg.magic != MSSG_MAGIC ) { + if ( mssg.magic != MSSG_MAGIC ) { - HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", - world_mpi_rank, fcn_name); - } + HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", + world_mpi_rank, fcn_name); + } #endif /* JRM */ - } else { + + } else { entry_ptr->ver = mssg.ver; entry_ptr->header.is_dirty = FALSE; @@ -2803,7 +2776,7 @@ size_datum(H5F_t UNUSED * f, } /* size_datum() */ - + /*****************************************************************************/ /************************** test utility functions ***************************/ /*****************************************************************************/ @@ -2821,12 +2794,7 @@ size_datum(H5F_t UNUSED * f, * Programmer: John Mainzer * 07/11/06 * - * Modifications: - * - * None. - * *****************************************************************************/ - static void expunge_entry(H5F_t * file_ptr, int32_t idx) @@ -2887,7 +2855,7 @@ expunge_entry(H5F_t * file_ptr, } /* expunge_entry() */ - + /***************************************************************************** * Function: insert_entry() * @@ -2909,7 +2877,6 @@ expunge_entry(H5F_t * file_ptr, * any pins must be global pins. * *****************************************************************************/ - static void insert_entry(H5C_t * cache_ptr, H5F_t * file_ptr, @@ -2998,7 +2965,7 @@ insert_entry(H5C_t * cache_ptr, } /* insert_entry() */ - + /***************************************************************************** * Function: local_pin_and_unpin_random_entries() * @@ -3012,10 +2979,7 @@ insert_entry(H5C_t * cache_ptr, * Programmer: John Mainzer * 4/12/06 * - * Modifications: - * *****************************************************************************/ - static void local_pin_and_unpin_random_entries(H5F_t * file_ptr, int min_idx, @@ -3118,7 +3082,7 @@ local_pin_random_entry(H5F_t * file_ptr, } /* local_pin_random_entry() */ - + /***************************************************************************** * Function: local_unpin_all_entries() * @@ -3131,10 +3095,7 @@ local_pin_random_entry(H5F_t * file_ptr, * Programmer: John Mainzer * 4/12/06 * - * Modifications: - * *****************************************************************************/ - static void local_unpin_all_entries(H5F_t * file_ptr, hbool_t via_unprotect) @@ -3160,7 +3121,7 @@ local_unpin_all_entries(H5F_t * file_ptr, } /* local_unpin_all_entries() */ - + /***************************************************************************** * Function: local_unpin_next_pinned_entry() * @@ -3176,10 +3137,7 @@ local_unpin_all_entries(H5F_t * file_ptr, * Programmer: John Mainzer * 4/12/06 * - * Modifications: - * *****************************************************************************/ - static int local_unpin_next_pinned_entry(H5F_t * file_ptr, int start_idx, @@ -3222,7 +3180,7 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr, } /* local_unpin_next_pinned_entry() */ - + /***************************************************************************** * Function: lock_and_unlock_random_entries() * @@ -3237,10 +3195,7 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr, * Programmer: John Mainzer * 1/12/06 * - * Modifications: - * *****************************************************************************/ - static void lock_and_unlock_random_entries(H5F_t * file_ptr, int min_idx, @@ -3273,7 +3228,7 @@ lock_and_unlock_random_entries(H5F_t * file_ptr, } /* lock_and_unlock_random_entries() */ - + /***************************************************************************** * Function: lock_and_unlock_random_entry() * @@ -3287,10 +3242,7 @@ lock_and_unlock_random_entries(H5F_t * file_ptr, * Programmer: John Mainzer * 1/4/06 * - * Modifications: - * *****************************************************************************/ - static void lock_and_unlock_random_entry(H5F_t * file_ptr, int min_idx, @@ -3320,7 +3272,7 @@ lock_and_unlock_random_entry(H5F_t * file_ptr, } /* lock_and_unlock_random_entry() */ - + /***************************************************************************** * Function: lock_entry() * @@ -3340,7 +3292,6 @@ lock_and_unlock_random_entry(H5F_t * file_ptr, * datum. * *****************************************************************************/ - static void lock_entry(H5F_t * file_ptr, int32_t idx) @@ -3400,7 +3351,6 @@ lock_entry(H5F_t * file_ptr, * 4/14/06 * *****************************************************************************/ - static void mark_entry_dirty(int32_t idx) { @@ -3442,7 +3392,7 @@ mark_entry_dirty(int32_t idx) } /* mark_entry_dirty() */ - + /***************************************************************************** * Function: pin_entry() * @@ -3455,10 +3405,7 @@ mark_entry_dirty(int32_t idx) * Programmer: John Mainzer * 4/11/06 * - * Modifications: - * *****************************************************************************/ - static void pin_entry(H5F_t * file_ptr, int32_t idx, @@ -3512,8 +3459,8 @@ pin_entry(H5F_t * file_ptr, } /* pin_entry() */ - #ifdef H5_METADATA_TRACE_FILE + /***************************************************************************** * Function: pin_protected_entry() * @@ -3527,12 +3474,7 @@ pin_entry(H5F_t * file_ptr, * Programmer: John Mainzer * 01/04/06 * - * Modifications: - * - * None. - * *****************************************************************************/ - static void pin_protected_entry(int32_t idx, hbool_t global) @@ -3793,7 +3735,7 @@ reset_server_counts(void) } /* reset_server_counts() */ - + /***************************************************************************** * Function: resize_entry() * @@ -3808,12 +3750,7 @@ reset_server_counts(void) * Programmer: John Mainzer * 7/11/06 * - * Modifications: - * - * None - * *****************************************************************************/ - static void resize_entry(int32_t idx, size_t new_size) @@ -4070,8 +4007,7 @@ setup_cache_for_test(hid_t * fid_ptr, 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 ) { @@ -4215,7 +4151,7 @@ verify_writes(int num_writes, } /* verify_writes() */ - + /***************************************************************************** * * Function: setup_rand() @@ -4235,7 +4171,6 @@ verify_writes(int num_writes, * Modified function to facilitate setting predefined seeds. * *****************************************************************************/ - static void setup_rand(void) { @@ -4282,7 +4217,7 @@ setup_rand(void) } /* setup_rand() */ - + /***************************************************************************** * * Function: take_down_cache() @@ -4298,12 +4233,7 @@ setup_rand(void) * * Programmer: JRM -- 1/4/06 * - * Modifications: - * - * None. - * *****************************************************************************/ - static hbool_t take_down_cache(hid_t fid) { @@ -4760,7 +4690,7 @@ verify_total_writes(int expected_total_writes) } /* verify_total_writes() */ - + /***************************************************************************** * Function: unlock_entry() * @@ -4779,7 +4709,6 @@ verify_total_writes(int expected_total_writes) * Updated for the new local_len field in datum. * *****************************************************************************/ - void unlock_entry(H5F_t * file_ptr, int32_t idx, @@ -4847,7 +4776,7 @@ unlock_entry(H5F_t * file_ptr, } /* unlock_entry() */ - + /***************************************************************************** * Function: unpin_entry() * @@ -4866,7 +4795,6 @@ unlock_entry(H5F_t * file_ptr, * Added assertion that entry is pinned on entry. * *****************************************************************************/ - static void unpin_entry(H5F_t * file_ptr, int32_t idx, @@ -5716,7 +5644,6 @@ smoke_check_3(int metadata_write_strategy) { const char * fcn_name = "smoke_check_3()"; hbool_t success = TRUE; - int cp = 0; int i; int max_nerrors; int min_count; @@ -5749,18 +5676,12 @@ smoke_check_3(int metadata_write_strategy) break; } - /* 0 */ - if ( verbose ) { HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); } - nerrors = 0; init_data(); reset_stats(); if ( world_mpi_rank == world_server_mpi_rank ) { - /* 1 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - if ( ! server_main() ) { /* some error occured in the server -- report failure */ @@ -5770,15 +5691,9 @@ smoke_check_3(int metadata_write_strategy) world_mpi_rank, fcn_name); } } - - /* 2 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} } else /* run the clients */ { - /* 1 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr, metadata_write_strategy) ) { @@ -5791,9 +5706,6 @@ smoke_check_3(int metadata_write_strategy) } } - /* 2 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - min_count = 100 / ((file_mpi_rank + 1) * (file_mpi_rank + 1)); max_count = min_count + 50; @@ -5808,9 +5720,6 @@ smoke_check_3(int metadata_write_strategy) } } - /* 3 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - min_count = 100 / ((file_mpi_rank + 2) * (file_mpi_rank + 2)); max_count = min_count + 50; @@ -5850,9 +5759,6 @@ smoke_check_3(int metadata_write_strategy) } - /* 4 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* flush the file to be sure that we have no problems flushing * pinned entries @@ -5865,9 +5771,6 @@ smoke_check_3(int metadata_write_strategy) } } - /* 5 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - min_idx = 0; max_idx = ((virt_num_data_entries / 10) / @@ -5902,9 +5805,6 @@ smoke_check_3(int metadata_write_strategy) } } - /* 6 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - min_idx = 0; max_idx = ((virt_num_data_entries / 10) / ((file_mpi_rank + 3) * (file_mpi_rank + 3))) - 1; @@ -5921,9 +5821,6 @@ smoke_check_3(int metadata_write_strategy) min_idx, max_idx, 0, 100); } - /* 7 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* we can't move pinned entries, so release any local pins now. */ local_unpin_all_entries(file_ptr, FALSE); @@ -5941,9 +5838,6 @@ smoke_check_3(int metadata_write_strategy) min_count, max_count); } - /* 8 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { @@ -5955,9 +5849,6 @@ smoke_check_3(int metadata_write_strategy) min_count, max_count); } - /* 9 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* finally, do some dirty lock/unlocks while we give the cache * a chance t reduce its size. */ @@ -5980,9 +5871,6 @@ smoke_check_3(int metadata_write_strategy) } } - /* 10 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* release any local pins before we take down the cache. */ local_unpin_all_entries(file_ptr, FALSE); @@ -5998,9 +5886,6 @@ smoke_check_3(int metadata_write_strategy) } } - /* 11 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* verify that all instances of datum are back where the started * and are clean. */ @@ -6036,9 +5921,6 @@ smoke_check_3(int metadata_write_strategy) } } } - - /* 12 */ - if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} } max_nerrors = get_max_nerrors(); @@ -6400,7 +6282,6 @@ smoke_check_5(int metadata_write_strategy) { const char * fcn_name = "smoke_check_5()"; hbool_t success = TRUE; - int cp = 0; int i; int max_nerrors; hid_t fid = -1; @@ -6430,20 +6311,12 @@ smoke_check_5(int metadata_write_strategy) } - /* 0 */ - if ( verbose ) { HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); } - nerrors = 0; init_data(); reset_stats(); if ( world_mpi_rank == world_server_mpi_rank ) { - /* 1 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - if ( ! server_main() ) { /* some error occured in the server -- report failure */ @@ -6453,20 +6326,10 @@ smoke_check_5(int metadata_write_strategy) world_mpi_rank, fcn_name); } } - - /* 2 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } } else /* run the clients */ { - /* 1 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr, metadata_write_strategy) ) { @@ -6479,21 +6342,11 @@ smoke_check_5(int metadata_write_strategy) } } - /* 2 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); } - /* 3 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - /* flush the file so we can lock known clean entries. */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; @@ -6503,11 +6356,6 @@ smoke_check_5(int metadata_write_strategy) } } - /* 4 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - for ( i = 0; i < (virt_num_data_entries / 4); i++ ) { lock_entry(file_ptr, i); @@ -6531,11 +6379,6 @@ smoke_check_5(int metadata_write_strategy) } } - /* 5 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - for ( i = (virt_num_data_entries / 2) - 1; i >= (virt_num_data_entries / 4); i-- ) @@ -6560,11 +6403,6 @@ smoke_check_5(int metadata_write_strategy) unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); } - /* 6 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - if ( fid >= 0 ) { if ( ! take_down_cache(fid) ) { @@ -6577,11 +6415,6 @@ smoke_check_5(int metadata_write_strategy) } } - /* 7 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - /* verify that all instance of datum are back where the started * and are clean. */ @@ -6592,11 +6425,6 @@ smoke_check_5(int metadata_write_strategy) HDassert( ! (data[i].dirty) ); } - /* 8 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } - /* compose the done message */ mssg.req = DONE_REQ_CODE; mssg.src = world_mpi_rank; @@ -6621,11 +6449,6 @@ smoke_check_5(int metadata_write_strategy) } } } - - /* 9 */ - if ( verbose ) { - HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); - } } max_nerrors = get_max_nerrors(); @@ -7079,7 +6902,7 @@ trace_file_check(int metadata_write_strategy) } /* trace_file_check() */ - + /***************************************************************************** * * Function: main() @@ -7092,12 +6915,7 @@ trace_file_check(int metadata_write_strategy) * * Programmer: JRM -- 12/23/05 * - * Modifications: - * - * None. - * *****************************************************************************/ - int main(int argc, char **argv) { @@ -7123,7 +6941,8 @@ main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("Failed to turn off atexit processing. Continue.\n"); + printf("%d:Failed to turn off atexit processing. Continue.\n", + mpi_rank); }; H5open(); -- cgit v0.12 From 8060c37ef471233e09cfe7d54de04d560b9de744 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 May 2015 09:38:38 -0500 Subject: [svn-r27087] Add changes for debug flags --- config/cmake/HDFCompilerFlags.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 6f37a48..56d17bf 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -3,7 +3,10 @@ #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -ftrapv -fno-common") + 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} -ftrapv -fno-common") + endif () else (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) @@ -13,7 +16,10 @@ if (CMAKE_COMPILER_IS_GNUCC) endif (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_BUILD_TYPE MATCHES Debug) - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99 -ftrapv -fno-common") + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrapv -fno-common") + endif () else (CMAKE_BUILD_TYPE MATCHES Debug) set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) -- cgit v0.12 From bf53b8c95c62bb359c2671870412f1e045ee1d59 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 15 May 2015 11:49:23 -0500 Subject: [svn-r27089] move private functions from H5A.c to H5Aint.c --- src/H5A.c | 266 ----------------------------------------------------------- src/H5Aint.c | 263 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Apkg.h | 3 + 3 files changed, 266 insertions(+), 266 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index 3b993ec..a20f730 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -63,9 +63,6 @@ typedef struct H5A_iter_cb1 { /* Local Prototypes */ /********************/ -static herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id); -static herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id); -static ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf); /*********************/ /* Package Variables */ @@ -608,120 +605,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5A__write - PURPOSE - Actually write out data to an attribute - USAGE - herr_t H5A__write (attr, mem_type, buf) - H5A_t *attr; IN: Attribute to write - const H5T_t *mem_type; IN: Memory datatype of buffer - const void *buf; IN: Buffer of data to write - RETURNS - Non-negative on success/Negative on failure - - DESCRIPTION - This function writes a complete attribute to disk. ---------------------------------------------------------------------------*/ -static herr_t -H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) -{ - uint8_t *tconv_buf = NULL; /* datatype conv buffer */ - hbool_t tconv_owned = FALSE; /* Whether the datatype conv buffer is owned by attribute */ - uint8_t *bkg_buf = NULL; /* temp conversion buffer */ - hssize_t snelmts; /* elements in attribute */ - size_t nelmts; /* elements in attribute */ - H5T_path_t *tpath = NULL; /* conversion information*/ - hid_t src_id = -1, dst_id = -1;/* temporary type atoms */ - size_t src_type_size; /* size of source type */ - size_t dst_type_size; /* size of destination type*/ - size_t buf_size; /* desired buffer size */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, attr->oloc.addr, FAIL) - - HDassert(attr); - HDassert(mem_type); - HDassert(buf); - - /* Get # of elements for attribute's dataspace */ - if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); - - /* If there's actually data elements for the attribute, make a copy of the data passed in */ - if(nelmts > 0) { - /* Get the memory and file datatype sizes */ - src_type_size = H5T_GET_SIZE(mem_type); - dst_type_size = H5T_GET_SIZE(attr->shared->dt); - - /* Convert memory buffer into disk buffer */ - /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") - - /* Check for type conversion required */ - if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") - - /* Get the maximum buffer size needed and allocate it */ - buf_size = nelmts * MAX(src_type_size, dst_type_size); - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") - - /* Copy the user's data into the buffer for conversion */ - HDmemcpy(tconv_buf, buf, (src_type_size * nelmts)); - - /* Perform datatype conversion */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") - - /* Free the previous attribute data buffer, if there is one */ - if(attr->shared->data) - attr->shared->data = H5FL_BLK_FREE(attr_buf, attr->shared->data); - - /* Set the pointer to the attribute data to the converted information */ - attr->shared->data = tconv_buf; - tconv_owned = TRUE; - } /* end if */ - /* No type conversion necessary */ - else { - HDassert(dst_type_size == src_type_size); - - /* Allocate the attribute buffer, if there isn't one */ - if(attr->shared->data == NULL) - if(NULL == (attr->shared->data = H5FL_BLK_MALLOC(attr_buf, dst_type_size * nelmts))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Copy the attribute data into the user's buffer */ - HDmemcpy(attr->shared->data, buf, (dst_type_size * nelmts)); - } /* end else */ - - /* Modify the attribute in the object header */ - if(H5O_attr_write(&(attr->oloc), dxpl_id, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") - } /* end if */ - -done: - /* Release resources */ - if(src_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(tconv_buf && !tconv_owned) - tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); - if(bkg_buf) - bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* H5A__write() */ - - -/*-------------------------------------------------------------------------- - NAME H5Aread PURPOSE Read in data from an attribute @@ -765,109 +648,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5A__read - PURPOSE - Actually read in data from an attribute - USAGE - herr_t H5A__read (attr, mem_type, buf) - H5A_t *attr; IN: Attribute to read - const H5T_t *mem_type; IN: Memory datatype of buffer - void *buf; IN: Buffer for data to read - RETURNS - Non-negative on success/Negative on failure - - DESCRIPTION - This function reads a complete attribute from disk. ---------------------------------------------------------------------------*/ -static herr_t -H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) -{ - uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ - uint8_t *bkg_buf = NULL; /* background buffer */ - hssize_t snelmts; /* elements in attribute */ - size_t nelmts; /* elements in attribute*/ - H5T_path_t *tpath = NULL; /* type conversion info */ - hid_t src_id = -1, dst_id = -1;/* temporary type atoms*/ - size_t src_type_size; /* size of source type */ - size_t dst_type_size; /* size of destination type */ - size_t buf_size; /* desired buffer size */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_STATIC - - HDassert(attr); - HDassert(mem_type); - HDassert(buf); - - /* Create buffer for data to store on disk */ - if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); - - if(nelmts > 0) { - /* Get the memory and file datatype sizes */ - src_type_size = H5T_GET_SIZE(attr->shared->dt); - dst_type_size = H5T_GET_SIZE(mem_type); - - /* Check if the attribute has any data yet, if not, fill with zeroes */ - if(attr->obj_opened && !attr->shared->data) - HDmemset(buf, 0, (dst_type_size * nelmts)); - else { /* Attribute exists and has a value */ - /* Convert memory buffer into disk buffer */ - /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") - - /* Check for type conversion required */ - if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") - - /* Get the maximum buffer size needed and allocate it */ - buf_size = nelmts * MAX(src_type_size, dst_type_size); - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Copy the attribute data into the buffer for conversion */ - HDmemcpy(tconv_buf, attr->shared->data, (src_type_size * nelmts)); - - /* Perform datatype conversion. */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") - - /* Copy the converted data into the user's buffer */ - HDmemcpy(buf, tconv_buf, (dst_type_size * nelmts)); - } /* end if */ - /* No type conversion necessary */ - else { - HDassert(dst_type_size == src_type_size); - - /* Copy the attribute data into the user's buffer */ - HDmemcpy(buf, attr->shared->data, (dst_type_size * nelmts)); - } /* end else */ - } /* end else */ - } /* end if */ - -done: - /* Release resources */ - if(src_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(tconv_buf) - tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); - if(bkg_buf) - bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A__read() */ - - -/*-------------------------------------------------------------------------- - NAME H5Aget_space PURPOSE Gets a copy of the dataspace for an attribute @@ -1027,52 +807,6 @@ done: } /* H5Aget_name() */ -/*-------------------------------------------------------------------------- - NAME - H5A__get_name - PURPOSE - Private function for H5Aget_name. Gets a copy of the name for an - attribute - RETURNS - This function returns the length of the attribute's name (which may be - longer than 'buf_size') on success or negative for failure. - DESCRIPTION - This function retrieves the name of an attribute for an attribute ID. - Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string - terminator. If the name of the attribute is longer than 'buf_size'-1, - the string terminator is stored in the last position of the buffer to - properly terminate the string. ---------------------------------------------------------------------------*/ -static ssize_t -H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) -{ - size_t copy_len, nbytes; - ssize_t ret_value; - - FUNC_ENTER_STATIC_NOERR - - /* get the real attribute length */ - nbytes = HDstrlen(attr->shared->name); - HDassert((ssize_t)nbytes >= 0); /*overflow, pretty unlikely --rpm*/ - - /* compute the string length which will fit into the user's buffer */ - copy_len = MIN(buf_size - 1, nbytes); - - /* Copy all/some of the name */ - if(buf && copy_len > 0) { - HDmemcpy(buf, attr->shared->name, copy_len); - - /* Terminate the string */ - buf[copy_len]='\0'; - } /* end if */ - - /* Set return value */ - ret_value = (ssize_t)nbytes; - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_get_name() */ - - /*------------------------------------------------------------------------- * Function: H5Aget_name_by_idx * diff --git a/src/H5Aint.c b/src/H5Aint.c index 84f7ecd..9012f6d 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -468,6 +468,269 @@ done: } /* H5A_open_by_name() */ +/*-------------------------------------------------------------------------- + NAME + H5A__read + PURPOSE + Actually read in data from an attribute + USAGE + herr_t H5A__read (attr, mem_type, buf) + H5A_t *attr; IN: Attribute to read + const H5T_t *mem_type; IN: Memory datatype of buffer + void *buf; IN: Buffer for data to read + RETURNS + Non-negative on success/Negative on failure + + DESCRIPTION + This function reads a complete attribute from disk. +--------------------------------------------------------------------------*/ +herr_t +H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) +{ + uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ + uint8_t *bkg_buf = NULL; /* background buffer */ + hssize_t snelmts; /* elements in attribute */ + size_t nelmts; /* elements in attribute*/ + H5T_path_t *tpath = NULL; /* type conversion info */ + hid_t src_id = -1, dst_id = -1;/* temporary type atoms*/ + size_t src_type_size; /* size of source type */ + size_t dst_type_size; /* size of destination type */ + size_t buf_size; /* desired buffer size */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(attr); + HDassert(mem_type); + HDassert(buf); + + /* Create buffer for data to store on disk */ + if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); + + if(nelmts > 0) { + /* Get the memory and file datatype sizes */ + src_type_size = H5T_GET_SIZE(attr->shared->dt); + dst_type_size = H5T_GET_SIZE(mem_type); + + /* Check if the attribute has any data yet, if not, fill with zeroes */ + if(attr->obj_opened && !attr->shared->data) + HDmemset(buf, 0, (dst_type_size * nelmts)); + else { /* Attribute exists and has a value */ + /* Convert memory buffer into disk buffer */ + /* Set up type conversion function */ + if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type, NULL, NULL, dxpl_id, FALSE))) + HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") + + /* Check for type conversion required */ + if(!H5T_path_noop(tpath)) { + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") + + /* Get the maximum buffer size needed and allocate it */ + buf_size = nelmts * MAX(src_type_size, dst_type_size); + if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") + if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Copy the attribute data into the buffer for conversion */ + HDmemcpy(tconv_buf, attr->shared->data, (src_type_size * nelmts)); + + /* Perform datatype conversion. */ + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") + + /* Copy the converted data into the user's buffer */ + HDmemcpy(buf, tconv_buf, (dst_type_size * nelmts)); + } /* end if */ + /* No type conversion necessary */ + else { + HDassert(dst_type_size == src_type_size); + + /* Copy the attribute data into the user's buffer */ + HDmemcpy(buf, attr->shared->data, (dst_type_size * nelmts)); + } /* end else */ + } /* end else */ + } /* end if */ + +done: + /* Release resources */ + if(src_id >= 0 && H5I_dec_ref(src_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(tconv_buf) + tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); + if(bkg_buf) + bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5A__read() */ + + +/*-------------------------------------------------------------------------- + NAME + H5A__write + PURPOSE + Actually write out data to an attribute + USAGE + herr_t H5A__write (attr, mem_type, buf) + H5A_t *attr; IN: Attribute to write + const H5T_t *mem_type; IN: Memory datatype of buffer + const void *buf; IN: Buffer of data to write + RETURNS + Non-negative on success/Negative on failure + + DESCRIPTION + This function writes a complete attribute to disk. +--------------------------------------------------------------------------*/ +herr_t +H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) +{ + uint8_t *tconv_buf = NULL; /* datatype conv buffer */ + hbool_t tconv_owned = FALSE; /* Whether the datatype conv buffer is owned by attribute */ + uint8_t *bkg_buf = NULL; /* temp conversion buffer */ + hssize_t snelmts; /* elements in attribute */ + size_t nelmts; /* elements in attribute */ + H5T_path_t *tpath = NULL; /* conversion information*/ + hid_t src_id = -1, dst_id = -1;/* temporary type atoms */ + size_t src_type_size; /* size of source type */ + size_t dst_type_size; /* size of destination type*/ + size_t buf_size; /* desired buffer size */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, attr->oloc.addr, FAIL) + + HDassert(attr); + HDassert(mem_type); + HDassert(buf); + + /* Get # of elements for attribute's dataspace */ + if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); + + /* If there's actually data elements for the attribute, make a copy of the data passed in */ + if(nelmts > 0) { + /* Get the memory and file datatype sizes */ + src_type_size = H5T_GET_SIZE(mem_type); + dst_type_size = H5T_GET_SIZE(attr->shared->dt); + + /* Convert memory buffer into disk buffer */ + /* Set up type conversion function */ + if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt, NULL, NULL, dxpl_id, FALSE))) + HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") + + /* Check for type conversion required */ + if(!H5T_path_noop(tpath)) { + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") + + /* Get the maximum buffer size needed and allocate it */ + buf_size = nelmts * MAX(src_type_size, dst_type_size); + if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") + if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed") + + /* Copy the user's data into the buffer for conversion */ + HDmemcpy(tconv_buf, buf, (src_type_size * nelmts)); + + /* Perform datatype conversion */ + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") + + /* Free the previous attribute data buffer, if there is one */ + if(attr->shared->data) + attr->shared->data = H5FL_BLK_FREE(attr_buf, attr->shared->data); + + /* Set the pointer to the attribute data to the converted information */ + attr->shared->data = tconv_buf; + tconv_owned = TRUE; + } /* end if */ + /* No type conversion necessary */ + else { + HDassert(dst_type_size == src_type_size); + + /* Allocate the attribute buffer, if there isn't one */ + if(attr->shared->data == NULL) + if(NULL == (attr->shared->data = H5FL_BLK_MALLOC(attr_buf, dst_type_size * nelmts))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Copy the attribute data into the user's buffer */ + HDmemcpy(attr->shared->data, buf, (dst_type_size * nelmts)); + } /* end else */ + + /* Modify the attribute in the object header */ + if(H5O_attr_write(&(attr->oloc), dxpl_id, attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") + } /* end if */ + +done: + /* Release resources */ + if(src_id >= 0 && H5I_dec_ref(src_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(tconv_buf && !tconv_owned) + tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); + if(bkg_buf) + bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); + + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) +} /* H5A__write() */ + + +/*-------------------------------------------------------------------------- + NAME + H5A__get_name + PURPOSE + Private function for H5Aget_name. Gets a copy of the name for an + attribute + RETURNS + This function returns the length of the attribute's name (which may be + longer than 'buf_size') on success or negative for failure. + DESCRIPTION + This function retrieves the name of an attribute for an attribute ID. + Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string + terminator. If the name of the attribute is longer than 'buf_size'-1, + the string terminator is stored in the last position of the buffer to + properly terminate the string. +--------------------------------------------------------------------------*/ +ssize_t +H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) +{ + size_t copy_len, nbytes; + ssize_t ret_value; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* get the real attribute length */ + nbytes = HDstrlen(attr->shared->name); + HDassert((ssize_t)nbytes >= 0); /*overflow, pretty unlikely --rpm*/ + + /* compute the string length which will fit into the user's buffer */ + copy_len = MIN(buf_size - 1, nbytes); + + /* Copy all/some of the name */ + if(buf && copy_len > 0) { + HDmemcpy(buf, attr->shared->name, copy_len); + + /* Terminate the string */ + buf[copy_len]='\0'; + } /* end if */ + + /* Set return value */ + ret_value = (ssize_t)nbytes; + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5A__get_name() */ + + /*------------------------------------------------------------------------- * Function: H5A_get_space * diff --git a/src/H5Apkg.h b/src/H5Apkg.h index f656214..d3fcd53 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -206,6 +206,9 @@ H5_DLL herr_t H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char const char *new_attr_name, hid_t lapl_id, hid_t dxpl_id); H5_DLL htri_t H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, hid_t lapl_id, hid_t dxpl_id); +H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id); +H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id); +H5_DLL ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf); /* Attribute "dense" storage routines */ H5_DLL herr_t H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo); -- cgit v0.12 From ab80cbadfd5d7a28e4cb37317e2535bde502626c Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 17 May 2015 18:59:27 -0500 Subject: [svn-r27092] Snapshot version 1.9 release 218 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index e17dadf..1148808 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.218 currently under development +HDF5 version 1.9.219 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 0487f69..2ea7be5 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -670,7 +670,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 208 +LT_VERS_REVISION = 209 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 4072c1b..9fff198 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 = HDF5 version 1.9.218 currently under development +PROJECT_NUMBER = HDF5 version 1.9.219 currently under development # 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/lt_vers.am b/config/lt_vers.am index 38a6357..d0ef02f 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 208 +LT_VERS_REVISION = 209 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 5c9e63f..b1da8b3 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.218. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.219. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.218' -PACKAGE_STRING='HDF5 1.9.218' +PACKAGE_VERSION='1.9.219' +PACKAGE_STRING='HDF5 1.9.219' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.218 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.219 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1542,7 +1542,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.218:";; + short | recursive ) echo "Configuration of HDF5 1.9.219:";; esac cat <<\_ACEOF @@ -1731,7 +1731,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.218 +HDF5 configure 1.9.219 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2668,7 +2668,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.218, which was +It was created by HDF5 $as_me 1.9.219, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3539,7 +3539,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.218' + VERSION='1.9.219' cat >>confdefs.h <<_ACEOF @@ -28577,7 +28577,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.218 +HDF5 config.lt 1.9.219 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -30693,7 +30693,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.218, which was +This file was extended by HDF5 $as_me 1.9.219, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30759,7 +30759,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.218 +HDF5 config.status 1.9.219 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f86d9b3..922da9f 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.218], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.219], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index f57e7e7..02071c9 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -724,7 +724,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 208 +LT_VERS_REVISION = 209 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 61cb11c..44ec9df 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -662,7 +662,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 208 +LT_VERS_REVISION = 209 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 7567dfc..d8466fd 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 208 +LT_VERS_REVISION = 209 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 6a719e7..88fada8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -661,7 +661,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 208 +LT_VERS_REVISION = 209 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d53ce79..6b223fc 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.218 currently under development +HDF5 version 1.9.219 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 7b9625b..225a2de 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 218 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 219 /* 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.9.218" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.219" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 0767628..bdfe30e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -723,7 +723,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 208 +LT_VERS_REVISION = 209 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From 194d647721cb4f71e6330d11c244b3d7db8309e7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 18 May 2015 08:00:54 -0500 Subject: [svn-r27097] Fixed a typo in test/th5o.c that caused the wrong property list ID to be checked. Tested on: h5committest --- test/th5o.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/th5o.c b/test/th5o.c index a470f4c..be3b4ab 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -669,7 +669,7 @@ test_h5o_plist(void) gcpl = H5Gget_create_plist(grp); CHECK(gcpl, FAIL, "H5Gget_create_plist"); tcpl = H5Tget_create_plist(dtype); - CHECK(dcpl, FAIL, "H5Tget_create_plist"); + CHECK(tcpl, FAIL, "H5Tget_create_plist"); dcpl = H5Dget_create_plist(dset); CHECK(dcpl, FAIL, "H5Dget_create_plist"); @@ -719,7 +719,7 @@ test_h5o_plist(void) gcpl = H5Gget_create_plist(grp); CHECK(gcpl, FAIL, "H5Gget_create_plist"); tcpl = H5Tget_create_plist(dtype); - CHECK(dcpl, FAIL, "H5Tget_create_plist"); + CHECK(tcpl, FAIL, "H5Tget_create_plist"); dcpl = H5Dget_create_plist(dset); CHECK(dcpl, FAIL, "H5Dget_create_plist"); -- cgit v0.12 From 965e459a9861326b3d3c3455c332d2bbca52bd87 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 24 May 2015 18:59:54 -0500 Subject: [svn-r27110] Snapshot version 1.9 release 219 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index 1148808..646d4cb 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.219 currently under development +HDF5 version 1.9.220 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 2ea7be5..48e78b2 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -670,7 +670,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 209 +LT_VERS_REVISION = 210 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 9fff198..9894908 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 = HDF5 version 1.9.219 currently under development +PROJECT_NUMBER = HDF5 version 1.9.220 currently under development # 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/lt_vers.am b/config/lt_vers.am index d0ef02f..7678149 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 209 +LT_VERS_REVISION = 210 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index b1da8b3..652edde 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.219. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.220. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.219' -PACKAGE_STRING='HDF5 1.9.219' +PACKAGE_VERSION='1.9.220' +PACKAGE_STRING='HDF5 1.9.220' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.219 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.220 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1542,7 +1542,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.219:";; + short | recursive ) echo "Configuration of HDF5 1.9.220:";; esac cat <<\_ACEOF @@ -1731,7 +1731,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.219 +HDF5 configure 1.9.220 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2668,7 +2668,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.219, which was +It was created by HDF5 $as_me 1.9.220, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3539,7 +3539,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.219' + VERSION='1.9.220' cat >>confdefs.h <<_ACEOF @@ -28577,7 +28577,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.219 +HDF5 config.lt 1.9.220 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -30693,7 +30693,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.219, which was +This file was extended by HDF5 $as_me 1.9.220, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30759,7 +30759,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.219 +HDF5 config.status 1.9.220 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 922da9f..63081e4 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.219], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.220], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 02071c9..85c09fa 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -724,7 +724,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 209 +LT_VERS_REVISION = 210 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 44ec9df..3976ab9 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -662,7 +662,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 209 +LT_VERS_REVISION = 210 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index d8466fd..5b953a8 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 209 +LT_VERS_REVISION = 210 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 88fada8..0b64afe 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -661,7 +661,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 209 +LT_VERS_REVISION = 210 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6b223fc..34f8de2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.219 currently under development +HDF5 version 1.9.220 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 225a2de..0637aee 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 219 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 220 /* 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.9.219" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.220" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index bdfe30e..bae576b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -723,7 +723,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 209 +LT_VERS_REVISION = 210 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From cea93c4a37a8ec0adc0dd769c9d8affc49078398 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Tue, 26 May 2015 09:23:27 -0500 Subject: [svn-r27111] move undef of __attribute__ back to private and remove its usage from public routines. --- src/H5Epublic.h | 2 +- src/H5api_adpt.h | 7 ------- src/H5private.h | 2 ++ tools/lib/h5tools_utils.h | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 1639ab4..17a35d9 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -165,7 +165,7 @@ H5_DLL herr_t H5Eclose_stack(hid_t stack_id); H5_DLL ssize_t H5Eget_class_name(hid_t class_id, char *name, size_t size); H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id); H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, - hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...)__attribute__((format (printf, 8, 9))); + hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...); H5_DLL herr_t H5Epop(hid_t err_stack, size_t count); H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream); H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func, diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index 7602310..9b00bd9 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -21,13 +21,6 @@ #ifndef H5API_ADPT_H #define H5API_ADPT_H -#ifdef __cplusplus -#define __attribute__(X) /*void*/ -#endif /* __cplusplus */ -#ifndef H5_HAVE_ATTRIBUTE -#define __attribute__(X) /*void*/ -#endif /* H5_HAVE_ATTRIBUTE */ - /* This will only be defined if HDF5 was built with CMake */ #ifdef H5_BUILT_AS_DYNAMIC_LIB diff --git a/src/H5private.h b/src/H5private.h index 66bf7eb..0987ce9 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -279,6 +279,7 @@ * big deal if we don't. */ #ifdef __cplusplus +# define __attribute__(X) /*void*/ # define UNUSED /*void*/ # define NORETURN /*void*/ #else /* __cplusplus */ @@ -286,6 +287,7 @@ # define UNUSED __attribute__((unused)) # define NORETURN __attribute__((noreturn)) #else +# define __attribute__(X) /*void*/ # define UNUSED /*void*/ # define NORETURN /*void*/ #endif diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index fd588b9..3285278 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -124,9 +124,9 @@ H5TOOLS_DLLVAR int h5tools_nCols; /*max number of columns for /* Definitions of useful routines */ H5TOOLS_DLL void indentation(int); H5TOOLS_DLL void print_version(const char *progname); -H5TOOLS_DLL void parallel_print(const char* format, ... )__attribute__((format (printf, 1, 2))); -H5TOOLS_DLL void error_msg(const char *fmt, ...)__attribute__((format (printf, 1, 2))); -H5TOOLS_DLL void warn_msg(const char *fmt, ...)__attribute__((format (printf, 1, 2))); +H5TOOLS_DLL void parallel_print(const char* format, ... ); +H5TOOLS_DLL void error_msg(const char *fmt, ...); +H5TOOLS_DLL void warn_msg(const char *fmt, ...); H5TOOLS_DLL void help_ref_msg(FILE *output); H5TOOLS_DLL void free_table(table_t *table); #ifdef H5DUMP_DEBUG -- cgit v0.12 From ae82b5232a98e170c74118fe3ddab4b525d89fe9 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 27 May 2015 15:31:39 -0500 Subject: [svn-r27114] Fixed spelling and which file is created with the program. Tested: none -- comments only. --- src/H5detect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5detect.c b/src/H5detect.c index 15736bd..5fa59d3 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -40,7 +40,7 @@ static const char *FileHeader = "\n\ * Livermore National Laboratory. * * Detects machine byte order and floating point - * format and generates a C source file (native.c) + * 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 -- cgit v0.12 From 78c4a8f4c66aed5792dc858cfb1b59cb1b425475 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 31 May 2015 19:02:10 -0500 Subject: [svn-r27127] Snapshot version 1.9 release 220 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index 646d4cb..155f050 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.220 currently under development +HDF5 version 1.9.221 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 48e78b2..1e446dc 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -670,7 +670,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 210 +LT_VERS_REVISION = 211 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 9894908..d2a0d28 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 = HDF5 version 1.9.220 currently under development +PROJECT_NUMBER = HDF5 version 1.9.221 currently under development # 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/lt_vers.am b/config/lt_vers.am index 7678149..ac9150e 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 210 +LT_VERS_REVISION = 211 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 652edde..2807384 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.220. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.221. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.220' -PACKAGE_STRING='HDF5 1.9.220' +PACKAGE_VERSION='1.9.221' +PACKAGE_STRING='HDF5 1.9.221' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.220 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.221 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1542,7 +1542,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.220:";; + short | recursive ) echo "Configuration of HDF5 1.9.221:";; esac cat <<\_ACEOF @@ -1731,7 +1731,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.220 +HDF5 configure 1.9.221 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2668,7 +2668,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.220, which was +It was created by HDF5 $as_me 1.9.221, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3539,7 +3539,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.220' + VERSION='1.9.221' cat >>confdefs.h <<_ACEOF @@ -28577,7 +28577,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.220 +HDF5 config.lt 1.9.221 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -30693,7 +30693,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.220, which was +This file was extended by HDF5 $as_me 1.9.221, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30759,7 +30759,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.220 +HDF5 config.status 1.9.221 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 63081e4..d5b91ce 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.220], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.221], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 85c09fa..4c15976 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -724,7 +724,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 210 +LT_VERS_REVISION = 211 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 3976ab9..5b0071b 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -662,7 +662,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 210 +LT_VERS_REVISION = 211 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 5b953a8..a0d0bc0 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 210 +LT_VERS_REVISION = 211 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 0b64afe..3ed70ec 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -661,7 +661,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 210 +LT_VERS_REVISION = 211 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 34f8de2..df1117b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.220 currently under development +HDF5 version 1.9.221 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 0637aee..bf6c6de 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 220 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 221 /* 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.9.220" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.221" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index bae576b..6dcba84 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -723,7 +723,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 210 +LT_VERS_REVISION = 211 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From 9ff455820324f2f39f69a12c9bb0be38b011a688 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Mon, 1 Jun 2015 10:41:33 -0500 Subject: [svn-r27128] Fix warnings in H5Tdbg --- src/H5Tdbg.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index fe204d8..18e0f2a 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -165,14 +165,19 @@ H5T_debug(const H5T_t *dt, FILE *stream) { const char *s1 = "", *s2 = ""; unsigned i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(dt); HDassert(stream); switch(dt->shared->type) { + case H5T_NO_CLASS: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); + break; + case H5T_INTEGER: s1 = "int"; break; @@ -212,6 +217,9 @@ H5T_debug(const H5T_t *dt, FILE *stream) s1 = "vlen"; break; + case H5T_REFERENCE: + case H5T_ARRAY: + case H5T_NCLASSES: default: s1 = ""; break; @@ -247,6 +255,10 @@ H5T_debug(const H5T_t *dt, FILE *stream) uint64_t tmp; switch(dt->shared->u.atomic.order) { + case H5T_ORDER_ERROR: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "order error"); + break; + case H5T_ORDER_BE: s1 = "BE"; break; @@ -263,6 +275,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) s1 = "NONE"; break; + case H5T_ORDER_MIXED: default: s1 = "order?"; break; @@ -277,8 +290,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) fprintf(stream, ", prec=%lu", (unsigned long) (dt->shared->u.atomic.prec)); switch(dt->shared->type) { + case H5T_NO_CLASS: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); + break; + case H5T_INTEGER: switch(dt->shared->u.atomic.u.i.sign) { + case H5T_SGN_ERROR: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "sign error"); + break; + case H5T_SGN_NONE: s1 = "unsigned"; break; @@ -287,6 +308,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) s1 = NULL; break; + case H5T_NSGN: default: s1 = "sign?"; break; @@ -298,6 +320,10 @@ H5T_debug(const H5T_t *dt, FILE *stream) case H5T_FLOAT: switch(dt->shared->u.atomic.u.f.norm) { + case H5T_NORM_ERROR: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "norm error"); + break; + case H5T_NORM_IMPLIED: s1 = "implied"; break; @@ -335,6 +361,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) } break; + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: /* No additional info */ break; @@ -351,6 +387,10 @@ H5T_debug(const H5T_t *dt, FILE *stream) fprintf(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"); break; @@ -359,6 +399,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) fprintf(stream, ", loc=disk"); break; + case H5T_LOC_MAXLOC: default: fprintf(stream, ", loc=UNKNOWN"); break; @@ -397,6 +438,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } fprintf(stream, "}"); - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_debug() */ -- cgit v0.12 From 1ac9bcaaa60c0a01c1d9bfa21baea47cbdc663e1 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Mon, 1 Jun 2015 10:43:13 -0500 Subject: [svn-r27129] Fix warnings in H5Tbit --- src/H5Tbit.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 79cf3a6..5322959 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -82,7 +82,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t mask = ((size_t)1 << nbits) - 1; dst[d_idx] &= (uint8_t)~(mask << dst_offset); - dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); src_offset += nbits; if(src_offset >= 8) { @@ -141,7 +141,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t mask = ((size_t)1 << nbits) - 1; dst[d_idx] &= (uint8_t)(~(mask << dst_offset)); - dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); src_offset += nbits; if(src_offset >= 8) { @@ -376,9 +376,11 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) unsigned mask = ((unsigned)1 << nbits) - 1; if(value) - buf[idx++] |= (uint8_t)(mask << offset); + buf[idx] = (uint8_t)(buf[idx] | (mask << offset)); else - buf[idx++] &= (uint8_t)(~(mask << offset)); + buf[idx] &= (uint8_t)(~(mask << offset)); + + idx++; size -= nbits; } /* end if */ @@ -551,7 +553,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) acc++; carry = acc & ((unsigned)1 << MIN(size, 8 - start)); buf[idx] &= (uint8_t)(~(mask << start)); - buf[idx] |= (uint8_t)((acc & mask) << start); + buf[idx] = (uint8_t)(buf[idx] | ((acc & mask) << start)); size -= MIN(size, 8 - start); start = 0; idx++; -- cgit v0.12 From 92e3188ff3c8c32a6875ae86c018b1aa954841b0 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Mon, 1 Jun 2015 10:44:42 -0500 Subject: [svn-r27130] Fix warnings in H5Tconv Remove H5T_INIT_INTERFACE from H5Tconv Add macro in H5Tconv to check overflow when using H5T_CONV_uS --- src/H5Tconv.c | 223 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 132 insertions(+), 91 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 1c51b69..b18f33f 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -23,10 +23,6 @@ #define H5T_PACKAGE /*suppress error about including H5Tpkg */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_conv_interface - - /***********/ /* Headers */ /***********/ @@ -174,10 +170,10 @@ * destination. * */ -#define H5T_CONV_xX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_xX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_xX_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_xX_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } @@ -188,7 +184,7 @@ * equal. In this case, do not return exception but make sure the maximum is assigned * to the destination. SLU - 2005/06/29 */ -#define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Xx_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ @@ -210,7 +206,7 @@ } else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Xx_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ } else if (*(S) < (ST)(D_MIN)) { \ @@ -219,7 +215,7 @@ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Ux_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ @@ -232,7 +228,7 @@ } else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Ux_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ } else \ @@ -244,7 +240,7 @@ H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } -#define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_sU_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if (*(S) < 0) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ @@ -257,7 +253,7 @@ } else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_sU_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_sU_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) < 0) \ *(D) = 0; \ else \ @@ -269,28 +265,87 @@ H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } -#define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(sizeof(ST) == sizeof(DT) && *(S) > (DT)(D_MAX)) { \ - H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ +/* Define to 1 if overflow is possible during conversion, 0 otherwise + * Because destination is at least as wide as the source, this should only + * occur between types of equal size */ +#define H5T_CONV_uS_UCHAR_SHORT 0 +#define H5T_CONV_uS_UCHAR_INT 0 +#define H5T_CONV_uS_UCHAR_LONG 0 +#define H5T_CONV_uS_UCHAR_LLONG 0 +#if H5_SIZEOF_SHORT == H5_SIZEOF_INT + #define H5T_CONV_uS_USHORT_INT 1 +#else + #define H5T_CONV_uS_USHORT_INT 0 +#endif +#define H5T_CONV_uS_USHORT_LONG 0 +#define H5T_CONV_uS_USHORT_LLONG 0 +#if H5_SIZEOF_INT == H5_SIZEOF_LONG + #define H5T_CONV_uS_UINT_LONG 1 +#else + #define H5T_CONV_uS_UINT_LONG 0 +#endif +#define H5T_CONV_uS_UINT_LLONG 0 +#if H5_SIZEOF_LONG == H5_SIZEOF_LONG_LONG + #define H5T_CONV_uS_ULONG_LLONG 1 +#else + #define H5T_CONV_uS_ULONG_LLONG 0 +#endif + +/* Note. If an argument is stringified or concatenated, the prescan does not + * occur. To expand the macro, then stringify or concatenate its expansion, + * one macro must call another macro that does the stringification or + * concatenation. */ +#define H5T_CONV_uS_EVAL_TYPES(STYPE, DTYPE) \ + H5_GLUE4(H5T_CONV_uS_, STYPE, _, DTYPE) + +/* Called if overflow is possible */ +#define H5T_CONV_uS_CORE_1(S, D, ST, DT, D_MIN, D_MAX) \ + if (*(S) > (DT)(D_MAX)) { \ + H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI,\ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ - /* Let compiler convert if case is ignored by user handler*/ \ - *(D) = (DT)(D_MAX); \ - else if(except_ret == H5T_CONV_ABORT) \ - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ - /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else \ - *(D) = (DT)(*(S)); \ -} -#define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (sizeof(ST)==sizeof(DT) && *(S) > (DT)(D_MAX)) { \ - *(D) = (D_MAX); \ - } else \ - *(D) = (DT)(*(S)); \ + /* Let compiler convert if case is ignored by user handler */ \ + *(D) = (DT)(D_MAX); \ + else if (except_ret == H5T_CONV_ABORT) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, \ + "can't handle conversion exception") \ + /* if (except_ret==H5T_CONV_HANDLED): Fall through, user handled it */\ + } else \ + *(D) = (DT)(*(S)); + +/* Called if no overflow is possible */ +#define H5T_CONV_uS_CORE_0(S, D, ST, DT, D_MIN, D_MAX) \ + *(D) = (DT)(*(S)); + +#define H5T_CONV_uS_CORE_I(over, S, D, ST, DT, D_MIN, D_MAX) \ + H5_GLUE(H5T_CONV_uS_CORE_, over)(S, D, ST, DT, D_MIN, D_MAX) + +#define H5T_CONV_uS_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) { \ + H5T_CONV_uS_CORE_I(H5T_CONV_uS_EVAL_TYPES(STYPE, DTYPE), \ + S, D, ST, DT, D_MIN, D_MAX) \ +} + +/* Called if overflow is possible */ +#define H5T_CONV_uS_NOEX_CORE_1(S, D, ST, DT, D_MIN, D_MAX) \ + if (*(S) > (DT)(D_MAX)) \ + *(D) = (D_MAX); \ + else \ + *(D) = (DT)(*(S)); + +/* Called if no overflow is possible */ +#define H5T_CONV_uS_NOEX_CORE_0(S, D, ST, DT, D_MIN, D_MAX) \ + *(D) = (DT)(*(S)); + +#define H5T_CONV_uS_NOEX_CORE_I(over, S, D, ST, DT, D_MIN, D_MAX) \ + H5_GLUE(H5T_CONV_uS_NOEX_CORE_, over)(S, D, ST, DT, D_MIN, D_MAX) + +#define H5T_CONV_uS_NOEX_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) { \ + H5T_CONV_uS_NOEX_CORE_I(H5T_CONV_uS_EVAL_TYPES(STYPE, DTYPE), \ + S, D, ST, DT, D_MIN, D_MAX) \ } -#define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ +#define H5T_CONV_uS(STYPE, DTYPE, ST, DT, D_MIN, D_MAX) { \ + HDcompile_assert(sizeof(ST) <= sizeof(DT)); \ H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } @@ -304,7 +359,7 @@ H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } -#define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Su_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) < 0) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ @@ -326,7 +381,7 @@ } else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Su_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) < 0) \ *(D) = 0; \ else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \ @@ -350,7 +405,7 @@ H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } -#define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_su_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ if(*(S) < 0) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ @@ -364,7 +419,7 @@ } else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_su_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ if(*(S) < 0) \ *(D) = 0; \ @@ -377,7 +432,7 @@ H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } -#define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_us_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ @@ -391,7 +446,7 @@ } else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_us_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ @@ -412,7 +467,7 @@ /* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN * when an overflow occurs, use the 'float' infinity values. */ -#define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Ff_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ @@ -434,7 +489,7 @@ } else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Ff_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) > (ST)(D_MAX)) \ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \ else if (*(S) < (ST)(D_MIN)) \ @@ -507,7 +562,7 @@ LO = count; \ } -#define H5T_CONV_xF_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_xF_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if (sprec > dprec) { \ unsigned low_bit_pos, high_bit_pos; \ \ @@ -531,7 +586,7 @@ else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_xF_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_xF_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } @@ -547,7 +602,7 @@ * (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under * the same situation the "int" doesn't overflow. SLU - 2005/9/12 */ -#define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Fx_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ @@ -579,7 +634,7 @@ else \ *(D) = (DT)(*(S)); \ } -#define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_Fx_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else if(*(S) < (ST)(D_MIN)) \ @@ -597,7 +652,7 @@ * to do them all. */ #ifndef H5_WANT_DCONV_EXCEPTION -#define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV_NO_EXCEPT_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } #endif /* H5_WANT_DCONV_EXCEPTION */ @@ -718,17 +773,17 @@ if (s_mv && d_mv) { \ /* Alignment is required for both source and dest */ \ s = &src_aligned; \ - H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DALIGN,POST_SALIGN,POST_DALIGN,GUTS,s,d,ST,DT,D_MIN,D_MAX) \ + H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DALIGN,POST_SALIGN,POST_DALIGN,GUTS,STYPE,DTYPE,s,d,ST,DT,D_MIN,D_MAX) \ } else if(s_mv) { \ /* Alignment is required only for source */ \ s = &src_aligned; \ - H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DNOALIGN,POST_SALIGN,POST_DNOALIGN,GUTS,s,dst,ST,DT,D_MIN,D_MAX) \ + H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DNOALIGN,POST_SALIGN,POST_DNOALIGN,GUTS,STYPE,DTYPE,s,dst,ST,DT,D_MIN,D_MAX) \ } else if(d_mv) { \ /* Alignment is required only for destination */ \ - H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DALIGN,POST_SNOALIGN,POST_DALIGN,GUTS,src,d,ST,DT,D_MIN,D_MAX) \ + H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DALIGN,POST_SNOALIGN,POST_DALIGN,GUTS,STYPE,DTYPE,src,d,ST,DT,D_MIN,D_MAX) \ } else { \ /* Alignment is not required for both source and destination */ \ - H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DNOALIGN,POST_SNOALIGN,POST_DNOALIGN,GUTS,src,dst,ST,DT,D_MIN,D_MAX) \ + H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DNOALIGN,POST_SNOALIGN,POST_DNOALIGN,GUTS,STYPE,DTYPE,src,dst,ST,DT,D_MIN,D_MAX) \ } \ \ /* Decrement number of elements left to convert */ \ @@ -812,16 +867,16 @@ done: \ } /* The outer wrapper for the type conversion loop, to check for an exception handling routine */ -#define H5T_CONV_LOOP_OUTER(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,S,D,ST,DT,D_MIN,D_MAX) \ +#define H5T_CONV_LOOP_OUTER(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \ if(cb_struct.func) { \ - H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,S,D,ST,DT,D_MIN,D_MAX) \ + H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \ } \ else { \ - H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,H5_GLUE(GUTS,_NOEX),S,D,ST,DT,D_MIN,D_MAX) \ + H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,H5_GLUE(GUTS,_NOEX),STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \ } /* The inner loop of the type conversion macro, actually converting the elements */ -#define H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,S,D,ST,DT,D_MIN,D_MAX) \ +#define H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \ for (elmtno=0; elmtnoshared->size); if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; + sp += direction * (ssize_t) buf_stride; + dp += direction * (ssize_t) buf_stride; } else { - sp += direction * src_p->shared->size; - dp += direction * dst_p->shared->size; + sp += direction * (ssize_t) src_p->shared->size; + dp += direction * (ssize_t) dst_p->shared->size; } HDmemset(int_buf, 0, buf_size); @@ -9700,7 +9741,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t) (HDpow((double)2.0f, (double)dst.u.f.esize) - 1); if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ @@ -9779,11 +9820,11 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (d==dbuf) HDmemcpy (dp, d, dst_p->shared->size); if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; + sp += direction * (ssize_t) buf_stride; + dp += direction * (ssize_t) buf_stride; } else { - sp += direction * src_p->shared->size; - dp += direction * dst_p->shared->size; + sp += direction * (ssize_t) src_p->shared->size; + dp += direction * (ssize_t) dst_p->shared->size; } HDmemset(int_buf, 0, buf_size); -- cgit v0.12 From fc45d5fcb05fbf1b9ee05a46a25afc6fd6c40503 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 1 Jun 2015 14:38:09 -0500 Subject: [svn-r27133] - Add a new attribute function characterstic for format: * H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z))) - Rename UNUSED attribute characterstic to H5_ATTR_UNUSED. - Rename NORETURN attribute characterstic to H5_ATTR_NORETURN tested with h5committest. --- c++/test/dsets.cpp | 4 +- c++/test/tfilter.cpp | 10 +- fortran/src/H5Af.c | 100 +++---- fortran/src/H5Df.c | 4 +- fortran/src/H5Pf.c | 16 +- fortran/test/t.h | 2 +- hl/test/test_dset_opt.c | 8 +- src/H5.c | 2 +- src/H5A.c | 10 +- src/H5AC.c | 8 +- src/H5Abtree2.c | 18 +- src/H5Adense.c | 2 +- src/H5Aint.c | 4 +- src/H5B2cache.c | 20 +- src/H5B2int.c | 2 +- src/H5B2test.c | 6 +- src/H5Bcache.c | 6 +- src/H5C.c | 48 +-- src/H5Dbtree.c | 22 +- src/H5Dchunk.c | 18 +- src/H5Dcompact.c | 8 +- src/H5Dcontig.c | 10 +- src/H5Defl.c | 8 +- src/H5Dint.c | 6 +- src/H5Dmpio.c | 20 +- src/H5EAcache.c | 22 +- src/H5EAdbg.c | 2 +- src/H5EAtest.c | 4 +- src/H5FAcache.c | 14 +- src/H5FAtest.c | 8 +- src/H5FDcore.c | 14 +- src/H5FDdirect.c | 16 +- src/H5FDfamily.c | 6 +- src/H5FDlog.c | 14 +- src/H5FDmpio.c | 18 +- src/H5FDsec2.c | 14 +- src/H5FDstdio.c | 8 +- src/H5FLprivate.h | 6 +- src/H5FS.c | 4 +- src/H5FScache.c | 22 +- src/H5FSdbg.c | 2 +- src/H5FSsection.c | 4 +- src/H5Faccum.c | 2 +- src/H5Fmount.c | 2 +- src/H5Fsuper_cache.c | 6 +- src/H5Gbtree2.c | 18 +- src/H5Gcache.c | 4 +- src/H5Gcompact.c | 6 +- src/H5Gdense.c | 10 +- src/H5Gdeprec.c | 2 +- src/H5Gint.c | 2 +- src/H5Gloc.c | 18 +- src/H5Gnode.c | 36 +-- src/H5Gobj.c | 2 +- src/H5Goh.c | 2 +- src/H5Gtest.c | 4 +- src/H5Gtraverse.c | 4 +- src/H5HF.c | 2 +- src/H5HFbtree2.c | 18 +- src/H5HFcache.c | 18 +- src/H5HFsection.c | 16 +- src/H5HFspace.c | 2 +- src/H5HGcache.c | 6 +- src/H5HLcache.c | 10 +- src/H5I.c | 4 +- src/H5L.c | 34 +-- src/H5Lexternal.c | 12 +- src/H5MFaggr.c | 2 +- src/H5MFsection.c | 14 +- src/H5O.c | 4 +- src/H5Oainfo.c | 22 +- src/H5Oattr.c | 14 +- src/H5Oattribute.c | 18 +- src/H5Obogus.c | 10 +- src/H5Obtreek.c | 10 +- src/H5Ocache.c | 12 +- src/H5Ocont.c | 10 +- src/H5Ocopy.c | 6 +- src/H5Odrvinfo.c | 10 +- src/H5Odtype.c | 16 +- src/H5Oefl.c | 16 +- src/H5Ofill.c | 18 +- src/H5Ofsinfo.c | 10 +- src/H5Oginfo.c | 10 +- src/H5Olayout.c | 12 +- src/H5Olinfo.c | 18 +- src/H5Olink.c | 24 +- src/H5Omtime.c | 20 +- src/H5Oname.c | 10 +- src/H5Opline.c | 14 +- src/H5Orefcount.c | 16 +- src/H5Osdspace.c | 10 +- src/H5Oshared.c | 4 +- src/H5Oshmesg.c | 10 +- src/H5Ostab.c | 18 +- src/H5Pdcpl.c | 10 +- src/H5Pdxpl.c | 8 +- src/H5Pfapl.c | 16 +- src/H5Pint.c | 18 +- src/H5Plapl.c | 16 +- src/H5Pocpl.c | 6 +- src/H5Pocpypl.c | 6 +- src/H5SM.c | 2 +- src/H5SMbtree2.c | 6 +- src/H5SMcache.c | 10 +- src/H5SMmessage.c | 2 +- src/H5Sall.c | 30 +- src/H5Shyper.c | 2 +- src/H5Snone.c | 46 +-- src/H5Spoint.c | 4 +- src/H5T.c | 2 +- src/H5Tarray.c | 4 +- src/H5Tconv.c | 662 ++++++++++++++++++++--------------------- src/H5Tdbg.c | 2 +- src/H5Toh.c | 2 +- src/H5Tvlen.c | 24 +- src/H5VMprivate.h | 24 +- src/H5Z.c | 6 +- src/H5Zfletcher32.c | 2 +- src/H5Znbit.c | 2 +- src/H5Zscaleoffset.c | 2 +- src/H5Zshuffle.c | 2 +- src/H5Zszip.c | 2 +- src/H5api_adpt.h | 20 ++ src/H5detect.c | 6 +- src/H5private.h | 9 +- test/app_ref.c | 2 +- test/cache.c | 14 +- test/cache_common.c | 20 +- test/dsets.c | 42 +-- test/dt_arith.c | 6 +- test/dtypes.c | 12 +- test/earray.c | 22 +- test/error_test.c | 2 +- test/farray.c | 14 +- test/fheap.c | 14 +- test/fillval.c | 2 +- test/filter_fail.c | 4 +- test/freespace.c | 8 +- test/gen_filters.c | 6 +- test/h5test.c | 6 +- test/links.c | 68 ++--- test/objcopy.c | 2 +- test/tattr.c | 6 +- test/tcheck_version.c | 4 +- test/tgenprop.c | 4 +- test/tid.c | 2 +- test/titerate.c | 6 +- test/tmisc.c | 4 +- test/trefer.c | 2 +- test/tselect.c | 12 +- test/tskiplist.c | 4 +- test/ttsafe_cancel.c | 6 +- test/ttsafe_error.c | 6 +- test/tunicode.c | 6 +- test/unregister.c | 6 +- testpar/t_cache.c | 24 +- tools/h5diff/h5diffgentest.c | 4 +- tools/h5dump/h5dump_ddl.c | 18 +- tools/h5dump/h5dump_ddl.h | 8 +- tools/h5dump/h5dump_xml.c | 10 +- tools/h5dump/h5dumpgentest.c | 20 +- tools/h5jam/h5jamgentest.c | 4 +- tools/h5ls/h5ls.c | 16 +- tools/h5repack/h5repack_copy.c | 2 +- tools/h5repack/h5repack_main.c | 2 +- tools/h5stat/h5stat.c | 2 +- tools/lib/h5tools_ref.c | 4 +- tools/lib/h5trav.c | 8 +- tools/perform/chunk.c | 12 +- tools/perform/overhead.c | 6 +- tools/perform/perf.c | 2 +- 172 files changed, 1279 insertions(+), 1266 deletions(-) diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 9f1916d..e57e50e 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -61,7 +61,7 @@ const int H5Z_FILTER_BOGUS = 305; static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); -// UNUSED variables caused warning, but taking them out caused failure. +// H5_ATTR_UNUSED variables caused warning, but taking them out caused failure. /*------------------------------------------------------------------------- * Function: test_create @@ -462,7 +462,7 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[], size_t nbytes, size_t *buf_size, void **buf) -// UNUSED variables caused warning, but taking them out caused failure. +// H5_ATTR_UNUSED variables caused warning, but taking them out caused failure. { return nbytes; } diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 3edb83a..ff3901d 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -59,7 +59,7 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, /* Temporary filter IDs used for testing */ const int H5Z_FILTER_BOGUS = 305; -#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead +#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); #endif @@ -92,10 +92,10 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static size_t -#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead -filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) +#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead +filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) #endif filter_bogus(size_t nbytes) { diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 240fbc3..bc2e9f1 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -256,7 +256,7 @@ nh5awritec_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) * SOURCE */ int_f -nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -266,7 +266,7 @@ nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -276,7 +276,7 @@ nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -286,7 +286,7 @@ nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -296,7 +296,7 @@ nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -306,7 +306,7 @@ nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -316,7 +316,7 @@ nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -326,7 +326,7 @@ nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -336,7 +336,7 @@ nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U } int_f -nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -346,7 +346,7 @@ nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -356,7 +356,7 @@ nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -366,7 +366,7 @@ nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -376,7 +376,7 @@ nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -386,7 +386,7 @@ nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -396,7 +396,7 @@ nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -406,7 +406,7 @@ nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -416,7 +416,7 @@ nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS } int_f -nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -426,7 +426,7 @@ nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -436,7 +436,7 @@ nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -446,7 +446,7 @@ nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -456,7 +456,7 @@ nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -466,7 +466,7 @@ nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -476,7 +476,7 @@ nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -486,7 +486,7 @@ nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { /* @@ -496,7 +496,7 @@ nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) /******/ { int_f ret_value=0; /* Return value */ @@ -655,7 +655,7 @@ nh5areadc_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) * SOURCE */ int_f -nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { int_f ret_value=0; /* Return value */ @@ -671,7 +671,7 @@ done: } int_f -nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -681,7 +681,7 @@ nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -691,7 +691,7 @@ nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -701,7 +701,7 @@ nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -711,7 +711,7 @@ nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -721,7 +721,7 @@ nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -731,7 +731,7 @@ nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -741,7 +741,7 @@ nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -751,7 +751,7 @@ nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN } int_f -nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -761,7 +761,7 @@ nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -771,7 +771,7 @@ nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -781,7 +781,7 @@ nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -791,7 +791,7 @@ nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -801,7 +801,7 @@ nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -811,7 +811,7 @@ nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -821,7 +821,7 @@ nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -831,7 +831,7 @@ nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE } int_f -nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -841,7 +841,7 @@ nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } int_f -nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -851,7 +851,7 @@ nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } int_f -nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -861,7 +861,7 @@ nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } int_f -nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -871,7 +871,7 @@ nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } int_f -nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -881,7 +881,7 @@ nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } int_f -nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -891,7 +891,7 @@ nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } int_f -nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* @@ -901,7 +901,7 @@ nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } int_f -nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) /******/ { /* diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index f4082a9..0d32dac 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -307,7 +307,7 @@ nh5dwritec_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h * SOURCE */ int_f -nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f UNUSED *dims) +nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f H5_ATTR_UNUSED *dims) /******/ { int ret_value = -1; @@ -904,7 +904,7 @@ nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi * SOURCE */ int_f -nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f UNUSED *dims) +nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f H5_ATTR_UNUSED *dims) /******/ { int ret_value = -1; diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index e9082d6..fe2f21a 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -2836,7 +2836,7 @@ DONE: * SOURCE */ int_f -nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len) +nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f H5_ATTR_UNUSED *value_len) /******/ { int ret_value = -1; @@ -2869,7 +2869,7 @@ nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd v * SOURCE */ int_f -h5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value) +h5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void H5_ATTR_UNUSED *value) /******/ { char* c_name = NULL; @@ -2939,7 +2939,7 @@ nh5pregister_double_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, * SOURCE */ int_f -nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len) +nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f H5_ATTR_UNUSED *value_len) /******/ { int_f ret_value = -1; @@ -2972,7 +2972,7 @@ nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd v * SOURCE */ int_f -h5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value) +h5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void H5_ATTR_UNUSED *value) /******/ { char* c_name = NULL; @@ -3437,7 +3437,7 @@ DONE: * SOURCE */ int_f -nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED *value_len) +nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f H5_ATTR_UNUSED *value_len) /******/ { int_f ret_value = -1; @@ -3535,7 +3535,7 @@ nh5pset_double_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) * SOURCE */ int_f -nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED *value_len) +nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f H5_ATTR_UNUSED *value_len) /******/ { int_f ret_value = -1; @@ -5215,7 +5215,7 @@ nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_den * SOURCE */ int_f -nh5pset_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size) +nh5pset_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size) /******/ { int ret_value = -1; @@ -5258,7 +5258,7 @@ nh5pset_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_ * SOURCE */ int_f -nh5pget_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size) +nh5pget_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size) /******/ { int ret_value = -1; diff --git a/fortran/test/t.h b/fortran/test/t.h index 6d6af52..738aa59 100644 --- a/fortran/test/t.h +++ b/fortran/test/t.h @@ -34,7 +34,7 @@ H5_FCTESTDLL int_f nh5_fixname_c H5_FCTESTDLL int_f nh5_cleanup_c (_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl); -H5_FCTESTDLL NORETURN void nh5_exit_c +H5_FCTESTDLL H5_ATTR_NORETURN void nh5_exit_c (int_f *status); H5_FCTESTDLL void nh5_env_nocleanup_c diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 95ce535..a8ffa44 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -496,8 +496,8 @@ error: *------------------------------------------------------------------------- */ static size_t -filter_bogus1(unsigned int flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, +filter_bogus1(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, size_t *buf_size, void **buf) { int *int_ptr=(int *)*buf; /* Pointer to the data values */ @@ -533,8 +533,8 @@ filter_bogus1(unsigned int flags, size_t UNUSED cd_nelmts, *------------------------------------------------------------------------- */ static size_t -filter_bogus2(unsigned int flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, +filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, size_t *buf_size, void **buf) { int *int_ptr=(int *)*buf; /* Pointer to the data values */ diff --git a/src/H5.c b/src/H5.c index 68b339a..ad5ff5f 100644 --- a/src/H5.c +++ b/src/H5.c @@ -615,7 +615,7 @@ H5_debug_mask(const char *s) * *------------------------------------------------------------------------- */ -static int H5_mpi_delete_cb(MPI_Comm UNUSED comm, int UNUSED keyval, void UNUSED *attr_val, int UNUSED *flag) +static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) { H5_term_library(); return MPI_SUCCESS; diff --git a/src/H5A.c b/src/H5A.c index a20f730..4afdefe 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -229,7 +229,7 @@ H5A_term_interface(void) /* ARGSUSED */ hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, - hid_t acpl_id, hid_t UNUSED aapl_id) + hid_t acpl_id, hid_t H5_ATTR_UNUSED aapl_id) { H5A_t *attr = NULL; /* Attribute created */ H5G_loc_t loc; /* Object location */ @@ -304,7 +304,7 @@ done: /* ARGSUSED */ hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, - hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t UNUSED aapl_id, + hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t H5_ATTR_UNUSED aapl_id, hid_t lapl_id) { H5A_t *attr = NULL; /* Attribute created */ @@ -385,7 +385,7 @@ done: H5Aclose or resource leaks will develop. --------------------------------------------------------------------------*/ hid_t -H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_id) +H5Aopen(hid_t loc_id, const char *attr_name, hid_t H5_ATTR_UNUSED aapl_id) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ @@ -447,7 +447,7 @@ done: --------------------------------------------------------------------------*/ hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, - hid_t UNUSED aapl_id, hid_t lapl_id) + hid_t H5_ATTR_UNUSED aapl_id, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ @@ -515,7 +515,7 @@ done: --------------------------------------------------------------------------*/ hid_t H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t UNUSED aapl_id, hid_t lapl_id) + H5_iter_order_t order, hsize_t n, hid_t H5_ATTR_UNUSED aapl_id, hid_t lapl_id) { H5A_t *attr = NULL; /* Attribute opened */ H5G_loc_t loc; /* Object location */ diff --git a/src/H5AC.c b/src/H5AC.c index e6bcbb6..9f5b88d 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -2988,12 +2988,12 @@ done: #ifdef H5_HAVE_PARALLEL static herr_t H5AC_check_if_write_permitted(const H5F_t *f, - hid_t UNUSED dxpl_id, + hid_t H5_ATTR_UNUSED dxpl_id, hbool_t * write_permitted_ptr) #else /* H5_HAVE_PARALLEL */ static herr_t -H5AC_check_if_write_permitted(const H5F_t UNUSED * f, - hid_t UNUSED dxpl_id, +H5AC_check_if_write_permitted(const H5F_t H5_ATTR_UNUSED * f, + hid_t H5_ATTR_UNUSED dxpl_id, hbool_t * write_permitted_ptr) #endif /* H5_HAVE_PARALLEL */ { @@ -3561,7 +3561,7 @@ H5AC_log_flushed_entry(H5C_t * cache_ptr, haddr_t addr, hbool_t was_dirty, unsigned flags, - int UNUSED type_id) + int H5_ATTR_UNUSED type_id) { herr_t ret_value = SUCCEED; /* Return value */ hbool_t cleared; diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 5e74e55..b85bee3 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -164,7 +164,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 UNUSED obj_len, void *_udata) +H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED 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 */ @@ -319,7 +319,7 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; @@ -350,7 +350,7 @@ H5A__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *c *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5A_dense_bt2_name_rec_t *nrecord = (H5A_dense_bt2_name_rec_t *)_nrecord; @@ -381,8 +381,8 @@ H5A__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *c *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void UNUSED *_udata) +H5A__dense_btree2_name_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, + int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; @@ -479,7 +479,7 @@ H5A__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; @@ -509,7 +509,7 @@ H5A__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) +H5A__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5A_dense_bt2_corder_rec_t *nrecord = (H5A_dense_bt2_corder_rec_t *)_nrecord; @@ -539,8 +539,8 @@ H5A__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void UNUSED *_udata) +H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, + int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; diff --git a/src/H5Adense.c b/src/H5Adense.c index 674ab5d..6d18249 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -845,7 +845,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__dense_copy_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) +H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED 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 */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 9012f6d..91bbc24 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -1239,8 +1239,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__compact_build_table_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned sequence, unsigned UNUSED *oh_modified, void *_udata/*in,out*/) +H5A__compact_build_table_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, + unsigned sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5A_compact_bt_ud_t *udata = (H5A_compact_bt_ud_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 9e01c03..3b30e02 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -70,17 +70,17 @@ /* Metadata cache callbacks */ static H5B2_hdr_t *H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_hdr_t *hdr, unsigned UNUSED * flags_ptr); +static herr_t H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5B2__cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr); static herr_t H5B2__cache_hdr_clear(H5F_t *f, H5B2_hdr_t *hdr, hbool_t destroy); static herr_t H5B2__cache_hdr_size(const H5F_t *f, const H5B2_hdr_t *hdr, size_t *size_ptr); static H5B2_internal_t *H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *i, unsigned UNUSED * flags_ptr); +static herr_t H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *i, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5B2__cache_internal_dest(H5F_t *f, H5B2_internal_t *internal); static herr_t H5B2__cache_internal_clear(H5F_t *f, H5B2_internal_t *i, hbool_t destroy); static herr_t H5B2__cache_internal_size(const H5F_t *f, const H5B2_internal_t *i, size_t *size_ptr); static H5B2_leaf_t *H5B2__cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *l, unsigned UNUSED * flags_ptr); +static herr_t H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *l, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5B2__cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf); static herr_t H5B2__cache_leaf_clear(H5F_t *f, H5B2_leaf_t *l, hbool_t destroy); static herr_t H5B2__cache_leaf_size(const H5F_t *f, const H5B2_leaf_t *l, size_t *size_ptr); @@ -274,7 +274,7 @@ done: */ static herr_t H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5B2_hdr_t *hdr, unsigned UNUSED * flags_ptr) + H5B2_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr) { H5WB_t *wb = NULL; /* Wrapped buffer for header data */ uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */ @@ -460,7 +460,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ptr) +H5B2__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ptr) { FUNC_ENTER_STATIC_NOERR @@ -622,7 +622,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *internal, unsigned UNUSED * flags_ptr) +H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *internal, unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -803,7 +803,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal, size_t *size_ptr) +H5B2__cache_internal_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_internal_t *internal, size_t *size_ptr) { FUNC_ENTER_STATIC_NOERR @@ -834,7 +834,7 @@ H5B2__cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal *------------------------------------------------------------------------- */ static H5B2_leaf_t * -H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata) +H5B2__cache_leaf_load(H5F_t H5_ATTR_UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata) { H5B2_leaf_cache_ud_t *udata = (H5B2_leaf_cache_ud_t *)_udata; H5B2_leaf_t *leaf = NULL; /* Pointer to lead node loaded */ @@ -944,7 +944,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *leaf, unsigned UNUSED * flags_ptr) +H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *leaf, unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1111,7 +1111,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__cache_leaf_size(const H5F_t UNUSED *f, const H5B2_leaf_t *leaf, size_t *size_ptr) +H5B2__cache_leaf_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_leaf_t *leaf, size_t *size_ptr) { FUNC_ENTER_STATIC_NOERR diff --git a/src/H5B2int.c b/src/H5B2int.c index 96636d5..638b4b3 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -3213,7 +3213,7 @@ H5B2__assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf) *------------------------------------------------------------------------- */ static herr_t -H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t UNUSED *leaf2) +H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t H5_ATTR_UNUSED *leaf2) { /* General sanity checking on node */ HDassert(leaf->nrec <= hdr->node_info->split_nrec); diff --git a/src/H5B2test.c b/src/H5B2test.c index d3149a7..1d31af8 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -295,9 +295,9 @@ H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5B2__test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5B2__test_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, int indent, int fwidth, const void *record, - const void UNUSED *_udata) + const void H5_ATTR_UNUSED *_udata) { FUNC_ENTER_STATIC_NOERR @@ -324,7 +324,7 @@ H5B2__test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, *------------------------------------------------------------------------- */ static void * -H5B2__test_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) +H5B2__test_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr) { H5B2_test_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 07b594d..a161e88 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -56,7 +56,7 @@ /* Metadata cache callbacks */ static H5B_t *H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned UNUSED * flags_ptr); +static herr_t H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5B__dest(H5F_t *f, H5B_t *bt); static herr_t H5B__clear(H5F_t *f, H5B_t *b, hbool_t destroy); static herr_t H5B__compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr); @@ -207,7 +207,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, unsigned UNUSED * flags_ptr) +H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, unsigned H5_ATTR_UNUSED * flags_ptr) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -389,7 +389,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__compute_size(const H5F_t UNUSED *f, const H5B_t *bt, size_t *size_ptr) +H5B__compute_size(const H5F_t H5_ATTR_UNUSED *f, const H5B_t *bt, size_t *size_ptr) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ diff --git a/src/H5C.c b/src/H5C.c index 3f11493..d05f686 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -241,10 +241,10 @@ const H5C_class_t epoch_marker_class = ***************************************************************************/ static void * -H5C_epoch_marker_load(H5F_t UNUSED * f, - hid_t UNUSED dxpl_id, - haddr_t UNUSED addr, - void UNUSED * udata) +H5C_epoch_marker_load(H5F_t H5_ATTR_UNUSED * f, + hid_t H5_ATTR_UNUSED dxpl_id, + haddr_t H5_ATTR_UNUSED addr, + void H5_ATTR_UNUSED * udata) { void * ret_value = NULL; /* Return value */ @@ -260,12 +260,12 @@ done: static herr_t -H5C_epoch_marker_flush(H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, - hbool_t UNUSED dest, - haddr_t UNUSED addr, - void UNUSED *thing, - unsigned UNUSED * flags_ptr) +H5C_epoch_marker_flush(H5F_t H5_ATTR_UNUSED *f, + hid_t H5_ATTR_UNUSED dxpl_id, + hbool_t H5_ATTR_UNUSED dest, + haddr_t H5_ATTR_UNUSED addr, + void H5_ATTR_UNUSED *thing, + unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = FAIL; /* Return value */ @@ -281,8 +281,8 @@ done: static herr_t -H5C_epoch_marker_dest(H5F_t UNUSED * f, - void UNUSED * thing) +H5C_epoch_marker_dest(H5F_t H5_ATTR_UNUSED * f, + void H5_ATTR_UNUSED * thing) { herr_t ret_value = FAIL; /* Return value */ @@ -296,9 +296,9 @@ done: } static herr_t -H5C_epoch_marker_clear(H5F_t UNUSED * f, - void UNUSED * thing, - hbool_t UNUSED dest) +H5C_epoch_marker_clear(H5F_t H5_ATTR_UNUSED * f, + void H5_ATTR_UNUSED * thing, + hbool_t H5_ATTR_UNUSED dest) { herr_t ret_value = FAIL; /* Return value */ @@ -312,8 +312,8 @@ done: } static herr_t -H5C_epoch_marker_notify(H5C_notify_action_t UNUSED action, - void UNUSED * thing) +H5C_epoch_marker_notify(H5C_notify_action_t H5_ATTR_UNUSED action, + void H5_ATTR_UNUSED * thing) { herr_t ret_value = FAIL; /* Return value */ @@ -326,9 +326,9 @@ done: } static herr_t -H5C_epoch_marker_size(const H5F_t UNUSED * f, - const void UNUSED * thing, - size_t UNUSED * size_ptr) +H5C_epoch_marker_size(const H5F_t H5_ATTR_UNUSED * f, + const void H5_ATTR_UNUSED * thing, + size_t H5_ATTR_UNUSED * size_ptr) { herr_t ret_value = FAIL; /* Return value */ @@ -1339,7 +1339,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, #ifndef NDEBUG int32_t version, #else /* NDEBUG */ - int32_t UNUSED version, + int32_t H5_ATTR_UNUSED version, #endif /* NDEBUG */ double hit_rate, enum H5C_resize_status status, @@ -3637,7 +3637,7 @@ H5C_pin_entry_from_client(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr) #else static herr_t -H5C_pin_entry_from_client(H5C_t UNUSED * cache_ptr, +H5C_pin_entry_from_client(H5C_t H5_ATTR_UNUSED * cache_ptr, H5C_cache_entry_t * entry_ptr) #endif { @@ -4658,7 +4658,7 @@ H5C_stats(H5C_t * cache_ptr, const char * cache_name, hbool_t #if !H5C_COLLECT_CACHE_STATS - UNUSED + H5_ATTR_UNUSED #endif /* H5C_COLLECT_CACHE_STATS */ display_detailed_stats) { @@ -5119,7 +5119,7 @@ H5C_stats__reset(H5C_t * cache_ptr) #if H5C_COLLECT_CACHE_STATS H5C_stats__reset(H5C_t * cache_ptr) #else /* H5C_COLLECT_CACHE_STATS */ -H5C_stats__reset(H5C_t UNUSED * cache_ptr) +H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) #endif /* H5C_COLLECT_CACHE_STATS */ #endif /* NDEBUG */ { diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 2933e5e..a4009a9 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -220,7 +220,7 @@ H5FL_DEFINE_STATIC(H5O_layout_chunk_t); */ /* ARGSUSED */ static H5UC_t * -H5D__btree_get_shared(const H5F_t UNUSED *f, const void *_udata) +H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata) { const H5D_chunk_common_ud_t *udata = (const H5D_chunk_common_ud_t *) _udata; @@ -255,7 +255,7 @@ H5D__btree_get_shared(const H5F_t UNUSED *f, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5D__btree_new_node(H5F_t *f, hid_t UNUSED dxpl_id, H5B_ins_t op, +H5D__btree_new_node(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p/*out*/) { @@ -441,7 +441,7 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) */ /* ARGSUSED */ static htri_t -H5D__btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void *_lt_key, +H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, const void *_lt_key, void *_udata) { H5D_chunk_ud_t *udata = (H5D_chunk_ud_t *) _udata; @@ -541,10 +541,10 @@ done: */ /* ARGSUSED */ static H5B_ins_t -H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key, +H5D__btree_insert(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, - hbool_t UNUSED *rt_key_changed, + hbool_t H5_ATTR_UNUSED *rt_key_changed, haddr_t *new_node_p/*out*/) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; @@ -637,8 +637,8 @@ done: static H5B_ins_t H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ , hbool_t *lt_key_changed /*out */ , - void UNUSED * _udata /*in,out */ , - void UNUSED * _rt_key /*in,out */ , + void H5_ATTR_UNUSED * _udata /*in,out */ , + void H5_ATTR_UNUSED * _rt_key /*in,out */ , hbool_t *rt_key_changed /*out */ ) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *)_lt_key; @@ -881,7 +881,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *space, +H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNUSED *space, haddr_t dset_ohdr_addr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1078,8 +1078,8 @@ done: */ /* ARGSUSED */ static int -H5D__btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, - const void *_lt_key, haddr_t addr, const void UNUSED *_rt_key, +H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, + const void *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5D_btree_it_ud_t *udata = (H5D_btree_it_ud_t *)_udata; /* User data */ @@ -1317,7 +1317,7 @@ done: static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t *storage_dst, - hid_t UNUSED dxpl_id) + hid_t H5_ATTR_UNUSED dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 5d8ea4a..e22eb3a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -503,7 +503,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_construct(H5F_t UNUSED *f, H5D_t *dset) +H5D__chunk_construct(H5F_t H5_ATTR_UNUSED *f, H5D_t *dset) { const H5T_t *type = dset->shared->type; /* Convenience pointer to dataset's datatype */ uint64_t chunk_size; /* Size of chunk in bytes */ @@ -1102,7 +1102,7 @@ H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5D__free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) +H5D__free_chunk_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *opdata) { H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *)item; @@ -1142,7 +1142,7 @@ H5D__free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) static herr_t H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t #ifndef H5_HAVE_PARALLEL - UNUSED + H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ *io_info) { @@ -1224,7 +1224,7 @@ done: static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t #ifndef H5_HAVE_PARALLEL - UNUSED + H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ *io_info) { @@ -1521,7 +1521,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_udata) +H5D__chunk_file_cb(void H5_ATTR_UNUSED *elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_udata) { H5D_chunk_file_iter_ud_t *udata = (H5D_chunk_file_iter_ud_t *)_udata; /* User data for operation */ H5D_chunk_map_t *fm = udata->fm; /* File<->memory chunk mapping info */ @@ -1638,7 +1638,7 @@ done: */ /* ARGSUSED */ static herr_t -H5D__chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) +H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) { H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ @@ -1790,7 +1790,7 @@ done: */ static herr_t H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space, H5D_chunk_map_t *fm) { H5SL_node_t *chunk_node; /* Current node in chunk skip list */ @@ -1942,7 +1942,7 @@ done: */ static herr_t H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space, H5D_chunk_map_t *fm) { H5SL_node_t *chunk_node; /* Current node in chunk skip list */ @@ -5310,7 +5310,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len, +H5D__nonexistent_readvv_cb(hsize_t H5_ATTR_UNUSED dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index af70c07..acb4541 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -224,7 +224,7 @@ done: *------------------------------------------------------------------------- */ static hbool_t -H5D__compact_is_space_alloc(const H5O_storage_t UNUSED *storage) +H5D__compact_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) { FUNC_ENTER_STATIC_NOERR @@ -249,9 +249,9 @@ H5D__compact_is_space_alloc(const H5O_storage_t UNUSED *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, - hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, - H5D_chunk_map_t UNUSED *cm) +H5D__compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info, + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space, + H5D_chunk_map_t H5_ATTR_UNUSED *cm) { FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 898b46d..29ab1ff 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -492,9 +492,9 @@ H5D__contig_is_space_alloc(const H5O_storage_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, - hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, - H5D_chunk_map_t UNUSED *cm) +H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info, + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space, + H5D_chunk_map_t H5_ATTR_UNUSED *cm) { FUNC_ENTER_STATIC_NOERR @@ -520,7 +520,7 @@ H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED * herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, - H5D_chunk_map_t UNUSED *fm) + H5D_chunk_map_t H5_ATTR_UNUSED *fm) { herr_t ret_value = SUCCEED; /*return value */ @@ -557,7 +557,7 @@ done: herr_t H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, - H5D_chunk_map_t UNUSED *fm) + H5D_chunk_map_t H5_ATTR_UNUSED *fm) { herr_t ret_value = SUCCEED; /*return value */ diff --git a/src/H5Defl.c b/src/H5Defl.c index 1ae7a23..9e5872a 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -193,7 +193,7 @@ done: *------------------------------------------------------------------------- */ hbool_t -H5D__efl_is_space_alloc(const H5O_storage_t UNUSED *storage) +H5D__efl_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -218,9 +218,9 @@ H5D__efl_is_space_alloc(const H5O_storage_t UNUSED *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, - hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, - H5D_chunk_map_t UNUSED *cm) +H5D__efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info, + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space, + H5D_chunk_map_t H5_ATTR_UNUSED *cm) { FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Dint.c b/src/H5Dint.c index 2289ac1..53cd86a 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2102,7 +2102,7 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info) */ /* ARGSUSED */ herr_t -H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data) +H5D__vlen_get_buf_size(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t *point, void *op_data) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data; H5T_t *dt; /* Datatype for operation */ @@ -2458,7 +2458,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags) +H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2492,7 +2492,7 @@ H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags) *------------------------------------------------------------------------- */ static int -H5D__flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) +H5D__flush_cb(void *_dataset, hid_t H5_ATTR_UNUSED id, void *_udata) { H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ H5D_flush_ud_t *udata = (H5D_flush_ud_t *)_udata; /* User data for callback */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 63faa5d..289e12b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -254,8 +254,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, - hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space) +H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info, + hsize_t mpi_buf_count, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space) { const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; @@ -283,8 +283,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, - hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space) +H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info, + hsize_t mpi_buf_count, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space) { const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; @@ -464,8 +464,8 @@ done: */ herr_t H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, - H5D_chunk_map_t UNUSED *fm) + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t H5_ATTR_UNUSED *fm) { H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; H5P_genplist_t *dx_plist; /* Pointer to DXPL */ @@ -511,8 +511,8 @@ done: */ herr_t H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, - H5D_chunk_map_t UNUSED *fm) + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t H5_ATTR_UNUSED *fm) { H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; H5P_genplist_t *dx_plist; /* Pointer to DXPL */ @@ -714,7 +714,7 @@ done: */ herr_t H5D__chunk_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space, H5D_chunk_map_t *fm) { herr_t ret_value = SUCCEED; /* Return value */ @@ -745,7 +745,7 @@ done: */ herr_t H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space, H5D_chunk_map_t *fm) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 57d69a4..b9acc49 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -350,7 +350,7 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_hdr_t *hdr, unsigned UNUSED * flags_ptr)) + H5EA_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr)) H5WB_t *wb = NULL; /* Wrapped buffer for header data */ uint8_t hdr_buf[H5EA_HDR_BUF_SIZE]; /* Buffer for header */ @@ -486,7 +486,7 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_clear() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_hdr_size(const H5F_t UNUSED *f, const H5EA_hdr_t *hdr, +H5EA__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_hdr_t *hdr, size_t *size_ptr)) /* Sanity check */ @@ -702,7 +702,7 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_iblock_t *iblock, unsigned UNUSED * flags_ptr)) + H5EA_iblock_t *iblock, unsigned H5_ATTR_UNUSED * flags_ptr)) /* Local variables */ H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ @@ -895,7 +895,7 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_iblock_size(const H5F_t UNUSED *f, const H5EA_iblock_t *iblock, +H5EA__cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_iblock_t *iblock, size_t *size_ptr)) /* Sanity check */ @@ -1104,7 +1104,7 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_sblock_t *sblock, unsigned UNUSED * flags_ptr)) + H5EA_sblock_t *sblock, unsigned H5_ATTR_UNUSED * flags_ptr)) /* Local variables */ H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ @@ -1245,7 +1245,7 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_clear() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_sblock_size(const H5F_t UNUSED *f, const H5EA_sblock_t *sblock, +H5EA__cache_sblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_sblock_t *sblock, size_t *size_ptr)) /* Sanity check */ @@ -1494,7 +1494,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_dblock_t *dblock, unsigned UNUSED * flags_ptr)) + H5EA_dblock_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr)) /* Local variables */ H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ @@ -1677,7 +1677,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_dblock_size(const H5F_t UNUSED *f, const H5EA_dblock_t *dblock, +H5EA__cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_dblock_t *dblock, size_t *size_ptr)) /* Sanity check */ @@ -1861,7 +1861,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5EA_dblk_page_t *dblk_page, unsigned UNUSED * flags_ptr)) + H5EA_dblk_page_t *dblk_page, unsigned H5_ATTR_UNUSED * flags_ptr)) /* Local variables */ H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ @@ -2022,7 +2022,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_dblk_page_size(const H5F_t UNUSED *f, const H5EA_dblk_page_t *dblk_page, +H5EA__cache_dblk_page_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_dblk_page_t *dblk_page, size_t *size_ptr)) /* Sanity check */ @@ -2055,7 +2055,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_size() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_dblk_page_dest(H5F_t UNUSED *f, H5EA_dblk_page_t *dblk_page)) +H5EA__cache_dblk_page_dest(H5F_t H5_ATTR_UNUSED *f, H5EA_dblk_page_t *dblk_page)) /* Sanity check */ HDassert(f); diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 60b9ecd..ff55722 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -192,7 +192,7 @@ END_FUNC(PKG) /* end H5EA__hdr_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, int indent, +H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr)) /* Local variables */ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 94303c3..b3942ca 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -78,7 +78,7 @@ static herr_t H5EA__test_fill(void *nat_blk, size_t nelmts); static herr_t H5EA__test_encode(void *raw, const void *elmt, size_t nelmts, void *ctx); static herr_t H5EA__test_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5EA__test_crt_dbg_context(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED obj_addr); +static void *H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr); static herr_t H5EA__test_dst_dbg_context(void *_ctx); /*********************/ @@ -358,7 +358,7 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5EA__test_crt_dbg_context(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED obj_addr)) +H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr)) /* Local variables */ H5EA__ctx_cb_t *ctx; /* Context for callbacks */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 2f07cd6..a26aee6 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -301,7 +301,7 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5FA_hdr_t *hdr, unsigned UNUSED * flags_ptr)) + H5FA_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr)) H5WB_t *wb = NULL; /* Wrapped buffer for header data */ uint8_t hdr_buf[H5FA_HDR_BUF_SIZE]; /* Buffer for header */ @@ -426,7 +426,7 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_clear() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__cache_hdr_size(const H5F_t UNUSED *f, const H5FA_hdr_t *hdr, +H5FA__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_hdr_t *hdr, size_t *size_ptr)) /* Sanity check */ @@ -632,7 +632,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5FA_dblock_t *dblock, unsigned UNUSED * flags_ptr)) + H5FA_dblock_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr)) /* Local variables */ H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ @@ -773,7 +773,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_clear() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__cache_dblock_size(const H5F_t UNUSED *f, const H5FA_dblock_t *dblock, +H5FA__cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_dblock_t *dblock, size_t *size_ptr)) /* Sanity check */ @@ -954,7 +954,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_load() */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5FA_dblk_page_t *dblk_page, unsigned UNUSED * flags_ptr)) + H5FA_dblk_page_t *dblk_page, unsigned H5_ATTR_UNUSED * flags_ptr)) /* Local variables */ H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */ @@ -1070,7 +1070,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_clear() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__cache_dblk_page_size(const H5F_t UNUSED *f, const H5FA_dblk_page_t *dblk_page, +H5FA__cache_dblk_page_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_dblk_page_t *dblk_page, size_t *size_ptr)) /* Sanity check */ @@ -1102,7 +1102,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_size() */ /* ARGSUSED */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5FA__cache_dblk_page_dest(H5F_t UNUSED *f, H5FA_dblk_page_t *dblk_page)) +H5FA__cache_dblk_page_dest(H5F_t H5_ATTR_UNUSED *f, H5FA_dblk_page_t *dblk_page)) /* Sanity check */ HDassert(f); diff --git a/src/H5FAtest.c b/src/H5FAtest.c index 298c89d..acb2d06 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -133,7 +133,7 @@ H5FL_DEFINE_STATIC(H5FA__test_ctx_t); */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5FA__test_crt_context(void UNUSED *udata)) +H5FA__test_crt_context(void H5_ATTR_UNUSED *udata)) /* Local variables */ H5FA__test_ctx_t *ctx; /* Context for callbacks */ @@ -226,7 +226,7 @@ END_FUNC(STATIC) /* end H5FA__test_fill() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void UNUSED *_ctx)) +H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx)) /* Local variables */ #ifndef NDEBUG @@ -271,7 +271,7 @@ END_FUNC(STATIC) /* end H5FA__test_encode() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void UNUSED *_ctx)) +H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx)) /* Local variables */ #ifndef NDEBUG @@ -350,7 +350,7 @@ END_FUNC(STATIC) /* end H5FA__test_debug() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5FA__test_crt_dbg_context(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED obj_addr)) +H5FA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr)) /* Local variables */ H5FA__test_ctx_t *ctx; /* Context for callbacks */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index f9bda00..32f23fb 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -1067,7 +1067,7 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_core_t *file = (const H5FD_core_t*)_file; @@ -1092,7 +1092,7 @@ H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) +H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1126,7 +1126,7 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_core_t *file = (const H5FD_core_t*)_file; @@ -1214,7 +1214,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_core_t *file = (H5FD_core_t*)_file; @@ -1274,7 +1274,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_core_t *file = (H5FD_core_t*)_file; @@ -1355,7 +1355,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing) +H5FD_core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, unsigned H5_ATTR_UNUSED closing) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1453,7 +1453,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing) +H5FD_core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_core_t *file = (H5FD_core_t*)_file; size_t new_eof; /* New size of memory buffer */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index c2b0660..e9fd1ea 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -706,7 +706,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) +H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out */) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -745,7 +745,7 @@ H5FD_direct_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; @@ -777,7 +777,7 @@ H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) +H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_direct_t *file = (H5FD_direct_t*)_file; @@ -810,7 +810,7 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; @@ -835,7 +835,7 @@ H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) +H5FD_direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle) { H5FD_direct_t *file = (H5FD_direct_t *)_file; herr_t ret_value = SUCCEED; @@ -871,7 +871,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_direct_t *file = (H5FD_direct_t*)_file; @@ -1054,7 +1054,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_direct_t *file = (H5FD_direct_t*)_file; @@ -1284,7 +1284,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) +H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_direct_t *file = (H5FD_direct_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 8660f1f..d993ad0 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -498,7 +498,7 @@ done: *------------------------------------------------------------------------- */ static hsize_t -H5FD_family_sb_size(H5FD_t UNUSED *_file) +H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -572,7 +572,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out* *------------------------------------------------------------------------- */ static herr_t -H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned char *buf) +H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf) { H5FD_family_t *file = (H5FD_family_t*)_file; uint64_t msize; @@ -934,7 +934,7 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; diff --git a/src/H5FDlog.c b/src/H5FDlog.c index cc0caa4..d2289fd 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -934,7 +934,7 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t size) +H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size) { H5FD_log_t *file = (H5FD_log_t *)_file; haddr_t addr; @@ -989,7 +989,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t siz *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; @@ -1061,7 +1061,7 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; @@ -1084,7 +1084,7 @@ H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_log_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void **file_handle) +H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; @@ -1118,7 +1118,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_log_t *file = (H5FD_log_t *)_file; @@ -1315,7 +1315,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_log_t *file = (H5FD_log_t *)_file; @@ -1515,7 +1515,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) +H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index d81509a..5f36d2a 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -995,7 +995,7 @@ done: */ static H5FD_t * H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, - haddr_t UNUSED maxaddr) + haddr_t H5_ATTR_UNUSED maxaddr) { H5FD_mpio_t *file=NULL; MPI_File fh; @@ -1212,7 +1212,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */) +H5FD_mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out */) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1251,7 +1251,7 @@ H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; @@ -1286,7 +1286,7 @@ H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) +H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; @@ -1331,7 +1331,7 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; @@ -1359,7 +1359,7 @@ H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) +H5FD_mpio_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; herr_t ret_value = SUCCEED; @@ -1445,7 +1445,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t addr, size_t size, +H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; @@ -1946,7 +1946,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing) +H5FD_mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, unsigned closing) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; int mpi_code; /* mpi return code */ @@ -1991,7 +1991,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) +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; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index b938c41..73dd7a0 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -568,7 +568,7 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; @@ -593,7 +593,7 @@ H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) +H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; @@ -621,7 +621,7 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) +H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; @@ -644,7 +644,7 @@ H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void **file_handle) +H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; @@ -678,7 +678,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, +H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf /*out*/) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; @@ -773,7 +773,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, +H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; @@ -863,7 +863,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) +H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 8611ab0..8e7eaf4 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -608,7 +608,7 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, hsize_t size) +H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, hid_t /*H5_ATTR_UNUSED*/ dxpl_id, hsize_t size) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; haddr_t addr; @@ -653,7 +653,7 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) +H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type) { const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; @@ -684,7 +684,7 @@ H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr) +H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, haddr_t addr) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; @@ -719,7 +719,7 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) +H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type) { const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 556712f..3cd30a6 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -138,7 +138,7 @@ typedef struct H5FL_reg_head_t { #else /* H5_NO_REG_FREE_LISTS */ #include "H5MMprivate.h" /* Common macro for H5FL_DEFINE & H5FL_DEFINE_STATIC */ -#define H5FL_DEFINE_COMMON(t) int UNUSED H5FL_REG_NAME(t) +#define H5FL_DEFINE_COMMON(t) int H5_ATTR_UNUSED H5FL_REG_NAME(t) #define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t) #define H5FL_EXTERN(t) H5_DLLVAR H5FL_DEFINE_COMMON(t) @@ -208,7 +208,7 @@ typedef struct H5FL_blk_head_t { #else /* H5_NO_BLK_FREE_LISTS */ /* Common macro for H5FL_BLK_DEFINE & H5FL_BLK_DEFINE_STATIC */ -#define H5FL_BLK_DEFINE_COMMON(t) int UNUSED H5FL_BLK_NAME(t) +#define H5FL_BLK_DEFINE_COMMON(t) int H5_ATTR_UNUSED H5FL_BLK_NAME(t) #define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t) #define H5FL_BLK_EXTERN(t) H5_DLLVAR H5FL_BLK_DEFINE_COMMON(t) @@ -337,7 +337,7 @@ typedef struct H5FL_seq_head_t { #else /* H5_NO_SEQ_FREE_LISTS */ /* Common macro for H5FL_SEQ_DEFINE & H5FL_SEQ_DEFINE_STATIC */ -#define H5FL_SEQ_DEFINE_COMMON(t) int UNUSED H5FL_SEQ_NAME(t) +#define H5FL_SEQ_DEFINE_COMMON(t) int H5_ATTR_UNUSED H5FL_SEQ_NAME(t) #define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t) #define H5FL_SEQ_EXTERN(t) H5_DLLVAR H5FL_SEQ_DEFINE_COMMON(t) diff --git a/src/H5FS.c b/src/H5FS.c index 67ec838..90bbe39 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -1064,7 +1064,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_free_sect_cb(void *_sect, void UNUSED *key, void *op_data) +H5FS_sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data) { H5FS_section_info_t *sect = (H5FS_section_info_t *)_sect; /* Section to free */ const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)op_data; /* Free space manager for section */ @@ -1096,7 +1096,7 @@ H5FS_sinfo_free_sect_cb(void *_sect, void UNUSED *key, void *op_data) *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_free_node_cb(void *item, void UNUSED *key, void *op_data) +H5FS_sinfo_free_node_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) { H5FS_node_t *fspace_node = (H5FS_node_t *)item; /* Temporary pointer to free space list node */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 5ab788e..461af99 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -75,17 +75,17 @@ typedef struct { /********************/ /* Section info routines */ -static herr_t H5FS_sinfo_serialize_sect_cb(void *_item, void UNUSED *key, void *_udata); -static herr_t H5FS_sinfo_serialize_node_cb(void *_item, void UNUSED *key, void *_udata); +static herr_t H5FS_sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata); +static herr_t H5FS_sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata); /* Metadata cache callbacks */ static H5FS_t *H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned UNUSED * flags_ptr); +static herr_t H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace); static herr_t H5FS_cache_hdr_clear(H5F_t *f, H5FS_t *fspace, hbool_t destroy); static herr_t H5FS_cache_hdr_size(const H5F_t *f, const H5FS_t *fspace, size_t *size_ptr); static H5FS_sinfo_t *H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned UNUSED * flags_ptr); +static herr_t H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo); static herr_t H5FS_cache_sinfo_clear(H5F_t *f, H5FS_sinfo_t *sinfo, hbool_t destroy); static herr_t H5FS_cache_sinfo_size(const H5F_t *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr); @@ -281,7 +281,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned UNUSED * flags_ptr) +H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned H5_ATTR_UNUSED * flags_ptr) { H5WB_t *wb = NULL; /* Wrapped buffer for header data */ uint8_t hdr_buf[H5FS_HDR_BUF_SIZE]; /* Buffer for header */ @@ -524,7 +524,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_ptr) +H5FS_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5FS_t *fspace, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -555,7 +555,7 @@ H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_pt *------------------------------------------------------------------------- */ static H5FS_sinfo_t * -H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) +H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void *_udata) { H5FS_sinfo_t *sinfo = NULL; /* Free space section info */ H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* user data for callback */ @@ -717,7 +717,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_serialize_sect_cb(void *_item, void UNUSED *key, void *_udata) +H5FS_sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_section_class_t *sect_cls; /* Class of section */ H5FS_section_info_t *sect= (H5FS_section_info_t *)_item; /* Free space section to work on */ @@ -773,7 +773,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_serialize_node_cb(void *_item, void UNUSED *key, void *_udata) +H5FS_sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */ H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ @@ -819,7 +819,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned UNUSED * flags_ptr) +H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1027,7 +1027,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_sinfo_size(const H5F_t UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr) +H5FS_cache_sinfo_size(const H5F_t H5_ATTR_UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index 7edbbf8..b180efd 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -232,7 +232,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, int indent, int fwidth, +H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, haddr_t fs_addr, haddr_t client_addr) { H5FS_t *fspace = NULL; /* Free space header info */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index b06c9b8..8fe4075 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -1895,7 +1895,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_iterate_sect_cb(void *_item, void UNUSED *key, void *_udata) +H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_section_info_t *sect_info = (H5FS_section_info_t *)_item; /* Free space section to work on */ H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ @@ -1933,7 +1933,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_iterate_node_cb(void *_item, void UNUSED *key, void *_udata) +H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */ H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 7cd9abb..99f83bd 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -845,7 +845,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t UNUSED type, haddr_t addr, +H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr, hsize_t size) { H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */ diff --git a/src/H5Fmount.c b/src/H5Fmount.c index ee7af97..643eba5 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -128,7 +128,7 @@ done: */ static herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t UNUSED plist_id, hid_t dxpl_id) + hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id) { H5G_t *mount_point = NULL; /*mount point group */ H5F_t *ancestor = NULL; /*ancestor files */ diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 46ebe6e..ded845d 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -122,7 +122,7 @@ H5FL_EXTERN(H5F_super_t); *------------------------------------------------------------------------- */ static H5F_super_t * -H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) +H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void *_udata) { H5F_super_t *sblock = NULL; /* File's superblock */ haddr_t base_addr = HADDR_UNDEF; /* Base address of file */ @@ -635,7 +635,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, +H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSED addr, H5F_super_t *sblock) { herr_t ret_value = SUCCEED; @@ -872,7 +872,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_sblock_dest(H5F_t UNUSED *f, H5F_super_t* sblock) +H5F_sblock_dest(H5F_t H5_ATTR_UNUSED *f, H5F_super_t* sblock) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index a917eb4..06af245 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -161,7 +161,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 UNUSED obj_len, void *_udata) +H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED 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 */ @@ -306,7 +306,7 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) +H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; @@ -334,7 +334,7 @@ H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) +H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; @@ -362,9 +362,9 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5G_dense_btree2_name_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, int indent, int fwidth, const void *_nrecord, - const void UNUSED *_udata) + const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; unsigned u; /* Local index variable */ @@ -472,7 +472,7 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx) +H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; @@ -500,7 +500,7 @@ H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx) +H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; @@ -528,9 +528,9 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5G_dense_btree2_corder_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, int indent, int fwidth, const void *_nrecord, - const void UNUSED *_udata) + const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; unsigned u; /* Local index variable */ diff --git a/src/H5Gcache.c b/src/H5Gcache.c index d1923a6..bedceb6 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -213,7 +213,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_t *sym, unsigned UNUSED * flags_ptr) +H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_t *sym, unsigned H5_ATTR_UNUSED * flags_ptr) { H5WB_t *wb = NULL; /* Wrapped buffer for node data */ uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */ @@ -394,7 +394,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_size(const H5F_t UNUSED *f, const H5G_node_t *sym, size_t *size_ptr) +H5G_node_size(const H5F_t H5_ATTR_UNUSED *f, const H5G_node_t *sym, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index e4de283..89e79cc 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -83,7 +83,7 @@ static herr_t H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, *------------------------------------------------------------------------- */ static herr_t -H5G_compact_build_table_cb(const void *_mesg, unsigned UNUSED idx, void *_udata) +H5G_compact_build_table_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_iter_bt_t *udata = (H5G_iter_bt_t *)_udata; /* 'User data' passed in */ @@ -274,7 +274,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_compact_remove_common_cb(const void *_mesg, unsigned UNUSED idx, void *_udata) +H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_iter_rm_t *udata = (H5G_iter_rm_t *)_udata; /* 'User data' passed in */ @@ -452,7 +452,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_compact_lookup_cb(const void *_mesg, unsigned UNUSED idx, void *_udata) +H5G_compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_iter_lkp_t *udata = (H5G_iter_lkp_t *)_udata; /* 'User data' passed in */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 841b4d3..285355f 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 UNUSED obj_len, void *_udata) +H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED 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 */ @@ -889,7 +889,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) +H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED 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 */ @@ -1101,7 +1101,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) +H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED 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 */ @@ -1308,7 +1308,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) +H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED 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 */ @@ -1485,7 +1485,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) +H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED 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 */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 8f2fe54..4e3572e 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -917,7 +917,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_objinfo_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, +H5G_get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 6f42cc2..04b21a5 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -869,7 +869,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_free_visit_visited(void *item, void UNUSED *key, void UNUSED *operator_data/*in,out*/) +H5G_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 9f0095a..677cc25 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -371,8 +371,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_find_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5G_loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_fnd_t *udata = (H5G_loc_fnd_t *)_udata; /* User data passed in */ @@ -448,8 +448,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_find_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5G_loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_fbi_t *udata = (H5G_loc_fbi_t *)_udata; /* User data passed in */ @@ -607,8 +607,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_exists_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */ @@ -685,7 +685,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_info_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, const H5O_link_t UNUSED *lnk, +H5G_loc_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_info_t *udata = (H5G_loc_info_t *)_udata; /* User data passed in */ @@ -764,7 +764,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_set_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, const H5O_link_t UNUSED *lnk, +H5G_loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_sc_t *udata = (H5G_loc_sc_t *)_udata; /* User data passed in */ @@ -856,7 +856,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_get_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, const H5O_link_t UNUSED *lnk, +H5G_loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_gc_t *udata = (H5G_loc_gc_t *)_udata; /* User data passed in */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 3c238ce..d695dac 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -157,7 +157,7 @@ H5FL_SEQ_DEFINE(H5G_entry_t); *------------------------------------------------------------------------- */ static H5UC_t * -H5G_node_get_shared(const H5F_t *f, const void UNUSED *_udata) +H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -323,8 +323,8 @@ H5G__node_free(H5G_node_t *sym) *------------------------------------------------------------------------- */ static herr_t -H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t UNUSED op, void *_lt_key, - void UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/) +H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, + void H5_ATTR_UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/) { H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; @@ -518,7 +518,7 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) *------------------------------------------------------------------------- */ static htri_t -H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key, +H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; @@ -614,7 +614,7 @@ done: */ static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, - void UNUSED *_lt_key, hbool_t UNUSED *lt_key_changed, + void H5_ATTR_UNUSED *_lt_key, hbool_t H5_ATTR_UNUSED *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p) @@ -785,7 +785,7 @@ done: */ static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, - hbool_t UNUSED *lt_key_changed/*out*/, + hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, void *_udata/*in,out*/, void *_rt_key/*in,out*/, hbool_t *rt_key_changed/*out*/) { @@ -982,8 +982,8 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, - const void UNUSED *_rt_key, void *_udata) +H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; H5G_node_t *sn = NULL; @@ -1061,8 +1061,8 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, - const void UNUSED *_rt_key, void *_udata) +H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *num_objs = (hsize_t *)_udata; H5G_node_t *sn = NULL; @@ -1106,8 +1106,8 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, - const void UNUSED *_rt_key, void *_udata) +H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; H5G_node_t *sn = NULL; @@ -1242,8 +1242,8 @@ H5G_node_close(const H5F_t *f) *------------------------------------------------------------------------- */ int -H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, - const void UNUSED *_rt_key, void *_udata) +H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_cpy_t *udata = (H5G_bt_it_cpy_t *)_udata; const H5O_loc_t *src_oloc = udata->src_oloc; @@ -1399,8 +1399,8 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, - const void UNUSED *_rt_key, void *_udata) +H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; H5G_node_t *sn = NULL; /* Symbol table node */ @@ -1474,8 +1474,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__node_iterate_size(H5F_t *f, hid_t UNUSED dxpl_id, const void UNUSED *_lt_key, haddr_t UNUSED addr, - const void UNUSED *_rt_key, void *_udata) +H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t H5_ATTR_UNUSED addr, + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *stab_size = (hsize_t *)_udata; /* User data */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 021f4e1..c1f05b7 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -382,7 +382,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned UNUSED idx, void *_udata) +H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ diff --git a/src/H5Goh.c b/src/H5Goh.c index c6115db..1a0f112 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -210,7 +210,7 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_group_open(const H5G_loc_t *obj_loc, hid_t UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O_group_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) { H5G_t *grp = NULL; /* Group opened */ hid_t ret_value; /* Return value */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index de37655..89b4a37 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -666,8 +666,8 @@ done: */ static int H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, - const void UNUSED *_lt_key, haddr_t addr, const void UNUSED *_rt_key, - void UNUSED *udata) + const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, + void H5_ATTR_UNUSED *udata) { H5G_node_t *sn = NULL; H5O_loc_t targ_oloc; diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 72e3201..1c654bb 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -119,8 +119,8 @@ static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_slink_cb(H5G_loc_t UNUSED *grp_loc, const char UNUSED *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5G_traverse_slink_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_trav_slink_t *udata = (H5G_trav_slink_t *)_udata; /* User data passed in */ diff --git a/src/H5HF.c b/src/H5HF.c index 64e8af2..f57c5e2 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -551,7 +551,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t UNUSED *id_changed, +H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, const void *obj) { uint8_t *id = (uint8_t *)_id; /* Object ID */ diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 34b74d7..0229ebe 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -278,7 +278,7 @@ H5HF_huge_bt2_dst_context(void *_ctx) *------------------------------------------------------------------------- */ static void * -H5HF_huge_bt2_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) +H5HF_huge_bt2_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr) { H5HF_huge_bt2_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ @@ -505,9 +505,9 @@ H5HF_huge_bt2_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_indir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5HF_huge_bt2_indir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, int indent, int fwidth, const void *_nrecord, - const void UNUSED *_udata) + const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_indir_rec_t *nrecord = (const H5HF_huge_bt2_indir_rec_t *)_nrecord; @@ -727,9 +727,9 @@ H5HF_huge_bt2_filt_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_filt_indir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5HF_huge_bt2_filt_indir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, int indent, int fwidth, const void *_nrecord, - const void UNUSED *_udata) + const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_filt_indir_rec_t *nrecord = (const H5HF_huge_bt2_filt_indir_rec_t *)_nrecord; @@ -920,9 +920,9 @@ H5HF_huge_bt2_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_dir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5HF_huge_bt2_dir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, int indent, int fwidth, const void *_nrecord, - const void UNUSED *_udata) + const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_dir_rec_t *nrecord = (const H5HF_huge_bt2_dir_rec_t *)_nrecord; @@ -1149,8 +1149,8 @@ H5HF_huge_bt2_filt_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_filt_dir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void UNUSED *_udata) +H5HF_huge_bt2_filt_dir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, + int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_filt_dir_rec_t *nrecord = (const H5HF_huge_bt2_filt_dir_rec_t *)_nrecord; diff --git a/src/H5HFcache.c b/src/H5HFcache.c index e5ea437..9f8dfd9 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -80,18 +80,18 @@ static herr_t H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *d /* Metadata cache (H5AC) callbacks */ static H5HF_hdr_t *H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned UNUSED * flags_ptr); +static herr_t H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5HF_cache_hdr_dest(H5F_t *f, H5HF_hdr_t *hdr); static herr_t H5HF_cache_hdr_clear(H5F_t *f, H5HF_hdr_t *hdr, hbool_t destroy); static herr_t H5HF_cache_hdr_size(const H5F_t *f, const H5HF_hdr_t *hdr, size_t *size_ptr); static H5HF_indirect_t *H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned UNUSED * flags_ptr); +static herr_t H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5HF_cache_iblock_dest(H5F_t *f, H5HF_indirect_t *iblock); static herr_t H5HF_cache_iblock_clear(H5F_t *f, H5HF_indirect_t *iblock, hbool_t destroy); static herr_t H5HF_cache_iblock_notify(H5C_notify_action_t action, H5HF_indirect_t *iblock); static herr_t H5HF_cache_iblock_size(const H5F_t *f, const H5HF_indirect_t *iblock, size_t *size_ptr); static H5HF_direct_t *H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned UNUSED * flags_ptr); +static herr_t H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5HF_cache_dblock_dest(H5F_t *f, H5HF_direct_t *dblock); static herr_t H5HF_cache_dblock_clear(H5F_t *f, H5HF_direct_t *dblock, hbool_t destroy); static herr_t H5HF_cache_dblock_notify(H5C_notify_action_t action, H5HF_direct_t *dblock); @@ -466,7 +466,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned UNUSED * flags_ptr) +H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr) { H5WB_t *wb = NULL; /* Wrapped buffer for header data */ uint8_t hdr_buf[H5HF_HDR_BUF_SIZE]; /* Buffer for header */ @@ -709,7 +709,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_hdr_size(const H5F_t UNUSED *f, const H5HF_hdr_t *hdr, size_t *size_ptr) +H5HF_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_hdr_t *hdr, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -948,7 +948,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned UNUSED * flags_ptr) +H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned H5_ATTR_UNUSED * flags_ptr) { H5WB_t *wb = NULL; /* Wrapped buffer for indirect block data */ uint8_t iblock_buf[H5HF_IBLOCK_BUF_SIZE]; /* Buffer for indirect block */ @@ -1352,7 +1352,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_iblock_size(const H5F_t UNUSED *f, const H5HF_indirect_t *iblock, size_t *size_ptr) +H5HF_cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_indirect_t *iblock, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1560,7 +1560,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned UNUSED * flags_ptr) +H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1993,7 +1993,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_dblock_size(const H5F_t UNUSED *f, const H5HF_direct_t *dblock, size_t *size_ptr) +H5HF_cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_direct_t *dblock, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5HFsection.c b/src/H5HFsection.c index d78114e..01a7b4a 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -861,9 +861,9 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5HF_sect_single_deserialize(const H5FS_section_class_t UNUSED *cls, - hid_t UNUSED dxpl_id, const uint8_t UNUSED *buf, haddr_t sect_addr, - hsize_t sect_size, unsigned UNUSED *des_flags) +H5HF_sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, + hid_t H5_ATTR_UNUSED dxpl_id, const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, + hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5HF_free_section_t *new_sect; /* New section */ H5FS_section_info_t *ret_value; /* Return value */ @@ -904,7 +904,7 @@ done: */ static htri_t H5HF_sect_single_can_merge(const H5FS_section_info_t *_sect1, - const H5FS_section_info_t *_sect2, void UNUSED *_udata) + const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ const H5HF_free_section_t *sect2 = (const H5HF_free_section_t *)_sect2; /* Fractal heap free section */ @@ -1063,7 +1063,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void UNUSED *_udata) +H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata) { H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ @@ -1171,7 +1171,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_valid(const H5FS_section_class_t UNUSED *cls, const H5FS_section_info_t *_sect) +H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5FS_section_info_t *_sect) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Pointer to section to check */ @@ -1714,7 +1714,7 @@ done: */ static htri_t H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, - const H5FS_section_info_t *_sect2, void UNUSED *_udata) + const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ const H5HF_free_section_t *sect2 = (const H5HF_free_section_t *)_sect2; /* Fractal heap free section */ @@ -1839,7 +1839,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void UNUSED *_udata) +H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 577d3b8..7fb0dd4 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -262,7 +262,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void UNUSED *_udata) +H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 4e3f568..f1b5fc6 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -64,7 +64,7 @@ /* Metadata cache callbacks */ static H5HG_heap_t *H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); static herr_t H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - H5HG_heap_t *heap, unsigned UNUSED * flags_ptr); + H5HG_heap_t *heap, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5HG_dest(H5F_t *f, H5HG_heap_t *heap); static herr_t H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy); static herr_t H5HG_size(const H5F_t *f, const H5HG_heap_t *heap, size_t *size_ptr); @@ -280,7 +280,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap, unsigned UNUSED * flags_ptr) +H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap, unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -401,7 +401,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HG_size(const H5F_t UNUSED *f, const H5HG_heap_t *heap, size_t *size_ptr) +H5HG_size(const H5F_t H5_ATTR_UNUSED *f, const H5HG_heap_t *heap, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5HLcache.c b/src/H5HLcache.c index d946815..b2c764d 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -394,7 +394,7 @@ done: */ static herr_t H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - void *thing, unsigned UNUSED *flags_ptr) + void *thing, unsigned H5_ATTR_UNUSED *flags_ptr) { H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to flush */ H5WB_t *wb = NULL; /* Wrapped buffer for heap data */ @@ -553,7 +553,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_clear(H5F_t UNUSED *f, void *thing, hbool_t destroy) +H5HL_prefix_clear(H5F_t H5_ATTR_UNUSED *f, void *thing, hbool_t destroy) { H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* The local heap prefix to operate on */ herr_t ret_value = SUCCEED; /* Return value */ @@ -590,7 +590,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_size(const H5F_t UNUSED *f, const void *thing, size_t *size_ptr) +H5HL_prefix_size(const H5F_t H5_ATTR_UNUSED *f, const void *thing, size_t *size_ptr) { const H5HL_prfx_t *prfx = (const H5HL_prfx_t *)thing; /* Pointer to local heap prefix to query */ @@ -694,7 +694,7 @@ done: */ static herr_t H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - void *_thing, unsigned UNUSED * flags_ptr) + void *_thing, unsigned H5_ATTR_UNUSED * flags_ptr) { H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ herr_t ret_value = SUCCEED; /* Return value */ @@ -835,7 +835,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_size(const H5F_t UNUSED *f, const void *_thing, size_t *size_ptr) +H5HL_datablock_size(const H5F_t H5_ATTR_UNUSED *f, const void *_thing, size_t *size_ptr) { const H5HL_dblk_t *dblk = (const H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ diff --git a/src/H5I.c b/src/H5I.c index 528be81..a2348f8 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -1882,7 +1882,7 @@ done: *------------------------------------------------------------------------- */ static int -H5I__iterate_cb(void *_item, void UNUSED *_key, void *_udata) +H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) { H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ H5I_iterate_ud_t *udata = (H5I_iterate_ud_t *)_udata; /* User data for callback */ @@ -2152,7 +2152,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5I__debug_cb(void *_item, void UNUSED *_key, void *_udata) +H5I__debug_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) { H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ diff --git a/src/H5L.c b/src/H5L.c index 11bf313..73d363e 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -1655,7 +1655,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED *lnk, +H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_cr_t *udata = (H5L_trav_cr_t *)_udata; /* User data passed in */ @@ -2140,8 +2140,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, - H5G_loc_t UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) +H5L_get_val_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, + H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gv_t *udata = (H5L_trav_gv_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2224,8 +2224,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5L_get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */ @@ -2277,7 +2277,7 @@ done: */ static herr_t H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, - H5G_loc_t UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) + H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_rm_t *udata = (H5L_trav_rm_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; @@ -2365,8 +2365,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_delete_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5L_delete_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */ @@ -2408,7 +2408,7 @@ done: */ static herr_t H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_mv2_t *udata = (H5L_trav_mv2_t *)_udata; /* User data passed in */ @@ -2721,8 +2721,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_exists_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t *lnk, H5G_loc_t UNUSED *obj_loc, void *_udata/*in,out*/, +H5L_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { hbool_t *udata = (hbool_t *)_udata; /* User data passed in */ @@ -2785,8 +2785,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_info_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t *lnk, H5G_loc_t UNUSED *obj_loc, void *_udata/*in,out*/, +H5L_get_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gi_t *udata = (H5L_trav_gi_t *)_udata; /* User data passed in */ @@ -2858,8 +2858,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_info_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5L_get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gibi_t *udata = (H5L_trav_gibi_t *)_udata; /* User data passed in */ @@ -2938,8 +2938,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_name_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, - const H5O_link_t UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, +H5L_get_name_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gnbi_t *udata = (H5L_trav_gnbi_t *)_udata; /* User data passed in */ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index a5302e0..ae13e6b 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -29,9 +29,9 @@ #include "H5Opublic.h" /* File objects */ #include "H5Pprivate.h" /* Property lists */ -static hid_t H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, - const void *udata, size_t UNUSED udata_size, hid_t lapl_id); -static ssize_t H5L_extern_query(const char UNUSED * link_name, const void *udata, +static hid_t 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); +static ssize_t H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *udata, size_t udata_size, void * buf /*out*/, size_t buf_size); /* Default External Link link class */ @@ -188,8 +188,8 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, - const void *_udata, size_t UNUSED udata_size, hid_t lapl_id) +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 */ @@ -490,7 +490,7 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5L_extern_query(const char UNUSED * link_name, const void *_udata, size_t udata_size, +H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, size_t udata_size, void *buf /*out*/, size_t buf_size) { const uint8_t *udata = (const uint8_t *)_udata; /* Pointer to external link buffer */ diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 29d21fd..3701441 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -536,7 +536,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_aggr_absorb(const H5F_t UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect, +H5MF_aggr_absorb(const H5F_t H5_ATTR_UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect, hbool_t allow_sect_absorb) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 0572def..bc147ed 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -173,9 +173,9 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5MF_sect_simple_deserialize(const H5FS_section_class_t UNUSED *cls, - hid_t UNUSED dxpl_id, const uint8_t UNUSED *buf, haddr_t sect_addr, - hsize_t sect_size, unsigned UNUSED *des_flags) +H5MF_sect_simple_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, + hid_t H5_ATTR_UNUSED dxpl_id, const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, + hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5MF_free_section_t *sect; /* New section */ H5FS_section_info_t *ret_value; /* Return value */ @@ -215,7 +215,7 @@ done: */ static htri_t H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1, - const H5FS_section_info_t *_sect2, void UNUSED *_udata) + const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */ const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */ @@ -253,7 +253,7 @@ H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1, */ static herr_t H5MF_sect_simple_merge(H5FS_section_info_t *_sect1, H5FS_section_info_t *_sect2, - void UNUSED *_udata) + void H5_ATTR_UNUSED *_udata) { H5MF_free_section_t *sect1 = (H5MF_free_section_t *)_sect1; /* File free section */ H5MF_free_section_t *sect2 = (H5MF_free_section_t *)_sect2; /* File free section */ @@ -483,10 +483,10 @@ H5MF_sect_simple_free(H5FS_section_info_t *_sect) *------------------------------------------------------------------------- */ static herr_t -H5MF_sect_simple_valid(const H5FS_section_class_t UNUSED *cls, +H5MF_sect_simple_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5FS_section_info_t #ifdef NDEBUG - UNUSED + H5_ATTR_UNUSED #endif /* NDEBUG */ *_sect) { diff --git a/src/H5O.c b/src/H5O.c index 6745716..22086fa 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -3121,7 +3121,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_free_visit_visited(void *item, void UNUSED *key, void UNUSED *operator_data/*in,out*/) +H5O_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -3145,7 +3145,7 @@ H5O_free_visit_visited(void *item, void UNUSED *key, void UNUSED *operator_data/ *------------------------------------------------------------------------- */ static herr_t -H5O_visit_cb(hid_t UNUSED group, const char *name, const H5L_info_t *linfo, +H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, void *_udata) { H5O_iter_visit_ud_t *udata = (H5O_iter_visit_ud_t *)_udata; /* User data for callback */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 654163b..4949b23 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -105,8 +105,8 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ainfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_ainfo_t *ainfo = NULL; /* Attribute info */ unsigned char flags; /* Flags for encoding attribute info */ @@ -179,7 +179,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; unsigned char flags; /* Flags for encoding attribute info */ @@ -276,7 +276,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_ainfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; size_t ret_value; /* Return value */ @@ -333,7 +333,7 @@ H5O_ainfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) +H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) { H5O_ainfo_t *ainfo = (H5O_ainfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -369,8 +369,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, - hbool_t *deleted, const H5O_copy_t *cpy_info, void UNUSED *udata) +H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, + hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -403,8 +403,8 @@ H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, */ static void * H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; @@ -469,7 +469,7 @@ done: */ static herr_t H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src; @@ -504,7 +504,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_ainfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *) _mesg; diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 9710f5d..fd7fcda 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -122,7 +122,7 @@ H5FL_EXTERN(H5S_extent_t); function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_flags, +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) { H5A_t *attr = NULL; @@ -413,7 +413,7 @@ done: portion of the message). It doesn't take into account alignment. --------------------------------------------------------------------------*/ static size_t -H5O_attr_size(const H5F_t UNUSED *f, const void *_mesg) +H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) { const H5A_t *attr = (const H5A_t *)_mesg; size_t name_len; @@ -478,7 +478,7 @@ H5O_attr_size(const H5F_t UNUSED *f, const void *_mesg) *------------------------------------------------------------------------- */ herr_t -H5O_attr_reset(void UNUSED *_mesg) +H5O_attr_reset(void H5_ATTR_UNUSED *_mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -614,8 +614,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, - hbool_t *deleted, const H5O_copy_t *cpy_info, void UNUSED *udata) +H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, + hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -648,9 +648,9 @@ H5O_attr_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, *------------------------------------------------------------------------- */ static void * -H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t UNUSED *mesg_type, +H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) { void *ret_value; /* Return value */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 30ec732..46e7ce4 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -170,7 +170,7 @@ static htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, */ static herr_t H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_cvt_t *udata = (H5O_iter_cvt_t *)_udata; /* Operator user data */ H5A_t *attr = (H5A_t *)mesg->native; /* Pointer to attribute to insert */ @@ -416,7 +416,7 @@ done: */ static herr_t H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - unsigned UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_opn_t *udata = (H5O_iter_opn_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -850,7 +850,7 @@ done: */ static herr_t H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_wrt_t *udata = (H5O_iter_wrt_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ @@ -1008,8 +1008,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_rename_chk_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned UNUSED *oh_modified, void *_udata/*in,out*/) +H5O_attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, + unsigned H5_ATTR_UNUSED sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -1055,7 +1055,7 @@ H5O_attr_rename_chk_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, */ static herr_t H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ @@ -1517,7 +1517,7 @@ done: */ static herr_t H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -1795,8 +1795,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_exists_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned UNUSED *oh_modified, void *_udata/*in,out*/) +H5O_attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, + unsigned H5_ATTR_UNUSED sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ diff --git a/src/H5Obogus.c b/src/H5Obogus.c index d930683..b368ab6 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -87,8 +87,8 @@ const H5O_msg_class_t H5O_MSG_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_bogus_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_bogus_t *mesg = NULL; void *ret_value; /* Return value */ @@ -135,7 +135,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_bogus_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void UNUSED *mesg) +H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void H5_ATTR_UNUSED *mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -170,7 +170,7 @@ H5O_bogus_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, con *------------------------------------------------------------------------- */ static size_t -H5O_bogus_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void UNUSED *mesg) +H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -194,7 +194,7 @@ H5O_bogus_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_bogus_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O_bogus_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_bogus_t *mesg = (const H5O_bogus_t *)_mesg; diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index d25a7a3..802f23a 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -79,8 +79,8 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_btreek_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_btreek_t *mesg; /* Native message */ void *ret_value; /* Return value */ @@ -125,7 +125,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_btreek_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; @@ -201,7 +201,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_btreek_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void UNUSED *_mesg) +H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value; @@ -232,7 +232,7 @@ H5O_btreek_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_btreek_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O_btreek_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 3ccdf11..816e06a 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -69,13 +69,13 @@ /* Metadata cache callbacks */ static H5O_t *H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh, unsigned UNUSED * flags_ptr); +static herr_t H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5O_dest(H5F_t *f, H5O_t *oh); static herr_t H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy); static herr_t H5O_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr); static H5O_chunk_proxy_t *H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_chunk_proxy_t *chk_proxy, unsigned UNUSED * flags_ptr); +static herr_t H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_chunk_proxy_t *chk_proxy, unsigned H5_ATTR_UNUSED * flags_ptr); static herr_t H5O_cache_chk_dest(H5F_t *f, H5O_chunk_proxy_t *chk_proxy); static herr_t H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t destroy); static herr_t H5O_cache_chk_size(const H5F_t *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr); @@ -370,7 +370,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, H5O_t *oh, unsigned UNUSED * flags_ptr) +H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSED addr, H5O_t *oh, unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -645,7 +645,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_size(const H5F_t UNUSED *f, const H5O_t *oh, size_t *size_ptr) +H5O_size(const H5F_t H5_ATTR_UNUSED *f, const H5O_t *oh, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -776,7 +776,7 @@ done: */ static herr_t H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5O_chunk_proxy_t *chk_proxy, unsigned UNUSED * flags_ptr) + H5O_chunk_proxy_t *chk_proxy, unsigned H5_ATTR_UNUSED * flags_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -942,7 +942,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_size(const H5F_t UNUSED *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr) +H5O_cache_chk_size(const H5F_t H5_ATTR_UNUSED *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 647532b..a139654 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -90,8 +90,8 @@ H5FL_DEFINE(H5O_cont_t); *------------------------------------------------------------------------- */ static void * -H5O_cont_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_cont_t *cont = NULL; void *ret_value; @@ -133,7 +133,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cont_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_cont_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_cont_t *cont = (const H5O_cont_t *) _mesg; @@ -172,7 +172,7 @@ H5O_cont_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *------------------------------------------------------------------------- */ static size_t -H5O_cont_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED *_mesg) +H5O_cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value; /* Return value */ @@ -261,7 +261,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cont_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_cont_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_cont_t *cont = (const H5O_cont_t *) _mesg; diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 1471ae5..afd8e94 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -1019,7 +1019,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5O_copy_free_addrmap_cb(void *_item, void UNUSED *key, void UNUSED *op_data) +H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) { H5O_addr_map_t *item = (H5O_addr_map_t *)_item; @@ -1411,7 +1411,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_free_comm_dt_cb(void *item, void *_key, void UNUSED *op_data) +H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data) { haddr_t *addr = (haddr_t *)item; H5O_copy_search_comm_dt_key_t *key = (H5O_copy_search_comm_dt_key_t *)_key; @@ -1692,7 +1692,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_search_comm_dt_cb(hid_t UNUSED group, const char *name, +H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, void *_udata) { H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; /* Skip list of dtypes in dest file */ diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index 005b74a..73cb7cc 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -80,8 +80,8 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_drvinfo_t *mesg; /* Native message */ void *ret_value; /* Return value */ @@ -139,7 +139,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; @@ -225,7 +225,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_drvinfo_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; size_t ret_value; @@ -289,7 +289,7 @@ H5O_drvinfo_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O_drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; diff --git a/src/H5Odtype.c b/src/H5Odtype.c index cb6bf98..622a18e 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -1089,7 +1089,7 @@ done: function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned UNUSED mesg_flags, +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) { H5T_t *dt = NULL; @@ -1508,7 +1508,7 @@ done: */ static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, - hbool_t UNUSED *deleted, const H5O_copy_t UNUSED *cpy_info, + hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata) { const H5T_t *dt_src = (const H5T_t *)mesg_src; /* Source datatype */ @@ -1557,9 +1557,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_dtype_copy_file(H5F_t UNUSED *file_src, const H5O_msg_class_t *mesg_type, - void *native_src, H5F_t *file_dst, hbool_t UNUSED *recompute_size, - H5O_copy_t UNUSED *cpy_info, void UNUSED *udata, hid_t UNUSED dxpl_id) +H5O_dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_type, + void *native_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_t *dst_mesg; /* Destination datatype */ void *ret_value; /* Return value */ @@ -1597,9 +1597,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_shared_post_copy_upd(const H5O_loc_t UNUSED *src_oloc, - const void UNUSED *mesg_src, H5O_loc_t UNUSED *dst_oloc, void *mesg_dst, - hid_t UNUSED dxpl_id, H5O_copy_t UNUSED *cpy_info) +H5O_dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, + const void H5_ATTR_UNUSED *mesg_src, H5O_loc_t H5_ATTR_UNUSED *dst_oloc, void *mesg_dst, + hid_t H5_ATTR_UNUSED dxpl_id, H5O_copy_t H5_ATTR_UNUSED *cpy_info) { H5T_t *dt_dst = (H5T_t *)mesg_dst; /* Destination datatype */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index c6db7c3..e37e9b7 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -89,8 +89,8 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_efl_t *mesg = NULL; int version; @@ -192,7 +192,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_efl_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg; size_t u; /* Local index variable */ @@ -340,7 +340,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_efl_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; size_t ret_value = 0; @@ -454,9 +454,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_efl_copy_file(H5F_t UNUSED *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, - H5O_copy_t UNUSED *cpy_info, void UNUSED *_udata, hid_t dxpl_id) +H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *_udata, hid_t dxpl_id) { H5O_efl_t *efl_src = (H5O_efl_t *) mesg_src; H5O_efl_t *efl_dst = NULL; @@ -541,7 +541,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_efl_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 33022fc..3bd1e84 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -184,8 +184,8 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ static void * -H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_fill_t *fill = NULL; void *ret_value; @@ -298,8 +298,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_fill_old_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_fill_t *fill = NULL; /* Decoded fill value message */ void *ret_value; /* Return value */ @@ -359,7 +359,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fill_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_fill) +H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; @@ -455,7 +455,7 @@ H5O_fill_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_old_encode(H5F_t UNUSED *f, uint8_t *p, const void *_fill) +H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; @@ -608,7 +608,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_fill_new_size(const H5F_t UNUSED *f, const void *_fill) +H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; size_t ret_value; @@ -656,7 +656,7 @@ H5O_fill_new_size(const H5F_t UNUSED *f, const void *_fill) *------------------------------------------------------------------------- */ static size_t -H5O_fill_old_size(const H5F_t UNUSED *f, const void *_fill) +H5O_fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; @@ -805,7 +805,7 @@ H5O_fill_free(void *fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_fill, FILE *stream, +H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_fill, FILE *stream, int indent, int fwidth) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 11bf43b..180ebe8 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -84,8 +84,8 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_fsinfo_t *fsinfo = NULL; /* free-space manager info */ H5FD_mem_t type; /* Memory type for iteration */ @@ -141,7 +141,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; H5FD_mem_t type; /* Memory type for iteration */ @@ -220,7 +220,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_fsinfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; size_t fs_addr_size = 0; @@ -277,7 +277,7 @@ H5O_fsinfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index d579984..5519021 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -95,8 +95,8 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ @@ -168,7 +168,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; unsigned char flags; /* Flags for encoding group info */ @@ -262,7 +262,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_ginfo_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; size_t ret_value; /* Return value */ @@ -324,7 +324,7 @@ H5O_ginfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_ginfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; diff --git a/src/H5Olayout.c b/src/H5Olayout.c index d58ad61..8821694 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -96,8 +96,8 @@ H5FL_DEFINE(H5O_layout_t); *------------------------------------------------------------------------- */ static void * -H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_layout_t *mesg = NULL; unsigned u; @@ -291,7 +291,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; unsigned u; @@ -432,7 +432,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_layout_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; size_t ret_value; @@ -587,7 +587,7 @@ done: */ static void * H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) { H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ @@ -682,7 +682,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, +H5O_layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index 5d3d75c..a0b6e4a 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -114,8 +114,8 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); *------------------------------------------------------------------------- */ static void * -H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_linfo_t *linfo = NULL; /* Link info */ unsigned char index_flags; /* Flags for encoding link index info */ @@ -189,7 +189,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; unsigned char index_flags; /* Flags for encoding link index info */ @@ -286,7 +286,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_linfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; size_t ret_value; /* Return value */ @@ -343,7 +343,7 @@ H5O_linfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) +H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) { H5O_linfo_t *linfo = (H5O_linfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -379,8 +379,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_linfo_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, +H5O_linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *file_dst, + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) { H5O_linfo_t *linfo_src = (H5O_linfo_t *) native_src; @@ -502,7 +502,7 @@ done: */ static herr_t H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_linfo_t *linfo_src = (const H5O_linfo_t *)mesg_src; @@ -558,7 +558,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_linfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_linfo_t *linfo = (const H5O_linfo_t *) _mesg; diff --git a/src/H5Olink.c b/src/H5Olink.c index 184f6b9..53191ca 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -118,8 +118,8 @@ H5FL_DEFINE_STATIC(H5O_link_t); *------------------------------------------------------------------------- */ static void * -H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_link_t *lnk = NULL; /* Pointer to link message */ size_t len = 0; /* Length of a string in the message */ @@ -280,7 +280,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; uint64_t len; /* Length of a string in the message */ @@ -475,7 +475,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_link_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; uint64_t name_len; /* Length of name */ @@ -611,7 +611,7 @@ H5O_link_free(void *_mesg) *------------------------------------------------------------------------- */ herr_t -H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) +H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -686,8 +686,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, - hbool_t *deleted, const H5O_copy_t *cpy_info, void UNUSED *udata) +H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, + hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -722,9 +722,9 @@ H5O_link_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, *------------------------------------------------------------------------- */ static void * -H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_dst, - hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, - H5O_copy_t UNUSED *cpy_info, void UNUSED *udata, hid_t UNUSED dxpl_id) +H5O_link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_ATTR_UNUSED *file_dst, + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) { H5O_link_t *link_src = (H5O_link_t *)native_src; void *ret_value; /* Return value */ @@ -764,7 +764,7 @@ done: */ static herr_t H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_link_t *link_src = (const H5O_link_t *)mesg_src; @@ -806,7 +806,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_link_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; diff --git a/src/H5Omtime.c b/src/H5Omtime.c index c9375f9..63ba152 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -122,8 +122,8 @@ H5FL_DEFINE(time_t); *------------------------------------------------------------------------- */ static void * -H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ @@ -178,8 +178,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { time_t *mesg, the_time; int i; @@ -265,7 +265,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_new_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; @@ -307,7 +307,7 @@ H5O_mtime_new_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; struct tm *tm; @@ -393,7 +393,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_mtime_new_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg) +H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -426,7 +426,7 @@ H5O_mtime_new_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const *------------------------------------------------------------------------- */ static size_t -H5O_mtime_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg) +H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -454,7 +454,7 @@ H5O_mtime_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_reset(void UNUSED *_mesg) +H5O_mtime_reset(void H5_ATTR_UNUSED *_mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -505,7 +505,7 @@ H5O_mtime_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth) { const time_t *mesg = (const time_t *)_mesg; diff --git a/src/H5Oname.c b/src/H5Oname.c index 5ca05e1..2cd9e72 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -84,8 +84,8 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_name_t *mesg; void *ret_value; /* Return value */ @@ -131,7 +131,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_name_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; @@ -220,7 +220,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_name_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void *_mesg) +H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; size_t ret_value; @@ -286,7 +286,7 @@ H5O_name_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_name_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O_name_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; diff --git a/src/H5Opline.c b/src/H5Opline.c index 0a0f12a..b79a73c 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -109,8 +109,8 @@ H5FL_DEFINE(H5O_pline_t); *------------------------------------------------------------------------- */ static void * -H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_pline_t *pline = NULL; /* Pipeline message */ H5Z_filter_info_t *filter; /* Filter to decode */ @@ -237,7 +237,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_pline_encode(H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg) +H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) { const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message to encode */ const H5Z_filter_info_t *filter; /* Filter to encode */ @@ -430,7 +430,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_pline_size(const H5F_t UNUSED *f, const void *mesg) +H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) { const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message */ size_t i; /* Local index variable */ @@ -566,8 +566,8 @@ H5O_pline_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_pline_pre_copy_file(H5F_t UNUSED *file_src, const void *mesg_src, - hbool_t UNUSED *deleted, const H5O_copy_t UNUSED *cpy_info, void *_udata) +H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, + hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata) { const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source datatype */ H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */ @@ -606,7 +606,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_pline_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE *stream, +H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth) { const H5O_pline_t *pline = (const H5O_pline_t *)mesg; diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index 399c8da..f5c7e25 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -90,8 +90,8 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); *------------------------------------------------------------------------- */ static void * -H5O_refcount_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_refcount_t *refcount = NULL; /* Reference count */ void *ret_value; /* Return value */ @@ -138,7 +138,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; @@ -216,8 +216,8 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_refcount_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, - const void UNUSED *_mesg) +H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, + const void H5_ATTR_UNUSED *_mesg) { size_t ret_value; /* Return value */ @@ -271,8 +271,8 @@ H5O_refcount_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, - hbool_t *deleted, const H5O_copy_t UNUSED *cpy_info, void UNUSED *udata) +H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, + hbool_t *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -303,7 +303,7 @@ H5O_refcount_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_refcount_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_refcount_t *refcount = (const H5O_refcount_t *) _mesg; diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 875cd56..8d357c2 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -111,8 +111,8 @@ H5FL_ARR_EXTERN(hsize_t); within this function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ void *ret_value; @@ -442,8 +442,8 @@ H5O_sdspace_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_sdspace_pre_copy_file(H5F_t UNUSED *file_src, const void *mesg_src, - hbool_t UNUSED *deleted, const H5O_copy_t UNUSED *cpy_info, void *_udata) +H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, + hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata) { const H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */ H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ @@ -495,7 +495,7 @@ done: parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, +H5O_sdspace_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *mesg, FILE * stream, int indent, int fwidth) { const H5S_extent_t *sdim = (const H5S_extent_t *)mesg; diff --git a/src/H5Oshared.c b/src/H5Oshared.c index e4a51ee..c5c088a 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -589,8 +589,8 @@ done: herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, - hbool_t UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, - void UNUSED *udata, hid_t dxpl_id) + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, + void H5_ATTR_UNUSED *udata, hid_t dxpl_id) { const H5O_shared_t *shared_src = (const H5O_shared_t *)_native_src; /* Alias to shared info in native source */ H5O_shared_t *shared_dst = (H5O_shared_t *)_native_dst; /* Alias to shared info in native destination message */ diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 2575856..deb10ab 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -76,8 +76,8 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_shmesg_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_shmesg_table_t *mesg; /* Native message */ void *ret_value; /* Return value */ @@ -117,7 +117,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_shmesg_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; @@ -192,7 +192,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_shmesg_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED *_mesg) +H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value; @@ -222,7 +222,7 @@ H5O_shmesg_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED *------------------------------------------------------------------------- */ static herr_t -H5O_shmesg_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O_shmesg_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; diff --git a/src/H5Ostab.c b/src/H5Ostab.c index f7c77bc..133a3e2 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -97,8 +97,8 @@ H5FL_DEFINE_STATIC(H5O_stab_t); *------------------------------------------------------------------------- */ static void * -H5O_stab_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, - unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) +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) { H5O_stab_t *stab = NULL; void *ret_value; /* Return value */ @@ -142,7 +142,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_stab_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O_stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; @@ -220,7 +220,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_stab_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED *_mesg) +H5O_stab_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value; /* Return value */ @@ -273,7 +273,7 @@ H5O_stab_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *mesg) +H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *mesg) { herr_t ret_value = SUCCEED; /* Return value */ @@ -308,8 +308,8 @@ done: */ static void * H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, - H5O_copy_t UNUSED *cpy_info, void *_udata, hid_t dxpl_id) + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata, hid_t dxpl_id) { H5O_stab_t *stab_src = (H5O_stab_t *) native_src; H5O_stab_t *stab_dst = NULL; @@ -372,7 +372,7 @@ done: */ static herr_t H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_stab_t *stab_src = (const H5O_stab_t *)mesg_src; @@ -425,7 +425,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_stab_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, +H5O_stab_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 949cefa..9bf58e4 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -256,7 +256,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__dcrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void UNUSED *copy_data) +H5P__dcrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void H5_ATTR_UNUSED *copy_data) { H5O_fill_t src_fill, dst_fill; /* Source & destination fill values */ H5O_efl_t src_efl, dst_efl; /* Source & destination external file lists */ @@ -370,7 +370,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__dcrt_close(hid_t dcpl_id, void UNUSED *close_data) +H5P__dcrt_close(hid_t dcpl_id, void H5_ATTR_UNUSED *close_data) { H5O_fill_t fill; /* Fill value */ H5O_efl_t efl; /* External file list */ @@ -562,7 +562,7 @@ done: *------------------------------------------------------------------------- */ static int -H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t UNUSED size) +H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t H5_ATTR_UNUSED size) { const H5O_layout_t *layout1 = (const H5O_layout_t *)_layout1, /* Create local aliases for values */ *layout2 = (const H5O_layout_t *)_layout2; @@ -794,7 +794,7 @@ done: *------------------------------------------------------------------------- */ int -H5P_fill_value_cmp(const void *_fill1, const void *_fill2, size_t UNUSED size) +H5P_fill_value_cmp(const void *_fill1, const void *_fill2, size_t H5_ATTR_UNUSED size) { const H5O_fill_t *fill1 = (const H5O_fill_t *)_fill1, /* Create local aliases for values */ *fill2 = (const H5O_fill_t *)_fill2; @@ -1031,7 +1031,7 @@ done: *------------------------------------------------------------------------- */ static int -H5P__dcrt_ext_file_list_cmp(const void *_efl1, const void *_efl2, size_t UNUSED size) +H5P__dcrt_ext_file_list_cmp(const void *_efl1, const void *_efl2, size_t H5_ATTR_UNUSED size) { const H5O_efl_t *efl1 = (const H5O_efl_t *)_efl1, /* Create local aliases for values */ *efl2 = (const H5O_efl_t *)_efl2; diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index ab96c4e..b5bc720 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -777,7 +777,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__dxfr_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) +H5P__dxfr_xform_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { herr_t ret_value = SUCCEED; /* Return value */ @@ -809,7 +809,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__dxfr_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value) +H5P__dxfr_xform_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { herr_t ret_value = SUCCEED; /* Return value */ @@ -839,7 +839,7 @@ done: *------------------------------------------------------------------------- */ static int -H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t UNUSED size) +H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t H5_ATTR_UNUSED size) { const H5Z_data_xform_t * const *xform1 = (const H5Z_data_xform_t * const *)_xform1; /* Create local aliases for values */ const H5Z_data_xform_t * const *xform2 = (const H5Z_data_xform_t * const *)_xform2; /* Create local aliases for values */ @@ -894,7 +894,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__dxfr_xform_close(const char UNUSED *name, size_t UNUSED size, void *value) +H5P__dxfr_xform_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7a44e86..79726e1 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -445,7 +445,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P_facc_create(hid_t fapl_id, void UNUSED *copy_data) +H5P_facc_create(hid_t fapl_id, void H5_ATTR_UNUSED *copy_data) { hid_t driver_id; H5P_genplist_t *plist; /* Property list */ @@ -495,7 +495,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P_facc_copy(hid_t dst_fapl_id, hid_t src_fapl_id, void UNUSED *copy_data) +H5P_facc_copy(hid_t dst_fapl_id, hid_t src_fapl_id, void H5_ATTR_UNUSED *copy_data) { hid_t driver_id; H5P_genplist_t *src_plist; /* Source property list */ @@ -546,7 +546,7 @@ done: */ /* ARGSUSED */ herr_t -H5P_facc_close(hid_t fapl_id, void UNUSED *close_data) +H5P_facc_close(hid_t fapl_id, void H5_ATTR_UNUSED *close_data) { hid_t driver_id; H5P_genplist_t *plist; /* Property list */ @@ -1117,7 +1117,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pset_cache(hid_t plist_id, int UNUSED mdc_nelmts, +H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ @@ -2294,7 +2294,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_file_image_info_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) +H5P_file_image_info_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { H5FD_file_image_info_t info; /* Image info struct */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2348,7 +2348,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_file_image_info_copy(const char UNUSED *name, size_t UNUSED size, void *value) +H5P_file_image_info_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2423,7 +2423,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_file_image_info_close(const char UNUSED *name, size_t UNUSED size, void *value) +H5P_file_image_info_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2473,7 +2473,7 @@ done: *------------------------------------------------------------------------- */ static int -H5P__facc_cache_config_cmp(const void *_config1, const void *_config2, size_t UNUSED size) +H5P__facc_cache_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size) { const H5AC_cache_config_t *config1 = (const H5AC_cache_config_t *)_config1; /* Create local aliases for values */ const H5AC_cache_config_t *config2 = (const H5AC_cache_config_t *)_config2; /* Create local aliases for values */ diff --git a/src/H5Pint.c b/src/H5Pint.c index c71a39b..e25b686 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -1307,7 +1307,7 @@ H5P_free_prop(H5P_genprop_t *prop) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P_free_prop_cb(void *item, void UNUSED *key, void *op_data) +H5P_free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) { H5P_genprop_t *tprop=(H5P_genprop_t *)item; /* Temporary pointer to property */ hbool_t make_cb = *(hbool_t *)op_data; /* Whether to make property 'close' callback */ @@ -1347,7 +1347,7 @@ H5P_free_prop_cb(void *item, void UNUSED *key, void *op_data) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P_free_del_name_cb(void *item, void UNUSED *key, void UNUSED *op_data) +H5P_free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) { char *del_name=(char *)item; /* Temporary pointer to deleted name */ @@ -1477,7 +1477,7 @@ H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) REVISION LOG --------------------------------------------------------------------------*/ static int -H5P_open_class_path_cb(void *_obj, hid_t UNUSED id, void *_key) +H5P_open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key) { H5P_genclass_t *obj = (H5P_genclass_t *)_obj; /* Pointer to the class for this ID */ H5P_check_class_t *key = (H5P_check_class_t *)_key; /* Pointer to key information for comparison */ @@ -1984,8 +1984,8 @@ done: void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. - size_t *size; IN: UNUSED - void *value; IN: UNUSED + size_t *size; IN: H5_ATTR_UNUSED + void *value; IN: H5_ATTR_UNUSED void *plist; IN: The property list structure. uint8_t **buf; IN: The buffer that holds the binary encoded property; The 'decode' routine decodes the binary buffer passed in and transforms it into @@ -2162,8 +2162,8 @@ done: void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. - size_t *size; IN: UNUSED - void *value; IN: UNUSED + size_t *size; IN: H5_ATTR_UNUSED + void *value; IN: H5_ATTR_UNUSED void *plist; IN: The property list structure. uint8_t **buf; IN: The buffer that holds the binary encoded property; The 'decode' routine decodes the binary buffer passed in and transforms it into @@ -2403,8 +2403,8 @@ done: void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. - size_t *size; IN: UNUSED - void *value; IN: UNUSED + size_t *size; IN: H5_ATTR_UNUSED + void *value; IN: H5_ATTR_UNUSED void *plist; IN: The property list structure. uint8_t **buf; IN: The buffer that holds the binary encoded property; The 'decode' routine decodes the binary buffer passed in and transforms it into diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 0d39b6c..87b96b6 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -344,7 +344,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P_lacc_elink_fapl_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) +H5P_lacc_elink_fapl_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { hid_t l_fapl_id; herr_t ret_value = SUCCEED; @@ -378,7 +378,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P_lacc_elink_fapl_copy(const char UNUSED *name, size_t UNUSED size, void *value) +H5P_lacc_elink_fapl_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { hid_t l_fapl_id; herr_t ret_value = SUCCEED; @@ -419,7 +419,7 @@ done: *------------------------------------------------------------------------- */ static int -H5P_lacc_elink_fapl_cmp(const void *value1, const void *value2, size_t UNUSED size) +H5P_lacc_elink_fapl_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) { const hid_t *fapl1 = (const hid_t *)value1; const hid_t *fapl2 = (const hid_t *)value2; @@ -466,7 +466,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P_lacc_elink_fapl_close(const char UNUSED *name, size_t UNUSED size, void *value) +H5P_lacc_elink_fapl_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { hid_t l_fapl_id; herr_t ret_value = SUCCEED; @@ -611,7 +611,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P_lacc_elink_pref_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) +H5P_lacc_elink_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 @@ -637,7 +637,7 @@ H5P_lacc_elink_pref_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UN */ /* ARGSUSED */ static herr_t -H5P_lacc_elink_pref_copy(const char UNUSED *name, size_t UNUSED size, void *value) +H5P_lacc_elink_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -664,7 +664,7 @@ H5P_lacc_elink_pref_copy(const char UNUSED *name, size_t UNUSED size, void *valu *------------------------------------------------------------------------- */ static int -H5P_lacc_elink_pref_cmp(const void *value1, const void *value2, size_t UNUSED size) +H5P_lacc_elink_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; @@ -698,7 +698,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P_lacc_elink_pref_close(const char UNUSED *name, size_t UNUSED size, void *value) +H5P_lacc_elink_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 37beb90..2740aad 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -203,7 +203,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__ocrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void UNUSED *copy_data) +H5P__ocrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void H5_ATTR_UNUSED *copy_data) { H5O_pline_t src_pline, dst_pline; /* Source & destination pipelines */ H5P_genplist_t *src_plist; /* Pointer to source property list */ @@ -252,7 +252,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__ocrt_close(hid_t dcpl_id, void UNUSED *close_data) +H5P__ocrt_close(hid_t dcpl_id, void H5_ATTR_UNUSED *close_data) { H5O_pline_t pline; /* I/O pipeline */ H5P_genplist_t *plist; /* Property list */ @@ -1662,7 +1662,7 @@ done: *------------------------------------------------------------------------- */ static int -H5P__ocrt_pipeline_cmp(const void *_pline1, const void *_pline2, size_t UNUSED size) +H5P__ocrt_pipeline_cmp(const void *_pline1, const void *_pline2, size_t H5_ATTR_UNUSED size) { const H5O_pline_t *pline1 = (const H5O_pline_t *)_pline1, /* Create local aliases for values */ *pline2 = (const H5O_pline_t *)_pline2; diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index fd4d968..45ba778 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -353,7 +353,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__ocpy_merge_comm_dt_list_copy(const char UNUSED *name, size_t UNUSED size, +H5P__ocpy_merge_comm_dt_list_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { const H5O_copy_dtype_merge_list_t *src_dt_list; /* Source merge named datatype lists */ @@ -423,7 +423,7 @@ done: */ static int H5P__ocpy_merge_comm_dt_list_cmp(const void *_dt_list1, const void *_dt_list2, - size_t UNUSED size) + size_t H5_ATTR_UNUSED size) { const H5O_copy_dtype_merge_list_t *dt_list1 = *(H5O_copy_dtype_merge_list_t * const *)_dt_list1, /* Create local aliases for values */ *dt_list2 = *(H5O_copy_dtype_merge_list_t * const *)_dt_list2; @@ -472,7 +472,7 @@ done: */ /* ARGSUSED */ static herr_t -H5P__ocpy_merge_comm_dt_list_close(const char UNUSED *name, size_t UNUSED size, void *value) +H5P__ocpy_merge_comm_dt_list_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { FUNC_ENTER_STATIC_NOERR diff --git a/src/H5SM.c b/src/H5SM.c index 62efb50..abdb109 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -2240,7 +2240,7 @@ done: */ static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - unsigned UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_read_udata_t *udata = (H5SM_read_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index daa1e4f..e18e9fb 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -195,8 +195,8 @@ H5SM_bt2_store(void *native, const void *udata) *------------------------------------------------------------------------- */ static herr_t -H5SM_bt2_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, - int indent, int fwidth, const void *record, const void UNUSED *_udata) +H5SM_bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, + int indent, int fwidth, const void *record, const void H5_ATTR_UNUSED *_udata) { const H5SM_sohm_t *sohm = (const H5SM_sohm_t *)record; @@ -231,7 +231,7 @@ H5SM_bt2_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, *------------------------------------------------------------------------- */ static void * -H5SM_bt2_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) +H5SM_bt2_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr) { H5SM_bt2_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 2e69899..98b5213 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -73,7 +73,7 @@ static H5SM_list_t *H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void * static herr_t H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_list_t *list); static herr_t H5SM_list_dest(H5F_t *f, H5SM_list_t* list); static herr_t H5SM_list_clear(H5F_t *f, H5SM_list_t *list, hbool_t destroy); -static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t UNUSED *list, size_t *size_ptr); +static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t H5_ATTR_UNUSED *list, size_t *size_ptr); /*********************/ @@ -127,7 +127,7 @@ const H5AC_class_t H5AC_SOHM_LIST[1] = {{ *------------------------------------------------------------------------- */ static H5SM_master_table_t * -H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) +H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udata) { H5SM_master_table_t *table = NULL; H5WB_t *wb = NULL; /* Wrapped buffer for table data */ @@ -369,7 +369,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_table_dest(H5F_t UNUSED *f, H5SM_master_table_t* table) +H5SM_table_dest(H5F_t H5_ATTR_UNUSED *f, H5SM_master_table_t* table) { herr_t ret_value = SUCCEED; /* Return value */ @@ -437,7 +437,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_table_size(const H5F_t UNUSED *f, const H5SM_master_table_t *table, size_t *size_ptr) +H5SM_table_size(const H5F_t H5_ATTR_UNUSED *f, const H5SM_master_table_t *table, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -740,7 +740,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_list_size(const H5F_t UNUSED *f, const H5SM_list_t *list, size_t *size_ptr) +H5SM_list_size(const H5F_t H5_ATTR_UNUSED *f, const H5SM_list_t *list, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index a9a58a4..d2dff47 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -125,7 +125,7 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) */ static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - unsigned UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_compare_udata_t *udata = (H5SM_compare_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; diff --git a/src/H5Sall.c b/src/H5Sall.c index 1105915..7eab8b3 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -255,7 +255,7 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_iter_has_next_block (const H5S_sel_iter_t UNUSED *iter) +H5S_all_iter_has_next_block (const H5S_sel_iter_t H5_ATTR_UNUSED *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -319,7 +319,7 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_iter_next_block(H5S_sel_iter_t UNUSED *iter) +H5S_all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -348,7 +348,7 @@ H5S_all_iter_next_block(H5S_sel_iter_t UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_iter_release (H5S_sel_iter_t UNUSED * iter) +H5S_all_iter_release (H5S_sel_iter_t H5_ATTR_UNUSED * iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -411,7 +411,7 @@ H5S_all_release(H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection) +H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -446,7 +446,7 @@ H5S_all_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_valid (const H5S_t UNUSED *space) +H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -476,7 +476,7 @@ H5S_all_is_valid (const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S_all_serial_size (const H5S_t UNUSED *space) +H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -553,7 +553,7 @@ H5S_all_serialize (const H5S_t *space, uint8_t **p) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_deserialize(H5S_t *space, const uint8_t UNUSED **p) +H5S_all_deserialize(H5S_t *space, const uint8_t H5_ATTR_UNUSED **p) { herr_t ret_value = SUCCEED; /* return value */ @@ -643,7 +643,7 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_offset(const H5S_t UNUSED *space, hsize_t *offset) +H5S_all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -676,7 +676,7 @@ H5S_all_offset(const H5S_t UNUSED *space, hsize_t *offset) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_contiguous(const H5S_t UNUSED *space) +H5S_all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -705,7 +705,7 @@ H5S_all_is_contiguous(const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_single(const H5S_t UNUSED *space) +H5S_all_is_single(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -735,7 +735,7 @@ H5S_all_is_single(const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_regular(const H5S_t UNUSED *space) +H5S_all_is_regular(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -765,7 +765,7 @@ H5S_all_is_regular(const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) +H5S_all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -791,7 +791,7 @@ H5S_all_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) *------------------------------------------------------------------------- */ static herr_t -H5S_all_project_scalar(const H5S_t UNUSED *space, hsize_t *offset) +H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -955,8 +955,8 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_iter_t *iter, - size_t UNUSED maxseq, size_t maxelem, size_t *nseq, size_t *nelem, +H5S_all_get_seq_list(const H5S_t H5_ATTR_UNUSED *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter, + size_t H5_ATTR_UNUSED maxseq, size_t maxelem, size_t *nseq, size_t *nelem, hsize_t *off, size_t *len) { size_t elem_used; /* The number of elements used */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 0d5e630..51b5ab6 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -8716,7 +8716,7 @@ H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter, REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t *iter, +H5S_hyper_get_seq_list(const H5S_t *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter, size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem, hsize_t *off, size_t *len) { diff --git a/src/H5Snone.c b/src/H5Snone.c index c5ec2de..a67880e 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -114,7 +114,7 @@ static const H5S_sel_iter_class_t H5S_sel_iter_none[1] = {{ *------------------------------------------------------------------------- */ static herr_t -H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t UNUSED *space) +H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -145,7 +145,7 @@ H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t UNUSED *space) *------------------------------------------------------------------------- */ static herr_t -H5S_none_iter_coords(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *coords) +H5S_none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED *coords) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -173,7 +173,7 @@ H5S_none_iter_coords(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *coords) *------------------------------------------------------------------------- */ static herr_t -H5S_none_iter_block(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *start, hsize_t UNUSED *end) +H5S_none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED *start, hsize_t H5_ATTR_UNUSED *end) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -201,7 +201,7 @@ H5S_none_iter_block(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *start, hs *------------------------------------------------------------------------- */ static hsize_t -H5S_none_iter_nelmts(const H5S_sel_iter_t UNUSED *iter) +H5S_none_iter_nelmts(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -230,7 +230,7 @@ H5S_none_iter_nelmts(const H5S_sel_iter_t UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_none_iter_has_next_block(const H5S_sel_iter_t UNUSED *iter) +H5S_none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -260,7 +260,7 @@ H5S_none_iter_has_next_block(const H5S_sel_iter_t UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_iter_next(H5S_sel_iter_t UNUSED *iter, size_t UNUSED nelem) +H5S_none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED nelem) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -290,7 +290,7 @@ H5S_none_iter_next(H5S_sel_iter_t UNUSED *iter, size_t UNUSED nelem) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_iter_next_block(H5S_sel_iter_t UNUSED *iter) +H5S_none_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -319,7 +319,7 @@ H5S_none_iter_next_block(H5S_sel_iter_t UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_iter_release(H5S_sel_iter_t UNUSED * iter) +H5S_none_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED * iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -348,7 +348,7 @@ H5S_none_iter_release(H5S_sel_iter_t UNUSED * iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_release(H5S_t UNUSED * space) +H5S_none_release(H5S_t H5_ATTR_UNUSED * space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -379,7 +379,7 @@ H5S_none_release(H5S_t UNUSED * space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection) +H5S_none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -414,7 +414,7 @@ H5S_none_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selectio REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_none_is_valid(const H5S_t UNUSED *space) +H5S_none_is_valid(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -444,7 +444,7 @@ H5S_none_is_valid(const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S_none_serial_size(const H5S_t UNUSED *space) +H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -519,7 +519,7 @@ H5S_none_serialize(const H5S_t *space, uint8_t **p) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_deserialize(H5S_t *space, const uint8_t UNUSED **p) +H5S_none_deserialize(H5S_t *space, const uint8_t H5_ATTR_UNUSED **p) { herr_t ret_value = SUCCEED; /* return value */ @@ -564,7 +564,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_bounds(const H5S_t UNUSED *space, hsize_t UNUSED *start, hsize_t UNUSED *end) +H5S_none_bounds(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *start, hsize_t H5_ATTR_UNUSED *end) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -597,7 +597,7 @@ H5S_none_bounds(const H5S_t UNUSED *space, hsize_t UNUSED *start, hsize_t UNUSED REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_offset(const H5S_t UNUSED *space, hsize_t UNUSED *offset) +H5S_none_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *offset) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -627,7 +627,7 @@ H5S_none_offset(const H5S_t UNUSED *space, hsize_t UNUSED *offset) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_none_is_contiguous(const H5S_t UNUSED *space) +H5S_none_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -656,7 +656,7 @@ H5S_none_is_contiguous(const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_none_is_single(const H5S_t UNUSED *space) +H5S_none_is_single(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -686,7 +686,7 @@ H5S_none_is_single(const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_none_is_regular(const H5S_t UNUSED *space) +H5S_none_is_regular(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -716,7 +716,7 @@ H5S_none_is_regular(const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) +H5S_none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -741,7 +741,7 @@ H5S_none_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) *------------------------------------------------------------------------- */ static herr_t -H5S_none_project_scalar(const H5S_t UNUSED *space, hsize_t UNUSED *offset) +H5S_none_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *offset) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -900,9 +900,9 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_iter_t UNUSED *iter, - size_t UNUSED maxseq, size_t UNUSED maxelem, size_t *nseq, size_t *nelem, - hsize_t UNUSED *off, size_t UNUSED *len) +H5S_none_get_seq_list(const H5S_t H5_ATTR_UNUSED *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t H5_ATTR_UNUSED *iter, + size_t H5_ATTR_UNUSED maxseq, size_t H5_ATTR_UNUSED maxelem, size_t *nseq, size_t *nelem, + hsize_t H5_ATTR_UNUSED *off, size_t H5_ATTR_UNUSED *len) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 44e0510..20a60bb 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -355,7 +355,7 @@ H5S_point_iter_next_block(H5S_sel_iter_t *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_point_iter_release (H5S_sel_iter_t UNUSED * iter) +H5S_point_iter_release (H5S_sel_iter_t H5_ATTR_UNUSED * iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -602,7 +602,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_point_copy(H5S_t *dst, const H5S_t *src, hbool_t UNUSED share_selection) +H5S_point_copy(H5S_t *dst, const H5S_t *src, hbool_t H5_ATTR_UNUSED share_selection) { H5S_pnt_node_t *curr, *new_node, *new_tail; /* Point information nodes */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5T.c b/src/H5T.c index 2758395..906061e 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1348,7 +1348,7 @@ done: *------------------------------------------------------------------------- */ static int -H5T_unlock_cb(void *_dt, hid_t UNUSED id, void UNUSED *key) +H5T_unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED *key) { H5T_t *dt = (H5T_t *)_dt; diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 2e9dec0..752f2aa 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -376,7 +376,7 @@ H5T__get_array_dims(const H5T_t *dt, hsize_t dims[]) */ hid_t H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], - const int UNUSED perm[/* ndims */]) + const int H5_ATTR_UNUSED perm[/* ndims */]) { H5T_t *base; /* base datatype */ H5T_t *dt = NULL; /* new array datatype */ @@ -429,7 +429,7 @@ done: *------------------------------------------------------------------------- */ int -H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int UNUSED perm[]) +H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int H5_ATTR_UNUSED perm[]) { H5T_t *dt; /* Array datatype to query */ int ret_value; /* return value */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index b18f33f..81c947d 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -1039,10 +1039,10 @@ H5FL_BLK_DEFINE_STATIC(array_seq); *------------------------------------------------------------------------- */ herr_t -H5T__conv_noop(hid_t UNUSED src_id, hid_t UNUSED dst_id, H5T_cdata_t *cdata, - size_t UNUSED nelmts, size_t UNUSED buf_stride, - size_t UNUSED bkg_stride, void UNUSED *buf, - void UNUSED *background, hid_t UNUSED dxpl_id) +H5T__conv_noop(hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, H5T_cdata_t *cdata, + size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *buf, + void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1090,8 +1090,8 @@ done: herr_t H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *_buf, - void UNUSED *background, hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL; @@ -1509,8 +1509,8 @@ done: */ herr_t H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, - void UNUSED *background, hid_t UNUSED dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL; @@ -1614,8 +1614,8 @@ done: */ herr_t H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, - void UNUSED *background, hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *background, hid_t dxpl_id) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ @@ -2793,8 +2793,8 @@ done: */ herr_t H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, - void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ @@ -2990,8 +2990,8 @@ done: */ herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t UNUSED buf_stride, size_t UNUSED bkg_stride, void *_buf, - void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_t *src, *dst; /*src and dst datatypes */ H5T_t *src_parent; /*parent type for src */ @@ -3429,7 +3429,7 @@ done: herr_t H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, - void UNUSED *_bkg, hid_t dxpl_id) + void H5_ATTR_UNUSED *_bkg, hid_t dxpl_id) { H5T_path_t *tpath; /* Type conversion path */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ @@ -3590,7 +3590,7 @@ done: */ herr_t H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, hid_t dxpl_id) { H5T_t *src = NULL; /*source datatype */ @@ -4004,7 +4004,7 @@ done: */ herr_t H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, hid_t dxpl_id) { /* Traversal-related variables */ @@ -4574,8 +4574,8 @@ done: */ herr_t H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *buf, - void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_t *src=NULL; /*source datatype */ H5T_t *dst=NULL; /*destination datatype */ @@ -4811,8 +4811,8 @@ done: herr_t H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_su(SCHAR, UCHAR, signed char, unsigned char, -, -); } @@ -4837,8 +4837,8 @@ H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_us(UCHAR, SCHAR, unsigned char, signed char, -, SCHAR_MAX); } @@ -4863,8 +4863,8 @@ H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(SCHAR, SHORT, signed char, short, -, -); } @@ -4889,8 +4889,8 @@ H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(SCHAR, USHORT, signed char, unsigned short, -, -); } @@ -4915,8 +4915,8 @@ H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(UCHAR, SHORT, unsigned char, short, -, SHRT_MAX); } @@ -4941,8 +4941,8 @@ H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(UCHAR, USHORT, unsigned char, unsigned short, -, -); } @@ -4966,8 +4966,8 @@ H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(SCHAR, INT, signed char, int, -, -); } @@ -4991,8 +4991,8 @@ H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(SCHAR, UINT, signed char, unsigned, -, -); } @@ -5016,8 +5016,8 @@ H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(UCHAR, INT, unsigned char, int, -, INT_MAX); } @@ -5041,8 +5041,8 @@ H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(UCHAR, UINT, unsigned char, unsigned, -, -); } @@ -5066,8 +5066,8 @@ H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(SCHAR, LONG, signed char, long, -, -); } @@ -5092,8 +5092,8 @@ H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(SCHAR, ULONG, signed char, unsigned long, -, -); } @@ -5117,8 +5117,8 @@ H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(UCHAR, LONG, unsigned char, long, -, LONG_MAX); } @@ -5143,8 +5143,8 @@ H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(UCHAR, ULONG, unsigned char, unsigned long, -, -); } @@ -5169,8 +5169,8 @@ H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -); } @@ -5195,8 +5195,8 @@ H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -); } @@ -5221,8 +5221,8 @@ H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX); } @@ -5247,8 +5247,8 @@ H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -); } @@ -5273,8 +5273,8 @@ H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(SHORT, SCHAR, short, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -5299,8 +5299,8 @@ H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(SHORT, UCHAR, short, unsigned char, -, UCHAR_MAX); } @@ -5325,8 +5325,8 @@ H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX); } @@ -5351,8 +5351,8 @@ H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(USHORT, UCHAR, unsigned short, unsigned char, -, UCHAR_MAX); } @@ -5377,8 +5377,8 @@ H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -); } @@ -5403,8 +5403,8 @@ H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_us(USHORT, SHORT, unsigned short, short, -, SHRT_MAX); } @@ -5429,8 +5429,8 @@ H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(SHORT, INT, short, int, -, -); } @@ -5455,8 +5455,8 @@ H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(SHORT, UINT, short, unsigned, -, -); } @@ -5481,8 +5481,8 @@ H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(USHORT, INT, unsigned short, int, -, INT_MAX); } @@ -5507,8 +5507,8 @@ H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(USHORT, UINT, unsigned short, unsigned, -, -); } @@ -5533,8 +5533,8 @@ H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(SHORT, LONG, short, long, -, -); } @@ -5559,8 +5559,8 @@ H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(SHORT, ULONG, short, unsigned long, -, -); } @@ -5585,8 +5585,8 @@ H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(USHORT, LONG, unsigned short, long, -, LONG_MAX); } @@ -5611,8 +5611,8 @@ H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(USHORT, ULONG, unsigned short, unsigned long, -, -); } @@ -5637,8 +5637,8 @@ H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(SHORT, LLONG, short, long long, -, -); } @@ -5663,8 +5663,8 @@ H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -); } @@ -5689,8 +5689,8 @@ H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX); } @@ -5715,8 +5715,8 @@ H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -); } @@ -5741,8 +5741,8 @@ H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(INT, SCHAR, int, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -5767,8 +5767,8 @@ H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(INT, UCHAR, int, unsigned char, -, UCHAR_MAX); } @@ -5793,8 +5793,8 @@ H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(UINT, SCHAR, unsigned, signed char, -, SCHAR_MAX); } @@ -5819,8 +5819,8 @@ H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX); } @@ -5845,8 +5845,8 @@ H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(INT, SHORT, int, short, SHRT_MIN, SHRT_MAX); } @@ -5871,8 +5871,8 @@ H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(INT, USHORT, int, unsigned short, -, USHRT_MAX); } @@ -5897,8 +5897,8 @@ H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(UINT, SHORT, unsigned, short, -, SHRT_MAX); } @@ -5923,8 +5923,8 @@ H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(UINT, USHORT, unsigned, unsigned short, -, USHRT_MAX); } @@ -5948,8 +5948,8 @@ H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_su(INT, UINT, int, unsigned, -, -); } @@ -5973,8 +5973,8 @@ H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_us(UINT, INT, unsigned, int, -, INT_MAX); } @@ -5998,8 +5998,8 @@ H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(INT, LONG, int, long, -, -); } @@ -6023,8 +6023,8 @@ H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(INT, LONG, int, unsigned long, -, -); } @@ -6048,8 +6048,8 @@ H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(UINT, LONG, unsigned, long, -, LONG_MAX); } @@ -6073,8 +6073,8 @@ H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(UINT, ULONG, unsigned, unsigned long, -, -); } @@ -6098,8 +6098,8 @@ H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(INT, LLONG, int, long long, -, -); } @@ -6123,8 +6123,8 @@ H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -); } @@ -6148,8 +6148,8 @@ H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX); } @@ -6174,8 +6174,8 @@ H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -); } @@ -6199,8 +6199,8 @@ H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(LONG, SCHAR, long, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6224,8 +6224,8 @@ H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(LONG, UCHAR, long, unsigned char, -, UCHAR_MAX); } @@ -6250,8 +6250,8 @@ H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(ULONG, SCHAR, unsigned long, signed char, -, SCHAR_MAX); } @@ -6276,8 +6276,8 @@ H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(ULONG, UCHAR, unsigned long, unsigned char, -, UCHAR_MAX); } @@ -6301,8 +6301,8 @@ H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(LONG, SHORT, long, short, SHRT_MIN, SHRT_MAX); } @@ -6327,8 +6327,8 @@ H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(LONG, USHORT, long, unsigned short, -, USHRT_MAX); } @@ -6352,8 +6352,8 @@ H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(ULONG, SHORT, unsigned long, short, -, SHRT_MAX); } @@ -6378,8 +6378,8 @@ H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(ULONG, USHORT, unsigned long, unsigned short, -, USHRT_MAX); } @@ -6403,8 +6403,8 @@ H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(LONG, INT, long, int, INT_MIN, INT_MAX); } @@ -6428,8 +6428,8 @@ H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(LONG, UINT, long, unsigned, -, UINT_MAX); } @@ -6453,8 +6453,8 @@ H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(ULONG, INT, unsigned long, int, -, INT_MAX); } @@ -6478,8 +6478,8 @@ H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(ULONG, UINT, unsigned long, unsigned, -, UINT_MAX); } @@ -6503,8 +6503,8 @@ H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_su(LONG, ULONG, long, unsigned long, -, -); } @@ -6528,8 +6528,8 @@ H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_us(ULONG, LONG, unsigned long, long, -, LONG_MAX); } @@ -6553,8 +6553,8 @@ H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sS(LONG, LLONG, long, long long, -, -); } @@ -6579,8 +6579,8 @@ H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -); } @@ -6605,8 +6605,8 @@ H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX); } @@ -6631,8 +6631,8 @@ H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -); } @@ -6657,8 +6657,8 @@ H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6683,8 +6683,8 @@ H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX); } @@ -6709,8 +6709,8 @@ H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX); } @@ -6735,8 +6735,8 @@ H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX); } @@ -6761,8 +6761,8 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX); } @@ -6787,8 +6787,8 @@ H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX); } @@ -6813,8 +6813,8 @@ H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX); } @@ -6839,8 +6839,8 @@ H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX); } @@ -6864,8 +6864,8 @@ H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX); } @@ -6889,8 +6889,8 @@ H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX); } @@ -6914,8 +6914,8 @@ H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX); } @@ -6940,8 +6940,8 @@ H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX); } @@ -6965,8 +6965,8 @@ H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ herr_t H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, - void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX); } @@ -6991,8 +6991,8 @@ H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX); } @@ -7017,8 +7017,8 @@ H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX); } @@ -7043,8 +7043,8 @@ H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX); } @@ -7069,8 +7069,8 @@ H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -); } @@ -7095,8 +7095,8 @@ H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX); } @@ -7124,8 +7124,8 @@ H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_fF(FLOAT, DOUBLE, float, double, -, -); } @@ -7150,8 +7150,8 @@ H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_fF(FLOAT, LDOUBLE, float, long double, -, -); } @@ -7183,8 +7183,8 @@ H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ff(DOUBLE, FLOAT, double, float, -FLT_MAX, FLT_MAX); } @@ -7209,8 +7209,8 @@ H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_fF(DOUBLE, LDOUBLE, double, long double, -, -); } @@ -7236,8 +7236,8 @@ H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ff(LDOUBLE, FLOAT, long double, float, -FLT_MAX, FLT_MAX); } @@ -7263,8 +7263,8 @@ H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_Ff(LDOUBLE, DOUBLE, long double, double, -DBL_MAX, DBL_MAX); } @@ -7289,8 +7289,8 @@ H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -); } @@ -7314,8 +7314,8 @@ H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -); } @@ -7339,8 +7339,8 @@ H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -); } @@ -7364,8 +7364,8 @@ H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -); } @@ -7389,8 +7389,8 @@ H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -); } @@ -7414,8 +7414,8 @@ H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -); } @@ -7439,8 +7439,8 @@ H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(SHORT, FLOAT, short, float, -, -); } @@ -7464,8 +7464,8 @@ H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -); } @@ -7489,8 +7489,8 @@ H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); } @@ -7514,8 +7514,8 @@ H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -); } @@ -7539,8 +7539,8 @@ H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -); } @@ -7564,8 +7564,8 @@ H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -); } @@ -7589,8 +7589,8 @@ H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(INT, FLOAT, int, float, -, -); } @@ -7614,8 +7614,8 @@ H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(INT, DOUBLE, int, double, -, -); } @@ -7639,8 +7639,8 @@ H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -); } @@ -7664,8 +7664,8 @@ H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -); } @@ -7689,8 +7689,8 @@ H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -); } @@ -7714,8 +7714,8 @@ H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -); } @@ -7739,8 +7739,8 @@ H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(LONG, FLOAT, long, float, -, -); } @@ -7764,8 +7764,8 @@ H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(LONG, DOUBLE, long, double, -, -); } @@ -7789,8 +7789,8 @@ H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -); } @@ -7814,8 +7814,8 @@ H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -); } @@ -7839,8 +7839,8 @@ H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -); } @@ -7864,8 +7864,8 @@ H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -); } @@ -7889,8 +7889,8 @@ H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -); } @@ -7914,8 +7914,8 @@ H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -); } @@ -7939,8 +7939,8 @@ H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(LLONG, LDOUBLE, long long, long double, -, -); } @@ -7964,8 +7964,8 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -); } @@ -7989,8 +7989,8 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -); } @@ -8014,8 +8014,8 @@ H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long long, long double, -, -); } @@ -8039,8 +8039,8 @@ H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t H5T__conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8066,8 +8066,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); @@ -8093,8 +8093,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8120,8 +8120,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); @@ -8147,8 +8147,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8174,8 +8174,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); @@ -8201,8 +8201,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); @@ -8228,8 +8228,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); @@ -8255,8 +8255,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); @@ -8282,8 +8282,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); @@ -8309,8 +8309,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); @@ -8336,8 +8336,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); @@ -8363,8 +8363,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); @@ -8390,8 +8390,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); @@ -8417,8 +8417,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); @@ -8444,8 +8444,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); @@ -8471,8 +8471,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); @@ -8498,8 +8498,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); @@ -8525,8 +8525,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); @@ -8552,8 +8552,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); @@ -8579,8 +8579,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); @@ -8606,8 +8606,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); @@ -8633,8 +8633,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); @@ -8660,8 +8660,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); @@ -8687,8 +8687,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); @@ -8714,8 +8714,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); @@ -8741,8 +8741,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); @@ -8768,7 +8768,7 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, hid_t dxpl_id) { H5_GCC_DIAG_OFF(float-equal) @@ -8795,8 +8795,8 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, - hid_t UNUSED dxpl_id) + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, + hid_t H5_ATTR_UNUSED dxpl_id) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); @@ -8822,7 +8822,7 @@ H5_GCC_DIAG_ON(float-equal) herr_t H5T__conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, hid_t dxpl_id) { H5_GCC_DIAG_OFF(float-equal) @@ -8857,7 +8857,7 @@ H5_GCC_DIAG_ON(float-equal) */ herr_t H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, hid_t dxpl_id) { /* Traversal-related variables */ @@ -9443,7 +9443,7 @@ done: */ herr_t H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, hid_t dxpl_id) { /* Traversal-related variables */ diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 18e0f2a..717fc17 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -102,7 +102,7 @@ *------------------------------------------------------------------------- */ herr_t -H5T__print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) +H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/*in,out*/) { #ifdef H5T_DEBUG hsize_t nbytes; diff --git a/src/H5Toh.c b/src/H5Toh.c index 7961706..abf8a51 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -130,7 +130,7 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) { H5T_t *type = NULL; /* Datatype opened */ hid_t ret_value; /* Return value */ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 52a2cde..4ee3d0d 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -389,7 +389,7 @@ H5T_vlen_seq_mem_getptr(void *_vl) */ /* ARGSUSED */ static htri_t -H5T_vlen_seq_mem_isnull(const H5F_t UNUSED *f, void *_vl) +H5T_vlen_seq_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS const hvl_t *vl=(const hvl_t *)_vl; /* Pointer to the user's hvl_t information */ @@ -427,7 +427,7 @@ H5T_vlen_seq_mem_isnull(const H5F_t UNUSED *f, void *_vl) */ /* ARGSUSED */ static herr_t -H5T_vlen_seq_mem_read(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *buf, size_t len) +H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS const hvl_t *vl=(const hvl_t *)_vl; /* Pointer to the user's hvl_t information */ @@ -469,7 +469,7 @@ H5T_vlen_seq_mem_read(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *bu */ /* ARGSUSED */ static herr_t -H5T_vlen_seq_mem_write(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void UNUSED *_bg, size_t seq_len, size_t base_size) +H5T_vlen_seq_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) { hvl_t vl; /* Temporary hvl_t to use during operation */ size_t len; @@ -526,7 +526,7 @@ done: */ /* ARGSUSED */ static herr_t -H5T_vlen_seq_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void UNUSED *_bg) +H5T_vlen_seq_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void H5_ATTR_UNUSED *_bg) { hvl_t vl; /* Temporary hvl_t to use during operation */ @@ -630,7 +630,7 @@ H5T_vlen_str_mem_getptr(void *_vl) */ /* ARGSUSED */ static htri_t -H5T_vlen_str_mem_isnull(const H5F_t UNUSED *f, void *_vl) +H5T_vlen_str_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS char *s=*(char **)_vl; /* Pointer to the user's string information */ @@ -662,7 +662,7 @@ H5T_vlen_str_mem_isnull(const H5F_t UNUSED *f, void *_vl) */ /* ARGSUSED */ static herr_t -H5T_vlen_str_mem_read(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *buf, size_t len) +H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS char *s=*(char **)_vl; /* Pointer to the user's string information */ @@ -703,7 +703,7 @@ H5T_vlen_str_mem_read(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *bu */ /* ARGSUSED */ static herr_t -H5T_vlen_str_mem_write(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void UNUSED *_bg, size_t seq_len, size_t base_size) +H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) { char *t; /* Pointer to temporary buffer allocated */ size_t len; /* Maximum length of the string to copy */ @@ -750,7 +750,7 @@ done: */ /* ARGSUSED */ static herr_t -H5T_vlen_str_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void UNUSED *_bg) +H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void H5_ATTR_UNUSED *_bg) { char *t=NULL; /* Pointer to temporary buffer allocated */ @@ -806,7 +806,7 @@ H5T_vlen_disk_getlen(const void *_vl) */ /* ARGSUSED */ static void * -H5T_vlen_disk_getptr(void UNUSED *vl) +H5T_vlen_disk_getptr(void H5_ATTR_UNUSED *vl) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -864,7 +864,7 @@ H5T_vlen_disk_isnull(const H5F_t *f, void *_vl) */ /* ARGSUSED */ static herr_t -H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED len) +H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR_UNUSED len) { uint8_t *vl=(uint8_t *)_vl; /* Pointer to the user's hvl_t information */ H5HG_t hobjid; @@ -910,7 +910,7 @@ done: */ /* ARGSUSED */ static herr_t -H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED *vl_alloc_info, +H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR_UNUSED *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size) { uint8_t *vl = (uint8_t *)_vl; /*Pointer to the user's hvl_t information*/ @@ -1154,7 +1154,7 @@ done: --------------------------------------------------------------------------*/ /* ARGSUSED */ herr_t -H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *op_data) +H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void *op_data) { H5T_vlen_alloc_info_t *vl_alloc_info = (H5T_vlen_alloc_info_t *)op_data; /* VL allocation info from iterator */ H5T_t *dt; diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 5d1e0c2..33f2b28 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -125,7 +125,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, * *------------------------------------------------------------------------- */ -static H5_inline hsize_t UNUSED +static H5_inline hsize_t H5_ATTR_UNUSED H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; @@ -157,7 +157,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_inline htri_t UNUSED +static H5_inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ @@ -192,7 +192,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_inline htri_t UNUSED +static H5_inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value=TRUE; /* Return value */ @@ -229,7 +229,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_inline int UNUSED +static H5_inline int H5_ATTR_UNUSED H5VM_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ @@ -271,7 +271,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_inline int UNUSED +static H5_inline int H5_ATTR_UNUSED H5VM_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ @@ -308,7 +308,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_inline void UNUSED +static H5_inline void H5_ATTR_UNUSED H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) *v1++ += *v2++; @@ -355,7 +355,7 @@ static const unsigned char LogTable256[] = * *------------------------------------------------------------------------- */ -static H5_inline unsigned UNUSED +static H5_inline unsigned H5_ATTR_UNUSED H5VM_log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ @@ -403,7 +403,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = * *------------------------------------------------------------------------- */ -static H5_inline unsigned UNUSED +static H5_inline unsigned H5_ATTR_UNUSED H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG @@ -424,7 +424,7 @@ H5VM_log2_of2(uint32_t n) * *------------------------------------------------------------------------- */ -static H5_inline hsize_t UNUSED +static H5_inline hsize_t H5_ATTR_UNUSED H5VM_power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -449,7 +449,7 @@ H5VM_power2up(hsize_t n) * *------------------------------------------------------------------------- */ -static H5_inline unsigned UNUSED +static H5_inline unsigned H5_ATTR_UNUSED H5VM_limit_enc_size(uint64_t limit) { return (H5VM_log2_gen(limit) / 8) + 1; @@ -478,7 +478,7 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * *------------------------------------------------------------------------- */ -static H5_inline hbool_t UNUSED +static H5_inline hbool_t H5_ATTR_UNUSED H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ @@ -505,7 +505,7 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) * *------------------------------------------------------------------------- */ -static H5_inline void UNUSED +static H5_inline void H5_ATTR_UNUSED H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ diff --git a/src/H5Z.c b/src/H5Z.c index 5dca3b4..01f5216 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -506,7 +506,7 @@ done: *------------------------------------------------------------------------- */ static int -H5Z__check_unregister_group_cb(void *obj_ptr, hid_t UNUSED obj_id, void *key) +H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key) { hid_t ocpl_id = -1; H5Z_object_t *object = (H5Z_object_t *)key; @@ -559,7 +559,7 @@ done: *------------------------------------------------------------------------- */ static int -H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t UNUSED obj_id, void *key) +H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key) { hid_t ocpl_id = -1; H5Z_object_t *object = (H5Z_object_t *)key; @@ -610,7 +610,7 @@ done: *------------------------------------------------------------------------- */ static int -H5Z__flush_file_cb(void *obj_ptr, hid_t UNUSED obj_id, void UNUSED *key) +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 */ diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 2ee69d1..1877ddd 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -72,7 +72,7 @@ const H5Z_class2_t H5Z_FLETCHER32[1] = {{ */ /* ARGSUSED */ static size_t -H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned UNUSED cd_values[], +H5Z_filter_fletcher32 (unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *outbuf = NULL; /* Pointer to new buffer */ diff --git a/src/H5Znbit.c b/src/H5Znbit.c index ff3ead2..38610b6 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -128,7 +128,7 @@ static unsigned parms_index = 0; *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_nbit(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) +H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ htri_t ret_value = TRUE; /* Return value */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index cda0a11..673b9e0 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -689,7 +689,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_scaleoffset(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) +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 */ H5T_class_t dtype_class; /* Datatype's class */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 4138bf1..654a7d5 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -63,7 +63,7 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ */ /* ARGSUSED */ static herr_t -H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id) +H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t *type; /* Datatype */ diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 631667b..f0d08d8 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -77,7 +77,7 @@ H5Z_class2_t H5Z_SZIP[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_szip(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) +H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ unsigned dtype_size; /* Datatype's size (in bits) */ diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index 9b00bd9..52167d0 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -21,6 +21,26 @@ #ifndef H5API_ADPT_H #define H5API_ADPT_H +/* + * Does the compiler support the __attribute__(()) syntax? It's no + * big deal if we don't. + */ +#ifdef __cplusplus +# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ +#else /* __cplusplus */ +#ifdef H5_HAVE_ATTRIBUTE +# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z))) +# define H5_ATTR_UNUSED __attribute__((unused)) +# define H5_ATTR_NORETURN __attribute__((noreturn)) +#else +# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ +#endif +#endif /* __cplusplus */ + /* This will only be defined if HDF5 was built with CMake */ #ifdef H5_BUILT_AS_DYNAMIC_LIB diff --git a/src/H5detect.c b/src/H5detect.c index 5fa59d3..5daf883 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -488,7 +488,7 @@ precision (detected_t *d) *------------------------------------------------------------------------- */ static void -sigsegv_handler(int UNUSED signo) +sigsegv_handler(int H5_ATTR_UNUSED signo) { #if !defined(H5HAVE_SIGJMP) && defined(H5_HAVE_SIGPROCMASK) /* Use sigprocmask to unblock the signal if sigsetjmp/siglongjmp are not */ @@ -526,7 +526,7 @@ sigsegv_handler(int UNUSED signo) *------------------------------------------------------------------------- */ static void -sigbus_handler(int UNUSED signo) +sigbus_handler(int H5_ATTR_UNUSED signo) { #if !defined(H5HAVE_SIGJMP) && defined(H5_HAVE_SIGPROCMASK) /* Use sigprocmask to unblock the signal if sigsetjmp/siglongjmp are not */ @@ -562,7 +562,7 @@ sigbus_handler(int UNUSED signo) *------------------------------------------------------------------------- */ static void -sigill_handler(int UNUSED signo) +sigill_handler(int H5_ATTR_UNUSED signo) { #if !defined(H5HAVE_SIGJMP) && defined(H5_HAVE_SIGPROCMASK) /* Use sigprocmask to unblock the signal if sigsetjmp/siglongjmp are not */ diff --git a/src/H5private.h b/src/H5private.h index 0987ce9..f7a4171 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -280,16 +280,9 @@ */ #ifdef __cplusplus # define __attribute__(X) /*void*/ -# define UNUSED /*void*/ -# define NORETURN /*void*/ #else /* __cplusplus */ -#ifdef H5_HAVE_ATTRIBUTE -# define UNUSED __attribute__((unused)) -# define NORETURN __attribute__((noreturn)) -#else +#ifndef H5_HAVE_ATTRIBUTE # define __attribute__(X) /*void*/ -# define UNUSED /*void*/ -# define NORETURN /*void*/ #endif #endif /* __cplusplus */ diff --git a/test/app_ref.c b/test/app_ref.c index 611d255..3052df7 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -80,7 +80,7 @@ void Abrt_Handler (int sig); /* Handler for SIGABRT - prints the reference count on each id */ void -Abrt_Handler (int UNUSED sig) +Abrt_Handler (int H5_ATTR_UNUSED sig) { int i, n; diff --git a/test/cache.c b/test/cache.c index eb17fcc..8d6076a 100644 --- a/test/cache.c +++ b/test/cache.c @@ -17341,14 +17341,14 @@ check_check_evictions_enabled_err(void) hbool_t rpt_fcn_called = FALSE; enum H5C_resize_status rpt_status; -static void test_rpt_fcn(UNUSED H5C_t * cache_ptr, - UNUSED int32_t version, - UNUSED double hit_rate, +static void test_rpt_fcn(H5_ATTR_UNUSED H5C_t * cache_ptr, + H5_ATTR_UNUSED int32_t version, + H5_ATTR_UNUSED double hit_rate, enum H5C_resize_status status, - UNUSED size_t old_max_cache_size, - UNUSED size_t new_max_cache_size, - UNUSED size_t old_min_clean_size, - UNUSED size_t new_min_clean_size) + H5_ATTR_UNUSED size_t old_max_cache_size, + H5_ATTR_UNUSED size_t new_max_cache_size, + H5_ATTR_UNUSED size_t old_min_clean_size, + H5_ATTR_UNUSED size_t new_min_clean_size) { rpt_fcn_called = TRUE; rpt_status = status; diff --git a/test/cache_common.c b/test/cache_common.c index 7b1a158..cce87a9 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -365,7 +365,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = static herr_t clear(H5F_t * f, void * thing, hbool_t dest); static herr_t destroy(H5F_t * f, void * thing); static herr_t flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned UNUSED * flags_ptr); + haddr_t addr, void *thing, unsigned H5_ATTR_UNUSED * flags_ptr); static void * load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); static herr_t size(H5F_t * f, void * thing, size_t * size_ptr); static herr_t notify(H5C_notify_action_t action, void *thing); @@ -478,8 +478,8 @@ addr_to_type_and_index(haddr_t addr, */ herr_t -check_write_permitted(const H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, +check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, + hid_t H5_ATTR_UNUSED dxpl_id, hbool_t *write_permitted_ptr) { @@ -638,7 +638,7 @@ notify_clear(H5F_t * f, void * thing, hbool_t dest) */ herr_t -destroy(H5F_t UNUSED * f, +destroy(H5F_t H5_ATTR_UNUSED * f, void * thing) { int i; @@ -802,11 +802,11 @@ notify_dest(H5F_t * f, void * thing) herr_t flush(H5F_t *f, - hid_t UNUSED dxpl_id, + hid_t H5_ATTR_UNUSED dxpl_id, hbool_t dest, haddr_t #ifdef NDEBUG - UNUSED + H5_ATTR_UNUSED #endif /* NDEBUG */ addr, void *thing, @@ -980,10 +980,10 @@ notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, */ void * -load(H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, +load(H5F_t H5_ATTR_UNUSED *f, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, - void UNUSED *udata) + void H5_ATTR_UNUSED *udata) { int32_t type; int32_t idx; @@ -1110,7 +1110,7 @@ notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) */ herr_t -size(H5F_t UNUSED * f, +size(H5F_t H5_ATTR_UNUSED * f, void * thing, size_t * size_ptr) { diff --git a/test/dsets.c b/test/dsets.c index e9dd2ce..8055d27 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1224,7 +1224,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static htri_t -can_apply_bogus(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) +can_apply_bogus(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { if(H5Tequal(type_id,H5T_NATIVE_DOUBLE)) return 0; @@ -1250,9 +1250,9 @@ can_apply_bogus(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) *------------------------------------------------------------------------- */ static size_t -filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) +filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { return nbytes; } @@ -1274,7 +1274,7 @@ filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, *------------------------------------------------------------------------- */ static herr_t -set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id) +set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { unsigned add_on=0; /* Value to add to data going through */ unsigned flags; /* Filter flags */ @@ -1381,9 +1381,9 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts, *------------------------------------------------------------------------- */ static size_t -filter_bogus3(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t UNUSED nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) +filter_bogus3(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t H5_ATTR_UNUSED nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { return 0; } @@ -1477,8 +1477,8 @@ error: *------------------------------------------------------------------------- */ static H5Z_cb_return_t -filter_cb_cont(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, - void UNUSED *op_data) +filter_cb_cont(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNUSED buf_size, + void H5_ATTR_UNUSED *op_data) { if(H5Z_FILTER_FLETCHER32==filter) return H5Z_CB_CONT; @@ -1500,8 +1500,8 @@ filter_cb_cont(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, *------------------------------------------------------------------------- */ static H5Z_cb_return_t -filter_cb_fail(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, - void UNUSED *op_data) +filter_cb_fail(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNUSED buf_size, + void H5_ATTR_UNUSED *op_data) { if(H5Z_FILTER_FLETCHER32==filter) return H5Z_CB_FAIL; @@ -2069,7 +2069,7 @@ error: static herr_t test_filters(hid_t file, hid_t #ifndef H5_HAVE_FILTER_SZIP -UNUSED +H5_ATTR_UNUSED #endif /* H5_HAVE_FILTER_SZIP */ fapl) { @@ -5400,7 +5400,7 @@ error: static herr_t test_can_apply_szip(hid_t #ifndef H5_HAVE_FILTER_SZIP -UNUSED +H5_ATTR_UNUSED #endif /* H5_HAVE_FILTER_SZIP */ file) { @@ -6760,13 +6760,13 @@ error: #ifndef H5_NO_DEPRECATED_SYMBOLS /* Empty can_apply and set_local callbacks */ static htri_t -can_apply_deprec(hid_t UNUSED dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id) +can_apply_deprec(hid_t H5_ATTR_UNUSED dcpl_id, hid_t H5_ATTR_UNUSED type_id, hid_t H5_ATTR_UNUSED space_id) { return 1; } static herr_t -set_local_deprec(hid_t UNUSED dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id) +set_local_deprec(hid_t H5_ATTR_UNUSED dcpl_id, hid_t H5_ATTR_UNUSED type_id, hid_t H5_ATTR_UNUSED space_id) { return(SUCCEED); } @@ -7489,9 +7489,9 @@ static size_t filter_expand_factor_g = 0; *------------------------------------------------------------------------- */ static size_t -filter_expand(unsigned int flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t *buf_size, void UNUSED **buf) +filter_expand(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t *buf_size, void H5_ATTR_UNUSED **buf) { size_t ret_value = 0; @@ -8890,8 +8890,8 @@ error: *------------------------------------------------------------------------- */ static herr_t -gather_error_cb_fail(const void UNUSED *dst_buf, - size_t UNUSED dst_buf_bytes_used, void UNUSED *op_data) +gather_error_cb_fail(const void H5_ATTR_UNUSED *dst_buf, + size_t H5_ATTR_UNUSED dst_buf_bytes_used, void H5_ATTR_UNUSED *op_data) { return FAIL; } diff --git a/test/dt_arith.c b/test/dt_arith.c index c5b72d4..8ededc7 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -415,7 +415,7 @@ static int my_isinf(int endian, unsigned char *val, size_t size, *------------------------------------------------------------------------- */ static void -fpe_handler(int UNUSED signo) +fpe_handler(int H5_ATTR_UNUSED signo) { SKIPPED(); HDputs(" Test skipped due to SIGFPE."); @@ -488,7 +488,7 @@ reset_hdf5(void) *------------------------------------------------------------------------- */ static H5T_conv_ret_t -except_func(H5T_conv_except_t except_type, hid_t UNUSED src_id, hid_t UNUSED dst_id, void UNUSED *src_buf, +except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, void H5_ATTR_UNUSED *src_buf, void *dst_buf, void *user_data) { H5T_conv_ret_t ret = H5T_CONV_HANDLED; @@ -677,7 +677,7 @@ test_hard_query(void) *------------------------------------------------------------------------- */ static H5T_conv_ret_t -expt_handle(H5T_conv_except_t except_type, hid_t UNUSED src_id, hid_t UNUSED dst_id, void UNUSED *src_buf, +expt_handle(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, void H5_ATTR_UNUSED *src_buf, void *dst_buf, void *user_data) { signed char fill_value1 = 7; diff --git a/test/dtypes.c b/test/dtypes.c index b2783c3..59cf000 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -4814,10 +4814,10 @@ test_bitfield_funcs(void) *------------------------------------------------------------------------- */ static herr_t -convert_opaque(hid_t UNUSED st, hid_t UNUSED dt, H5T_cdata_t *cdata, - size_t UNUSED nelmts, size_t UNUSED buf_stride, - size_t UNUSED bkg_stride, void UNUSED *_buf, - void UNUSED *bkg, hid_t UNUSED dset_xfer_plid) +convert_opaque(hid_t H5_ATTR_UNUSED st, hid_t H5_ATTR_UNUSED dt, H5T_cdata_t *cdata, + size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *_buf, + void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dset_xfer_plid) { if (H5T_CONV_CONV==cdata->command) num_opaque_conversions_g++; return 0; @@ -5872,8 +5872,8 @@ typedef struct { } except_info_t; static H5T_conv_ret_t -conv_except(H5T_conv_except_t except_type, hid_t UNUSED src_id, hid_t UNUSED dst_id, - void UNUSED *src_buf, void UNUSED *dst_buf, void *_user_data) +conv_except(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, + void H5_ATTR_UNUSED *src_buf, void H5_ATTR_UNUSED *dst_buf, void *_user_data) { except_info_t *user_data = (except_info_t *)_user_data; diff --git a/test/earray.c b/test/earray.c index 2135281..8a355c8 100644 --- a/test/earray.c +++ b/test/earray.c @@ -624,7 +624,7 @@ error: *------------------------------------------------------------------------- */ static earray_test_t * -earray_cache_test_load(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, const void UNUSED *udata1, void UNUSED *udata2) +earray_cache_test_load(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr, const void H5_ATTR_UNUSED *udata1, void H5_ATTR_UNUSED *udata2) { /* Check arguments */ HDassert(f); @@ -651,7 +651,7 @@ earray_cache_test_load(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED add *------------------------------------------------------------------------- */ static herr_t -earray_cache_test_flush(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, hbool_t destroy, haddr_t UNUSED addr, earray_test_t *test, unsigned UNUSED * flags_ptr) +earray_cache_test_flush(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSED addr, earray_test_t *test, unsigned H5_ATTR_UNUSED * flags_ptr) { /* check arguments */ HDassert(f); @@ -722,7 +722,7 @@ error: *------------------------------------------------------------------------- */ herr_t -earray_cache_test_dest(H5F_t UNUSED *f, earray_test_t *test) +earray_cache_test_dest(H5F_t H5_ATTR_UNUSED *f, earray_test_t *test) { /* * Check arguments. @@ -787,7 +787,7 @@ error: *------------------------------------------------------------------------- */ static herr_t -earray_cache_test_size(const H5F_t UNUSED *f, const earray_test_t UNUSED *test, size_t *size_ptr) +earray_cache_test_size(const H5F_t H5_ATTR_UNUSED *f, const earray_test_t H5_ATTR_UNUSED *test, size_t *size_ptr) { /* check arguments */ HDassert(f); @@ -816,7 +816,7 @@ earray_cache_test_size(const H5F_t UNUSED *f, const earray_test_t UNUSED *test, *------------------------------------------------------------------------- */ static unsigned -test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t UNUSED *tparam) +test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSED *tparam) { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ @@ -1394,7 +1394,7 @@ test_flush_depend_cb(const void *_elmt, size_t nelmts, void *udata) *------------------------------------------------------------------------- */ static unsigned -test_flush_depend(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t UNUSED *tparam) +test_flush_depend(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSED *tparam) { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ @@ -1629,8 +1629,8 @@ typedef struct eiter_fw_t { *------------------------------------------------------------------------- */ static void * -eiter_fw_init(const H5EA_create_t UNUSED *cparam, const earray_test_param_t UNUSED *tparam, - hsize_t UNUSED cnt) +eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_param_t H5_ATTR_UNUSED *tparam, + hsize_t H5_ATTR_UNUSED cnt) { eiter_fw_t *eiter; /* Forward element iteration object */ @@ -2074,7 +2074,7 @@ typedef struct eiter_rnd_t { *------------------------------------------------------------------------- */ static void * -eiter_rnd_init(const H5EA_create_t UNUSED *cparam, const earray_test_param_t UNUSED *tparam, +eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_param_t H5_ATTR_UNUSED *tparam, hsize_t cnt) { eiter_rnd_t *eiter; /* Random element iteration object */ @@ -2227,7 +2227,7 @@ static const earray_iter_t ea_iter_rnd = { *------------------------------------------------------------------------- */ static void * -eiter_rnd2_init(const H5EA_create_t UNUSED *cparam, const earray_test_param_t UNUSED *tparam, +eiter_rnd2_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_param_t H5_ATTR_UNUSED *tparam, hsize_t cnt) { eiter_rnd_t *eiter; /* Random element iteration object */ @@ -2311,7 +2311,7 @@ typedef struct eiter_cyc_t { *------------------------------------------------------------------------- */ static void * -eiter_cyc_init(const H5EA_create_t UNUSED *cparam, const earray_test_param_t UNUSED *tparam, +eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_param_t H5_ATTR_UNUSED *tparam, hsize_t cnt) { eiter_cyc_t *eiter; /* Cyclic element iteration object */ diff --git a/test/error_test.c b/test/error_test.c index 0d945d2..e712d86 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -314,7 +314,7 @@ error: *------------------------------------------------------------------------- */ static herr_t -long_desc_cb(unsigned UNUSED n, const H5E_error2_t *err_desc, void *client_data) +long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *client_data) { char *real_desc = (char *)client_data; diff --git a/test/farray.c b/test/farray.c index 7a79aaa..4c18916 100644 --- a/test/farray.c +++ b/test/farray.c @@ -440,7 +440,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t UNUSED *tparam) +test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSED *tparam) { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ @@ -852,8 +852,8 @@ typedef struct fiter_fw_t { *------------------------------------------------------------------------- */ static void * -fiter_fw_init(const H5FA_create_t UNUSED *cparam, const farray_test_param_t UNUSED *tparam, - hsize_t UNUSED cnt) +fiter_fw_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_param_t H5_ATTR_UNUSED *tparam, + hsize_t H5_ATTR_UNUSED cnt) { fiter_fw_t *fiter; /* Forward element iteration object */ @@ -941,8 +941,8 @@ typedef struct fiter_rv_t { *------------------------------------------------------------------------- */ static void * -fiter_rv_init(const H5FA_create_t *cparam, const farray_test_param_t UNUSED *tparam, - hsize_t UNUSED cnt) +fiter_rv_init(const H5FA_create_t *cparam, const farray_test_param_t H5_ATTR_UNUSED *tparam, + hsize_t H5_ATTR_UNUSED cnt) { fiter_rv_t *fiter; /* Reverse element iteration object */ @@ -1008,7 +1008,7 @@ typedef struct fiter_rnd_t { *------------------------------------------------------------------------- */ static void * -fiter_rnd_init(const H5FA_create_t UNUSED *cparam, const farray_test_param_t UNUSED *tparam, +fiter_rnd_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_param_t H5_ATTR_UNUSED *tparam, hsize_t cnt) { fiter_rnd_t *fiter; /* Random element iteration object */ @@ -1126,7 +1126,7 @@ typedef struct fiter_cyc_t { *------------------------------------------------------------------------- */ static void * -fiter_cyc_init(const H5FA_create_t UNUSED *cparam, const farray_test_param_t UNUSED *tparam, +fiter_cyc_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_param_t H5_ATTR_UNUSED *tparam, hsize_t cnt) { fiter_cyc_t *fiter; /* Cyclic element iteration object */ diff --git a/test/fheap.c b/test/fheap.c index 6bcd8bf..fee6fdf 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1827,7 +1827,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam) +test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED *tparam) { hid_t file = -1; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ @@ -1944,7 +1944,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam) +test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED *tparam) { hid_t file = -1; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ @@ -2090,7 +2090,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam) +test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED *tparam) { hid_t file = -1; /* File ID */ hid_t file2 = -1; /* File ID */ @@ -2262,7 +2262,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam) +test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED *tparam) { hid_t file = -1; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ @@ -15884,9 +15884,9 @@ error: /* Custom filter used to verify that the filters are actually called and do not * just silently fail */ static hbool_t test_write_filter_called; -static size_t test_write_filter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED cd_values[], size_t nbytes, size_t UNUSED *buf_size, - void UNUSED **buf) +static size_t test_write_filter(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t H5_ATTR_UNUSED *buf_size, + void H5_ATTR_UNUSED **buf) { test_write_filter_called = TRUE; diff --git a/test/fillval.c b/test/fillval.c index e7ad521..c791504 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -1301,7 +1301,7 @@ error: *------------------------------------------------------------------------- */ static int -test_extend_release_integer(void UNUSED *_elmt) +test_extend_release_integer(void H5_ATTR_UNUSED *_elmt) { return 0; } /* end test_extend_release_integer() */ diff --git a/test/filter_fail.c b/test/filter_fail.c index 3dbb564..0b92abb 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -65,8 +65,8 @@ const H5Z_class2_t H5Z_FAIL_TEST[1] = {{ *------------------------------------------------------------------------- */ static size_t -filter_fail(unsigned int flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, +filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, size_t *buf_size, void **buf) { int *dst = (int*)(*buf); diff --git a/test/freespace.c b/test/freespace.c index 9ab0d75..1338ae7 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -85,8 +85,8 @@ typedef struct TEST_free_section_t { static herr_t TEST_sect_init_cls(H5FS_section_class_t *, void *); static herr_t TEST_sect_free(H5FS_section_info_t *_sect); -static herr_t TEST_sect_can_merge(const H5FS_section_info_t *, const H5FS_section_info_t *, void UNUSED *); -static herr_t TEST_sect_merging(H5FS_section_info_t *, H5FS_section_info_t *, void UNUSED *); +static herr_t TEST_sect_can_merge(const H5FS_section_info_t *, const H5FS_section_info_t *, void H5_ATTR_UNUSED *); +static herr_t TEST_sect_merging(H5FS_section_info_t *, H5FS_section_info_t *, void H5_ATTR_UNUSED *); static herr_t TEST_sect_can_shrink(const H5FS_section_info_t *, void *); static herr_t TEST_sect_shrinking(H5FS_section_info_t **, void *); @@ -223,7 +223,7 @@ TEST_sect_init_cls(H5FS_section_class_t *cls, void *_udata) */ static herr_t TEST_sect_can_merge(const H5FS_section_info_t *_sect1, - const H5FS_section_info_t *_sect2, void UNUSED *_udata) + const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const TEST_free_section_t *sect1 = (const TEST_free_section_t *)_sect1; const TEST_free_section_t *sect2 = (const TEST_free_section_t *)_sect2; @@ -246,7 +246,7 @@ TEST_sect_can_merge(const H5FS_section_info_t *_sect1, */ static herr_t TEST_sect_merging(H5FS_section_info_t *_sect1, H5FS_section_info_t *_sect2, - void UNUSED *_udata) + void H5_ATTR_UNUSED *_udata) { TEST_free_section_t *sect1 = (TEST_free_section_t *)_sect1; TEST_free_section_t *sect2 = (TEST_free_section_t *)_sect2; diff --git a/test/gen_filters.c b/test/gen_filters.c index b44339d..f506602 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -123,9 +123,9 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static size_t -filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) +filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { return nbytes; } diff --git a/test/h5test.c b/test/h5test.c index 693760c..d73c120 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -113,7 +113,7 @@ static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suf *------------------------------------------------------------------------- */ static herr_t -h5_errors(hid_t estack, void UNUSED *client_data) +h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data) { H5_FAILED(); H5Eprint2(estack, stdout); @@ -1222,8 +1222,8 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) *------------------------------------------------------------------------- */ static herr_t -h5_verify_cached_stabs_cb(hid_t oid, const char UNUSED *name, - const H5O_info_t *oinfo, void UNUSED *udata) +h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name, + const H5O_info_t *oinfo, void H5_ATTR_UNUSED *udata) { if(oinfo->type == H5O_TYPE_GROUP) return(H5G__verify_cached_stabs_test(oid)); diff --git a/test/links.c b/test/links.c index 0846c49..cfbc4a1 100644 --- a/test/links.c +++ b/test/links.c @@ -7320,8 +7320,8 @@ error: /* Callback functions for UD hard links. */ /* UD_hard_create increments the object's reference count */ static herr_t -UD_hard_create(const char UNUSED * link_name, hid_t loc_group, const void *udata, - size_t udata_size, hid_t UNUSED lcpl_id) +UD_hard_create(const char H5_ATTR_UNUSED * link_name, hid_t loc_group, const void *udata, + size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id) { haddr_t addr; hid_t target_obj = -1; @@ -7389,8 +7389,8 @@ done: /* Traverse a hard link by opening the object */ static hid_t -UD_hard_traverse(const char UNUSED *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t UNUSED lapl_id) +UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, + const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id) { haddr_t addr; hid_t ret_value = -1; @@ -7407,7 +7407,7 @@ UD_hard_traverse(const char UNUSED *link_name, hid_t cur_group, /* UD_hard_delete decrements the object's reference count */ static herr_t -UD_hard_delete(const char UNUSED * link_name, hid_t file, const void *udata, +UD_hard_delete(const char H5_ATTR_UNUSED * link_name, hid_t file, const void *udata, size_t udata_size) { haddr_t addr; @@ -7625,8 +7625,8 @@ ud_hard_links(hid_t fapl) * in the current group named REREG_TARGET_NAME */ static hid_t -UD_rereg_traverse(const char UNUSED * link_name, hid_t cur_group, - const void UNUSED *udata, size_t UNUSED udata_size, hid_t lapl_id) +UD_rereg_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, + const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) { hid_t ret_value; @@ -8064,8 +8064,8 @@ error: *------------------------------------------------------------------------- */ static hid_t -UD_plist_traverse(const char UNUSED * link_name, hid_t cur_group, - const void UNUSED *udata, size_t udata_size, hid_t lapl_id) +UD_plist_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, + const void H5_ATTR_UNUSED *udata, size_t udata_size, hid_t lapl_id) { char target[NAME_BUF_SIZE]; hid_t ret_value; @@ -8203,8 +8203,8 @@ lapl_udata(hid_t fapl, hbool_t new_format) *------------------------------------------------------------------------- */ static herr_t -UD_cbsucc_create(const char UNUSED * link_name, hid_t UNUSED loc_group, - const void *udata, size_t udata_size, hid_t UNUSED lcpl_id) +UD_cbsucc_create(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED loc_group, + const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id) { /* Check to make sure that this "soft link" has a target */ if(udata_size < 1 || !udata) @@ -8214,8 +8214,8 @@ UD_cbsucc_create(const char UNUSED * link_name, hid_t UNUSED loc_group, } /* end UD_cbsucc_create() */ static hid_t -UD_cbsucc_traverse(const char UNUSED *link_name, hid_t cur_group, - const void *udata, size_t UNUSED udata_size, hid_t lapl_id) +UD_cbsucc_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) { const char *target = (const char *)udata; hid_t ret_value; @@ -8232,8 +8232,8 @@ error: /* Failure callback for when the link is moved or renamed */ static herr_t -UD_cbfail_move(const char UNUSED *new_name, hid_t UNUSED new_loc, - const void UNUSED *udata, size_t UNUSED udata_size) +UD_cbfail_move(const char H5_ATTR_UNUSED *new_name, hid_t H5_ATTR_UNUSED new_loc, + const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size) { /* This traversal function will always fail. */ return -1; @@ -8241,8 +8241,8 @@ UD_cbfail_move(const char UNUSED *new_name, hid_t UNUSED new_loc, /* SuccessCallback for when the link is moved or renamed */ static herr_t -UD_cbsucc_move(const char UNUSED *new_name, hid_t UNUSED new_loc, - const void UNUSED *udata, size_t UNUSED udata_size) +UD_cbsucc_move(const char H5_ATTR_UNUSED *new_name, hid_t H5_ATTR_UNUSED new_loc, + const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size) { /* This traversal function will always succeed. */ return 0; @@ -8250,8 +8250,8 @@ UD_cbsucc_move(const char UNUSED *new_name, hid_t UNUSED new_loc, /* Callback for when the link is deleted. Also called during move */ static herr_t -UD_cbsucc_delete(const char UNUSED *link_name, hid_t UNUSED file, - const void UNUSED *udata, size_t UNUSED udata_size) +UD_cbsucc_delete(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED file, + const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size) { /* This callback will always succeed */ return 0; @@ -8259,8 +8259,8 @@ UD_cbsucc_delete(const char UNUSED *link_name, hid_t UNUSED file, /* Callback for when the link is deleted. Also called during move */ static herr_t -UD_cbfail_delete(const char UNUSED *link_name, hid_t UNUSED file, - const void UNUSED *udata, size_t UNUSED udata_size) +UD_cbfail_delete(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED file, + const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size) { /* This traversal function will always fail. */ /* Note: un-deletable links are in general a very bad idea! */ @@ -8269,8 +8269,8 @@ UD_cbfail_delete(const char UNUSED *link_name, hid_t UNUSED file, /* Callback for when the link is queried */ static ssize_t -UD_cbfail_query(const char UNUSED *link_name, const void UNUSED *udata, - size_t UNUSED udata_size, void UNUSED *buf, size_t UNUSED buf_size) +UD_cbfail_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATTR_UNUSED *udata, + size_t H5_ATTR_UNUSED udata_size, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNUSED buf_size) { /* This traversal function will always fail. */ return -1; @@ -8278,8 +8278,8 @@ UD_cbfail_query(const char UNUSED *link_name, const void UNUSED *udata, /* Callback for when the link is queried */ static ssize_t -UD_cbfail_on_write_query(const char UNUSED *link_name, const void UNUSED *udata, - size_t UNUSED udata_size, void *buf, size_t UNUSED buf_size) +UD_cbfail_on_write_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATTR_UNUSED *udata, + size_t H5_ATTR_UNUSED udata_size, void *buf, size_t H5_ATTR_UNUSED buf_size) { /* This traversal function will return a buffer size, * but will fail when a buffer is passed in ("writing to the buffer" @@ -8294,8 +8294,8 @@ UD_cbfail_on_write_query(const char UNUSED *link_name, const void UNUSED *udata, /* Callback for when the link is queried */ static ssize_t -UD_cbsucc_query(const char UNUSED *link_name, const void UNUSED *udata, - size_t UNUSED udata_size, void *buf, size_t buf_size) +UD_cbsucc_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATTR_UNUSED *udata, + size_t H5_ATTR_UNUSED udata_size, void *buf, size_t buf_size) { /* This traversal function will return a buffer size, * but will fail when a buffer is passed in ("writing to the buffer" @@ -9007,7 +9007,7 @@ error: *------------------------------------------------------------------------- */ static int -visit_link_cb(hid_t UNUSED group_id, const char *name, const H5L_info_t *linfo, +visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t *linfo, void *_op_data) { lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data; @@ -9185,7 +9185,7 @@ error: *------------------------------------------------------------------------- */ static int -visit_obj_cb(hid_t UNUSED group_id, const char *name, const H5O_info_t *oinfo, +visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t *oinfo, void *_op_data) { ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data; @@ -9363,7 +9363,7 @@ error: *------------------------------------------------------------------------- */ static int -visit_obj_stop_cb(hid_t UNUSED group_id, const char UNUSED *name, const H5O_info_t UNUSED *oinfo, +visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name, const H5O_info_t H5_ATTR_UNUSED *oinfo, void *_op_data) { unsigned *op_data = (unsigned *)_op_data; @@ -9489,8 +9489,8 @@ static herr_t link_filter_set_local(hid_t dcpl_id, hid_t type_id, hid_t space_id } /* end link_filter_set_local */ static size_t link_filter_filter(unsigned int flags, size_t cd_nelmts, - const unsigned int cd_values[], size_t nbytes, size_t UNUSED *buf_size, - void UNUSED **buf) + const unsigned int cd_values[], size_t nbytes, size_t H5_ATTR_UNUSED *buf_size, + void H5_ATTR_UNUSED **buf) { if(flags & H5Z_FLAG_OPTIONAL || cd_nelmts != 1 || cd_values[0] != 2112) return 0; @@ -11990,8 +11990,8 @@ group_iterate_cb(hid_t group_id, const char *link_name, void *_op_data) *------------------------------------------------------------------------- */ static int -link_iterate_fail_cb(hid_t UNUSED group_id, const char UNUSED *link_name, - const H5L_info_t UNUSED *info, void UNUSED *_op_data) +link_iterate_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *link_name, + const H5L_info_t H5_ATTR_UNUSED *info, void H5_ATTR_UNUSED *_op_data) { return(H5_ITER_ERROR); } /* end link_iterate_fail_cb() */ diff --git a/test/objcopy.c b/test/objcopy.c index 71a7236..e84e70c 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -11449,7 +11449,7 @@ error: */ static herr_t test_copy_iterate_cb(hid_t loc_id, const char *name, - const H5L_info_t UNUSED *link_info, void *op_data) + const H5L_info_t H5_ATTR_UNUSED *link_info, void *op_data) { hid_t dst_loc_id = *((hid_t *)op_data); diff --git a/test/tattr.c b/test/tattr.c index 31a3844..9429f31 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -1392,7 +1392,7 @@ test_attr_mult_read(hid_t fapl) ** ****************************************************************/ static herr_t -attr_op1(hid_t UNUSED loc_id, const char *name, const H5A_info_t UNUSED *ainfo, +attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *op_data) { int *count = (int *)op_data; @@ -6508,8 +6508,8 @@ attr_iterate1_cb(hid_t loc_id, const char *attr_name, void *_op_data) *------------------------------------------------------------------------- */ static int -attr_iterate2_fail_cb(hid_t UNUSED group_id, const char UNUSED *attr_name, - const H5A_info_t UNUSED *info, void UNUSED *_op_data) +attr_iterate2_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *attr_name, + const H5A_info_t H5_ATTR_UNUSED *info, void H5_ATTR_UNUSED *_op_data) { return(H5_ITER_ERROR); } /* end attr_iterate2_fail_cb() */ diff --git a/test/tcheck_version.c b/test/tcheck_version.c index 91d98ef..a75d642 100644 --- a/test/tcheck_version.c +++ b/test/tcheck_version.c @@ -36,7 +36,7 @@ /* prototypes */ void showhelp(void); void parse(int ac, char **av); -void abort_intercept (int UNUSED sig); +void abort_intercept (int H5_ATTR_UNUSED sig); /* global variables */ unsigned major = H5_VERS_MAJOR; @@ -105,7 +105,7 @@ parse(int ac, char **av) * This tries to eliminate those side effects. */ void -abort_intercept (int UNUSED sig) +abort_intercept (int H5_ATTR_UNUSED sig) { HDexit(6); } diff --git a/test/tgenprop.c b/test/tgenprop.c index a3f1752..bf4f3fa 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -385,7 +385,7 @@ test_genprop_cls_crt_cb1(hid_t list_id, void *create_data) } static herr_t -test_genprop_cls_cpy_cb1(hid_t new_list_id, hid_t UNUSED old_list_id, void *copy_data) +test_genprop_cls_cpy_cb1(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *copy_data) { struct { /* Struct for iterations */ int count; @@ -993,7 +993,7 @@ prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */ ** ****************************************************************/ static herr_t -test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t UNUSED old_list_id, void *create_data) +test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *create_data) { struct { /* Struct for iterations */ int count; diff --git a/test/tid.c b/test/tid.c index 8c64b79..85d26c9 100644 --- a/test/tid.c +++ b/test/tid.c @@ -239,7 +239,7 @@ out: /* A dummy search function for the next test */ -static int test_search_func(void UNUSED * ptr1, void UNUSED * ptr2) { return 0; } +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 */ static int id_predefined_test(void ) diff --git a/test/titerate.c b/test/titerate.c index 049e258..fff13f1 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -83,7 +83,7 @@ int iter_strcmp(const void *s1, const void *s2) ** ****************************************************************/ static herr_t -liter_cb(hid_t UNUSED group, const char *name, const H5L_info_t UNUSED *link_info, +liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info, void *op_data) { iter_info *info = (iter_info *)op_data; @@ -344,7 +344,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) ** ****************************************************************/ herr_t -aiter_cb(hid_t UNUSED group, const char *name, const H5A_info_t UNUSED *ainfo, +aiter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *op_data) { iter_info *info = (iter_info *)op_data; @@ -538,7 +538,7 @@ int iter_strcmp2(const void *s1, const void *s2) ** ****************************************************************/ static herr_t -liter_cb2(hid_t loc_id, const char *name, const H5L_info_t UNUSED *link_info, +liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info, void *opdata) { const iter_info *test_info = (const iter_info *)opdata; diff --git a/test/tmisc.c b/test/tmisc.c index 869557c..e9b5680 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5137,8 +5137,8 @@ test_misc29(void) static int -test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t UNUSED *info, - void UNUSED *op_data) +test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *info, + void H5_ATTR_UNUSED *op_data) { H5O_info_t object_info; diff --git a/test/trefer.c b/test/trefer.c index 6d72aee..203b602 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -1232,7 +1232,7 @@ test_reference_obj_deleted(void) ** ****************************************************************/ static herr_t -test_deref_iter_op(hid_t UNUSED group, const char *name, const H5L_info_t UNUSED *info, +test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *info, void *op_data) { int *count = (int *)op_data; /* Pointer to name counter */ diff --git a/test/tselect.c b/test/tselect.c index b34d095..bdcdb2b 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -186,7 +186,7 @@ static herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, c ** ****************************************************************/ static herr_t -test_select_hyper_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) +test_select_hyper_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void *_operator_data) { uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ **tbuf2=(uint8_t **)_operator_data; /* temporary buffer handle */ @@ -385,7 +385,7 @@ struct pnt_iter { ** ****************************************************************/ static herr_t -test_select_point_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) +test_select_point_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void *_operator_data) { uint8_t *elem=(uint8_t *)_elem; /* Pointer to the element to examine */ uint8_t *tmp; /* temporary ptr to element in operator data */ @@ -662,7 +662,7 @@ test_select_point(hid_t xfer_plist) ** ****************************************************************/ static herr_t -test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) +test_select_all_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void *_operator_data) { uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ **tbuf2=(uint8_t **)_operator_data; /* temporary buffer handle */ @@ -682,7 +682,7 @@ test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, c ** ****************************************************************/ static herr_t -test_select_none_iter1(void UNUSED *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void UNUSED *_operator_data) +test_select_none_iter1(void H5_ATTR_UNUSED *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void H5_ATTR_UNUSED *_operator_data) { return(-1); } /* end test_select_none_iter1() */ @@ -5816,7 +5816,7 @@ test_select_hyper_nota_2d(void) ** ****************************************************************/ static herr_t -test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) +test_select_hyper_iter2(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) { int *tbuf=(int *)_elem, /* temporary buffer pointer */ **tbuf2=(int **)_operator_data; /* temporary buffer handle */ @@ -7008,7 +7008,7 @@ typedef struct { ** ****************************************************************/ static herr_t -test_select_hyper_iter3(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) +test_select_hyper_iter3(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) { unsigned *tbuf = (unsigned *)_elem; /* temporary buffer pointer */ fill_iter_info *iter_info = (fill_iter_info *)_operator_data; /* Get the pointer to the iterator information */ diff --git a/test/tskiplist.c b/test/tskiplist.c index 8966e39..07e63fd 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -592,7 +592,7 @@ test_skiplist_string(void) } /* end test_skiplist_string() */ static herr_t -test_skiplist_iter(void *item, void UNUSED *key, void *op_data) +test_skiplist_iter(void *item, void H5_ATTR_UNUSED *key, void *op_data) { size_t *up=(size_t *)op_data; @@ -1070,7 +1070,7 @@ test_skiplist_add(void) } /* end test_skiplist_add() */ static herr_t -test_skiplist_destroy_free(void *item, void UNUSED *key, void *op_data) +test_skiplist_destroy_free(void *item, void H5_ATTR_UNUSED *key, void *op_data) { unsigned *free_count=(unsigned *)op_data; diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index d8ed462..9bbec34 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -120,7 +120,7 @@ void tts_cancel(void) assert(ret==0); } -void *tts_cancel_thread(void UNUSED *arg) +void *tts_cancel_thread(void H5_ATTR_UNUSED *arg) { int datavalue; int buffer; @@ -182,8 +182,8 @@ void *tts_cancel_thread(void UNUSED *arg) return NULL; } -herr_t tts_cancel_callback(void *elem, hid_t UNUSED type_id, unsigned UNUSED ndim, - const hsize_t UNUSED *point, void *operator_data) +herr_t tts_cancel_callback(void *elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_ATTR_UNUSED ndim, + const hsize_t H5_ATTR_UNUSED *point, void *operator_data) { int value = *(int *)elem; hid_t dataset = *(hid_t *)operator_data; diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index b81a7ad..e143263 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -154,7 +154,7 @@ void tts_error(void) } static -void *tts_error_thread(void UNUSED *arg) +void *tts_error_thread(void H5_ATTR_UNUSED *arg) { hid_t dataspace, datatype, dataset; hsize_t dimsf[1]; /* dataset dimensions */ @@ -199,7 +199,7 @@ void *tts_error_thread(void UNUSED *arg) } static -herr_t error_callback(hid_t UNUSED estack_id, void *client_data) +herr_t error_callback(hid_t H5_ATTR_UNUSED estack_id, void *client_data) { H5TS_mutex_lock_simple(&error_mutex); error_count++; @@ -208,7 +208,7 @@ herr_t error_callback(hid_t UNUSED estack_id, void *client_data) } static -herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void UNUSED *client_data) +herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void H5_ATTR_UNUSED *client_data) { hid_t maj_num, min_num; diff --git a/test/tunicode.c b/test/tunicode.c index 82dc429..93c00c5 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -119,7 +119,7 @@ void test_fl_string(hid_t fid, const char *string) * Borrows heavily from dtypes.c, but is more complicated because * the string is randomly generated. */ -void test_strpad(hid_t UNUSED fid, const char *string) +void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string) { /* buf is used to hold the data that H5Tconvert operates on. */ char buf[LONG_BUF_SIZE]; @@ -650,7 +650,7 @@ void test_compound(hid_t fid, const char * string) * test_enum * Test that enumerated datatypes can have UTF-8 member names. */ -void test_enum(hid_t UNUSED fid, const char * string) +void test_enum(hid_t H5_ATTR_UNUSED fid, const char * string) { /* Define an enumerated type */ typedef enum { @@ -699,7 +699,7 @@ void test_enum(hid_t UNUSED fid, const char * string) * test_opaque * Test comments on opaque datatypes */ -void test_opaque(hid_t UNUSED fid, const char * string) +void test_opaque(hid_t H5_ATTR_UNUSED fid, const char * string) { hid_t type_id; char * read_buf; diff --git a/test/unregister.c b/test/unregister.c index 383958d..be40383 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -68,9 +68,9 @@ const H5Z_class2_t H5Z_DUMMY[1] = {{ *------------------------------------------------------------------------- */ static size_t -filter_dummy(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) +filter_dummy(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { return nbytes; } diff --git a/testpar/t_cache.c b/testpar/t_cache.c index d36f34f..91c1113 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -373,12 +373,12 @@ static hbool_t serve_rw_count_reset_request(struct mssg_t * mssg_ptr); /* call back functions & related data structures */ static herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest); -static herr_t destroy_datum(H5F_t UNUSED * f, void * thing); -static herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr, +static herr_t destroy_datum(H5F_t H5_ATTR_UNUSED * f, void * thing); +static herr_t flush_datum(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t dest, haddr_t addr, void *thing); -static void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - void UNUSED *udata); -static herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr); +static void * load_datum(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, + void H5_ATTR_UNUSED *udata); +static herr_t size_datum(H5F_t H5_ATTR_UNUSED * f, void * thing, size_t * size_ptr); #define DATUM_ENTRY_TYPE H5AC_TEST_ID @@ -2362,7 +2362,7 @@ clear_datum(H5F_t * f, *------------------------------------------------------------------------- */ static herr_t -destroy_datum(H5F_t UNUSED * f, +destroy_datum(H5F_t H5_ATTR_UNUSED * f, void * thing) { int idx; @@ -2411,9 +2411,9 @@ destroy_datum(H5F_t UNUSED * f, */ static herr_t flush_datum(H5F_t *f, - hid_t UNUSED dxpl_id, + hid_t H5_ATTR_UNUSED dxpl_id, hbool_t dest, - haddr_t UNUSED addr, + haddr_t H5_ATTR_UNUSED addr, void *thing) { const char * fcn_name = "flush_datum()"; @@ -2569,10 +2569,10 @@ flush_datum(H5F_t *f, */ static void * -load_datum(H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, +load_datum(H5F_t H5_ATTR_UNUSED *f, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, - void UNUSED *udata) + void H5_ATTR_UNUSED *udata) { const char * fcn_name = "load_datum()"; hbool_t success = TRUE; @@ -2747,7 +2747,7 @@ load_datum(H5F_t UNUSED *f, */ static herr_t -size_datum(H5F_t UNUSED * f, +size_datum(H5F_t H5_ATTR_UNUSED * f, void * thing, size_t * size_ptr) { diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 1b80317..cfaffe6 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -106,8 +106,8 @@ hsize_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(UNUSED const char * link_name, UNUSED hid_t cur_group, - UNUSED const void * udata, UNUSED size_t udata_size, 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; } diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index e38b93b..3822251 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -112,7 +112,7 @@ dump_dataspace(hid_t space) *------------------------------------------------------------------------- */ herr_t -dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, void UNUSED *_op_data) +dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *info, void H5_ATTR_UNUSED *_op_data) { h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &h5tools_dataformat; @@ -182,7 +182,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo *------------------------------------------------------------------------- */ static herr_t -dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data) +dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR_UNUSED *op_data) { hid_t obj; herr_t ret = SUCCEED; @@ -1295,7 +1295,7 @@ dump_fcontents(hid_t fid) } static herr_t -attr_search(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *_op_data) +attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data) { herr_t ret = SUCCEED; int i; @@ -1351,7 +1351,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *ainfo, vo } /* end attr_search() */ static herr_t -obj_search(const char *path, const H5O_info_t *oi, const char UNUSED *already_visited, void *_op_data) +obj_search(const char *path, const H5O_info_t *oi, const char H5_ATTR_UNUSED *already_visited, void *_op_data) { trav_handle_udata_t *handle_data = (trav_handle_udata_t*)_op_data; char *op_name = (char*)handle_data->op_name; @@ -1443,7 +1443,7 @@ lnk_search(const char *path, const H5L_info_t *li, void *_op_data) *------------------------------------------------------------------------- */ void -handle_paths(hid_t fid, const char *path_name, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) +handle_paths(hid_t fid, const char *path_name, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name) { hid_t gid = -1; @@ -1506,7 +1506,7 @@ handle_paths(hid_t fid, const char *path_name, void UNUSED * data, int UNUSED pe *------------------------------------------------------------------------- */ void -handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) +handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name) { hid_t oid = -1; hid_t attr_id = -1; @@ -1817,7 +1817,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis *------------------------------------------------------------------------- */ void -handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const char *display_name) +handle_groups(hid_t fid, const char *group, void H5_ATTR_UNUSED *data, int pe, const char *display_name) { hid_t gid; const char *real_name = display_name ? display_name : group; @@ -1867,7 +1867,7 @@ handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const cha *------------------------------------------------------------------------- */ void -handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) +handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name) { H5L_info_t linfo; @@ -1962,7 +1962,7 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co *------------------------------------------------------------------------- */ void -handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const char *display_name) +handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED * data, int pe, const char *display_name) { hid_t type_id; const char *real_name = display_name ? display_name : type; diff --git a/tools/h5dump/h5dump_ddl.h b/tools/h5dump/h5dump_ddl.h index c4f4638..6cd9181 100644 --- a/tools/h5dump/h5dump_ddl.h +++ b/tools/h5dump/h5dump_ddl.h @@ -36,10 +36,10 @@ herr_t dump_attr_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *in void handle_paths(hid_t fid, const char *path_name, void *data, int pe, const char *display_name); void handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name); -void handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name); -void handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const char *display_name); -void handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name); -void handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const char *display_name); +void handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name); +void handle_groups(hid_t fid, const char *group, void H5_ATTR_UNUSED *data, int pe, const char *display_name); +void handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name); +void handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED * data, int pe, const char *display_name); #ifdef __cplusplus } diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 6ccbc8c..4f8d250 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -141,7 +141,7 @@ static char *xml_escape_the_name(const char *); *------------------------------------------------------------------------- */ static herr_t -xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data) +xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR_UNUSED *op_data) { hid_t obj; herr_t ret = SUCCEED; @@ -1854,7 +1854,7 @@ xml_dump_dataspace(hid_t space) *------------------------------------------------------------------------- */ void -xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNUSED pindex) +xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, int H5_ATTR_UNUSED pindex) { hid_t space = -1; hid_t type = -1; @@ -2051,8 +2051,8 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU *------------------------------------------------------------------------- */ herr_t -xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, - void UNUSED * op_data) +xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *info, + void H5_ATTR_UNUSED * op_data) { hid_t attr_id = -1; hid_t type = -1; @@ -3753,7 +3753,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) *------------------------------------------------------------------------- */ void -xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) +xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * sset) { hid_t type; hid_t space; diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index c04afe9..250f96f 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -128,13 +128,13 @@ write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, /* a filter operation callback function */ static size_t -myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf); +myfilter(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf); /* a "set local" callback */ static herr_t -set_local_myfilter(hid_t dcpl_id, hid_t tid, hid_t UNUSED sid); +set_local_myfilter(hid_t dcpl_id, hid_t tid, hid_t H5_ATTR_UNUSED sid); #define MYFILTER_ID 405 @@ -151,8 +151,8 @@ const H5Z_class2_t H5Z_MYFILTER[1] = {{ /* A UD link traversal function. Shouldn't actually be called. */ -static hid_t UD_traverse(UNUSED const char * link_name, UNUSED hid_t cur_group, - UNUSED const void * udata, UNUSED size_t udata_size, 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; } @@ -5626,9 +5626,9 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ static size_t -myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) +myfilter(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { return nbytes; } @@ -5643,7 +5643,7 @@ myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, */ static herr_t -set_local_myfilter(hid_t dcpl_id, hid_t UNUSED tid, hid_t UNUSED sid) +set_local_myfilter(hid_t dcpl_id, hid_t H5_ATTR_UNUSED tid, hid_t H5_ATTR_UNUSED sid) { unsigned flags; /* Filter flags */ size_t cd_nelmts = 0; /* Number of filter parameters */ diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index 5a93c13..5f24566 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -96,8 +96,8 @@ typedef struct s1_t { #define ARRAY3_DIM2 3 /* A UD link traversal function. Shouldn't actually be called. */ -static hid_t UD_traverse(const char UNUSED * link_name, hid_t UNUSED cur_group, - const void UNUSED * udata, size_t UNUSED udata_size, hid_t UNUSED lapl_id) +static hid_t UD_traverse(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED cur_group, + const void H5_ATTR_UNUSED * udata, size_t H5_ATTR_UNUSED udata_size, hid_t H5_ATTR_UNUSED lapl_id) { return -1; } diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 96bd8d0..28f7b8a 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -385,7 +385,7 @@ print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, *------------------------------------------------------------------------- */ static hbool_t -print_native_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) +print_native_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) { if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) { h5tools_str_append(buffer, "native signed char"); @@ -503,7 +503,7 @@ print_native_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) *------------------------------------------------------------------------- */ static hbool_t -print_ieee_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) +print_ieee_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) { if (H5Tequal(type, H5T_IEEE_F32BE)==TRUE) { h5tools_str_append(buffer, "IEEE 32-bit big-endian float"); @@ -999,7 +999,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) *------------------------------------------------------------------------- */ static hbool_t -print_string_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) +print_string_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) { H5T_str_t pad; const char *pad_s=NULL; @@ -1102,7 +1102,7 @@ print_string_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) *------------------------------------------------------------------------- */ static hbool_t -print_reference_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) +print_reference_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) { if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE; @@ -1491,8 +1491,8 @@ dump_dataset_values(hid_t dset) *------------------------------------------------------------------------- */ static herr_t -list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, - void UNUSED *op_data) +list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, + void H5_ATTR_UNUSED *op_data) { hid_t attr = -1; hid_t space = -1; @@ -1743,7 +1743,7 @@ dataset_list1(hid_t dset) *------------------------------------------------------------------------- */ static herr_t -dataset_list2(hid_t dset, const char UNUSED *name) +dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) { hid_t dcpl; /* dataset creation property list */ hid_t type; /* data type of dataset */ @@ -1940,7 +1940,7 @@ dataset_list2(hid_t dset, const char UNUSED *name) *------------------------------------------------------------------------- */ static herr_t -datatype_list2(hid_t type, const char UNUSED *name) +datatype_list2(hid_t type, const char H5_ATTR_UNUSED *name) { if (verbose_g>0) { hsize_t curr_pos = 0; /* total data element position */ diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index b5f6861..1171ab8 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -66,7 +66,7 @@ static void print_user_block(const char *filename, hid_t fid); static herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void *udata); /* get the major number from the error stack. */ -static herr_t walk_error_callback(UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) { +static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) { if (err_desc) *((hid_t *) udata) = err_desc->maj_num; diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index bc7b4e5..c56e3ce 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -21,7 +21,7 @@ #define PROGRAMNAME "h5repack" static int parse_command_line(int argc, const char **argv, pack_opt_t* options); -static void leave(int ret) NORETURN; +static void leave(int ret) H5_ATTR_NORETURN; /* module-scoped variables */ diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index e9fa0fa..c19aba5 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -745,7 +745,7 @@ obj_stats(const char *path, const H5O_info_t *oi, const char *already_visited, *------------------------------------------------------------------------- */ static herr_t -lnk_stats(const char UNUSED *path, const H5L_info_t *li, void *_iter) +lnk_stats(const char H5_ATTR_UNUSED *path, const H5L_info_t *li, void *_iter) { iter_t *iter = (iter_t *)_iter; diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 52d84f9..0bb7d77 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -61,7 +61,7 @@ static int ref_path_table_put(const char *, haddr_t objno); *------------------------------------------------------------------------- */ static herr_t -free_ref_path_info(void *item, void UNUSED *key, void UNUSED *operator_data/*in,out*/) +free_ref_path_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) { ref_path_node_t *node = (ref_path_node_t *)item; @@ -85,7 +85,7 @@ free_ref_path_info(void *item, void UNUSED *key, void UNUSED *operator_data/*in, */ static herr_t init_ref_path_cb(const char *obj_name, const H5O_info_t *oinfo, - const char *already_seen, void UNUSED *_udata) + const char *already_seen, void H5_ATTR_UNUSED *_udata) { /* Check if the object is already in the path table */ if(NULL == already_seen) { diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 90e6d3d..86e60c3 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -404,7 +404,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id) */ int trav_info_visit_obj(const char *path, const H5O_info_t *oinfo, - const char UNUSED *already_visited, void *udata) + const char H5_ATTR_UNUSED *already_visited, void *udata) { size_t idx; trav_info_t *info_p; @@ -628,7 +628,7 @@ trav_table_visit_obj(const char *path, const H5O_info_t *oinfo, *------------------------------------------------------------------------- */ static int -trav_table_visit_lnk(const char *path, const H5L_info_t UNUSED *linfo, void *udata) +trav_table_visit_lnk(const char *path, const H5L_info_t H5_ATTR_UNUSED *linfo, void *udata) { /* Add the link to the 'table' struct */ trav_table_add((trav_table_t *)udata, path, NULL); @@ -901,9 +901,9 @@ void trav_table_free( trav_table_t *table ) static herr_t trav_attr(hid_t #ifndef H5TRAV_PRINT_SPACE -UNUSED +H5_ATTR_UNUSED #endif /* H5TRAV_PRINT_SPACE */ -obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *_op_data) +obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data) { trav_path_op_data_t *op_data = (trav_path_op_data_t *)_op_data; const char *buf = op_data->path; diff --git a/tools/perform/chunk.c b/tools/perform/chunk.c index 6825a4c..625809a 100644 --- a/tools/perform/chunk.c +++ b/tools/perform/chunk.c @@ -37,9 +37,9 @@ #if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus # undef __attribute__ # define __attribute__(X) /*void*/ -# define UNUSED /*void*/ +# define H5_ATTR_UNUSED /*void*/ #else -# define UNUSED __attribute__((unused)) +# define H5_ATTR_UNUSED __attribute__((unused)) #endif #define FILE_NAME "chunk.h5" @@ -78,7 +78,7 @@ static hid_t fapl_g = -1; /* Local function prototypes */ static size_t -counter (unsigned UNUSED flags, size_t cd_nelmts, +counter (unsigned H5_ATTR_UNUSED flags, size_t cd_nelmts, const unsigned *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -111,9 +111,9 @@ const H5Z_class2_t H5Z_COUNTER[1] = {{ *------------------------------------------------------------------------- */ static size_t -counter (unsigned UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) +counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { nio_g += nbytes; return nbytes; diff --git a/tools/perform/overhead.c b/tools/perform/overhead.c index 046668f..0e9166c 100644 --- a/tools/perform/overhead.c +++ b/tools/perform/overhead.c @@ -49,9 +49,9 @@ #ifndef H5_HAVE_ATTRIBUTE # undef __attribute__ # define __attribute__(X) /*void*/ -# define UNUSED /*void*/ +# define H5_ATTR_UNUSED /*void*/ #else -# define UNUSED __attribute__((unused)) +# define H5_ATTR_UNUSED __attribute__((unused)) #endif #define FILE_NAME_1 "overhead.h5" @@ -163,7 +163,7 @@ cleanup (void) *------------------------------------------------------------------------- */ static herr_t -display_error_cb (hid_t estack, void UNUSED *client_data) +display_error_cb (hid_t estack, void H5_ATTR_UNUSED *client_data) { puts ("*FAILED*"); H5Eprint2(estack, stdout); diff --git a/tools/perform/perf.c b/tools/perform/perf.c index 1bd33b6..afd13c0 100644 --- a/tools/perform/perf.c +++ b/tools/perform/perf.c @@ -473,7 +473,7 @@ parse_args(int argc, char **argv) #else /* H5_HAVE_PARALLEL */ /* dummy program since H5_HAVE_PARALLEL is not configured in */ int -main(int UNUSED argc, char UNUSED **argv) +main(int H5_ATTR_UNUSED argc, char H5_ATTR_UNUSED **argv) { printf("No parallel performance because parallel is not configured in\n"); return(0); -- cgit v0.12 From e2fa1a7555ea0c548824c33f84a5e5c9efd1b938 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 3 Jun 2015 09:32:56 -0500 Subject: [svn-r27142] Add optional variable for version extension --- config/cmake/scripts/HDF518config.cmake | 47 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index f0aceea..aee5389 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -9,7 +9,8 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) set(CTEST_SOURCE_VERSION 1.8.15) -set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}) +set(CTEST_SOURCE_VERSEXT "") +set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}) set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") if(WIN32) @@ -86,7 +87,7 @@ set(SITE_BUILDNAME_SUFFIX "STATIC") #set(LOCAL_UPDATE "TRUE") set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows -#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") +#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") ################################################################### ################################################################### @@ -100,7 +101,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") #### ext libraries #### ### ext libs from tgz -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=\"${CTEST_SCRIPT_DIRECTORY}\"") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") ### ext libs from svn #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") ### ext libs on system @@ -131,41 +132,41 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") if(WIN32) include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() endif() endif() -- cgit v0.12 From 235b3b86c1eabefcf6c4de9594a5609b6f03060b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 3 Jun 2015 10:35:28 -0500 Subject: [svn-r27144] Description: Normalize trunk against the metadata_cache_merge branch, in preparation for merging the branch into the trunk. Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/64 2.6.x (koala) w/serial Linux/32 2.6.x (jam) w/serial & parallel --- src/H5AC.c | 42 ++-- src/H5ACpkg.h | 49 ++++- src/H5ACprivate.h | 4 +- src/H5ACpublic.h | 2 +- src/H5B2hdr.c | 2 +- src/H5B2pkg.h | 20 +- src/H5C.c | 35 ++- src/H5Cpkg.h | 612 ++++++++++++++++++++++++++-------------------------- src/H5EAcache.c | 4 +- src/H5EAdblkpage.c | 2 +- src/H5EAhdr.c | 2 +- src/H5EApkg.h | 30 ++- src/H5F.c | 1 + src/H5FAcache.c | 4 +- src/H5FAdblkpage.c | 2 +- src/H5FAhdr.c | 2 +- src/H5FApkg.h | 20 +- src/H5FS.c | 2 +- src/H5Fint.c | 63 ++++++ src/H5Fpkg.h | 44 ++-- src/H5Fprivate.h | 4 +- src/H5Fsuper.c | 8 +- src/H5Gent.c | 4 +- src/H5Gpkg.h | 2 +- src/H5Gprivate.h | 8 +- src/H5HFcache.c | 16 +- src/H5HGcache.c | 10 +- src/H5MF.c | 6 +- src/H5MFdbg.c | 4 +- src/H5MFprivate.h | 2 +- src/H5MFsection.c | 2 +- src/H5Oprivate.h | 1 + src/H5Pfapl.c | 8 +- src/H5SMcache.c | 72 +++---- test/cache.c | 36 ++-- test/cache_common.c | 6 - testpar/t_cache.c | 5 +- 37 files changed, 635 insertions(+), 501 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 9f5b88d..c5466be 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -1002,7 +1002,7 @@ H5AC_mark_entry_dirty(void *thing) * is really necessary in the trace file. Write the result to catch * occult errors. */ - if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + if((H5C_get_trace_file_ptr_from_entry((const H5C_cache_entry_t *) thing, &trace_file_ptr) >= 0) && (NULL != trace_file_ptr)) sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); @@ -1150,7 +1150,7 @@ H5AC_pin_protected_entry(void *thing) /* For the pin protected entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + if((H5C_get_trace_file_ptr_from_entry((const H5C_cache_entry_t *)thing, &trace_file_ptr) >= 0) && (NULL != trace_file_ptr)) sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); @@ -1198,7 +1198,7 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) HDassert(child_thing); #if H5AC__TRACE_FILE_ENABLED - if((H5C_get_trace_file_ptr_from_entry(parent_thing, &trace_file_ptr) >= 0) && + if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)parent_thing, &trace_file_ptr) >= 0) && (NULL != trace_file_ptr)) sprintf(trace, "%s %lx %lx", FUNC, @@ -1309,10 +1309,8 @@ H5AC_protect(H5F_t *f, } #endif /* H5AC__TRACE_FILE_ENABLED */ - if ( rw == H5AC_READ ) { - + if ( rw == H5AC_READ ) protect_flags |= H5C__READ_ONLY_FLAG; - } thing = H5C_protect(f, dxpl_id, @@ -1385,7 +1383,7 @@ H5AC_resize_entry(void *thing, size_t new_size) * really necessary in the trace file. Write the result to catch * occult errors. */ - if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)thing, &trace_file_ptr) >= 0) && (NULL != trace_file_ptr)) sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr), @@ -1451,7 +1449,7 @@ H5AC_unpin_entry(void *thing) /* For the unpin entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)thing, &trace_file_ptr) >= 0) && (NULL != trace_file_ptr)) sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); @@ -1498,8 +1496,8 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) HDassert(child_thing); #if H5AC__TRACE_FILE_ENABLED - if((H5C_get_trace_file_ptr_from_entry(parent_thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) + if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)parent_thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) sprintf(trace, "%s %llx %llx", FUNC, (unsigned long long)(((H5C_cache_entry_t *)parent_thing)->addr), @@ -1648,7 +1646,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) - HDfprintf(trace_file_ptr, "%s %x %d\n", + HDfprintf(trace_file_ptr, "%s 0x%x %d\n", trace, (unsigned)flags, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -2154,7 +2152,7 @@ done: ( trace_file_ptr != NULL ) ) { HDfprintf(trace_file_ptr, - "%s %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %f %f %d %d %d %f %f %d %d %d %d %f %d %d %d\n", + "%s %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %f %f %d %d %d %f %f %d %d %d %d %f %zu %d %d\n", "H5AC_set_cache_auto_resize_config", trace_config.version, (int)(trace_config.rpt_fcn_enabled), @@ -2450,7 +2448,7 @@ H5AC_open_trace_file(H5AC_t * cache_ptr, HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "trace file open failed.") } - HDfprintf(file_ptr, "### HDF5 metadata cache trace file ###\n"); + HDfprintf(file_ptr, "### HDF5 metadata cache trace file version 1 ###\n"); if ( H5C_set_trace_file_ptr(cache_ptr, file_ptr) < 0 ) { @@ -5002,15 +5000,15 @@ H5AC_run_sync_point(H5F_t *f, #if H5AC_DEBUG_DIRTY_BYTES_CREATION HDfprintf(stdout, - "%d:H5AC_propagate...:%d: (u/uu/i/iu/r/ru) = %d/%d/%d/%d/%d/%d\n", - (int)(aux_ptr->mpi_rank), - (int)(aux_ptr->dirty_bytes_propagations), - (int)(aux_ptr->unprotect_dirty_bytes), - (int)(aux_ptr->unprotect_dirty_bytes_updates), - (int)(aux_ptr->insert_dirty_bytes), - (int)(aux_ptr->insert_dirty_bytes_updates), - (int)(aux_ptr->rename_dirty_bytes), - (int)(aux_ptr->rename_dirty_bytes_updates)); + "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu/%u\n", + aux_ptr->mpi_rank, + aux_ptr->dirty_bytes_propagations, + aux_ptr->unprotect_dirty_bytes, + aux_ptr->unprotect_dirty_bytes_updates, + aux_ptr->insert_dirty_bytes, + aux_ptr->insert_dirty_bytes_updates, + aux_ptr->rename_dirty_bytes, + aux_ptr->rename_dirty_bytes_updates); #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ switch(aux_ptr->metadata_write_strategy) { diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index ad768ef..5b8ac86 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -64,10 +64,10 @@ *------------------------------------------------------------------------- */ -#define H5AC__MIN_DIRTY_BYTES_THRESHOLD (int32_t) \ +#define H5AC__MIN_DIRTY_BYTES_THRESHOLD (size_t) \ (H5C__MIN_MAX_CACHE_SIZE / 2) #define H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD (256 * 1024) -#define H5AC__MAX_DIRTY_BYTES_THRESHOLD (int32_t) \ +#define H5AC__MAX_DIRTY_BYTES_THRESHOLD (size_t) \ (H5C__MAX_MAX_CACHE_SIZE / 4) @@ -142,6 +142,29 @@ * * JRM - 6/27/05 * + * Update: When the above was written, I planned to allow the process + * 0 metadata cache to write dirty metadata between sync points. + * However, testing indicated that this allowed occasional + * messages from the future to reach the caches on other processes. + * + * To resolve this, the code was altered to require that all metadata + * writes take place during sync points -- which solved the problem. + * Initially all writes were performed by the process 0 cache. This + * approach was later replaced with a distributed write approach + * in which each process writes a subset of the metadata to be + * written. + * + * After thinking on the matter for a while, I arrived at the + * conclusion that the process 0 cache could be allowed to write + * dirty metadata between sync points if it restricted itself to + * entries that had been dirty at the time of the previous sync point. + * + * To date, there has been no attempt to implement this optimization. + * However, should it be attempted, much of the supporting code + * should still be around. + * + * JRM -- 1/6/15 + * * magic: Unsigned 32 bit integer always set to * H5AC__H5AC_AUX_T_MAGIC. This field is used to validate * pointers to instances of H5AC_aux_t. @@ -180,6 +203,10 @@ * field exists to facilitate experiments with other * strategies. * + * At present, this field must be set to either + * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY or + * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. + * * dirty_bytes_propagations: This field only exists when the * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. * @@ -344,24 +371,24 @@ typedef struct H5AC_aux_t hbool_t write_permitted; - int32_t dirty_bytes_threshold; + size_t dirty_bytes_threshold; - int32_t dirty_bytes; + size_t dirty_bytes; int32_t metadata_write_strategy; #if H5AC_DEBUG_DIRTY_BYTES_CREATION - int32_t dirty_bytes_propagations; + unsigned dirty_bytes_propagations; - int32_t unprotect_dirty_bytes; - int32_t unprotect_dirty_bytes_updates; + size_t unprotect_dirty_bytes; + unsigned unprotect_dirty_bytes_updates; - int32_t insert_dirty_bytes; - int32_t insert_dirty_bytes_updates; + size_t insert_dirty_bytes; + unsigned insert_dirty_bytes_updates; - int32_t move_dirty_bytes; - int32_t move_dirty_bytes_updates; + size_t move_dirty_bytes; + unsigned move_dirty_bytes_updates; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index cf4c122..e259a24 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -255,7 +255,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id; /* int epochs_before_eviction = */ 3, \ /* hbool_t apply_empty_reserve = */ TRUE, \ /* double empty_reserve = */ 0.1f, \ - /* int dirty_bytes_threshold = */ (256 * 1024), \ + /* size_t dirty_bytes_threshold = */ (256 * 1024), \ /* int metadata_write_strategy = */ \ H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ } @@ -291,7 +291,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id; /* int epochs_before_eviction = */ 3, \ /* hbool_t apply_empty_reserve = */ TRUE, \ /* double empty_reserve = */ 0.1f, \ - /* int dirty_bytes_threshold = */ (256 * 1024), \ + /* size_t dirty_bytes_threshold = */ (256 * 1024), \ /* int metadata_write_strategy = */ \ H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ } diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index 639179c..598197f 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -496,7 +496,7 @@ typedef struct H5AC_cache_config_t /* parallel configuration fields: */ - int dirty_bytes_threshold; + size_t dirty_bytes_threshold; int metadata_write_strategy; } H5AC_cache_config_t; diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 97b979e..d873cf6 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -256,7 +256,7 @@ H5B2__hdr_alloc(H5F_t *f) hdr->f = f; hdr->sizeof_addr = H5F_SIZEOF_ADDR(f); hdr->sizeof_size = H5F_SIZEOF_SIZE(f); - hdr->hdr_size = H5B2_HEADER_SIZE(hdr); + hdr->hdr_size = H5B2_HEADER_SIZE_HDR(hdr); hdr->root.addr = HADDR_UNDEF; /* Set return value */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 72476eb..a2d32e6 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -45,10 +45,10 @@ /* Size of a "tree pointer" (on disk) */ /* (essentially, the largest internal pointer allowed) */ -#define H5B2_TREE_POINTER_SIZE(h) ( \ - (h)->sizeof_addr + \ +#define H5B2_TREE_POINTER_SIZE(sizeof_addr, sizeof_size) ( \ + (sizeof_addr) + \ H5B2_SIZEOF_RECORDS_PER_NODE + \ - (h)->sizeof_size \ + (sizeof_size) \ ) /* Size of a internal node pointer (on disk) */ @@ -70,7 +70,7 @@ ) /* Size of the v2 B-tree header on disk */ -#define H5B2_HEADER_SIZE(h) ( \ +#define H5B2_HEADER_SIZE(sizeof_addr, sizeof_size) ( \ /* General metadata fields */ \ H5B2_METADATA_PREFIX_SIZE \ \ @@ -80,7 +80,17 @@ + (unsigned)2 /* Depth of tree */ \ + (unsigned)1 /* Split % of full (as integer, ie. "98" means 98%) */ \ + (unsigned)1 /* Merge % of full (as integer, ie. "98" means 98%) */ \ - + H5B2_TREE_POINTER_SIZE(h) /* Node pointer to root node in tree */ \ + + H5B2_TREE_POINTER_SIZE(sizeof_addr, sizeof_size) /* Node pointer to root node in tree */ \ + ) + +/* Size of the v2 B-tree header on disk (via file pointer) */ +#define H5B2_HEADER_SIZE_FILE(f) ( \ + H5B2_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \ + ) + +/* Size of the v2 B-tree header on disk (via v2 B-tree header) */ +#define H5B2_HEADER_SIZE_HDR(h) ( \ + H5B2_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \ ) /* Size of the v2 B-tree internal node prefix */ diff --git a/src/H5C.c b/src/H5C.c index d05f686..a5eaa93 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -621,7 +621,7 @@ H5C_apply_candidate_list(H5F_t * f, (int)(cache_ptr->LRU_list_len)); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - /* ====================================================================== * + /* ===================================================================== * * Now scan the LRU and PEL lists, flushing or clearing entries as * needed. * @@ -632,7 +632,7 @@ H5C_apply_candidate_list(H5F_t * f, * to account for this one case where they come into play. If these flags * are ever expanded upon, this function and the following flushing steps * should be reworked to account for additional cases. - * ====================================================================== */ + * ===================================================================== */ entries_examined = 0; initial_list_len = cache_ptr->LRU_list_len; @@ -1612,9 +1612,7 @@ H5C_expunge_entry(H5F_t * f, HDassert(f); HDassert(f->shared); - cache_ptr = f->shared->cache; - HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(type); @@ -2394,7 +2392,7 @@ H5C_get_cache_hit_rate(H5C_t * cache_ptr, double * hit_rate_ptr) FUNC_ENTER_NOAPI(FAIL) - if((cache_ptr == NULL ) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) + if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") if(hit_rate_ptr == NULL) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad hit_rate_ptr on entry.") @@ -2733,7 +2731,7 @@ H5C_insert_entry(H5F_t * f, entry_ptr->cache_ptr = cache_ptr; entry_ptr->addr = addr; entry_ptr->type = type; - + /* Apply tag to newly inserted entry */ if(H5C_tag_entry(cache_ptr, entry_ptr, primary_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") @@ -3469,7 +3467,7 @@ H5C_move_entry(H5C_t * cache_ptr, #endif /* H5C_DO_SANITY_CHECKS */ H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, FAIL) - } + } } H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) @@ -4729,11 +4727,9 @@ H5C_stats(H5C_t * cache_ptr, total_clears += cache_ptr->clears[i]; total_flushes += cache_ptr->flushes[i]; total_evictions += cache_ptr->evictions[i]; - total_moves += cache_ptr->moves[i]; - total_entry_flush_moves - += cache_ptr->entry_flush_moves[i]; - total_cache_flush_moves - += cache_ptr->cache_flush_moves[i]; + total_moves += cache_ptr->moves[i]; + total_entry_flush_moves += cache_ptr->entry_flush_moves[i]; + total_cache_flush_moves += cache_ptr->cache_flush_moves[i]; total_size_increases += cache_ptr->size_increases[i]; total_size_decreases += cache_ptr->size_decreases[i]; total_entry_flush_size_changes @@ -4889,14 +4885,14 @@ H5C_stats(H5C_t * cache_ptr, (long)total_evictions); HDfprintf(stdout, - "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n", + "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, (long)total_insertions, (long)total_pinned_insertions, (long)total_moves); HDfprintf(stdout, - "%s Total entry / cache flush moves = %ld / %ld\n", + "%s Total entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, (long)total_entry_flush_moves, (long)total_cache_flush_moves); @@ -5018,14 +5014,14 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->evictions[i])); HDfprintf(stdout, - "%s insertions(pinned) / moves = %ld(%ld) / %ld\n", + "%s insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, (long)(cache_ptr->insertions[i]), (long)(cache_ptr->pinned_insertions[i]), (long)(cache_ptr->moves[i])); HDfprintf(stdout, - "%s entry / cache flush moves = %ld / %ld\n", + "%s entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->entry_flush_moves[i]), (long)(cache_ptr->cache_flush_moves[i])); @@ -5050,7 +5046,7 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->unpins[i])); HDfprintf(stdout, - "%s entry dirty pins/pin'd flushes = %ld / %ld\n", + "%s entry dirty pins/pin'd flushes = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->dirty_pins[i]), (long)(cache_ptr->pinned_flushes[i])); @@ -5144,8 +5140,8 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) cache_ptr->flushes[i] = 0; cache_ptr->evictions[i] = 0; cache_ptr->moves[i] = 0; - cache_ptr->entry_flush_moves[i] = 0; - cache_ptr->cache_flush_moves[i] = 0; + cache_ptr->entry_flush_moves[i] = 0; + cache_ptr->cache_flush_moves[i] = 0; cache_ptr->pins[i] = 0; cache_ptr->unpins[i] = 0; cache_ptr->dirty_pins[i] = 0; @@ -8943,7 +8939,6 @@ H5C_make_space_in_cache(H5F_t * f, total_entries_scanned++; #endif /* H5C_COLLECT_CACHE_STATS */ - } else { /* Skip epoch markers. Set result to SUCCEED to avoid diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index ae6bdad..7c278e8 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -530,7 +530,7 @@ * * cache_full: Boolean flag used to keep track of whether the cache is * full, so we can refrain from increasing the size of a - * cache which hasn't used up the space alotted to it. + * cache which hasn't used up the space allotted to it. * * The field is initialized to FALSE, and then set to TRUE * whenever we attempt to make space in the cache. @@ -542,7 +542,7 @@ * resize_enabled = size_increase_possible || * size_decrease_possible; * - * size_decreased: Boolean flag set to TRUE whenever the maximun cache + * size_decreased: Boolean flag set to TRUE whenever the maximum cache * size is decreased. The flag triggers a call to * H5C_make_space_in_cache() on the next call to H5C_protect(). * @@ -667,7 +667,7 @@ * pinned into the cache in the current epoch. * * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type + * are used to record the number of times a dirty entry with type * id equal to the array index has been cleared in the current * epoch. * @@ -1217,78 +1217,78 @@ if ( ( (new_size) > (dll_size) ) || \ #define H5C__DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ - H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (tail_ptr)->next = (entry_ptr); \ - (entry_ptr)->prev = (tail_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - (len)++; \ - (Size) += (entry_ptr)->size; +{ \ + H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (tail_ptr)->next = (entry_ptr); \ + (entry_ptr)->prev = (tail_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += (entry_ptr)->size; \ +} /* H5C__DLL_APPEND() */ #define H5C__DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ - H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (head_ptr)->prev = (entry_ptr); \ - (entry_ptr)->next = (head_ptr); \ - (head_ptr) = (entry_ptr); \ - } \ - (len)++; \ - (Size) += entry_ptr->size; +{ \ + H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (head_ptr)->prev = (entry_ptr); \ + (entry_ptr)->next = (head_ptr); \ + (head_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += entry_ptr->size; \ +} /* H5C__DLL_PREPEND() */ #define H5C__DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ - H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - { \ - if ( (head_ptr) == (entry_ptr) ) \ - { \ - (head_ptr) = (entry_ptr)->next; \ - if ( (head_ptr) != NULL ) \ - { \ - (head_ptr)->prev = NULL; \ - } \ - } \ - else \ - { \ - (entry_ptr)->prev->next = (entry_ptr)->next; \ - } \ - if ( (tail_ptr) == (entry_ptr) ) \ - { \ - (tail_ptr) = (entry_ptr)->prev; \ - if ( (tail_ptr) != NULL ) \ - { \ - (tail_ptr)->next = NULL; \ - } \ - } \ - else \ - { \ - (entry_ptr)->next->prev = (entry_ptr)->prev; \ - } \ - entry_ptr->next = NULL; \ - entry_ptr->prev = NULL; \ - (len)--; \ - (Size) -= entry_ptr->size; \ - } +{ \ + H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + { \ + if ( (head_ptr) == (entry_ptr) ) \ + { \ + (head_ptr) = (entry_ptr)->next; \ + if ( (head_ptr) != NULL ) \ + (head_ptr)->prev = NULL; \ + } \ + else \ + (entry_ptr)->prev->next = (entry_ptr)->next; \ + if ( (tail_ptr) == (entry_ptr) ) \ + { \ + (tail_ptr) = (entry_ptr)->prev; \ + if ( (tail_ptr) != NULL ) \ + (tail_ptr)->next = NULL; \ + } \ + else \ + (entry_ptr)->next->prev = (entry_ptr)->prev; \ + entry_ptr->next = NULL; \ + entry_ptr->prev = NULL; \ + (len)--; \ + (Size) -= entry_ptr->size; \ + } \ +} /* H5C__DLL_REMOVE() */ #define H5C__DLL_UPDATE_FOR_SIZE_CHANGE(dll_len, dll_size, old_size, new_size) \ - H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ - (dll_size) -= (old_size); \ - (dll_size) += (new_size); \ - H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) +{ \ + H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ + (dll_size) -= (old_size); \ + (dll_size) += (new_size); \ + H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +} /* H5C__DLL_UPDATE_FOR_SIZE_CHANGE() */ #if H5C_DO_SANITY_CHECKS @@ -1365,72 +1365,68 @@ if ( ( (entry_ptr) == NULL ) || \ #define H5C__AUX_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val)\ - H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (tail_ptr)->aux_next = (entry_ptr); \ - (entry_ptr)->aux_prev = (tail_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - (len)++; \ - (Size) += entry_ptr->size; +{ \ + H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (tail_ptr)->aux_next = (entry_ptr); \ + (entry_ptr)->aux_prev = (tail_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += entry_ptr->size; \ +} /* H5C__AUX_DLL_APPEND() */ #define H5C__AUX_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ - H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fv) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (head_ptr)->aux_prev = (entry_ptr); \ - (entry_ptr)->aux_next = (head_ptr); \ - (head_ptr) = (entry_ptr); \ - } \ - (len)++; \ - (Size) += entry_ptr->size; +{ \ + H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (head_ptr)->aux_prev = (entry_ptr); \ + (entry_ptr)->aux_next = (head_ptr); \ + (head_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += entry_ptr->size; \ +} /* H5C__AUX_DLL_PREPEND() */ #define H5C__AUX_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ - H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fv) \ - { \ - if ( (head_ptr) == (entry_ptr) ) \ - { \ - (head_ptr) = (entry_ptr)->aux_next; \ - if ( (head_ptr) != NULL ) \ - { \ - (head_ptr)->aux_prev = NULL; \ - } \ - } \ - else \ - { \ - (entry_ptr)->aux_prev->aux_next = (entry_ptr)->aux_next; \ - } \ - if ( (tail_ptr) == (entry_ptr) ) \ - { \ - (tail_ptr) = (entry_ptr)->aux_prev; \ - if ( (tail_ptr) != NULL ) \ - { \ - (tail_ptr)->aux_next = NULL; \ - } \ - } \ - else \ - { \ - (entry_ptr)->aux_next->aux_prev = (entry_ptr)->aux_prev; \ - } \ - entry_ptr->aux_next = NULL; \ - entry_ptr->aux_prev = NULL; \ - (len)--; \ - (Size) -= entry_ptr->size; \ - } +{ \ + H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ + { \ + if ( (head_ptr) == (entry_ptr) ) \ + { \ + (head_ptr) = (entry_ptr)->aux_next; \ + if ( (head_ptr) != NULL ) \ + (head_ptr)->aux_prev = NULL; \ + } \ + else \ + (entry_ptr)->aux_prev->aux_next = (entry_ptr)->aux_next; \ + if ( (tail_ptr) == (entry_ptr) ) \ + { \ + (tail_ptr) = (entry_ptr)->aux_prev; \ + if ( (tail_ptr) != NULL ) \ + (tail_ptr)->aux_next = NULL; \ + } \ + else \ + (entry_ptr)->aux_next->aux_prev = (entry_ptr)->aux_prev; \ + entry_ptr->aux_next = NULL; \ + entry_ptr->aux_prev = NULL; \ + (len)--; \ + (Size) -= entry_ptr->size; \ + } \ +} /* H5C__AUX_DLL_REMOVE() */ /*********************************************************************** @@ -1544,185 +1540,195 @@ if ( ( (entry_ptr) == NULL ) || \ #if H5C_COLLECT_CACHE_ENTRY_STATS #define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \ - (entry_ptr)->accesses = 0; \ - (entry_ptr)->clears = 0; \ - (entry_ptr)->flushes = 0; \ - (entry_ptr)->pins = 0; - -#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ - } \ - ((entry_ptr)->clears)++; - -#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ - } \ - ((entry_ptr)->flushes)++; - -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->accesses > \ - ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] \ - = (entry_ptr)->accesses; \ - } \ - if ( (entry_ptr)->accesses < \ - ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] \ - = (entry_ptr)->accesses; \ - } \ - if ( (entry_ptr)->clears > \ - ((cache_ptr)->max_clears)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_clears)[(entry_ptr)->type->id] \ - = (entry_ptr)->clears; \ - } \ - if ( (entry_ptr)->flushes > \ - ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] \ - = (entry_ptr)->flushes; \ - } \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ - = (entry_ptr)->size; \ - } \ - if ( (entry_ptr)->pins > \ - ((cache_ptr)->max_pins)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_pins)[(entry_ptr)->type->id] \ - = (entry_ptr)->pins; \ - } - -#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - (entry_ptr)->pins++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ - (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ - = (entry_ptr)->size; \ - } - -#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ - if ( hit ) \ - ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ - else \ - ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ - if ( ! ((entry_ptr)->is_read_only) ) { \ - ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ - } else { \ - ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ - if ( ((entry_ptr)->ro_ref_count) > \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ - ((entry_ptr)->ro_ref_count); \ - } \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ - (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ - (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ - = (entry_ptr)->size; \ - } \ - ((entry_ptr)->accesses)++; - -#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - (entry_ptr)->pins++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; +{ \ + (entry_ptr)->accesses = 0; \ + (entry_ptr)->clears = 0; \ + (entry_ptr)->flushes = 0; \ + (entry_ptr)->pins = 0; \ +} + +#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ + ((entry_ptr)->clears)++; \ +} + +#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ + ((entry_ptr)->flushes)++; \ +} + +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->accesses > \ + ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] = \ + (entry_ptr)->accesses; \ + if ( (entry_ptr)->accesses < \ + ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] = \ + (entry_ptr)->accesses; \ + if ( (entry_ptr)->clears > \ + ((cache_ptr)->max_clears)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_clears)[(entry_ptr)->type->id] \ + = (entry_ptr)->clears; \ + if ( (entry_ptr)->flushes > \ + ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] \ + = (entry_ptr)->flushes; \ + if ( (entry_ptr)->size > \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ + = (entry_ptr)->size; \ + if ( (entry_ptr)->pins > \ + ((cache_ptr)->max_pins)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_pins)[(entry_ptr)->type->id] \ + = (entry_ptr)->pins; \ +} + +#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) { \ + (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + (entry_ptr)->pins++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ + (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ + if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ( (entry_ptr)->size > \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ + = (entry_ptr)->size; \ + } \ +} + +#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ +{ \ + if ( hit ) \ + ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ + else \ + ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ + if ( ! ((entry_ptr)->is_read_only) ) { \ + ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ + } else { \ + ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ + if ( ((entry_ptr)->ro_ref_count) > \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ + ((entry_ptr)->ro_ref_count); \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ + (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ + if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ + (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ + if ( (entry_ptr)->size > \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] = (entry_ptr)->size; \ + ((entry_ptr)->accesses)++; \ +} + +#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ +{ \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + (entry_ptr)->pins++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ +} #else /* H5C_COLLECT_CACHE_ENTRY_STATS */ #define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) -#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ - } \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; +#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ +{ \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ + (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ +} -#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ - } +#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ +} -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; - -#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ - (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; - -#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ - if ( hit ) \ - ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ - else \ - ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ - if ( ! ((entry_ptr)->is_read_only) ) { \ - ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ - } else { \ - ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ - if ( ((entry_ptr)->ro_ref_count) > \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) { \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ - ((entry_ptr)->ro_ref_count); \ - } \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ - (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ - (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; - -#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; + +#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) { \ + (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ + (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ + if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ +} + +#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ +{ \ + if ( hit ) \ + ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ + else \ + ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ + if ( ! ((entry_ptr)->is_read_only) ) \ + ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ + else { \ + ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ + if ( ((entry_ptr)->ro_ref_count) > \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ + ((entry_ptr)->ro_ref_count); \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ + (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ + if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ + (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ +} + +#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ +{ \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ +} #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index b9acc49..70686fb 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -227,7 +227,7 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) H5E_THROW(H5E_CANTINIT, "can't wrap buffer") /* Compute the 'base' size of the extensible array header on disk */ - size = H5EA_HEADER_SIZE(hdr); + size = H5EA_HEADER_SIZE_HDR(hdr); /* Get a pointer to a buffer that's large enough for serialized header */ if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) @@ -1789,7 +1789,7 @@ H5EA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) H5E_THROW(H5E_CANTINIT, "can't wrap buffer") /* Compute the size of the extensible array data block page on disk */ - size = H5EA_DBLK_PAGE_SIZE(dblk_page); + size = H5EA_DBLK_PAGE_SIZE(udata->hdr); /* Get a pointer to a buffer that's large enough for serialized info */ if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 3c2da7c..37fd68b 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -169,7 +169,7 @@ HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr); /* Set info about data block page on disk */ dblk_page->addr = addr; - dblk_page->size = H5EA_DBLK_PAGE_SIZE(dblk_page); + dblk_page->size = H5EA_DBLK_PAGE_SIZE(hdr); #ifdef QAK HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size); #endif /* QAK */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 136cf1e..76ea6d8 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -230,7 +230,7 @@ HDfprintf(stderr, "%s: hdr->sblk_info[%Zu] = {%Zu, %Zu, %Hu, %Hu}\n", FUNC, u, h } /* end for */ /* Set size of header on disk (locally and in statistics) */ - hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE(hdr); + hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE_HDR(hdr); /* Create the callback context, if there's one */ if(hdr->cparam.cls->crt_context) { diff --git a/src/H5EApkg.h b/src/H5EApkg.h index d89a35e..5382eac 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -66,7 +66,7 @@ ) /* Size of the extensible array header on disk */ -#define H5EA_HEADER_SIZE(h) ( \ +#define H5EA_HEADER_SIZE(sizeof_addr, sizeof_size) ( \ /* General metadata fields */ \ H5EA_METADATA_PREFIX_SIZE(TRUE) \ \ @@ -79,15 +79,25 @@ + 1 /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ \ \ /* Extensible Array statistics fields */ \ - + (h)->sizeof_size /* Number of super blocks created */ \ - + (h)->sizeof_size /* Size of super blocks created */ \ - + (h)->sizeof_size /* Number of data blocks created */ \ - + (h)->sizeof_size /* Size of data blocks created */ \ - + (h)->sizeof_size /* Max. index set */ \ - + (h)->sizeof_size /* Number of elements 'realized' */ \ + + (sizeof_size) /* Number of super blocks created */ \ + + (sizeof_size) /* Size of super blocks created */ \ + + (sizeof_size) /* Number of data blocks created */ \ + + (sizeof_size) /* Size of data blocks created */ \ + + (sizeof_size) /* Max. index set */ \ + + (sizeof_size) /* Number of elements 'realized' */ \ \ /* Extensible Array Header specific fields */ \ - + (h)->sizeof_addr /* File address of index block */ \ + + (sizeof_addr) /* File address of index block */ \ + ) + +/* Size of the extensible array header on disk (via file pointer) */ +#define H5EA_HEADER_SIZE_FILE(f) ( \ + H5EA_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \ + ) + +/* Size of the extensible array header on disk (via extensible array header) */ +#define H5EA_HEADER_SIZE_HDR(h) ( \ + H5EA_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \ ) /* Size of the extensible array index block on disk */ @@ -139,8 +149,8 @@ ) /* Size of the extensible array data block page on disk */ -#define H5EA_DBLK_PAGE_SIZE(p) ( \ - + ((p)->hdr->dblk_page_nelmts * (size_t)(p)->hdr->cparam.raw_elmt_size) /* Elements in data block page */ \ +#define H5EA_DBLK_PAGE_SIZE(h) ( \ + + ((h)->dblk_page_nelmts * (size_t)(h)->cparam.raw_elmt_size) /* Elements in data block page */ \ + H5EA_SIZEOF_CHKSUM /* Checksum for each page */ \ ) diff --git a/src/H5F.c b/src/H5F.c index 3cdb604..d3b9fc8 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1477,3 +1477,4 @@ H5Fclear_elink_file_cache(hid_t file_id) done: FUNC_LEAVE_API(ret_value) } /* end H5Fclear_elink_file_cache() */ + diff --git a/src/H5FAcache.c b/src/H5FAcache.c index a26aee6..9a1fc57 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -189,7 +189,7 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) H5E_THROW(H5E_CANTINIT, "can't wrap buffer") /* Compute the 'base' size of the fixed array header on disk */ - size = H5FA_HEADER_SIZE(hdr); + size = H5FA_HEADER_SIZE_HDR(hdr); /* Get a pointer to a buffer that's large enough for serialized header */ if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) @@ -883,7 +883,7 @@ H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) H5E_THROW(H5E_CANTINIT, "can't wrap buffer") /* Compute the size of the fixed array data block page on disk */ - size = H5FA_DBLK_PAGE_SIZE(dblk_page, udata->nelmts); + size = H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts); /* Get a pointer to a buffer that's large enough for serialized info */ if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index b5ef82c..1f6b706 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -167,7 +167,7 @@ HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr); /* Set info about data block page on disk */ dblk_page->addr = addr; - dblk_page->size = H5FA_DBLK_PAGE_SIZE(dblk_page, nelmts); + dblk_page->size = H5FA_DBLK_PAGE_SIZE(hdr, nelmts); #ifdef H5FA_DEBUG HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size); #endif /* H5FA_DEBUG */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 5970ff0..23c20bc 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -148,7 +148,7 @@ H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata)) HDassert(hdr); /* Set size of header on disk (locally and in statistics) */ - hdr->stats.hdr_size = hdr->size = H5FA_HEADER_SIZE(hdr); + hdr->stats.hdr_size = hdr->size = H5FA_HEADER_SIZE_HDR(hdr); /* Set number of elements for Fixed Array in statistics */ hdr->stats.nelmts = hdr->cparam.nelmts; diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 7101f0b..e7993a6 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -70,7 +70,7 @@ ) /* Size of the Fixed Array header on disk */ -#define H5FA_HEADER_SIZE(h) ( \ +#define H5FA_HEADER_SIZE(sizeof_addr, sizeof_size) ( \ /* General metadata fields */ \ H5FA_METADATA_PREFIX_SIZE(TRUE) \ \ @@ -79,10 +79,20 @@ + 1 /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ \ \ /* Fixed Array statistics fields */ \ - + (h)->sizeof_size /* # of elements in the fixed array */ \ + + (sizeof_size) /* # of elements in the fixed array */ \ \ /* Fixed Array Header specific fields */ \ - + (h)->sizeof_addr /* File address of Fixed Array data block */ \ + + (sizeof_addr) /* File address of Fixed Array data block */ \ + ) + +/* Size of the fixed array header on disk (via file pointer) */ +#define H5FA_HEADER_SIZE_FILE(f) ( \ + H5FA_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \ + ) + +/* Size of the fixed array header on disk (via fixed array header) */ +#define H5FA_HEADER_SIZE_HDR(h) ( \ + H5FA_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \ ) /* Size of the Fixed Array data block prefix on disk */ @@ -108,9 +118,9 @@ ) /* Size of the Fixed Array data block page on disk */ -#define H5FA_DBLK_PAGE_SIZE(d, nelmts) ( \ +#define H5FA_DBLK_PAGE_SIZE(h, nelmts) ( \ /* Fixed Array Data Block Page */ \ - + (nelmts * (size_t)(d)->hdr->cparam.raw_elmt_size) /* Elements in data block page */ \ + + (nelmts * (size_t)(h)->cparam.raw_elmt_size) /* Elements in data block page */ \ + H5FA_SIZEOF_CHKSUM /* Checksum for each page */ \ ) diff --git a/src/H5FS.c b/src/H5FS.c index 90bbe39..42ea070 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -605,7 +605,7 @@ H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space free list") /* Set immutable free list parameters */ - fspace->nclasses = nclasses; + H5_CHECKED_ASSIGN(fspace->nclasses, unsigned, nclasses, size_t); if(nclasses > 0) { if(NULL == (fspace->sect_cls = H5FL_SEQ_MALLOC(H5FS_section_class_t, nclasses))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space section class array") diff --git a/src/H5Fint.c b/src/H5Fint.c index 775c91f..e012ba6 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -2049,3 +2049,66 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_get_file_image() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__set_base_addr + * + * Purpose: Quick and dirty routine to set the file's 'base_addr' value + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * July 19, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__set_base_addr(const H5F_t *f, haddr_t addr) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + HDassert(f); + HDassert(f->shared); + + /* Dispatch to driver */ + if(H5FD_set_base_addr(f->shared->lf, addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_base_addr request failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__set_base_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__set_eoa + * + * Purpose: Quick and dirty routine to set the file's 'eoa' value + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * July 19, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + HDassert(f); + HDassert(f->shared); + + /* Dispatch to driver */ + if(H5FD_set_eoa(f->shared->lf, type, addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__set_eoa() */ + diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index a645fd3..9f70e12 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -89,34 +89,34 @@ + 1 /* reserved */ \ + 4 /* group leaf k, group internal k */ \ + 4) /* consistency flags */ -#define H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) \ +#define H5F_SUPERBLOCK_VARLEN_SIZE_V0(sizeof_addr, sizeof_size) \ ( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \ - + H5F_SIZEOF_ADDR(f) /* base address */ \ - + H5F_SIZEOF_ADDR(f) /* */ \ - + H5F_SIZEOF_ADDR(f) /* EOF address */ \ - + H5F_SIZEOF_ADDR(f) /* driver block address */ \ - + H5G_SIZEOF_ENTRY(f)) /* root group ptr */ -#define H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) \ + + (sizeof_addr) /* base address */ \ + + (sizeof_addr) /* */ \ + + (sizeof_addr) /* EOF address */ \ + + (sizeof_addr) /* driver block address */ \ + + H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */ +#define H5F_SUPERBLOCK_VARLEN_SIZE_V1(sizeof_addr, sizeof_size) \ ( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \ + 2 /* indexed B-tree internal k */ \ + 2 /* reserved */ \ - + H5F_SIZEOF_ADDR(f) /* base address */ \ - + H5F_SIZEOF_ADDR(f) /* */ \ - + H5F_SIZEOF_ADDR(f) /* EOF address */ \ - + H5F_SIZEOF_ADDR(f) /* driver block address */ \ - + H5G_SIZEOF_ENTRY(f)) /* root group ptr */ -#define H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) \ + + (sizeof_addr) /* base address */ \ + + (sizeof_addr) /* */ \ + + (sizeof_addr) /* EOF address */ \ + + (sizeof_addr) /* driver block address */ \ + + H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */ +#define H5F_SUPERBLOCK_VARLEN_SIZE_V2(sizeof_addr) \ ( 2 /* size of address, size of lengths */ \ + 1 /* consistency flags */ \ - + H5F_SIZEOF_ADDR(f) /* base address */ \ - + H5F_SIZEOF_ADDR(f) /* superblock extension address */ \ - + H5F_SIZEOF_ADDR(f) /* EOF address */ \ - + H5F_SIZEOF_ADDR(f) /* root group object header address */ \ + + (sizeof_addr) /* base address */ \ + + (sizeof_addr) /* superblock extension address */ \ + + (sizeof_addr) /* EOF address */ \ + + (sizeof_addr) /* root group object header address */ \ + H5F_SIZEOF_CHKSUM) /* superblock checksum (keep this last) */ #define H5F_SUPERBLOCK_VARLEN_SIZE(v, f) ( \ - (v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) : 0) \ - + (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) : 0) \ - + (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) : 0)) + (v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) : 0) \ + + (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) : 0) \ + + (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(H5F_SIZEOF_ADDR(f)) : 0)) /* Total size of superblock, depends on superblock version */ #define H5F_SUPERBLOCK_SIZE(v, f) ( H5F_SUPERBLOCK_FIXED_SIZE \ @@ -340,6 +340,10 @@ H5_DLL herr_t H5F_efc_release(H5F_efc_t *efc); H5_DLL herr_t H5F_efc_destroy(H5F_efc_t *efc); H5_DLL herr_t H5F_efc_try_close(H5F_t *f); +/* Functions that get/retrieve values from VFD layer */ +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); + /* Testing functions */ #ifdef H5F_TESTING H5_DLL herr_t H5F_get_sohm_mesg_count_test(hid_t fid, unsigned type_id, diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 9a5bfb3..36d7429 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -394,13 +394,13 @@ */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) # define H5F_OVERFLOW_SIZET2OFFT(X) \ - ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(off_t)-1))) + ((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) \ - ((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(off_t)-1))) + ((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(HDoff_t)-1))) #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 #endif diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 6db631e..166247a 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -279,7 +279,7 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id) /* Check for userblock present */ if(H5F_addr_gt(super_addr, 0)) { /* Set the base address for the file in the VFD now */ - if(H5FD_set_base_addr(f->shared->lf, super_addr) < 0) + if(H5F__set_base_addr(f, super_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "failed to set base address for file driver") } /* end if */ @@ -418,13 +418,13 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) sblock->status_flags = 0; /* Reserve space for the userblock */ - if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, userblock_size) < 0) + if(H5F__set_eoa(f, H5FD_MEM_SUPER, userblock_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to set EOA value for userblock") /* Set the base address for the file in the VFD now, after allocating * space for userblock. */ - if(H5FD_set_base_addr(f->shared->lf, sblock->base_addr) < 0) + if(H5F__set_base_addr(f, sblock->base_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to set base address for file driver") /* Save a local copy of the superblock version number */ @@ -455,7 +455,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) superblock_size += driver_size; /* Reserve space in the file for the superblock, instead of allocating it */ - if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, superblock_size) < 0) + if(H5F__set_eoa(f, H5FD_MEM_SUPER, superblock_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to set EOA value for superblock") /* Insert superblock into cache, pinned */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 2cef9f7..3f243de 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -173,7 +173,7 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unknown symbol table entry cache type") } /* end switch */ - *pp = p_ret + H5G_SIZEOF_ENTRY(f); + *pp = p_ret + H5G_SIZEOF_ENTRY_FILE(f); done: FUNC_LEAVE_NOAPI(ret_value) @@ -240,7 +240,7 @@ done: herr_t H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) { - uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY(f); + uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY_FILE(f); herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index b194adb..7346b41 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -55,7 +55,7 @@ + 2 /* Number of symbols */ \ \ /* Entries */ \ - + ((2 * H5F_SYM_LEAF_K(f)) * H5G_SIZEOF_ENTRY(f)) \ + + ((2 * H5F_SYM_LEAF_K(f)) * H5G_SIZEOF_ENTRY_FILE(f)) \ ) diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 50f8bda..130c742 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -47,12 +47,14 @@ * The disk size for a symbol table entry... */ #define H5G_SIZEOF_SCRATCH 16 -#define H5G_SIZEOF_ENTRY(F) \ - (H5F_SIZEOF_SIZE(F) + /*offset of name into heap */ \ - H5F_SIZEOF_ADDR(F) + /*address of object header */ \ +#define H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size) \ + ((sizeof_size) + /*offset of name into heap */ \ + (sizeof_addr) + /*address of object header */ \ 4 + /*entry type */ \ 4 + /*reserved */ \ H5G_SIZEOF_SCRATCH) /*scratch pad space */ +#define H5G_SIZEOF_ENTRY_FILE(F) \ + H5G_SIZEOF_ENTRY(H5F_SIZEOF_ADDR(F), H5F_SIZEOF_SIZE(F)) /* ========= Group Creation properties ============ */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 9f8dfd9..07e5b36 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -262,6 +262,10 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5HF__dtable_encode() */ +/**************************************************/ +/* metadata cache callback definitions for header */ +/**************************************************/ + /*------------------------------------------------------------------------- * Function: H5HF_cache_hdr_load @@ -379,8 +383,8 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Compute the size of the extra filter information */ filter_info_size = (size_t)(hdr->sizeof_size /* Size of size for filtered root direct block */ - + (unsigned)4 /* Size of filter mask for filtered root direct block */ - + hdr->filter_len); /* Size of encoded I/O filter info */ + + (unsigned)4 /* Size of filter mask for filtered root direct block */ + + hdr->filter_len); /* Size of encoded I/O filter info */ /* Compute the heap header's size */ hdr->heap_size = size + filter_info_size; @@ -724,6 +728,10 @@ H5HF_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_hdr_t *hdr, size_t FUNC_LEAVE_NOAPI(SUCCEED) } /* H5HF_cache_hdr_size() */ +/***********************************************************/ +/* metadata cache callback definitions for indirect blocks */ +/***********************************************************/ + /*------------------------------------------------------------------------- * Function: H5HF_cache_iblock_load @@ -1366,6 +1374,10 @@ H5HF_cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_indirect_t *ibl FUNC_LEAVE_NOAPI(SUCCEED) } /* H5HF_cache_iblock_size() */ +/*********************************************************/ +/* metadata cache callback definitions for direct blocks */ +/*********************************************************/ + /*------------------------------------------------------------------------- * Function: H5HF_cache_dblock_load diff --git a/src/H5HGcache.c b/src/H5HGcache.c index f1b5fc6..aac73ed 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -129,10 +129,10 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* Read the initial 4k page */ if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") heap->shared = H5F_SHARED(f); if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, (size_t)H5HG_MINSIZE))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(H5F_block_read(f, H5FD_MEM_GHEAP, addr, (size_t)H5HG_MINSIZE, dxpl_id, heap->chunk) < 0) HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read global heap collection") p = heap->chunk; @@ -260,7 +260,7 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) done: if(!ret_value && heap) if(H5HG_free(heap) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy global heap collection") + HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy global heap collection") FUNC_LEAVE_NOAPI(ret_value) } /* end H5HG_load() */ @@ -367,11 +367,11 @@ done: static herr_t H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - /* Check arguments */ + /* Sanity checks */ HDassert(heap); /* Mark heap as clean */ diff --git a/src/H5MF.c b/src/H5MF.c index eecd724..0c98654 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -565,7 +565,7 @@ HDfprintf(stderr, "%s: size = %Hu\n", FUNC, size); HDassert(size > 0); /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "driver get_eoa request failed") /* Compute value to return */ @@ -598,7 +598,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, +H5MF_xfree(const H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, hsize_t size) { H5F_io_info_t fio_info; /* I/O info for operation */ @@ -862,7 +862,7 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si HDassert(f->shared->lf); /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* Retrieve metadata aggregator info, if available */ diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index d6fc5ce..3a664ef 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -238,7 +238,7 @@ HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC); HDassert(stream); /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa); @@ -265,7 +265,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, if(H5FD_MEM_DEFAULT == f->shared->fs_type_map[type] || type == f->shared->fs_type_map[type]) { /* Retrieve the 'eoa' for this file memory type */ - if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "eoa:", diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index ad5e385..024cc91 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -67,7 +67,7 @@ H5_DLL herr_t H5MF_close(H5F_t *f, hid_t dxpl_id); /* File space allocation routines */ H5_DLL haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); -H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5MF_xfree(const H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); H5_DLL herr_t H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize_t size, hsize_t extra_requested); diff --git a/src/H5MFsection.c b/src/H5MFsection.c index bc147ed..20b9984 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -310,7 +310,7 @@ H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata) HDassert(udata->f); /* Retrieve the end of the file's address space */ - if(HADDR_UNDEF == (eoa = H5FD_get_eoa(udata->f->shared->lf, udata->alloc_type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(udata->f, udata->alloc_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* Compute address of end of section to check */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 3707367..cc262a0 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -35,6 +35,7 @@ #include "H5Spublic.h" /* Dataspace functions */ /* Private headers needed by this file */ +#include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Fprivate.h" /* File access */ #include "H5SLprivate.h" /* Skip lists */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 79726e1..6b3d4ac 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2698,8 +2698,8 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_DOUBLE(*pp, config->empty_reserve); - /* int */ - INT32ENCODE(*pp, (int32_t)config->dirty_bytes_threshold); + /* unsigned */ + UINT32ENCODE(*pp, (uint32_t)config->dirty_bytes_threshold); /* int */ INT32ENCODE(*pp, (int32_t)config->metadata_write_strategy); @@ -2850,8 +2850,8 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value) H5_DECODE_DOUBLE(*pp, config->empty_reserve); - /* int */ - INT32DECODE(*pp, config->dirty_bytes_threshold); + /* unsigned */ + UINT32DECODE(*pp, config->dirty_bytes_threshold); /* int */ INT32DECODE(*pp, config->metadata_write_strategy); diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 98b5213..eaeb889 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -130,13 +130,13 @@ static H5SM_master_table_t * H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udata) { H5SM_master_table_t *table = NULL; - H5WB_t *wb = NULL; /* Wrapped buffer for table data */ + H5WB_t *wb = NULL; /* Wrapped buffer for table data */ uint8_t tbl_buf[H5SM_TBL_BUF_SIZE]; /* Buffer for table */ - uint8_t *buf; /* Reading buffer */ - const uint8_t *p; /* Pointer into input buffer */ - uint32_t stored_chksum; /* Stored metadata checksum value */ - uint32_t computed_chksum; /* Computed metadata checksum value */ - size_t x; /* Counter variable for index headers */ + uint8_t *buf; /* Reading buffer */ + const uint8_t *p; /* Pointer into input buffer */ + uint32_t stored_chksum; /* Stored metadata checksum value */ + uint32_t computed_chksum; /* Computed metadata checksum value */ + size_t u; /* Counter variable for index headers */ H5SM_master_table_t *ret_value; FUNC_ENTER_NOAPI_NOINIT @@ -187,37 +187,37 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void H5_ATTR_UNUSED *udat HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed for SOHM indexes") /* Read in the index headers */ - for(x = 0; x < table->num_indexes; ++x) { + for(u = 0; u < table->num_indexes; ++u) { /* Verify correct version of index list */ if(H5SM_LIST_VERSION != *p++) HGOTO_ERROR(H5E_SOHM, H5E_VERSION, NULL, "bad shared message list version number") /* Type of the index (list or B-tree) */ - table->indexes[x].index_type= (H5SM_index_type_t)*p++; + table->indexes[u].index_type= (H5SM_index_type_t)*p++; /* Type of messages in the index */ - UINT16DECODE(p, table->indexes[x].mesg_types); + UINT16DECODE(p, table->indexes[u].mesg_types); /* Minimum size of message to share */ - UINT32DECODE(p, table->indexes[x].min_mesg_size); + UINT32DECODE(p, table->indexes[u].min_mesg_size); /* List cutoff; fewer than this number and index becomes a list */ - UINT16DECODE(p, table->indexes[x].list_max); + UINT16DECODE(p, table->indexes[u].list_max); /* B-tree cutoff; more than this number and index becomes a B-tree */ - UINT16DECODE(p, table->indexes[x].btree_min); + UINT16DECODE(p, table->indexes[u].btree_min); /* Number of messages shared */ - UINT16DECODE(p, table->indexes[x].num_messages); + UINT16DECODE(p, table->indexes[u].num_messages); /* Address of the actual index */ - H5F_addr_decode(f, &p, &(table->indexes[x].index_addr)); + H5F_addr_decode(f, &p, &(table->indexes[u].index_addr)); /* Address of the index's heap */ - H5F_addr_decode(f, &p, &(table->indexes[x].heap_addr)); + H5F_addr_decode(f, &p, &(table->indexes[u].heap_addr)); /* Compute the size of a list index for this SOHM index */ - table->indexes[x].list_size = H5SM_LIST_SIZE(f, table->indexes[x].list_max); + table->indexes[u].list_size = H5SM_LIST_SIZE(f, table->indexes[u].list_max); } /* end for */ /* Read in checksum */ @@ -279,7 +279,7 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma uint8_t *buf; /* Temporary buffer */ uint8_t *p; /* Pointer into raw data buffer */ uint32_t computed_chksum; /* Computed metadata checksum value */ - size_t x; /* Counter variable */ + size_t u; /* Counter variable */ /* Verify that we're writing version 0 of the table; this is the only * version defined so far. @@ -302,33 +302,33 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma p += H5_SIZEOF_MAGIC; /* Encode each index header */ - for(x = 0; x < table->num_indexes; ++x) { - /* Version for this list. */ + for(u = 0; u < table->num_indexes; ++u) { + /* Version for this list */ *p++ = H5SM_LIST_VERSION; /* Is message index a list or a B-tree? */ - *p++ = table->indexes[x].index_type; + *p++ = table->indexes[u].index_type; /* Type of messages in the index */ - UINT16ENCODE(p, table->indexes[x].mesg_types); + UINT16ENCODE(p, table->indexes[u].mesg_types); /* Minimum size of message to share */ - UINT32ENCODE(p, table->indexes[x].min_mesg_size); + UINT32ENCODE(p, table->indexes[u].min_mesg_size); /* List cutoff; fewer than this number and index becomes a list */ - UINT16ENCODE(p, table->indexes[x].list_max); + UINT16ENCODE(p, table->indexes[u].list_max); /* B-tree cutoff; more than this number and index becomes a B-tree */ - UINT16ENCODE(p, table->indexes[x].btree_min); + UINT16ENCODE(p, table->indexes[u].btree_min); /* Number of messages shared */ - UINT16ENCODE(p, table->indexes[x].num_messages); + UINT16ENCODE(p, table->indexes[u].num_messages); /* Address of the actual index */ - H5F_addr_encode(f, &p, table->indexes[x].index_addr); + H5F_addr_encode(f, &p, table->indexes[u].index_addr); /* Address of the index's heap */ - H5F_addr_encode(f, &p, table->indexes[x].heap_addr); + H5F_addr_encode(f, &p, table->indexes[u].heap_addr); } /* end for */ /* Compute checksum on buffer */ @@ -477,7 +477,7 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) uint8_t *p; /* Pointer into input buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - size_t x; /* Counter variable for messages in list */ + size_t u; /* Counter variable for messages in list */ H5SM_list_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -517,8 +517,8 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Read messages into the list array */ ctx.sizeof_addr = H5F_SIZEOF_ADDR(udata->f); - for(x = 0; x < udata->header->num_messages; x++) { - if(H5SM_message_decode(p, &(list->messages[x]), &ctx) < 0) + for(u = 0; u < udata->header->num_messages; u++) { + if(H5SM_message_decode(p, &(list->messages[u]), &ctx) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "can't decode shared message") p += H5SM_SOHM_ENTRY_SIZE(udata->f); } /* end for */ @@ -537,8 +537,8 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, NULL, "incorrect metadata checksum for shared message list") /* Initialize the rest of the array */ - for(x = udata->header->num_messages; x < udata->header->list_max; x++) - list->messages[x].location = H5SM_NO_LOC; + for(u = udata->header->num_messages; u < udata->header->list_max; u++) + list->messages[u].location = H5SM_NO_LOC; /* Set return value */ ret_value = list; @@ -590,7 +590,7 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis uint8_t *p; /* Pointer into raw data buffer */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t mesgs_written; /* Number of messages written to list */ - size_t x; /* Local index variable */ + size_t u; /* Local index variable */ /* Wrap the local buffer for serialized list index info */ if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf)))) @@ -610,9 +610,9 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis /* Write messages from the messages array to disk */ mesgs_written = 0; ctx.sizeof_addr = H5F_SIZEOF_ADDR(f); - for(x = 0; x < list->header->list_max && mesgs_written < list->header->num_messages; x++) { - if(list->messages[x].location != H5SM_NO_LOC) { - if(H5SM_message_encode(p, &(list->messages[x]), &ctx) < 0) + for(u = 0; u < list->header->list_max && mesgs_written < list->header->num_messages; u++) { + if(list->messages[u].location != H5SM_NO_LOC) { + if(H5SM_message_encode(p, &(list->messages[u]), &ctx) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to write shared message to disk") p += H5SM_SOHM_ENTRY_SIZE(f); diff --git a/test/cache.c b/test/cache.c index 8d6076a..9bf225e 100644 --- a/test/cache.c +++ b/test/cache.c @@ -271,7 +271,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -289,7 +289,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_backward(/* file_ptr */ file_ptr, + row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -307,7 +307,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -336,7 +336,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_forward(/* file_ptr */ file_ptr, + col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -360,7 +360,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_backward(/* file_ptr */ file_ptr, + col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -456,7 +456,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -474,7 +474,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_backward(/* file_ptr */ file_ptr, + row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -492,7 +492,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -521,7 +521,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_forward(/* file_ptr */ file_ptr, + col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -545,7 +545,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_backward(/* file_ptr */ file_ptr, + col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -640,7 +640,7 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -825,7 +825,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -843,7 +843,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_backward(/* file_ptr */ file_ptr, + row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -861,7 +861,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -890,7 +890,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_forward(/* file_ptr */ file_ptr, + col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -914,7 +914,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_backward(/* file_ptr */ file_ptr, + col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -13206,8 +13206,8 @@ check_expunge_entry(void) */ result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL); + &in_cache, &is_dirty, &is_protected, + &is_pinned, NULL, NULL); if ( result < 0 ) { diff --git a/test/cache_common.c b/test/cache_common.c index cce87a9..12001b2 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -19,7 +19,6 @@ * This file contains common code for tests of the cache * implemented in H5C.c */ -#include "H5private.h" /* Put this first, so H5open() isn't invoked in public macros */ #include "h5test.h" #include "H5Cprivate.h" #include "H5Iprivate.h" @@ -799,7 +798,6 @@ notify_dest(H5F_t * f, void * thing) * *------------------------------------------------------------------------- */ - herr_t flush(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, @@ -871,7 +869,6 @@ flush(H5F_t *f, } return(SUCCEED); - } /* flush() */ herr_t @@ -962,7 +959,6 @@ notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); } - /*------------------------------------------------------------------------- * Function: load & friends @@ -1108,7 +1104,6 @@ notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) * *------------------------------------------------------------------------- */ - herr_t size(H5F_t H5_ATTR_UNUSED * f, void * thing, @@ -1134,7 +1129,6 @@ size(H5F_t H5_ATTR_UNUSED * f, *size_ptr = entry_ptr->size; return(SUCCEED); - } /* size() */ herr_t diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 91c1113..02792b1 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -31,6 +31,7 @@ #include "H5Iprivate.h" +#define BASE_ADDR (haddr_t)512 int nerrors = 0; @@ -767,7 +768,7 @@ init_data(void) 1974, 3194, 5168, 8362, 13539}; int i; int j = 0; - haddr_t addr = 512; + haddr_t addr = BASE_ADDR; /* this must hold so moves don't change entry size. */ HDassert( (NUM_DATA_ENTRIES / 2) % 20 == 0 ); @@ -4709,7 +4710,7 @@ verify_total_writes(int expected_total_writes) * Updated for the new local_len field in datum. * *****************************************************************************/ -void +static void unlock_entry(H5F_t * file_ptr, int32_t idx, unsigned int flags) -- cgit v0.12 From 4a2bee5cd8d66dba228fbf942e7394bc40d0f81f Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Sun, 7 Jun 2015 18:03:42 -0500 Subject: [svn-r27158] missed rename if UNUSED to H5_ATTR_UNUSED in trace script. --- bin/trace | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/trace b/bin/trace index 2823982..da6673c 100755 --- a/bin/trace +++ b/bin/trace @@ -179,7 +179,7 @@ sub argstring ($$$) { # Normalize the data type by removing redundant white space, # certain type qualifiers, and indirection. $atype =~ s/^\bconst\b//; - $atype =~ s/\bUNUSED\b//g; + $atype =~ s/\bH5_ATTR_UNUSED\b//g; $atype =~ s/\s+/ /g; $ptr = length $1 if $atype =~ s/(\*+)//; $atype =~ s/^\s+//; -- cgit v0.12 From 02e9a43900cb8d2879b9bb2af9c3a9aba98c8949 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 7 Jun 2015 19:01:32 -0500 Subject: [svn-r27159] Snapshot version 1.9 release 221 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index 155f050..4e8aacc 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.221 currently under development +HDF5 version 1.9.222 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 1e446dc..9df8eff 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -670,7 +670,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 211 +LT_VERS_REVISION = 212 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index d2a0d28..a4aa9af 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 = HDF5 version 1.9.221 currently under development +PROJECT_NUMBER = HDF5 version 1.9.222 currently under development # 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/lt_vers.am b/config/lt_vers.am index ac9150e..f9e6f77 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 211 +LT_VERS_REVISION = 212 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 2807384..7352402 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.221. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.222. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.221' -PACKAGE_STRING='HDF5 1.9.221' +PACKAGE_VERSION='1.9.222' +PACKAGE_STRING='HDF5 1.9.222' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.221 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.222 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1542,7 +1542,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.221:";; + short | recursive ) echo "Configuration of HDF5 1.9.222:";; esac cat <<\_ACEOF @@ -1731,7 +1731,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.221 +HDF5 configure 1.9.222 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2668,7 +2668,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.221, which was +It was created by HDF5 $as_me 1.9.222, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3539,7 +3539,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.221' + VERSION='1.9.222' cat >>confdefs.h <<_ACEOF @@ -28577,7 +28577,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.221 +HDF5 config.lt 1.9.222 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -30693,7 +30693,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.221, which was +This file was extended by HDF5 $as_me 1.9.222, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30759,7 +30759,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.221 +HDF5 config.status 1.9.222 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index d5b91ce..f9776dc 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.221], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.222], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 4c15976..2c36b8c 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -724,7 +724,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 211 +LT_VERS_REVISION = 212 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 5b0071b..6b6bc67 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -662,7 +662,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 211 +LT_VERS_REVISION = 212 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index a0d0bc0..8820964 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 211 +LT_VERS_REVISION = 212 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 3ed70ec..314b11d 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -661,7 +661,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 211 +LT_VERS_REVISION = 212 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index df1117b..18b800e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.221 currently under development +HDF5 version 1.9.222 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index bf6c6de..e625367 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 221 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 222 /* 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.9.221" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.222" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 6dcba84..f546f2f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -723,7 +723,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 211 +LT_VERS_REVISION = 212 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From 929e8ce1281a2a4953f6f3925a8595227fcb8f7f Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 8 Jun 2015 15:52:48 -0500 Subject: [svn-r27162] fix for HDFFV-9412: - Check for mpi is_initialized and is_finalized before making MPI calls in init/terminate of HDF5. - Add a test to make sure we can make serial HDF5 calls from rank 0 after MPI_Finalize is called. tested with h5committest --- src/H5.c | 26 +++++++++-------- testpar/CMakeLists.txt | 1 + testpar/Makefile.am | 5 ++-- testpar/Makefile.in | 24 +++++++++++----- testpar/t_init_term.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 112 insertions(+), 20 deletions(-) create mode 100644 testpar/t_init_term.c diff --git a/src/H5.c b/src/H5.c index ad5ff5f..37476b0 100644 --- a/src/H5.c +++ b/src/H5.c @@ -115,26 +115,27 @@ H5_init_library(void) #ifdef H5_HAVE_PARALLEL { int mpi_initialized; + int mpi_finalized; int mpi_code; MPI_Initialized(&mpi_initialized); + MPI_Finalized(&mpi_finalized); #ifdef H5_HAVE_MPE /* Initialize MPE instrumentation library. */ - if (!H5_MPEinit_g) - { - int mpe_code; - if (mpi_initialized){ - mpe_code = MPE_Init_log(); - HDassert(mpe_code >=0); - H5_MPEinit_g = TRUE; - } + if (!H5_MPEinit_g) { + int mpe_code; + if (mpi_initialized && !mpi_finalized) { + mpe_code = MPE_Init_log(); + HDassert(mpe_code >=0); + H5_MPEinit_g = TRUE; } + } #endif /*H5_HAVE_MPE*/ /* add an attribute on MPI_COMM_SELF to call H5_term_library when it is destroyed, i.e. on MPI_Finalize */ - if (mpi_initialized) { + if (mpi_initialized && !mpi_finalized) { int key_val; if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_NULL_COPY_FN, @@ -334,11 +335,14 @@ H5_term_library(void) * down if any of the below code involves using the instrumentation code. */ if(H5_MPEinit_g) { - int mpe_code; int mpi_initialized; + int mpi_finalized; + int mpe_code; MPI_Initialized(&mpi_initialized); - if(mpi_initialized) { + MPI_Finalized(&mpi_finalized); + + if (mpi_initialized && !mpi_finalized) { mpe_code = MPE_Finish_log("h5log"); HDassert(mpe_code >=0); } /* end if */ diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 70e0246..b02c8e2 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -48,6 +48,7 @@ set (H5P_TESTS t_pflush2 t_pshutdown t_prestart + t_init_term t_shapesame ) diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 1eae439..4fe0ba8 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -25,7 +25,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test programs. These are our main targets. # -TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame +TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame check_PROGRAMS = $(TEST_PROG_PARA) @@ -40,7 +40,8 @@ LDADD = $(LIBH5TEST) $(LIBHDF5) # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf # 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 go +CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 shutdown.h5 after_mpi_fin.h5 go include $(top_srcdir)/config/conclude.am diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 7787a65..dc339cd 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -113,7 +113,7 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = t_mpi$(EXEEXT) testphdf5$(EXEEXT) t_cache$(EXEEXT) \ t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) t_pshutdown$(EXEEXT) \ - t_prestart$(EXEEXT) t_shapesame$(EXEEXT) + t_prestart$(EXEEXT) t_init_term$(EXEEXT) t_shapesame$(EXEEXT) t_cache_SOURCES = t_cache.c t_cache_OBJECTS = t_cache.$(OBJEXT) t_cache_LDADD = $(LDADD) @@ -122,6 +122,10 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +t_init_term_SOURCES = t_init_term.c +t_init_term_OBJECTS = t_init_term.$(OBJEXT) +t_init_term_LDADD = $(LDADD) +t_init_term_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) t_mpi_SOURCES = t_mpi.c t_mpi_OBJECTS = t_mpi.$(OBJEXT) t_mpi_LDADD = $(LDADD) @@ -188,10 +192,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \ - t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES) -DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \ - t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES) +SOURCES = t_cache.c t_init_term.c t_mpi.c t_pflush1.c t_pflush2.c \ + t_prestart.c t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES) +DIST_SOURCES = t_cache.c t_init_term.c t_mpi.c t_pflush1.c t_pflush2.c \ + t_prestart.c t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -687,13 +691,14 @@ TRACE = perl $(top_srcdir)/bin/trace # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf # 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 = *.chkexe *.chklog *.clog *.clog2 MPItest.h5 \ - Para*.h5 CacheTestDummy.h5 shutdown.h5 go + Para*.h5 CacheTestDummy.h5 shutdown.h5 after_mpi_fin.h5 go # Test programs. These are our main targets. # -TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame +TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \ t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c \ t_prop.c @@ -770,6 +775,10 @@ t_cache$(EXEEXT): $(t_cache_OBJECTS) $(t_cache_DEPENDENCIES) $(EXTRA_t_cache_DEP @rm -f t_cache$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_cache_OBJECTS) $(t_cache_LDADD) $(LIBS) +t_init_term$(EXEEXT): $(t_init_term_OBJECTS) $(t_init_term_DEPENDENCIES) $(EXTRA_t_init_term_DEPENDENCIES) + @rm -f t_init_term$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_init_term_OBJECTS) $(t_init_term_LDADD) $(LIBS) + t_mpi$(EXEEXT): $(t_mpi_OBJECTS) $(t_mpi_DEPENDENCIES) $(EXTRA_t_mpi_DEPENDENCIES) @rm -f t_mpi$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_mpi_OBJECTS) $(t_mpi_LDADD) $(LIBS) @@ -811,6 +820,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_filter_read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_init_term.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mdset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mpi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pflush1.Po@am__quote@ diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c new file mode 100644 index 0000000..824f773 --- /dev/null +++ b/testpar/t_init_term.c @@ -0,0 +1,76 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Mohamad Chaarawi + * June 2015 + * + * Purpose: This test checks for the correct initialization and + * termination of the HDF5 library with MPI init and finalize. + */ + +#include "testphdf5.h" + +int nerrors = 0; /* errors count */ + +const char *FILENAME[] = { + "after_mpi_fin", + NULL +}; + +int +main (int argc, char **argv) +{ + int mpi_size, mpi_rank; + MPI_Comm comm = MPI_COMM_WORLD; + + /* Initialize and finalize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + if(MAINPROCESS) + TESTING("Usage of Serial HDF5 after MPI_Finalize() is called"); + + MPI_Finalize(); + + nerrors += GetTestNumErrs(); + + /* test if we can initialize the library with MPI being finalized + and create a file serially */ + H5open(); + + if(mpi_rank == 0) { + char filename[1024]; + hid_t file_id; + + h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename); + file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + VRFY((file_id >= 0), "H5Fcreate succeeded"); + H5Fclose(file_id); + file_id = -1; + } + + H5close(); + + if(MAINPROCESS) { + if(0 == nerrors) + PASSED() + else + H5_FAILED() + } + + return (nerrors!=0); +} -- cgit v0.12 From bf3b382df7fdf4411118e4713cfbab48d09e81b3 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 8 Jun 2015 16:10:14 -0500 Subject: [svn-r27163] update manifest for newly added file. --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 3fd7242..bd6928c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1144,6 +1144,7 @@ ./testpar/t_pshutdown.c ./testpar/t_prestart.c ./testpar/t_span_tree.c +./testpar/t_init_term.c ./testpar/testpar.h ./testpar/testphdf5.c ./testpar/testphdf5.h -- cgit v0.12 From 84311eb7018660f7546291c060d50dc2981edabe Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jun 2015 13:48:03 -0500 Subject: [svn-r27171] Disable big test on cygwin --- test/CMakeLists.txt | 11 +++++++---- test/CMakeTests.cmake | 42 ++++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 55b3c44..20cf3ab 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -85,7 +85,7 @@ if (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$" "${CMAKE_BINARY_DIR}/testdir1/$" ) @@ -116,7 +116,7 @@ if (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$" "${CMAKE_BINARY_DIR}/testdir2/$" ) @@ -190,7 +190,7 @@ set (H5_TESTS objcopy links unlink - big +# big mtime fillval mount @@ -223,6 +223,9 @@ set (H5_TESTS enc_dec_plist_with_endianess unregister ) +if (NOT CYGWIN) + set (H5_TESTS ${H5_TESTS} big) +endif (NOT CYGWIN) foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) @@ -293,7 +296,7 @@ set_target_properties (links_env PROPERTIES FOLDER test) #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -file (WRITE ${GREP_RUNNER} +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\") diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 92e4574..f1cfb59 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -204,7 +204,7 @@ endif (HDF5_TEST_VFD) add_test ( NAME H5TEST-clear-testhdf5-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove coord.h5 dtypes10.h5 sys_file1 @@ -259,7 +259,7 @@ else (HDF5_ENABLE_USING_MEMCHECKER) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) endif (HDF5_ENABLE_USING_MEMCHECKER) - + ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -270,7 +270,7 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5TEST-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove dt_arith1.h5 dt_arith2.h5 dtransform.h5 @@ -337,7 +337,7 @@ add_test ( foreach (test ${H5_TESTS}) add_test (NAME H5TEST-${test} COMMAND $) set_tests_properties (H5TEST-${test} PROPERTIES - DEPENDS H5TEST-clear-objects + DEPENDS H5TEST-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -346,7 +346,9 @@ endforeach (test ${H5_TESTS}) set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-testmeta PROPERTIES TIMEOUT 1800) -set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) +if (NOT CYGWIN) + set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) +endif (NOT CYGWIN) ############################################################################## ############################################################################## @@ -358,7 +360,7 @@ set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) add_test ( NAME H5TEST-clear-cache-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove cache_test.h5 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST @@ -374,14 +376,14 @@ set_tests_properties (H5TEST-cache PROPERTIES add_test ( NAME H5TEST-clear-cache_api-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove cache_api_test.h5 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) add_test (NAME H5TEST-cache_api COMMAND $) set_tests_properties (H5TEST-cache_api PROPERTIES - DEPENDS H5TEST-clear-cache_api-objects + DEPENDS H5TEST-clear-cache_api-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -390,7 +392,7 @@ set_tests_properties (H5TEST-cache_api PROPERTIES add_test ( NAME H5TEST-clear-cache_tagging-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove tagging_test.h5 tagging_ext_test.h5 WORKING_DIRECTORY @@ -407,7 +409,7 @@ set_tests_properties (H5TEST-cache_tagging PROPERTIES add_test ( NAME H5TEST-clear-ttsafe-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove ttsafe_error.h5 ttsafe_dcreate.h5 ttsafe_cancel.h5 @@ -427,7 +429,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_test ( NAME H5TEST-clear-err_compat-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove err_compat.txt err_compat.txt.err WORKING_DIRECTORY @@ -454,7 +456,7 @@ endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_test ( NAME H5TEST-clear-error_test-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove error_test.txt error_test.txt.err WORKING_DIRECTORY @@ -470,7 +472,7 @@ add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) -set_tests_properties (H5TEST-error_test PROPERTIES +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 @@ -482,7 +484,7 @@ add_test ( COMMAND ${CMAKE_COMMAND} -E remove links_env.txt - links_env.txt.err + links_env.txt.err extlinks_env0.h5 extlinks_env1.h5 tmp/extlinks_env1.h5 @@ -610,7 +612,7 @@ if (HDF5_TEST_VFD) if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) add_test ( - NAME VFD-${vfdname}-${vfdtest} + NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -632,7 +634,7 @@ if (HDF5_TEST_VFD) endif(NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) else (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") add_test ( - NAME VFD-${vfdname}-${vfdtest} + NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -649,7 +651,7 @@ if (HDF5_TEST_VFD) endif (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") else (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") add_test ( - NAME VFD-${vfdname}-${vfdtest} + NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -672,7 +674,7 @@ if (HDF5_TEST_VFD) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) else (WIN32) add_test ( - NAME VFD-${vfdname}-${test} + NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -693,7 +695,7 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) if (HDF5_TEST_FHEAP_VFD) add_test ( - NAME VFD-${vfdname}-fheap + NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -710,7 +712,7 @@ if (HDF5_TEST_VFD) ) endif (HDF5_TEST_FHEAP_VFD) ENDMACRO (ADD_VFD_TEST) - + # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) -- cgit v0.12 From 0f4e97907cf40af09eece68546e45cf3f3e473b2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jun 2015 13:52:43 -0500 Subject: [svn-r27172] Change disable to skip big test on cygwin --- test/CMakeLists.txt | 5 +---- test/CMakeTests.cmake | 13 +++++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 20cf3ab..651e4eb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -190,7 +190,7 @@ set (H5_TESTS objcopy links unlink -# big + big mtime fillval mount @@ -223,9 +223,6 @@ set (H5_TESTS enc_dec_plist_with_endianess unregister ) -if (NOT CYGWIN) - set (H5_TESTS ${H5_TESTS} big) -endif (NOT CYGWIN) foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f1cfb59..c7803f6 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -335,7 +335,14 @@ add_test ( ) foreach (test ${H5_TESTS}) - add_test (NAME H5TEST-${test} COMMAND $) + if (${test} STREQUAL "big" AND CYGWIN) + add_test ( + NAME H5TEST-${test} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" + ) + else (${test} STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-${test} COMMAND $) + endif (${test} STREQUAL "big" AND CYGWIN) set_tests_properties (H5TEST-${test} PROPERTIES DEPENDS H5TEST-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" @@ -346,9 +353,7 @@ endforeach (test ${H5_TESTS}) set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-testmeta PROPERTIES TIMEOUT 1800) -if (NOT CYGWIN) - set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) -endif (NOT CYGWIN) +set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) ############################################################################## ############################################################################## -- cgit v0.12 From b9f2a18b5ae9adf23cac4c0336291373a25f0721 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 10 Jun 2015 12:57:32 -0500 Subject: [svn-r27185] fix more instances where both mpi is_initialized and is_finalized need to be checked before making any MPI calls. tested with h5committest. --- src/H5Eint.c | 12 ++-- test/h5test.c | 158 +++++++++++++++++++++++++++------------------------- tools/lib/h5tools.c | 14 ++--- 3 files changed, 96 insertions(+), 88 deletions(-) diff --git a/src/H5Eint.c b/src/H5Eint.c index 2092566..07d1e46 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -272,10 +272,12 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data) /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { - int mpi_rank, mpi_initialized; + int mpi_rank, mpi_initialized, mpi_finalized; MPI_Initialized(&mpi_initialized); - if(mpi_initialized) { + MPI_Finalized(&mpi_finalized); + + if(mpi_initialized && !mpi_finalized) { MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); fprintf(stream, "MPI-process %d", mpi_rank); } /* end if */ @@ -402,10 +404,12 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { - int mpi_rank, mpi_initialized; + int mpi_rank, mpi_initialized, mpi_finalized; MPI_Initialized(&mpi_initialized); - if(mpi_initialized) { + MPI_Finalized(&mpi_finalized); + + if(mpi_initialized && !mpi_finalized) { MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); fprintf(stream, "MPI-process %d", mpi_rank); } /* end if */ diff --git a/test/h5test.c b/test/h5test.c index d73c120..fefacda 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -700,21 +700,24 @@ h5_show_hostname(void) { char hostname[80]; #ifdef H5_HAVE_WIN32_API - WSADATA wsaData; - int err; + WSADATA wsaData; + int err; #endif /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { - int mpi_rank, mpi_initialized; - - MPI_Initialized(&mpi_initialized); - if (mpi_initialized){ - MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); - printf("MPI-process %d.", mpi_rank); - }else - printf("thread 0."); + int mpi_rank, mpi_initialized, mpi_finalized; + + MPI_Initialized(&mpi_initialized); + MPI_Finalized(&mpi_finalized); + + if(mpi_initialized && !mpi_finalized) { + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + printf("MPI-process %d.", mpi_rank); + } + else + printf("thread 0."); } #elif defined(H5_HAVE_THREADSAFE) printf("thread %lu.", HDpthread_self_ulong()); @@ -723,31 +726,31 @@ h5_show_hostname(void) #endif #ifdef H5_HAVE_WIN32_API - err = WSAStartup( MAKEWORD(2,2), &wsaData ); - if ( err != 0 ) { - /* could not find a usable WinSock DLL */ - return; - } - -/* Confirm that the WinSock DLL supports 2.2.*/ -/* Note that if the DLL supports versions greater */ -/* than 2.2 in addition to 2.2, it will still return */ -/* 2.2 in wVersion since that is the version we */ -/* requested. */ - - if ( LOBYTE( wsaData.wVersion ) != 2 || - HIBYTE( wsaData.wVersion ) != 2 ) { - /* could not find a usable WinSock DLL */ - WSACleanup( ); - return; - } + err = WSAStartup( MAKEWORD(2,2), &wsaData ); + if ( err != 0 ) { + /* could not find a usable WinSock DLL */ + return; + } + + /* Confirm that the WinSock DLL supports 2.2.*/ + /* Note that if the DLL supports versions greater */ + /* than 2.2 in addition to 2.2, it will still return */ + /* 2.2 in wVersion since that is the version we */ + /* requested. */ + + if ( LOBYTE( wsaData.wVersion ) != 2 || + HIBYTE( wsaData.wVersion ) != 2 ) { + /* could not find a usable WinSock DLL */ + WSACleanup( ); + return; + } #endif #ifdef H5_HAVE_GETHOSTNAME if (gethostname(hostname, (size_t)80) < 0) - printf(" gethostname failed\n"); + printf(" gethostname failed\n"); else - printf(" hostname=%s\n", hostname); + printf(" hostname=%s\n", hostname); #else printf(" gethostname not supported\n"); #endif @@ -1099,61 +1102,62 @@ int h5_szip_can_encode(void ) char * getenv_all(MPI_Comm comm, int root, const char* name) { - int mpi_size, mpi_rank, mpi_initialized; + int mpi_size, mpi_rank, mpi_initialized, mpi_finalized; int len; static char* env = NULL; assert(name); MPI_Initialized(&mpi_initialized); - if(!mpi_initialized) { - /* use original getenv */ - if(env) - HDfree(env); - env = HDgetenv(name); - } /* end if */ - else { - MPI_Comm_rank(comm, &mpi_rank); - MPI_Comm_size(comm, &mpi_size); - assert(root < mpi_size); - - /* The root task does the getenv call - * and sends the result to the other tasks */ - if(mpi_rank == root) { - env = HDgetenv(name); - if(env) { - len = (int)HDstrlen(env); - MPI_Bcast(&len, 1, MPI_INT, root, comm); - MPI_Bcast(env, len, MPI_CHAR, root, comm); - } - else { - /* len -1 indicates that the variable was not in the environment */ - len = -1; - MPI_Bcast(&len, 1, MPI_INT, root, comm); - } - } - else { - MPI_Bcast(&len, 1, MPI_INT, root, comm); - if(len >= 0) { - if(env == NULL) - env = (char*) HDmalloc((size_t)len+1); - else if(HDstrlen(env) < (size_t)len) - env = (char*) HDrealloc(env, (size_t)len+1); - - MPI_Bcast(env, len, MPI_CHAR, root, comm); - env[len] = '\0'; - } - else { - if(env) - HDfree(env); - env = NULL; - } - } - } - + MPI_Finalized(&mpi_finalized); + + if(mpi_initialized && !mpi_finalized) { + MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_size(comm, &mpi_size); + assert(root < mpi_size); + + /* The root task does the getenv call + * and sends the result to the other tasks */ + if(mpi_rank == root) { + env = HDgetenv(name); + if(env) { + len = (int)HDstrlen(env); + MPI_Bcast(&len, 1, MPI_INT, root, comm); + MPI_Bcast(env, len, MPI_CHAR, root, comm); + } + else { + /* len -1 indicates that the variable was not in the environment */ + len = -1; + MPI_Bcast(&len, 1, MPI_INT, root, comm); + } + } + else { + MPI_Bcast(&len, 1, MPI_INT, root, comm); + if(len >= 0) { + if(env == NULL) + env = (char*) HDmalloc((size_t)len+1); + else if(HDstrlen(env) < (size_t)len) + env = (char*) HDrealloc(env, (size_t)len+1); + + MPI_Bcast(env, len, MPI_CHAR, root, comm); + env[len] = '\0'; + } + else { + if(env) + HDfree(env); + env = NULL; + } + } #ifndef NDEBUG - MPI_Barrier(comm); + MPI_Barrier(comm); #endif + } + else { + /* use original getenv */ + if(env) + HDfree(env); + env = HDgetenv(name); + } /* end if */ return env; } diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 10d150f..c820aff 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -54,9 +54,6 @@ unsigned long long packed_data_mask; /* mask in which packed bits to display */ /* module-scoped variables */ static int h5tools_init_g; /* if h5tools lib has been initialized */ -#ifdef H5_HAVE_PARALLEL -static int h5tools_mpi_init_g; /* if MPI_Init() has been called */ -#endif /* H5_HAVE_PARALLEL */ /* Names of VFDs */ static const char *drivernames[]={ @@ -516,11 +513,14 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) } #ifdef H5_HAVE_PARALLEL else if(!HDstrcmp(driver, drivernames[MPIO_IDX])) { + int mpi_initialized, mpi_finalized; + /* MPI-I/O Driver */ - /* check if MPI has been initialized. */ - if(!h5tools_mpi_init_g) - MPI_Initialized(&h5tools_mpi_init_g); - if(h5tools_mpi_init_g) { + /* check if MPI is available. */ + MPI_Initialized(&mpi_initialized); + MPI_Finalized(&mpi_finalized); + + if(mpi_initialized && !mpi_finalized) { if(H5Pset_fapl_mpio(new_fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) goto error; if(drivernum) -- cgit v0.12 From d92c74b4aa169d33c72ea273dd401ac8586ca56f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 12 Jun 2015 16:33:27 -0500 Subject: [svn-r27196] Move pbbits file to subfolder --- tools/h5dump/CMakeTestsPBITS.cmake | 146 +++++++-------- tools/h5dump/testh5dumppbits.sh.in | 128 +++++++------- .../pbits/tnofilename-with-packed-bits.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsArray.ddl | 14 ++ tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsCompound.ddl | 66 +++++++ tools/testfiles/pbits/tpbitsIncomplete.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl | 18 ++ tools/testfiles/pbits/tpbitsLengthExceeded.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsLengthPositive.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl | 26 +++ tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl | 26 +++ tools/testfiles/pbits/tpbitsMax.ddl | 94 ++++++++++ tools/testfiles/pbits/tpbitsMaxExceeded.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsOffsetExceeded.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsOffsetNegative.ddl | 136 ++++++++++++++ tools/testfiles/pbits/tpbitsOverlapped.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsSigned.ddl | 28 +++ tools/testfiles/pbits/tpbitsSigned2.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsSigned4.ddl | 28 +++ tools/testfiles/pbits/tpbitsSignedInt.ddl | 28 +++ tools/testfiles/pbits/tpbitsSignedInt4.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsSignedInt8.ddl | 34 ++++ tools/testfiles/pbits/tpbitsSignedIntWhole.ddl | 25 +++ tools/testfiles/pbits/tpbitsSignedLong.ddl | 44 +++++ tools/testfiles/pbits/tpbitsSignedLong16.ddl | 67 +++++++ tools/testfiles/pbits/tpbitsSignedLong8.ddl | 96 ++++++++++ tools/testfiles/pbits/tpbitsSignedLongLong.ddl | 68 +++++++ tools/testfiles/pbits/tpbitsSignedLongLong16.ddl | 196 +++++++++++++++++++++ tools/testfiles/pbits/tpbitsSignedLongLong32.ddl | 175 ++++++++++++++++++ .../testfiles/pbits/tpbitsSignedLongLongWhole.ddl | 121 +++++++++++++ .../testfiles/pbits/tpbitsSignedLongLongWhole1.ddl | 175 ++++++++++++++++++ .../pbits/tpbitsSignedLongLongWhole63.ddl | 172 ++++++++++++++++++ tools/testfiles/pbits/tpbitsSignedLongWhole.ddl | 46 +++++ tools/testfiles/pbits/tpbitsSignedWhole.ddl | 17 ++ tools/testfiles/pbits/tpbitsUnsigned.ddl | 28 +++ tools/testfiles/pbits/tpbitsUnsigned2.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsUnsigned4.ddl | 28 +++ tools/testfiles/pbits/tpbitsUnsignedInt.ddl | 28 +++ tools/testfiles/pbits/tpbitsUnsignedInt4.ddl | 50 ++++++ tools/testfiles/pbits/tpbitsUnsignedInt8.ddl | 34 ++++ tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl | 25 +++ tools/testfiles/pbits/tpbitsUnsignedLong.ddl | 44 +++++ tools/testfiles/pbits/tpbitsUnsignedLong16.ddl | 67 +++++++ tools/testfiles/pbits/tpbitsUnsignedLong8.ddl | 96 ++++++++++ tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl | 68 +++++++ tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl | 196 +++++++++++++++++++++ tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl | 175 ++++++++++++++++++ .../pbits/tpbitsUnsignedLongLongWhole.ddl | 176 ++++++++++++++++++ .../pbits/tpbitsUnsignedLongLongWhole1.ddl | 175 ++++++++++++++++++ .../pbits/tpbitsUnsignedLongLongWhole63.ddl | 172 ++++++++++++++++++ tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl | 59 +++++++ tools/testfiles/pbits/tpbitsUnsignedWhole.ddl | 17 ++ tools/testfiles/tnofilename-with-packed-bits.ddl | 136 -------------- tools/testfiles/tpbitsArray.ddl | 14 -- tools/testfiles/tpbitsCharLengthExceeded.ddl | 18 -- tools/testfiles/tpbitsCharOffsetExceeded.ddl | 18 -- tools/testfiles/tpbitsCompound.ddl | 66 ------- tools/testfiles/tpbitsIncomplete.ddl | 136 -------------- tools/testfiles/tpbitsIntLengthExceeded.ddl | 18 -- tools/testfiles/tpbitsIntOffsetExceeded.ddl | 18 -- tools/testfiles/tpbitsLengthExceeded.ddl | 136 -------------- tools/testfiles/tpbitsLengthPositive.ddl | 136 -------------- tools/testfiles/tpbitsLongLengthExceeded.ddl | 26 --- tools/testfiles/tpbitsLongOffsetExceeded.ddl | 26 --- tools/testfiles/tpbitsMax.ddl | 94 ---------- tools/testfiles/tpbitsMaxExceeded.ddl | 136 -------------- tools/testfiles/tpbitsOffsetExceeded.ddl | 136 -------------- tools/testfiles/tpbitsOffsetNegative.ddl | 136 -------------- tools/testfiles/tpbitsOverlapped.ddl | 50 ------ tools/testfiles/tpbitsSigned.ddl | 28 --- tools/testfiles/tpbitsSigned2.ddl | 50 ------ tools/testfiles/tpbitsSigned4.ddl | 28 --- tools/testfiles/tpbitsSignedInt.ddl | 28 --- tools/testfiles/tpbitsSignedInt4.ddl | 50 ------ tools/testfiles/tpbitsSignedInt8.ddl | 34 ---- tools/testfiles/tpbitsSignedIntWhole.ddl | 25 --- tools/testfiles/tpbitsSignedLong.ddl | 44 ----- tools/testfiles/tpbitsSignedLong16.ddl | 67 ------- tools/testfiles/tpbitsSignedLong8.ddl | 96 ---------- tools/testfiles/tpbitsSignedLongLong.ddl | 68 ------- tools/testfiles/tpbitsSignedLongLong16.ddl | 196 --------------------- tools/testfiles/tpbitsSignedLongLong32.ddl | 175 ------------------ tools/testfiles/tpbitsSignedLongLongWhole.ddl | 121 ------------- tools/testfiles/tpbitsSignedLongLongWhole1.ddl | 175 ------------------ tools/testfiles/tpbitsSignedLongLongWhole63.ddl | 172 ------------------ tools/testfiles/tpbitsSignedLongWhole.ddl | 46 ----- tools/testfiles/tpbitsSignedWhole.ddl | 17 -- tools/testfiles/tpbitsUnsigned.ddl | 28 --- tools/testfiles/tpbitsUnsigned2.ddl | 50 ------ tools/testfiles/tpbitsUnsigned4.ddl | 28 --- tools/testfiles/tpbitsUnsignedInt.ddl | 28 --- tools/testfiles/tpbitsUnsignedInt4.ddl | 50 ------ tools/testfiles/tpbitsUnsignedInt8.ddl | 34 ---- tools/testfiles/tpbitsUnsignedIntWhole.ddl | 25 --- tools/testfiles/tpbitsUnsignedLong.ddl | 44 ----- tools/testfiles/tpbitsUnsignedLong16.ddl | 67 ------- tools/testfiles/tpbitsUnsignedLong8.ddl | 96 ---------- tools/testfiles/tpbitsUnsignedLongLong.ddl | 68 ------- tools/testfiles/tpbitsUnsignedLongLong16.ddl | 196 --------------------- tools/testfiles/tpbitsUnsignedLongLong32.ddl | 175 ------------------ tools/testfiles/tpbitsUnsignedLongLongWhole.ddl | 176 ------------------ tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl | 175 ------------------ tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl | 172 ------------------ tools/testfiles/tpbitsUnsignedLongWhole.ddl | 59 ------- tools/testfiles/tpbitsUnsignedWhole.ddl | 17 -- 108 files changed, 4345 insertions(+), 4345 deletions(-) create mode 100644 tools/testfiles/pbits/tnofilename-with-packed-bits.ddl create mode 100644 tools/testfiles/pbits/tpbitsArray.ddl create mode 100644 tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsCompound.ddl create mode 100644 tools/testfiles/pbits/tpbitsIncomplete.ddl create mode 100644 tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsLengthPositive.ddl create mode 100644 tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsMax.ddl create mode 100644 tools/testfiles/pbits/tpbitsMaxExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsOffsetExceeded.ddl create mode 100644 tools/testfiles/pbits/tpbitsOffsetNegative.ddl create mode 100644 tools/testfiles/pbits/tpbitsOverlapped.ddl create mode 100644 tools/testfiles/pbits/tpbitsSigned.ddl create mode 100644 tools/testfiles/pbits/tpbitsSigned2.ddl create mode 100644 tools/testfiles/pbits/tpbitsSigned4.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedInt.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedInt4.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedInt8.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedIntWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLong8.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLong32.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsSignedWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsigned.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsigned2.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsigned4.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedInt.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedInt4.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedInt8.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLong8.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl create mode 100644 tools/testfiles/pbits/tpbitsUnsignedWhole.ddl delete mode 100644 tools/testfiles/tnofilename-with-packed-bits.ddl delete mode 100644 tools/testfiles/tpbitsArray.ddl delete mode 100644 tools/testfiles/tpbitsCharLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsCharOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsCompound.ddl delete mode 100644 tools/testfiles/tpbitsIncomplete.ddl delete mode 100644 tools/testfiles/tpbitsIntLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsIntOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsLengthPositive.ddl delete mode 100644 tools/testfiles/tpbitsLongLengthExceeded.ddl delete mode 100644 tools/testfiles/tpbitsLongOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsMax.ddl delete mode 100644 tools/testfiles/tpbitsMaxExceeded.ddl delete mode 100644 tools/testfiles/tpbitsOffsetExceeded.ddl delete mode 100644 tools/testfiles/tpbitsOffsetNegative.ddl delete mode 100644 tools/testfiles/tpbitsOverlapped.ddl delete mode 100644 tools/testfiles/tpbitsSigned.ddl delete mode 100644 tools/testfiles/tpbitsSigned2.ddl delete mode 100644 tools/testfiles/tpbitsSigned4.ddl delete mode 100644 tools/testfiles/tpbitsSignedInt.ddl delete mode 100644 tools/testfiles/tpbitsSignedInt4.ddl delete mode 100644 tools/testfiles/tpbitsSignedInt8.ddl delete mode 100644 tools/testfiles/tpbitsSignedIntWhole.ddl delete mode 100644 tools/testfiles/tpbitsSignedLong.ddl delete mode 100644 tools/testfiles/tpbitsSignedLong16.ddl delete mode 100644 tools/testfiles/tpbitsSignedLong8.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLong.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLong16.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLong32.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLongWhole1.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongLongWhole63.ddl delete mode 100644 tools/testfiles/tpbitsSignedLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsSignedWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsigned.ddl delete mode 100644 tools/testfiles/tpbitsUnsigned2.ddl delete mode 100644 tools/testfiles/tpbitsUnsigned4.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedInt.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedInt4.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedInt8.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedIntWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLong.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLong16.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLong8.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLong.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLong16.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLong32.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedLongWhole.ddl delete mode 100644 tools/testfiles/tpbitsUnsignedWhole.ddl diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index 421e020..e76fa0e 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -4,65 +4,65 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - + # -------------------------------------------------------------------- # Packed Bits # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory set (HDF5_REFERENCE_PBITS - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIncomplete.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthPositive.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMax.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMaxExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetNegative.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOverlapped.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedIntWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedIntWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole63.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole63.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong16.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong16.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong32.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong32.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl + tnofilename-with-packed-bits.ddl + tpbitsArray.ddl + tpbitsCompound.ddl + tpbitsIncomplete.ddl + tpbitsLengthExceeded.ddl + tpbitsCharLengthExceeded.ddl + tpbitsIntLengthExceeded.ddl + tpbitsLongLengthExceeded.ddl + tpbitsLengthPositive.ddl + tpbitsMax.ddl + tpbitsMaxExceeded.ddl + tpbitsOffsetExceeded.ddl + tpbitsCharOffsetExceeded.ddl + tpbitsIntOffsetExceeded.ddl + tpbitsLongOffsetExceeded.ddl + tpbitsOffsetNegative.ddl + tpbitsOverlapped.ddl + tpbitsSigned.ddl + tpbitsUnsigned.ddl + tpbitsSignedInt.ddl + tpbitsUnsignedInt.ddl + tpbitsSignedLong.ddl + tpbitsUnsignedLong.ddl + tpbitsSignedLongLong.ddl + tpbitsUnsignedLongLong.ddl + tpbitsSignedWhole.ddl + tpbitsUnsignedWhole.ddl + tpbitsSignedIntWhole.ddl + tpbitsUnsignedIntWhole.ddl + tpbitsSignedLongWhole.ddl + tpbitsUnsignedLongWhole.ddl + tpbitsSignedLongLongWhole.ddl + tpbitsUnsignedLongLongWhole.ddl + tpbitsSignedLongLongWhole1.ddl + tpbitsUnsignedLongLongWhole1.ddl + tpbitsSignedLongLongWhole63.ddl + tpbitsUnsignedLongLongWhole63.ddl + tpbitsSigned4.ddl + tpbitsUnsigned4.ddl + tpbitsSignedInt8.ddl + tpbitsUnsignedInt8.ddl + tpbitsSignedLong16.ddl + tpbitsUnsignedLong16.ddl + tpbitsSignedLongLong32.ddl + tpbitsUnsignedLongLong32.ddl + tpbitsSigned2.ddl + tpbitsUnsigned2.ddl + tpbitsSignedInt4.ddl + tpbitsUnsignedInt4.ddl + tpbitsSignedLong8.ddl + tpbitsUnsignedLong8.ddl + tpbitsSignedLongLong16.ddl + tpbitsUnsignedLongLong16.ddl ) set (HDF5_REFERENCE_TEST_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 @@ -70,19 +70,19 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 ) set (HDF5_ERROR_REFERENCE_PBITS - ${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIncomplete.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntLengthExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntOffsetExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthPositive.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongLengthExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongOffsetExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsMaxExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err + tnofilename-with-packed-bits.err + tpbitsCharLengthExceeded.err + tpbitsCharOffsetExceeded.err + tpbitsIncomplete.err + tpbitsIntLengthExceeded.err + tpbitsIntOffsetExceeded.err + tpbitsLengthExceeded.err + tpbitsLengthPositive.err + tpbitsLongLengthExceeded.err + tpbitsLongOffsetExceeded.err + tpbitsMaxExceeded.err + tpbitsOffsetExceeded.err + tpbitsOffsetNegative.err ) foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) @@ -96,7 +96,7 @@ ARGS -E copy_if_different ${pbits_h5_file} ${dest} ) endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) - + foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) @@ -106,7 +106,7 @@ TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${ddl_pbits} ${ddldest} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/pbits/${ddl_pbits} ${ddldest} ) endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) @@ -118,10 +118,10 @@ TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${ddl_pbits} ${ddldest} + ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/errfiles/${ddl_pbits} ${ddldest} ) endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) - + ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -163,7 +163,7 @@ ############################################################################## ############################################################################## -### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### +### T H E T E S T S ### ############################################################################## ############################################################################## @@ -172,7 +172,7 @@ add_test ( NAME H5DUMP_PACKED_BITS-clearall-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove tnofilename-with-packed-bits.out tnofilename-with-packed-bits.out.err tpbitsArray.out diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in index 6556ff5..4211c63 100644 --- a/tools/h5dump/testh5dumppbits.sh.in +++ b/tools/h5dump/testh5dumppbits.sh.in @@ -28,10 +28,10 @@ EXIT_FAILURE=1 DUMPER=h5dump # The tool name DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary -H5DIFF=../h5diff/h5diff # The h5diff tool name +H5DIFF=../h5diff/h5diff # The h5diff tool name H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary -H5IMPORT=../h5import/h5import # The h5import tool name +H5IMPORT=../h5import/h5import # The h5import tool name H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary RM='rm -rf' @@ -81,59 +81,59 @@ $SRC_H5DUMP_TESTFILES/tcompound.h5 " LIST_OTHER_TEST_FILES=" -$SRC_H5DUMP_TESTFILES/tnofilename-with-packed-bits.ddl -$SRC_H5DUMP_TESTFILES/tpbitsArray.ddl -$SRC_H5DUMP_TESTFILES/tpbitsCompound.ddl -$SRC_H5DUMP_TESTFILES/tpbitsIncomplete.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsCharLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsIntLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLongLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLengthPositive.ddl -$SRC_H5DUMP_TESTFILES/tpbitsMax.ddl -$SRC_H5DUMP_TESTFILES/tpbitsMaxExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsCharOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsIntOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLongOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsOffsetNegative.ddl -$SRC_H5DUMP_TESTFILES/tpbitsOverlapped.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSigned.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsigned.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedInt.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedIntWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedIntWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole1.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole1.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole63.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole63.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSigned4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsigned4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedInt8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLong16.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong16.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong32.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong32.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSigned2.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsigned2.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedInt4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLong8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong16.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong16.ddl +$SRC_H5DUMP_TESTFILES/pbits/tnofilename-with-packed-bits.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsArray.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsCompound.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsIncomplete.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsCharLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsIntLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsLongLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsLengthPositive.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsMax.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsMaxExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsCharOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsIntOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsLongOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsOffsetNegative.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsOverlapped.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSigned.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsigned.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedInt.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedInt.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLong.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLong.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLong.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLong.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedIntWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedIntWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLongWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLongWhole.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLongWhole1.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLongWhole1.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLongWhole63.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLongWhole63.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSigned4.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsigned4.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedInt8.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedInt8.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLong16.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLong16.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLong32.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLong32.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSigned2.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsigned2.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedInt4.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedInt4.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLong8.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLong8.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsSignedLongLong16.ddl +$SRC_H5DUMP_TESTFILES/pbits/tpbitsUnsignedLongLong16.ddl " LIST_ERROR_TEST_FILES=" @@ -173,10 +173,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -303,7 +303,7 @@ TOOLTEST2() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actualdata $actual_err @@ -434,7 +434,7 @@ SKIP() { TESTING $DUMPER $@ echo " -SKIP-" } - + # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { @@ -445,7 +445,7 @@ PRINT_H5DIFF() { # Call the h5diff tool # -DIFFTEST() +DIFFTEST() { PRINT_H5DIFF $@ ( @@ -459,7 +459,7 @@ DIFFTEST() else echo " PASSED" fi - + } # Print a line-line message left justified in a field of 70 characters @@ -472,7 +472,7 @@ PRINT_H5IMPORT() { # Call the h5import tool # -IMPORTTEST() +IMPORTTEST() { # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" @@ -483,7 +483,7 @@ IMPORTTEST() PRINT_H5IMPORT $@ ( cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? if [ $RET != 0 ] ; then @@ -492,7 +492,7 @@ IMPORTTEST() else echo " PASSED" fi - + } diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl new file mode 100644 index 0000000..64a2880 --- /dev/null +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -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. + --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) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: missing file name diff --git a/tools/testfiles/pbits/tpbitsArray.ddl b/tools/testfiles/pbits/tpbitsArray.ddl new file mode 100644 index 0000000..125abb8 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsArray.ddl @@ -0,0 +1,14 @@ +HDF5 "tarray1.h5" { +DATASET "/Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0): [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ] + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0): [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ], [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ] + } +} +} diff --git a/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl new file mode 100644 index 0000000..b0683a7 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=2 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl new file mode 100644 index 0000000..530fa05 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=8 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/pbits/tpbitsCompound.ddl b/tools/testfiles/pbits/tpbitsCompound.ddl new file mode 100644 index 0000000..c84272a --- /dev/null +++ b/tools/testfiles/pbits/tpbitsCompound.ddl @@ -0,0 +1,66 @@ +HDF5 "tcompound.h5" { +DATASET "/dset1" { + DATATYPE H5T_COMPOUND { + H5T_STD_I32BE "a_name"; + H5T_IEEE_F32BE "b_name"; + H5T_IEEE_F64BE "c_name"; + } + DATASPACE SIMPLE { ( 5 ) / ( 5 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0): { + 0, + 0, + 1 + }, + (1): { + 1, + 1, + 0.5 + }, + (2): { + 0, + 4, + 0.333333 + }, + (3): { + 1, + 9, + 0.25 + }, + (4): { + 0, + 16, + 0.2 + } + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0): { + 0, + 0, + 1 + }, + (1): { + 0, + 1, + 0.5 + }, + (2): { + 1, + 4, + 0.333333 + }, + (3): { + 1, + 9, + 0.25 + }, + (4): { + 0, + 16, + 0.2 + } + } +} +} diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl new file mode 100644 index 0000000..cdb1f91 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -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. + --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) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl new file mode 100644 index 0000000..1c919cd --- /dev/null +++ b/tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=10 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl new file mode 100644 index 0000000..f3b2a8c --- /dev/null +++ b/tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=16 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl new file mode 100644 index 0000000..6d2492a --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -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. + --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) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl new file mode 100644 index 0000000..4f56619 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -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. + --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) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl new file mode 100644 index 0000000..812c300 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl @@ -0,0 +1,26 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=26 LENGTH=7 + DATA { + (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,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl new file mode 100644 index 0000000..cbea722 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl @@ -0,0 +1,26 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=32 LENGTH=1 + DATA { + (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,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/pbits/tpbitsMax.ddl b/tools/testfiles/pbits/tpbitsMax.ddl new file mode 100644 index 0000000..e569488 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsMax.ddl @@ -0,0 +1,94 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0,0): 1, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0,0): 1, 1, 0, 0, 0, 0, 0, 0, + (1,0): 1, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 0, 0, 0, 0, 0, + (1,0): 1, 1, 0, 0, 0, 0, 0, 0, + (2,0): 1, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=3 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 0, 0, 0, 0, + (1,0): 1, 1, 1, 0, 0, 0, 0, 0, + (2,0): 1, 1, 0, 0, 0, 0, 0, 0, + (3,0): 1, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 0, 0, 0, + (1,0): 1, 1, 1, 1, 0, 0, 0, 0, + (2,0): 1, 1, 1, 0, 0, 0, 0, 0, + (3,0): 1, 1, 0, 0, 0, 0, 0, 0, + (4,0): 1, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=5 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 0, 0, + (1,0): 1, 1, 1, 1, 1, 0, 0, 0, + (2,0): 1, 1, 1, 1, 0, 0, 0, 0, + (3,0): 1, 1, 1, 0, 0, 0, 0, 0, + (4,0): 1, 1, 0, 0, 0, 0, 0, 0, + (5,0): 1, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 1, 0, + (1,0): 1, 1, 1, 1, 1, 1, 0, 0, + (2,0): 1, 1, 1, 1, 1, 0, 0, 0, + (3,0): 1, 1, 1, 1, 0, 0, 0, 0, + (4,0): 1, 1, 1, 0, 0, 0, 0, 0, + (5,0): 1, 1, 0, 0, 0, 0, 0, 0, + (6,0): 1, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=7 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 1, 1, + (1,0): 1, 1, 1, 1, 1, 1, 1, 0, + (2,0): 1, 1, 1, 1, 1, 1, 0, 0, + (3,0): 1, 1, 1, 1, 1, 0, 0, 0, + (4,0): 1, 1, 1, 1, 0, 0, 0, 0, + (5,0): 1, 1, 1, 0, 0, 0, 0, 0, + (6,0): 1, 1, 0, 0, 0, 0, 0, 0, + (7,0): 1, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl new file mode 100644 index 0000000..3432433 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -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. + --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) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl new file mode 100644 index 0000000..e51a09e --- /dev/null +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -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. + --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) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl new file mode 100644 index 0000000..ba6e46d --- /dev/null +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -0,0 +1,136 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- + -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- + -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -t P, --datatype=P Print the specified named datatype + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -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. + --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) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + +--------------- Subsetting Options --------------- + Subsetting is available by using the following options with a dataset + option. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + (Alternate compact form of subsetting is described in the Reference Manual) + +--------------- Option Argument Conventions --------------- + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + See examples below for family, split, and multi driver special file name usage. + + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + +--------------- Examples --------------- + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 + + h5dump -d /foo -f split splitfile + + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + +h5dump error: Bad mask list(-1,1) diff --git a/tools/testfiles/pbits/tpbitsOverlapped.ddl b/tools/testfiles/pbits/tpbitsOverlapped.ddl new file mode 100644 index 0000000..9dcc9d2 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsOverlapped.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0,0): 1, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0,0): 1, 1, 0, 0, 0, 0, 0, 0, + (1,0): 1, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 0, 0, 0, 0, 0, + (1,0): 1, 1, 0, 0, 0, 0, 0, 0, + (2,0): 1, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=0 LENGTH=3 + DATA { + (0,0): 7, 6, 4, 0, 0, 0, 0, 0, + (1,0): 6, 4, 0, 0, 0, 0, 0, 0, + (2,0): 4, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSigned.ddl b/tools/testfiles/pbits/tpbitsSigned.ddl new file mode 100644 index 0000000..b843388 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSigned.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSigned2.ddl b/tools/testfiles/pbits/tpbitsSigned2.ddl new file mode 100644 index 0000000..932b5fd --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSigned2.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 2, 0, 0, 0, 0, + (1,0): 3, 3, 2, 0, 0, 0, 0, 0, + (2,0): 3, 2, 0, 0, 0, 0, 0, 0, + (3,0): 2, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 2, 0, 0, + (1,0): 3, 3, 3, 3, 2, 0, 0, 0, + (2,0): 3, 3, 3, 2, 0, 0, 0, 0, + (3,0): 3, 3, 2, 0, 0, 0, 0, 0, + (4,0): 3, 2, 0, 0, 0, 0, 0, 0, + (5,0): 2, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 3, 3, 2, + (1,0): 3, 3, 3, 3, 3, 3, 2, 0, + (2,0): 3, 3, 3, 3, 3, 2, 0, 0, + (3,0): 3, 3, 3, 3, 2, 0, 0, 0, + (4,0): 3, 3, 3, 2, 0, 0, 0, 0, + (5,0): 3, 3, 2, 0, 0, 0, 0, 0, + (6,0): 3, 2, 0, 0, 0, 0, 0, 0, + (7,0): 2, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSigned4.ddl b/tools/testfiles/pbits/tpbitsSigned4.ddl new file mode 100644 index 0000000..9eacd83 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSigned4.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedInt.ddl b/tools/testfiles/pbits/tpbitsSignedInt.ddl new file mode 100644 index 0000000..5c37e77 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedInt.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=10 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedInt4.ddl b/tools/testfiles/pbits/tpbitsSignedInt4.ddl new file mode 100644 index 0000000..4e9f0f6 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedInt4.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=12 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedInt8.ddl b/tools/testfiles/pbits/tpbitsSignedInt8.ddl new file mode 100644 index 0000000..f2d6069 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedInt8.ddl @@ -0,0 +1,34 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl b/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl new file mode 100644 index 0000000..598c446 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedIntWhole.ddl @@ -0,0 +1,25 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, + (7,11): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLong.ddl b/tools/testfiles/pbits/tpbitsSignedLong.ddl new file mode 100644 index 0000000..b3eba61 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLong.ddl @@ -0,0 +1,44 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=26 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLong16.ddl b/tools/testfiles/pbits/tpbitsSignedLong16.ddl new file mode 100644 index 0000000..83fa889 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLong16.ddl @@ -0,0 +1,67 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLong8.ddl b/tools/testfiles/pbits/tpbitsSignedLong8.ddl new file mode 100644 index 0000000..e99b1d0 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLong8.ddl @@ -0,0 +1,96 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (0,28): 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, + (1,28): 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (2,29): 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,30): 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,30): 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,31): 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=24 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (0,26): 252, 248, 240, 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (1,26): 248, 240, 224, 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (2,26): 240, 224, 192, 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (3,26): 224, 192, 128, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (4,26): 192, 128, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (5,26): 128, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, + (6,26): 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLong.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong.ddl new file mode 100644 index 0000000..2be8a55 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLong.ddl @@ -0,0 +1,68 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=58 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl new file mode 100644 index 0000000..44e336d --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLong16.ddl @@ -0,0 +1,196 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,63): 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=48 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (0,63): 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl b/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl new file mode 100644 index 0000000..6ab4ac4 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLong32.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,57): 0, 0, 0, 0, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,60): 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,63): 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (0,60): 4026531840, 3758096384, 3221225472, 2147483648, + (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (1,60): 3758096384, 3221225472, 2147483648, 0, + (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (2,60): 3221225472, 2147483648, 0, 0, + (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (3,60): 2147483648, 0, 0, 0, + (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, + (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (4,62): 0, 0, + (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl new file mode 100644 index 0000000..134f3be --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl @@ -0,0 +1,121 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=64 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, + (0,31): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (0,36): -68719476736, -137438953472, -274877906944, -549755813888, + (0,40): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (0,44): -17592186044416, -35184372088832, -70368744177664, + (0,47): -140737488355328, -281474976710656, -562949953421312, + (0,50): -1125899906842624, -2251799813685248, -4503599627370496, + (0,53): -9007199254740992, -18014398509481984, -36028797018963968, + (0,56): -72057594037927936, -144115188075855872, -288230376151711744, + (0,59): -576460752303423488, -1152921504606846976, -2305843009213693952, + (0,62): -4611686018427387904, -9223372036854775808, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, + (1,30): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (1,35): -68719476736, -137438953472, -274877906944, -549755813888, + (1,39): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (1,43): -17592186044416, -35184372088832, -70368744177664, + (1,46): -140737488355328, -281474976710656, -562949953421312, + (1,49): -1125899906842624, -2251799813685248, -4503599627370496, + (1,52): -9007199254740992, -18014398509481984, -36028797018963968, + (1,55): -72057594037927936, -144115188075855872, -288230376151711744, + (1,58): -576460752303423488, -1152921504606846976, -2305843009213693952, + (1,61): -4611686018427387904, -9223372036854775808, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, + (2,29): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (2,34): -68719476736, -137438953472, -274877906944, -549755813888, + (2,38): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (2,42): -17592186044416, -35184372088832, -70368744177664, + (2,45): -140737488355328, -281474976710656, -562949953421312, + (2,48): -1125899906842624, -2251799813685248, -4503599627370496, + (2,51): -9007199254740992, -18014398509481984, -36028797018963968, + (2,54): -72057594037927936, -144115188075855872, -288230376151711744, + (2,57): -576460752303423488, -1152921504606846976, -2305843009213693952, + (2,60): -4611686018427387904, -9223372036854775808, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, + (3,29): -4294967296, -8589934592, -17179869184, -34359738368, + (3,33): -68719476736, -137438953472, -274877906944, -549755813888, + (3,37): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (3,41): -17592186044416, -35184372088832, -70368744177664, + (3,44): -140737488355328, -281474976710656, -562949953421312, + (3,47): -1125899906842624, -2251799813685248, -4503599627370496, + (3,50): -9007199254740992, -18014398509481984, -36028797018963968, + (3,53): -72057594037927936, -144115188075855872, -288230376151711744, + (3,56): -576460752303423488, -1152921504606846976, -2305843009213693952, + (3,59): -4611686018427387904, -9223372036854775808, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, + (4,28): -4294967296, -8589934592, -17179869184, -34359738368, + (4,32): -68719476736, -137438953472, -274877906944, -549755813888, + (4,36): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (4,40): -17592186044416, -35184372088832, -70368744177664, + (4,43): -140737488355328, -281474976710656, -562949953421312, + (4,46): -1125899906842624, -2251799813685248, -4503599627370496, + (4,49): -9007199254740992, -18014398509481984, -36028797018963968, + (4,52): -72057594037927936, -144115188075855872, -288230376151711744, + (4,55): -576460752303423488, -1152921504606846976, -2305843009213693952, + (4,58): -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, + (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, + (5,23): -268435456, -536870912, -1073741824, -2147483648, -4294967296, + (5,28): -8589934592, -17179869184, -34359738368, -68719476736, + (5,32): -137438953472, -274877906944, -549755813888, -1099511627776, + (5,36): -2199023255552, -4398046511104, -8796093022208, -17592186044416, + (5,40): -35184372088832, -70368744177664, -140737488355328, + (5,43): -281474976710656, -562949953421312, -1125899906842624, + (5,46): -2251799813685248, -4503599627370496, -9007199254740992, + (5,49): -18014398509481984, -36028797018963968, -72057594037927936, + (5,52): -144115188075855872, -288230376151711744, -576460752303423488, + (5,55): -1152921504606846976, -2305843009213693952, -4611686018427387904, + (5,58): -9223372036854775808, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (6,23): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, + (6,28): -17179869184, -34359738368, -68719476736, -137438953472, + (6,32): -274877906944, -549755813888, -1099511627776, -2199023255552, + (6,36): -4398046511104, -8796093022208, -17592186044416, -35184372088832, + (6,40): -70368744177664, -140737488355328, -281474976710656, + (6,43): -562949953421312, -1125899906842624, -2251799813685248, + (6,46): -4503599627370496, -9007199254740992, -18014398509481984, + (6,49): -36028797018963968, -72057594037927936, -144115188075855872, + (6,52): -288230376151711744, -576460752303423488, -1152921504606846976, + (6,55): -2305843009213693952, -4611686018427387904, -9223372036854775808, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (7,22): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, + (7,27): -17179869184, -34359738368, -68719476736, -137438953472, + (7,31): -274877906944, -549755813888, -1099511627776, -2199023255552, + (7,35): -4398046511104, -8796093022208, -17592186044416, -35184372088832, + (7,39): -70368744177664, -140737488355328, -281474976710656, + (7,42): -562949953421312, -1125899906842624, -2251799813685248, + (7,45): -4503599627370496, -9007199254740992, -18014398509481984, + (7,48): -36028797018963968, -72057594037927936, -144115188075855872, + (7,51): -288230376151711744, -576460752303423488, -1152921504606846976, + (7,54): -2305843009213693952, -4611686018427387904, -9223372036854775808, + (7,57): 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl new file mode 100644 index 0000000..7431670 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=1 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, + (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (0,63): 4611686018427387904, + (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (2,60): 6917529027641081856, 4611686018427387904, 0, 0, + (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (3,60): 4611686018427387904, 0, 0, 0, + (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (4,61): 0, 0, 0, + (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (7,58): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl b/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl new file mode 100644 index 0000000..c7cc65f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl @@ -0,0 +1,172 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (1,60): 6917529027641081856, 4611686018427387904, 0, 0, + (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (2,60): 4611686018427387904, 0, 0, 0, + (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (3,61): 0, 0, 0, + (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl b/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl new file mode 100644 index 0000000..e583f1d --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedLongWhole.ddl @@ -0,0 +1,46 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, + (0,31): -2147483648, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, + (1,30): -2147483648, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, + (2,29): -2147483648, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, + (3,30): 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, + (4,29): 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, + (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, + (5,23): -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (6,23): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (7,22): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsSignedWhole.ddl b/tools/testfiles/pbits/tpbitsSignedWhole.ddl new file mode 100644 index 0000000..f044e23 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsSignedWhole.ddl @@ -0,0 +1,17 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, + (1,0): -2, -4, -8, -16, -32, -64, -128, 0, + (2,0): -4, -8, -16, -32, -64, -128, 0, 0, + (3,0): -8, -16, -32, -64, -128, 0, 0, 0, + (4,0): -16, -32, -64, -128, 0, 0, 0, 0, + (5,0): -32, -64, -128, 0, 0, 0, 0, 0, + (6,0): -64, -128, 0, 0, 0, 0, 0, 0, + (7,0): -128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsigned.ddl b/tools/testfiles/pbits/tpbitsUnsigned.ddl new file mode 100644 index 0000000..9e7ac50 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsigned.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsigned2.ddl b/tools/testfiles/pbits/tpbitsUnsigned2.ddl new file mode 100644 index 0000000..b7e6f79 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsigned2.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 2, 0, 0, 0, 0, + (1,0): 3, 3, 2, 0, 0, 0, 0, 0, + (2,0): 3, 2, 0, 0, 0, 0, 0, 0, + (3,0): 2, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 2, 0, 0, + (1,0): 3, 3, 3, 3, 2, 0, 0, 0, + (2,0): 3, 3, 3, 2, 0, 0, 0, 0, + (3,0): 3, 3, 2, 0, 0, 0, 0, 0, + (4,0): 3, 2, 0, 0, 0, 0, 0, 0, + (5,0): 2, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 3, 3, 2, + (1,0): 3, 3, 3, 3, 3, 3, 2, 0, + (2,0): 3, 3, 3, 3, 3, 2, 0, 0, + (3,0): 3, 3, 3, 3, 2, 0, 0, 0, + (4,0): 3, 3, 3, 2, 0, 0, 0, 0, + (5,0): 3, 3, 2, 0, 0, 0, 0, 0, + (6,0): 3, 2, 0, 0, 0, 0, 0, 0, + (7,0): 2, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsigned4.ddl b/tools/testfiles/pbits/tpbitsUnsigned4.ddl new file mode 100644 index 0000000..d25d838 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsigned4.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedInt.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt.ddl new file mode 100644 index 0000000..5e0fefe --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedInt.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=10 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl new file mode 100644 index 0000000..0d3e38f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedInt4.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=12 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl b/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl new file mode 100644 index 0000000..861ed3e --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedInt8.ddl @@ -0,0 +1,34 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl new file mode 100644 index 0000000..c054011 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl @@ -0,0 +1,25 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLong.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong.ddl new file mode 100644 index 0000000..9f8bcb4 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLong.ddl @@ -0,0 +1,44 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=26 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl new file mode 100644 index 0000000..7a1984f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLong16.ddl @@ -0,0 +1,67 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl b/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl new file mode 100644 index 0000000..17b896c --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLong8.ddl @@ -0,0 +1,96 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (0,28): 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, + (1,28): 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (2,29): 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,30): 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,30): 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,31): 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=24 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (0,26): 252, 248, 240, 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (1,26): 248, 240, 224, 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (2,26): 240, 224, 192, 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (3,26): 224, 192, 128, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (4,26): 192, 128, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (5,26): 128, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, + (6,26): 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl new file mode 100644 index 0000000..1cd9a6c --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl @@ -0,0 +1,68 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=58 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl new file mode 100644 index 0000000..f8b0189 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl @@ -0,0 +1,196 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,63): 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=48 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (0,63): 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl new file mode 100644 index 0000000..befaf5b --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,57): 0, 0, 0, 0, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,60): 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,63): 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (0,60): 4026531840, 3758096384, 3221225472, 2147483648, + (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (1,60): 3758096384, 3221225472, 2147483648, 0, + (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (2,60): 3221225472, 2147483648, 0, 0, + (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (3,60): 2147483648, 0, 0, 0, + (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, + (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (4,62): 0, 0, + (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl new file mode 100644 index 0000000..27c8879 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl @@ -0,0 +1,176 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=64 + DATA { + (0,0): 18446744073709551615, 18446744073709551614, 18446744073709551612, + (0,3): 18446744073709551608, 18446744073709551600, 18446744073709551584, + (0,6): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (0,9): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (0,12): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (0,15): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (0,18): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (0,21): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (0,24): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (0,27): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (0,30): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (0,33): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (0,36): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (0,39): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (0,42): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (0,45): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (0,48): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (0,51): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (0,54): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (0,57): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (0,60): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (0,63): 9223372036854775808, + (1,0): 18446744073709551614, 18446744073709551612, 18446744073709551608, + (1,3): 18446744073709551600, 18446744073709551584, 18446744073709551552, + (1,6): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (1,9): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (1,12): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (1,15): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (1,18): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (1,21): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (1,24): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (1,27): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (1,30): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (1,33): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (1,36): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (1,39): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (1,42): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (1,45): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (1,48): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (1,51): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (1,54): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (1,57): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (1,60): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (1,63): 0, + (2,0): 18446744073709551612, 18446744073709551608, 18446744073709551600, + (2,3): 18446744073709551584, 18446744073709551552, 18446744073709551488, + (2,6): 18446744073709551360, 18446744073709551104, 18446744073709550592, + (2,9): 18446744073709549568, 18446744073709547520, 18446744073709543424, + (2,12): 18446744073709535232, 18446744073709518848, 18446744073709486080, + (2,15): 18446744073709420544, 18446744073709289472, 18446744073709027328, + (2,18): 18446744073708503040, 18446744073707454464, 18446744073705357312, + (2,21): 18446744073701163008, 18446744073692774400, 18446744073675997184, + (2,24): 18446744073642442752, 18446744073575333888, 18446744073441116160, + (2,27): 18446744073172680704, 18446744072635809792, 18446744071562067968, + (2,30): 18446744069414584320, 18446744065119617024, 18446744056529682432, + (2,33): 18446744039349813248, 18446744004990074880, 18446743936270598144, + (2,36): 18446743798831644672, 18446743523953737728, 18446742974197923840, + (2,39): 18446741874686296064, 18446739675663040512, 18446735277616529408, + (2,42): 18446726481523507200, 18446708889337462784, 18446673704965373952, + (2,45): 18446603336221196288, 18446462598732840960, 18446181123756130304, + (2,48): 18445618173802708992, 18444492273895866368, 18442240474082181120, + (2,51): 18437736874454810624, 18428729675200069632, 18410715276690587648, + (2,54): 18374686479671623680, 18302628885633695744, 18158513697557839872, + (2,57): 17870283321406128128, 17293822569102704640, 16140901064495857664, + (2,60): 13835058055282163712, 9223372036854775808, 0, 0, + (3,0): 18446744073709551608, 18446744073709551600, 18446744073709551584, + (3,3): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (3,6): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (3,9): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (3,12): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (3,15): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (3,18): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (3,21): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (3,24): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (3,27): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (3,30): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (3,33): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (3,36): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (3,39): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (3,42): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (3,45): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (3,48): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (3,51): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (3,54): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (3,57): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (3,60): 9223372036854775808, 0, 0, 0, + (4,0): 18446744073709551600, 18446744073709551584, 18446744073709551552, + (4,3): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (4,6): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (4,9): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (4,12): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (4,15): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (4,18): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (4,21): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (4,24): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (4,27): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (4,30): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (4,33): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (4,36): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (4,39): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (4,42): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (4,45): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (4,48): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (4,51): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (4,54): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (4,57): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (4,60): 0, 0, 0, 0, + (5,0): 18446744073709551584, 18446744073709551552, 18446744073709551488, + (5,3): 18446744073709551360, 18446744073709551104, 18446744073709550592, + (5,6): 18446744073709549568, 18446744073709547520, 18446744073709543424, + (5,9): 18446744073709535232, 18446744073709518848, 18446744073709486080, + (5,12): 18446744073709420544, 18446744073709289472, 18446744073709027328, + (5,15): 18446744073708503040, 18446744073707454464, 18446744073705357312, + (5,18): 18446744073701163008, 18446744073692774400, 18446744073675997184, + (5,21): 18446744073642442752, 18446744073575333888, 18446744073441116160, + (5,24): 18446744073172680704, 18446744072635809792, 18446744071562067968, + (5,27): 18446744069414584320, 18446744065119617024, 18446744056529682432, + (5,30): 18446744039349813248, 18446744004990074880, 18446743936270598144, + (5,33): 18446743798831644672, 18446743523953737728, 18446742974197923840, + (5,36): 18446741874686296064, 18446739675663040512, 18446735277616529408, + (5,39): 18446726481523507200, 18446708889337462784, 18446673704965373952, + (5,42): 18446603336221196288, 18446462598732840960, 18446181123756130304, + (5,45): 18445618173802708992, 18444492273895866368, 18442240474082181120, + (5,48): 18437736874454810624, 18428729675200069632, 18410715276690587648, + (5,51): 18374686479671623680, 18302628885633695744, 18158513697557839872, + (5,54): 17870283321406128128, 17293822569102704640, 16140901064495857664, + (5,57): 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, + (6,0): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (6,3): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (6,6): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (6,9): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (6,12): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (6,15): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (6,18): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (6,21): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (6,24): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (6,27): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (6,30): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (6,33): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (6,36): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (6,39): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (6,42): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (6,45): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (6,48): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (6,51): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (6,54): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (6,57): 9223372036854775808, 0, 0, 0, 0, 0, 0, + (7,0): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (7,3): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (7,6): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (7,9): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (7,12): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (7,15): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (7,18): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (7,21): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (7,24): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (7,27): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (7,30): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (7,33): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (7,36): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (7,39): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (7,42): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (7,45): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (7,48): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (7,51): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (7,54): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (7,57): 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl new file mode 100644 index 0000000..0302105 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=1 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, + (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (0,63): 4611686018427387904, + (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (2,60): 6917529027641081856, 4611686018427387904, 0, 0, + (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (3,60): 4611686018427387904, 0, 0, 0, + (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (4,61): 0, 0, 0, + (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (7,58): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl new file mode 100644 index 0000000..6a9b503 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl @@ -0,0 +1,172 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (1,60): 6917529027641081856, 4611686018427387904, 0, 0, + (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (2,60): 4611686018427387904, 0, 0, 0, + (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (3,61): 0, 0, 0, + (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl new file mode 100644 index 0000000..50ad02f --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl @@ -0,0 +1,59 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl b/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl new file mode 100644 index 0000000..7c9e736 --- /dev/null +++ b/tools/testfiles/pbits/tpbitsUnsignedWhole.ddl @@ -0,0 +1,17 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl deleted file mode 100644 index 64a2880..0000000 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -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. - --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) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: missing file name diff --git a/tools/testfiles/tpbitsArray.ddl b/tools/testfiles/tpbitsArray.ddl deleted file mode 100644 index 125abb8..0000000 --- a/tools/testfiles/tpbitsArray.ddl +++ /dev/null @@ -1,14 +0,0 @@ -HDF5 "tarray1.h5" { -DATASET "/Dataset1" { - DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } - DATASPACE SIMPLE { ( 4 ) / ( 4 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0): [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ] - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0): [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ], [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ] - } -} -} diff --git a/tools/testfiles/tpbitsCharLengthExceeded.ddl b/tools/testfiles/tpbitsCharLengthExceeded.ddl deleted file mode 100644 index b0683a7..0000000 --- a/tools/testfiles/tpbitsCharLengthExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=2 LENGTH=7 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/tpbitsCharOffsetExceeded.ddl b/tools/testfiles/tpbitsCharOffsetExceeded.ddl deleted file mode 100644 index 530fa05..0000000 --- a/tools/testfiles/tpbitsCharOffsetExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=8 LENGTH=1 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/tpbitsCompound.ddl b/tools/testfiles/tpbitsCompound.ddl deleted file mode 100644 index c84272a..0000000 --- a/tools/testfiles/tpbitsCompound.ddl +++ /dev/null @@ -1,66 +0,0 @@ -HDF5 "tcompound.h5" { -DATASET "/dset1" { - DATATYPE H5T_COMPOUND { - H5T_STD_I32BE "a_name"; - H5T_IEEE_F32BE "b_name"; - H5T_IEEE_F64BE "c_name"; - } - DATASPACE SIMPLE { ( 5 ) / ( 5 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0): { - 0, - 0, - 1 - }, - (1): { - 1, - 1, - 0.5 - }, - (2): { - 0, - 4, - 0.333333 - }, - (3): { - 1, - 9, - 0.25 - }, - (4): { - 0, - 16, - 0.2 - } - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0): { - 0, - 0, - 1 - }, - (1): { - 0, - 1, - 0.5 - }, - (2): { - 1, - 4, - 0.333333 - }, - (3): { - 1, - 9, - 0.25 - }, - (4): { - 0, - 16, - 0.2 - } - } -} -} diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl deleted file mode 100644 index cdb1f91..0000000 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -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. - --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) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/tpbitsIntLengthExceeded.ddl b/tools/testfiles/tpbitsIntLengthExceeded.ddl deleted file mode 100644 index 1c919cd..0000000 --- a/tools/testfiles/tpbitsIntLengthExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=10 LENGTH=7 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/tpbitsIntOffsetExceeded.ddl b/tools/testfiles/tpbitsIntOffsetExceeded.ddl deleted file mode 100644 index f3b2a8c..0000000 --- a/tools/testfiles/tpbitsIntOffsetExceeded.ddl +++ /dev/null @@ -1,18 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=16 LENGTH=1 - DATA { - (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl deleted file mode 100644 index 6d2492a..0000000 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -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. - --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) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl deleted file mode 100644 index 4f56619..0000000 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -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. - --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) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/tpbitsLongLengthExceeded.ddl b/tools/testfiles/tpbitsLongLengthExceeded.ddl deleted file mode 100644 index 812c300..0000000 --- a/tools/testfiles/tpbitsLongLengthExceeded.ddl +++ /dev/null @@ -1,26 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=26 LENGTH=7 - DATA { - (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,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/tpbitsLongOffsetExceeded.ddl b/tools/testfiles/tpbitsLongOffsetExceeded.ddl deleted file mode 100644 index cbea722..0000000 --- a/tools/testfiles/tpbitsLongOffsetExceeded.ddl +++ /dev/null @@ -1,26 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=32 LENGTH=1 - DATA { - (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,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} -h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/tpbitsMax.ddl b/tools/testfiles/tpbitsMax.ddl deleted file mode 100644 index e569488..0000000 --- a/tools/testfiles/tpbitsMax.ddl +++ /dev/null @@ -1,94 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0,0): 1, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0,0): 1, 1, 0, 0, 0, 0, 0, 0, - (1,0): 1, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 0, 0, 0, 0, 0, - (1,0): 1, 1, 0, 0, 0, 0, 0, 0, - (2,0): 1, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=3 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 0, 0, 0, 0, - (1,0): 1, 1, 1, 0, 0, 0, 0, 0, - (2,0): 1, 1, 0, 0, 0, 0, 0, 0, - (3,0): 1, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 0, 0, 0, - (1,0): 1, 1, 1, 1, 0, 0, 0, 0, - (2,0): 1, 1, 1, 0, 0, 0, 0, 0, - (3,0): 1, 1, 0, 0, 0, 0, 0, 0, - (4,0): 1, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=5 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 1, 0, 0, - (1,0): 1, 1, 1, 1, 1, 0, 0, 0, - (2,0): 1, 1, 1, 1, 0, 0, 0, 0, - (3,0): 1, 1, 1, 0, 0, 0, 0, 0, - (4,0): 1, 1, 0, 0, 0, 0, 0, 0, - (5,0): 1, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=6 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 1, 1, 0, - (1,0): 1, 1, 1, 1, 1, 1, 0, 0, - (2,0): 1, 1, 1, 1, 1, 0, 0, 0, - (3,0): 1, 1, 1, 1, 0, 0, 0, 0, - (4,0): 1, 1, 1, 0, 0, 0, 0, 0, - (5,0): 1, 1, 0, 0, 0, 0, 0, 0, - (6,0): 1, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=7 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 1, 1, 1, 1, 1, - (1,0): 1, 1, 1, 1, 1, 1, 1, 0, - (2,0): 1, 1, 1, 1, 1, 1, 0, 0, - (3,0): 1, 1, 1, 1, 1, 0, 0, 0, - (4,0): 1, 1, 1, 1, 0, 0, 0, 0, - (5,0): 1, 1, 1, 0, 0, 0, 0, 0, - (6,0): 1, 1, 0, 0, 0, 0, 0, 0, - (7,0): 1, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl deleted file mode 100644 index 3432433..0000000 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -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. - --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) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl deleted file mode 100644 index e51a09e..0000000 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -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. - --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) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl deleted file mode 100644 index ba6e46d..0000000 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ /dev/null @@ -1,136 +0,0 @@ -usage: h5dump [OPTIONS] files - OPTIONS - -h, --help Print a usage message and exit - -V, --version Print version number and exit ---------------- File Options --------------- - -n, --contents Print a list of the file contents and exit - Optional value 1 also prints attributes. - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -f D, --filedriver=D Specify which driver to open the file with - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display ---------------- Object Options --------------- - -a P, --attribute=P Print the specified attribute - If an attribute name contains a slash (/), escape the - slash with a preceding backslash (\). - (See example section below.) - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -t P, --datatype=P Print the specified named datatype - -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P - P can be the absolute path or just a relative path. - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. ---------------- Object Property Options --------------- - -i, --object-ids Print the object ids - -p, --properties Print dataset filters, storage layout and fill value - -M L, --packedbits=L Print packed bits as unsigned integers, using mask - format L for an integer dataset specified with - option -d. L is a list of offset,length values, - separated by commas. Offset is the beginning bit in - the data value and length is the number of bits of - the mask. - -R, --region Print dataset pointed by region references ---------------- Formatting Options --------------- - -e, --escape Escape non printing characters - -r, --string Print 1-byte integer datasets as ASCII - -y, --noindex Do not print array indices with the data - -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. - --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) - sets the number of columns to the maximum (65535). - Default width is 80 columns. ---------------- XML Options --------------- - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - ---------------- Subsetting Options --------------- - Subsetting is available by using the following options with a dataset - option. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - (Alternate compact form of subsetting is described in the Reference Manual) - ---------------- Option Argument Conventions --------------- - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - See examples below for family, split, and multi driver special file name usage. - - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - ---------------- Examples --------------- - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - Attribute "high/low" of the group /bar_none in the file quux.h5 - - h5dump -a "/bar_none/high\/low" quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - - 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset - - h5dump -d /dset -M 0,1,4,3 quux.h5 - - 5) Dataset foo in files file1.h5 file2.h5 file3.h5 - - h5dump -d /foo file1.h5 file2.h5 file3.h5 - - 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - - h5dump -d /foo -f split splitfile - - 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 - - h5dump -d /foo -f multi mf - - 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 - - h5dump -d /foo -f family fam%05d.h5 - -h5dump error: Bad mask list(-1,1) diff --git a/tools/testfiles/tpbitsOverlapped.ddl b/tools/testfiles/tpbitsOverlapped.ddl deleted file mode 100644 index 9dcc9d2..0000000 --- a/tools/testfiles/tpbitsOverlapped.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=1 - DATA { - (0,0): 1, 0, 0, 0, 0, 0, 0, 0, - (1,0): 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=1 LENGTH=1 - DATA { - (0,0): 1, 1, 0, 0, 0, 0, 0, 0, - (1,0): 1, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=1 - DATA { - (0,0): 1, 1, 1, 0, 0, 0, 0, 0, - (1,0): 1, 1, 0, 0, 0, 0, 0, 0, - (2,0): 1, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=0 LENGTH=3 - DATA { - (0,0): 7, 6, 4, 0, 0, 0, 0, 0, - (1,0): 6, 4, 0, 0, 0, 0, 0, 0, - (2,0): 4, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSigned.ddl b/tools/testfiles/tpbitsSigned.ddl deleted file mode 100644 index b843388..0000000 --- a/tools/testfiles/tpbitsSigned.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSigned2.ddl b/tools/testfiles/tpbitsSigned2.ddl deleted file mode 100644 index 932b5fd..0000000 --- a/tools/testfiles/tpbitsSigned2.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 2, 0, 0, 0, 0, - (1,0): 3, 3, 2, 0, 0, 0, 0, 0, - (2,0): 3, 2, 0, 0, 0, 0, 0, 0, - (3,0): 2, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 2, 0, 0, - (1,0): 3, 3, 3, 3, 2, 0, 0, 0, - (2,0): 3, 3, 3, 2, 0, 0, 0, 0, - (3,0): 3, 3, 2, 0, 0, 0, 0, 0, - (4,0): 3, 2, 0, 0, 0, 0, 0, 0, - (5,0): 2, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=6 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 3, 3, 2, - (1,0): 3, 3, 3, 3, 3, 3, 2, 0, - (2,0): 3, 3, 3, 3, 3, 2, 0, 0, - (3,0): 3, 3, 3, 3, 2, 0, 0, 0, - (4,0): 3, 3, 3, 2, 0, 0, 0, 0, - (5,0): 3, 3, 2, 0, 0, 0, 0, 0, - (6,0): 3, 2, 0, 0, 0, 0, 0, 0, - (7,0): 2, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSigned4.ddl b/tools/testfiles/tpbitsSigned4.ddl deleted file mode 100644 index 9eacd83..0000000 --- a/tools/testfiles/tpbitsSigned4.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedInt.ddl b/tools/testfiles/tpbitsSignedInt.ddl deleted file mode 100644 index 5c37e77..0000000 --- a/tools/testfiles/tpbitsSignedInt.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=10 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedInt4.ddl b/tools/testfiles/tpbitsSignedInt4.ddl deleted file mode 100644 index 4e9f0f6..0000000 --- a/tools/testfiles/tpbitsSignedInt4.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=12 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedInt8.ddl b/tools/testfiles/tpbitsSignedInt8.ddl deleted file mode 100644 index f2d6069..0000000 --- a/tools/testfiles/tpbitsSignedInt8.ddl +++ /dev/null @@ -1,34 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedIntWhole.ddl b/tools/testfiles/tpbitsSignedIntWhole.ddl deleted file mode 100644 index 598c446..0000000 --- a/tools/testfiles/tpbitsSignedIntWhole.ddl +++ /dev/null @@ -1,25 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS16BITS" { - DATATYPE H5T_STD_I16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, - (0,12): -4096, -8192, -16384, -32768, - (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (1,12): -8192, -16384, -32768, 0, - (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (2,11): -8192, -16384, -32768, 0, 0, - (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (3,11): -16384, -32768, 0, 0, 0, - (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (4,10): -16384, -32768, 0, 0, 0, 0, - (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, - (5,10): -32768, 0, 0, 0, 0, 0, - (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (6,10): 0, 0, 0, 0, 0, 0, - (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, - (7,11): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLong.ddl b/tools/testfiles/tpbitsSignedLong.ddl deleted file mode 100644 index b3eba61..0000000 --- a/tools/testfiles/tpbitsSignedLong.ddl +++ /dev/null @@ -1,44 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=26 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLong16.ddl b/tools/testfiles/tpbitsSignedLong16.ddl deleted file mode 100644 index 83fa889..0000000 --- a/tools/testfiles/tpbitsSignedLong16.ddl +++ /dev/null @@ -1,67 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLong8.ddl b/tools/testfiles/tpbitsSignedLong8.ddl deleted file mode 100644 index e99b1d0..0000000 --- a/tools/testfiles/tpbitsSignedLong8.ddl +++ /dev/null @@ -1,96 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (0,28): 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, - (1,28): 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (2,29): 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,30): 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,30): 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,31): 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=24 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (0,26): 252, 248, 240, 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (1,26): 248, 240, 224, 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (2,26): 240, 224, 192, 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (3,26): 224, 192, 128, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (4,26): 192, 128, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (5,26): 128, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, - (6,26): 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (7,27): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLong.ddl b/tools/testfiles/tpbitsSignedLongLong.ddl deleted file mode 100644 index 2be8a55..0000000 --- a/tools/testfiles/tpbitsSignedLongLong.ddl +++ /dev/null @@ -1,68 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=58 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLong16.ddl b/tools/testfiles/tpbitsSignedLongLong16.ddl deleted file mode 100644 index 44e336d..0000000 --- a/tools/testfiles/tpbitsSignedLongLong16.ddl +++ /dev/null @@ -1,196 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,63): 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=48 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (0,63): 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLong32.ddl b/tools/testfiles/tpbitsSignedLongLong32.ddl deleted file mode 100644 index 6ab4ac4..0000000 --- a/tools/testfiles/tpbitsSignedLongLong32.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,57): 0, 0, 0, 0, 0, 0, 0, - (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,60): 0, 0, 0, 0, - (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,63): 0, - (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (0,60): 4026531840, 3758096384, 3221225472, 2147483648, - (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (1,60): 3758096384, 3221225472, 2147483648, 0, - (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (2,60): 3221225472, 2147483648, 0, 0, - (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (3,60): 2147483648, 0, 0, 0, - (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, - (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (4,62): 0, 0, - (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, - (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole.ddl b/tools/testfiles/tpbitsSignedLongLongWhole.ddl deleted file mode 100644 index 134f3be..0000000 --- a/tools/testfiles/tpbitsSignedLongLongWhole.ddl +++ /dev/null @@ -1,121 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=64 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, - (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, - (0,31): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, - (0,36): -68719476736, -137438953472, -274877906944, -549755813888, - (0,40): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (0,44): -17592186044416, -35184372088832, -70368744177664, - (0,47): -140737488355328, -281474976710656, -562949953421312, - (0,50): -1125899906842624, -2251799813685248, -4503599627370496, - (0,53): -9007199254740992, -18014398509481984, -36028797018963968, - (0,56): -72057594037927936, -144115188075855872, -288230376151711744, - (0,59): -576460752303423488, -1152921504606846976, -2305843009213693952, - (0,62): -4611686018427387904, -9223372036854775808, - (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, - (1,30): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, - (1,35): -68719476736, -137438953472, -274877906944, -549755813888, - (1,39): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (1,43): -17592186044416, -35184372088832, -70368744177664, - (1,46): -140737488355328, -281474976710656, -562949953421312, - (1,49): -1125899906842624, -2251799813685248, -4503599627370496, - (1,52): -9007199254740992, -18014398509481984, -36028797018963968, - (1,55): -72057594037927936, -144115188075855872, -288230376151711744, - (1,58): -576460752303423488, -1152921504606846976, -2305843009213693952, - (1,61): -4611686018427387904, -9223372036854775808, 0, - (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, - (2,29): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, - (2,34): -68719476736, -137438953472, -274877906944, -549755813888, - (2,38): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (2,42): -17592186044416, -35184372088832, -70368744177664, - (2,45): -140737488355328, -281474976710656, -562949953421312, - (2,48): -1125899906842624, -2251799813685248, -4503599627370496, - (2,51): -9007199254740992, -18014398509481984, -36028797018963968, - (2,54): -72057594037927936, -144115188075855872, -288230376151711744, - (2,57): -576460752303423488, -1152921504606846976, -2305843009213693952, - (2,60): -4611686018427387904, -9223372036854775808, 0, 0, - (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, - (3,29): -4294967296, -8589934592, -17179869184, -34359738368, - (3,33): -68719476736, -137438953472, -274877906944, -549755813888, - (3,37): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (3,41): -17592186044416, -35184372088832, -70368744177664, - (3,44): -140737488355328, -281474976710656, -562949953421312, - (3,47): -1125899906842624, -2251799813685248, -4503599627370496, - (3,50): -9007199254740992, -18014398509481984, -36028797018963968, - (3,53): -72057594037927936, -144115188075855872, -288230376151711744, - (3,56): -576460752303423488, -1152921504606846976, -2305843009213693952, - (3,59): -4611686018427387904, -9223372036854775808, 0, 0, 0, - (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, - (4,28): -4294967296, -8589934592, -17179869184, -34359738368, - (4,32): -68719476736, -137438953472, -274877906944, -549755813888, - (4,36): -1099511627776, -2199023255552, -4398046511104, -8796093022208, - (4,40): -17592186044416, -35184372088832, -70368744177664, - (4,43): -140737488355328, -281474976710656, -562949953421312, - (4,46): -1125899906842624, -2251799813685248, -4503599627370496, - (4,49): -9007199254740992, -18014398509481984, -36028797018963968, - (4,52): -72057594037927936, -144115188075855872, -288230376151711744, - (4,55): -576460752303423488, -1152921504606846976, -2305843009213693952, - (4,58): -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, - (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, - (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, - (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, - (5,23): -268435456, -536870912, -1073741824, -2147483648, -4294967296, - (5,28): -8589934592, -17179869184, -34359738368, -68719476736, - (5,32): -137438953472, -274877906944, -549755813888, -1099511627776, - (5,36): -2199023255552, -4398046511104, -8796093022208, -17592186044416, - (5,40): -35184372088832, -70368744177664, -140737488355328, - (5,43): -281474976710656, -562949953421312, -1125899906842624, - (5,46): -2251799813685248, -4503599627370496, -9007199254740992, - (5,49): -18014398509481984, -36028797018963968, -72057594037927936, - (5,52): -144115188075855872, -288230376151711744, -576460752303423488, - (5,55): -1152921504606846976, -2305843009213693952, -4611686018427387904, - (5,58): -9223372036854775808, 0, 0, 0, 0, 0, - (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (6,23): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, - (6,28): -17179869184, -34359738368, -68719476736, -137438953472, - (6,32): -274877906944, -549755813888, -1099511627776, -2199023255552, - (6,36): -4398046511104, -8796093022208, -17592186044416, -35184372088832, - (6,40): -70368744177664, -140737488355328, -281474976710656, - (6,43): -562949953421312, -1125899906842624, -2251799813685248, - (6,46): -4503599627370496, -9007199254740992, -18014398509481984, - (6,49): -36028797018963968, -72057594037927936, -144115188075855872, - (6,52): -288230376151711744, -576460752303423488, -1152921504606846976, - (6,55): -2305843009213693952, -4611686018427387904, -9223372036854775808, - (6,58): 0, 0, 0, 0, 0, 0, - (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (7,22): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, - (7,27): -17179869184, -34359738368, -68719476736, -137438953472, - (7,31): -274877906944, -549755813888, -1099511627776, -2199023255552, - (7,35): -4398046511104, -8796093022208, -17592186044416, -35184372088832, - (7,39): -70368744177664, -140737488355328, -281474976710656, - (7,42): -562949953421312, -1125899906842624, -2251799813685248, - (7,45): -4503599627370496, -9007199254740992, -18014398509481984, - (7,48): -36028797018963968, -72057594037927936, -144115188075855872, - (7,51): -288230376151711744, -576460752303423488, -1152921504606846976, - (7,54): -2305843009213693952, -4611686018427387904, -9223372036854775808, - (7,57): 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole1.ddl b/tools/testfiles/tpbitsSignedLongLongWhole1.ddl deleted file mode 100644 index 7431670..0000000 --- a/tools/testfiles/tpbitsSignedLongLongWhole1.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=1 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, - (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (0,63): 4611686018427387904, - (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (2,60): 6917529027641081856, 4611686018427387904, 0, 0, - (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (3,60): 4611686018427387904, 0, 0, 0, - (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (4,61): 0, 0, 0, - (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (7,58): 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole63.ddl b/tools/testfiles/tpbitsSignedLongLongWhole63.ddl deleted file mode 100644 index c7cc65f..0000000 --- a/tools/testfiles/tpbitsSignedLongLongWhole63.ddl +++ /dev/null @@ -1,172 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS64BITS" { - DATATYPE H5T_STD_I64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (1,60): 6917529027641081856, 4611686018427387904, 0, 0, - (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (2,60): 4611686018427387904, 0, 0, 0, - (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (3,61): 0, 0, 0, - (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (6,58): 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedLongWhole.ddl b/tools/testfiles/tpbitsSignedLongWhole.ddl deleted file mode 100644 index e583f1d..0000000 --- a/tools/testfiles/tpbitsSignedLongWhole.ddl +++ /dev/null @@ -1,46 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS32BITS" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, - (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, - (0,31): -2147483648, - (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, - (1,30): -2147483648, 0, - (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, - (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, - (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, - (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, - (2,29): -2147483648, 0, 0, - (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, - (3,30): 0, 0, - (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, - (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, - (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, - (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, - (4,29): 0, 0, 0, - (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, - (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, - (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, - (5,23): -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, - (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (6,23): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, - (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, - (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, - (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, - (7,22): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsSignedWhole.ddl b/tools/testfiles/tpbitsSignedWhole.ddl deleted file mode 100644 index f044e23..0000000 --- a/tools/testfiles/tpbitsSignedWhole.ddl +++ /dev/null @@ -1,17 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DS08BITS" { - DATATYPE H5T_STD_I8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): -1, -2, -4, -8, -16, -32, -64, -128, - (1,0): -2, -4, -8, -16, -32, -64, -128, 0, - (2,0): -4, -8, -16, -32, -64, -128, 0, 0, - (3,0): -8, -16, -32, -64, -128, 0, 0, 0, - (4,0): -16, -32, -64, -128, 0, 0, 0, 0, - (5,0): -32, -64, -128, 0, 0, 0, 0, 0, - (6,0): -64, -128, 0, 0, 0, 0, 0, 0, - (7,0): -128, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsigned.ddl b/tools/testfiles/tpbitsUnsigned.ddl deleted file mode 100644 index 9e7ac50..0000000 --- a/tools/testfiles/tpbitsUnsigned.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsigned2.ddl b/tools/testfiles/tpbitsUnsigned2.ddl deleted file mode 100644 index b7e6f79..0000000 --- a/tools/testfiles/tpbitsUnsigned2.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=2 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 2, 0, 0, 0, 0, - (1,0): 3, 3, 2, 0, 0, 0, 0, 0, - (2,0): 3, 2, 0, 0, 0, 0, 0, 0, - (3,0): 2, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 2, 0, 0, - (1,0): 3, 3, 3, 3, 2, 0, 0, 0, - (2,0): 3, 3, 3, 2, 0, 0, 0, 0, - (3,0): 3, 3, 2, 0, 0, 0, 0, 0, - (4,0): 3, 2, 0, 0, 0, 0, 0, 0, - (5,0): 2, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=6 LENGTH=2 - DATA { - (0,0): 3, 3, 3, 3, 3, 3, 3, 2, - (1,0): 3, 3, 3, 3, 3, 3, 2, 0, - (2,0): 3, 3, 3, 3, 3, 2, 0, 0, - (3,0): 3, 3, 3, 3, 2, 0, 0, 0, - (4,0): 3, 3, 3, 2, 0, 0, 0, 0, - (5,0): 3, 3, 2, 0, 0, 0, 0, 0, - (6,0): 3, 2, 0, 0, 0, 0, 0, 0, - (7,0): 2, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsigned4.ddl b/tools/testfiles/tpbitsUnsigned4.ddl deleted file mode 100644 index d25d838..0000000 --- a/tools/testfiles/tpbitsUnsigned4.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedInt.ddl b/tools/testfiles/tpbitsUnsignedInt.ddl deleted file mode 100644 index 5e0fefe..0000000 --- a/tools/testfiles/tpbitsUnsignedInt.ddl +++ /dev/null @@ -1,28 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=10 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedInt4.ddl b/tools/testfiles/tpbitsUnsignedInt4.ddl deleted file mode 100644 index 0d3e38f..0000000 --- a/tools/testfiles/tpbitsUnsignedInt4.ddl +++ /dev/null @@ -1,50 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=4 - DATA { - (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=4 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=12 LENGTH=4 - DATA { - (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, - (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, - (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, - (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, - (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, - (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, - (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, - (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedInt8.ddl b/tools/testfiles/tpbitsUnsignedInt8.ddl deleted file mode 100644 index 861ed3e..0000000 --- a/tools/testfiles/tpbitsUnsignedInt8.ddl +++ /dev/null @@ -1,34 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedIntWhole.ddl b/tools/testfiles/tpbitsUnsignedIntWhole.ddl deleted file mode 100644 index c054011..0000000 --- a/tools/testfiles/tpbitsUnsignedIntWhole.ddl +++ /dev/null @@ -1,25 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU16BITS" { - DATATYPE H5T_STD_U16LE - DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLong.ddl b/tools/testfiles/tpbitsUnsignedLong.ddl deleted file mode 100644 index 9f8bcb4..0000000 --- a/tools/testfiles/tpbitsUnsignedLong.ddl +++ /dev/null @@ -1,44 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=26 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLong16.ddl b/tools/testfiles/tpbitsUnsignedLong16.ddl deleted file mode 100644 index 7a1984f..0000000 --- a/tools/testfiles/tpbitsUnsignedLong16.ddl +++ /dev/null @@ -1,67 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLong8.ddl b/tools/testfiles/tpbitsUnsignedLong8.ddl deleted file mode 100644 index 17b896c..0000000 --- a/tools/testfiles/tpbitsUnsignedLong8.ddl +++ /dev/null @@ -1,96 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=8 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, - (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, - (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, - (0,28): 0, 0, 0, 0, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, - (1,28): 0, 0, 0, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, - (2,29): 0, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,30): 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,30): 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,31): 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=24 LENGTH=8 - DATA { - (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, - (0,26): 252, 248, 240, 224, 192, 128, - (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, - (1,26): 248, 240, 224, 192, 128, 0, - (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, - (2,26): 240, 224, 192, 128, 0, 0, - (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, - (3,26): 224, 192, 128, 0, 0, 0, - (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, - (4,26): 192, 128, 0, 0, 0, 0, - (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, - (5,26): 128, 0, 0, 0, 0, 0, - (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, - (6,26): 0, 0, 0, 0, 0, 0, - (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, - (7,27): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLong.ddl b/tools/testfiles/tpbitsUnsignedLongLong.ddl deleted file mode 100644 index 1cd9a6c..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLong.ddl +++ /dev/null @@ -1,68 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=2 - DATA { - (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=58 LENGTH=6 - DATA { - (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, - (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, - (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, - (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, - (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, - (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, - (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, - (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLong16.ddl b/tools/testfiles/tpbitsUnsignedLongLong16.ddl deleted file mode 100644 index f8b0189..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLong16.ddl +++ /dev/null @@ -1,196 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=16 - DATA { - (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=16 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,63): 0, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, - (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, - (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, - (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=48 LENGTH=16 - DATA { - (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, - (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, - (0,63): 32768, - (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, - (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, - (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, - (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, - (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, - (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, - (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, - (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, - (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, - (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, - (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, - (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, - (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, - (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, - (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, - (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, - (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, - (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLong32.ddl b/tools/testfiles/tpbitsUnsignedLongLong32.ddl deleted file mode 100644 index befaf5b..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLong32.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (3,57): 0, 0, 0, 0, 0, 0, 0, - (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (4,60): 0, 0, 0, 0, - (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (5,63): 0, - (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - PACKED_BITS OFFSET=32 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (0,60): 4026531840, 3758096384, 3221225472, 2147483648, - (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (1,60): 3758096384, 3221225472, 2147483648, 0, - (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (2,60): 3221225472, 2147483648, 0, 0, - (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (3,60): 2147483648, 0, 0, 0, - (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, - (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (4,62): 0, 0, - (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, - (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, - (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, - (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, - (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, - (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl deleted file mode 100644 index 27c8879..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl +++ /dev/null @@ -1,176 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=64 - DATA { - (0,0): 18446744073709551615, 18446744073709551614, 18446744073709551612, - (0,3): 18446744073709551608, 18446744073709551600, 18446744073709551584, - (0,6): 18446744073709551552, 18446744073709551488, 18446744073709551360, - (0,9): 18446744073709551104, 18446744073709550592, 18446744073709549568, - (0,12): 18446744073709547520, 18446744073709543424, 18446744073709535232, - (0,15): 18446744073709518848, 18446744073709486080, 18446744073709420544, - (0,18): 18446744073709289472, 18446744073709027328, 18446744073708503040, - (0,21): 18446744073707454464, 18446744073705357312, 18446744073701163008, - (0,24): 18446744073692774400, 18446744073675997184, 18446744073642442752, - (0,27): 18446744073575333888, 18446744073441116160, 18446744073172680704, - (0,30): 18446744072635809792, 18446744071562067968, 18446744069414584320, - (0,33): 18446744065119617024, 18446744056529682432, 18446744039349813248, - (0,36): 18446744004990074880, 18446743936270598144, 18446743798831644672, - (0,39): 18446743523953737728, 18446742974197923840, 18446741874686296064, - (0,42): 18446739675663040512, 18446735277616529408, 18446726481523507200, - (0,45): 18446708889337462784, 18446673704965373952, 18446603336221196288, - (0,48): 18446462598732840960, 18446181123756130304, 18445618173802708992, - (0,51): 18444492273895866368, 18442240474082181120, 18437736874454810624, - (0,54): 18428729675200069632, 18410715276690587648, 18374686479671623680, - (0,57): 18302628885633695744, 18158513697557839872, 17870283321406128128, - (0,60): 17293822569102704640, 16140901064495857664, 13835058055282163712, - (0,63): 9223372036854775808, - (1,0): 18446744073709551614, 18446744073709551612, 18446744073709551608, - (1,3): 18446744073709551600, 18446744073709551584, 18446744073709551552, - (1,6): 18446744073709551488, 18446744073709551360, 18446744073709551104, - (1,9): 18446744073709550592, 18446744073709549568, 18446744073709547520, - (1,12): 18446744073709543424, 18446744073709535232, 18446744073709518848, - (1,15): 18446744073709486080, 18446744073709420544, 18446744073709289472, - (1,18): 18446744073709027328, 18446744073708503040, 18446744073707454464, - (1,21): 18446744073705357312, 18446744073701163008, 18446744073692774400, - (1,24): 18446744073675997184, 18446744073642442752, 18446744073575333888, - (1,27): 18446744073441116160, 18446744073172680704, 18446744072635809792, - (1,30): 18446744071562067968, 18446744069414584320, 18446744065119617024, - (1,33): 18446744056529682432, 18446744039349813248, 18446744004990074880, - (1,36): 18446743936270598144, 18446743798831644672, 18446743523953737728, - (1,39): 18446742974197923840, 18446741874686296064, 18446739675663040512, - (1,42): 18446735277616529408, 18446726481523507200, 18446708889337462784, - (1,45): 18446673704965373952, 18446603336221196288, 18446462598732840960, - (1,48): 18446181123756130304, 18445618173802708992, 18444492273895866368, - (1,51): 18442240474082181120, 18437736874454810624, 18428729675200069632, - (1,54): 18410715276690587648, 18374686479671623680, 18302628885633695744, - (1,57): 18158513697557839872, 17870283321406128128, 17293822569102704640, - (1,60): 16140901064495857664, 13835058055282163712, 9223372036854775808, - (1,63): 0, - (2,0): 18446744073709551612, 18446744073709551608, 18446744073709551600, - (2,3): 18446744073709551584, 18446744073709551552, 18446744073709551488, - (2,6): 18446744073709551360, 18446744073709551104, 18446744073709550592, - (2,9): 18446744073709549568, 18446744073709547520, 18446744073709543424, - (2,12): 18446744073709535232, 18446744073709518848, 18446744073709486080, - (2,15): 18446744073709420544, 18446744073709289472, 18446744073709027328, - (2,18): 18446744073708503040, 18446744073707454464, 18446744073705357312, - (2,21): 18446744073701163008, 18446744073692774400, 18446744073675997184, - (2,24): 18446744073642442752, 18446744073575333888, 18446744073441116160, - (2,27): 18446744073172680704, 18446744072635809792, 18446744071562067968, - (2,30): 18446744069414584320, 18446744065119617024, 18446744056529682432, - (2,33): 18446744039349813248, 18446744004990074880, 18446743936270598144, - (2,36): 18446743798831644672, 18446743523953737728, 18446742974197923840, - (2,39): 18446741874686296064, 18446739675663040512, 18446735277616529408, - (2,42): 18446726481523507200, 18446708889337462784, 18446673704965373952, - (2,45): 18446603336221196288, 18446462598732840960, 18446181123756130304, - (2,48): 18445618173802708992, 18444492273895866368, 18442240474082181120, - (2,51): 18437736874454810624, 18428729675200069632, 18410715276690587648, - (2,54): 18374686479671623680, 18302628885633695744, 18158513697557839872, - (2,57): 17870283321406128128, 17293822569102704640, 16140901064495857664, - (2,60): 13835058055282163712, 9223372036854775808, 0, 0, - (3,0): 18446744073709551608, 18446744073709551600, 18446744073709551584, - (3,3): 18446744073709551552, 18446744073709551488, 18446744073709551360, - (3,6): 18446744073709551104, 18446744073709550592, 18446744073709549568, - (3,9): 18446744073709547520, 18446744073709543424, 18446744073709535232, - (3,12): 18446744073709518848, 18446744073709486080, 18446744073709420544, - (3,15): 18446744073709289472, 18446744073709027328, 18446744073708503040, - (3,18): 18446744073707454464, 18446744073705357312, 18446744073701163008, - (3,21): 18446744073692774400, 18446744073675997184, 18446744073642442752, - (3,24): 18446744073575333888, 18446744073441116160, 18446744073172680704, - (3,27): 18446744072635809792, 18446744071562067968, 18446744069414584320, - (3,30): 18446744065119617024, 18446744056529682432, 18446744039349813248, - (3,33): 18446744004990074880, 18446743936270598144, 18446743798831644672, - (3,36): 18446743523953737728, 18446742974197923840, 18446741874686296064, - (3,39): 18446739675663040512, 18446735277616529408, 18446726481523507200, - (3,42): 18446708889337462784, 18446673704965373952, 18446603336221196288, - (3,45): 18446462598732840960, 18446181123756130304, 18445618173802708992, - (3,48): 18444492273895866368, 18442240474082181120, 18437736874454810624, - (3,51): 18428729675200069632, 18410715276690587648, 18374686479671623680, - (3,54): 18302628885633695744, 18158513697557839872, 17870283321406128128, - (3,57): 17293822569102704640, 16140901064495857664, 13835058055282163712, - (3,60): 9223372036854775808, 0, 0, 0, - (4,0): 18446744073709551600, 18446744073709551584, 18446744073709551552, - (4,3): 18446744073709551488, 18446744073709551360, 18446744073709551104, - (4,6): 18446744073709550592, 18446744073709549568, 18446744073709547520, - (4,9): 18446744073709543424, 18446744073709535232, 18446744073709518848, - (4,12): 18446744073709486080, 18446744073709420544, 18446744073709289472, - (4,15): 18446744073709027328, 18446744073708503040, 18446744073707454464, - (4,18): 18446744073705357312, 18446744073701163008, 18446744073692774400, - (4,21): 18446744073675997184, 18446744073642442752, 18446744073575333888, - (4,24): 18446744073441116160, 18446744073172680704, 18446744072635809792, - (4,27): 18446744071562067968, 18446744069414584320, 18446744065119617024, - (4,30): 18446744056529682432, 18446744039349813248, 18446744004990074880, - (4,33): 18446743936270598144, 18446743798831644672, 18446743523953737728, - (4,36): 18446742974197923840, 18446741874686296064, 18446739675663040512, - (4,39): 18446735277616529408, 18446726481523507200, 18446708889337462784, - (4,42): 18446673704965373952, 18446603336221196288, 18446462598732840960, - (4,45): 18446181123756130304, 18445618173802708992, 18444492273895866368, - (4,48): 18442240474082181120, 18437736874454810624, 18428729675200069632, - (4,51): 18410715276690587648, 18374686479671623680, 18302628885633695744, - (4,54): 18158513697557839872, 17870283321406128128, 17293822569102704640, - (4,57): 16140901064495857664, 13835058055282163712, 9223372036854775808, - (4,60): 0, 0, 0, 0, - (5,0): 18446744073709551584, 18446744073709551552, 18446744073709551488, - (5,3): 18446744073709551360, 18446744073709551104, 18446744073709550592, - (5,6): 18446744073709549568, 18446744073709547520, 18446744073709543424, - (5,9): 18446744073709535232, 18446744073709518848, 18446744073709486080, - (5,12): 18446744073709420544, 18446744073709289472, 18446744073709027328, - (5,15): 18446744073708503040, 18446744073707454464, 18446744073705357312, - (5,18): 18446744073701163008, 18446744073692774400, 18446744073675997184, - (5,21): 18446744073642442752, 18446744073575333888, 18446744073441116160, - (5,24): 18446744073172680704, 18446744072635809792, 18446744071562067968, - (5,27): 18446744069414584320, 18446744065119617024, 18446744056529682432, - (5,30): 18446744039349813248, 18446744004990074880, 18446743936270598144, - (5,33): 18446743798831644672, 18446743523953737728, 18446742974197923840, - (5,36): 18446741874686296064, 18446739675663040512, 18446735277616529408, - (5,39): 18446726481523507200, 18446708889337462784, 18446673704965373952, - (5,42): 18446603336221196288, 18446462598732840960, 18446181123756130304, - (5,45): 18445618173802708992, 18444492273895866368, 18442240474082181120, - (5,48): 18437736874454810624, 18428729675200069632, 18410715276690587648, - (5,51): 18374686479671623680, 18302628885633695744, 18158513697557839872, - (5,54): 17870283321406128128, 17293822569102704640, 16140901064495857664, - (5,57): 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, - (6,0): 18446744073709551552, 18446744073709551488, 18446744073709551360, - (6,3): 18446744073709551104, 18446744073709550592, 18446744073709549568, - (6,6): 18446744073709547520, 18446744073709543424, 18446744073709535232, - (6,9): 18446744073709518848, 18446744073709486080, 18446744073709420544, - (6,12): 18446744073709289472, 18446744073709027328, 18446744073708503040, - (6,15): 18446744073707454464, 18446744073705357312, 18446744073701163008, - (6,18): 18446744073692774400, 18446744073675997184, 18446744073642442752, - (6,21): 18446744073575333888, 18446744073441116160, 18446744073172680704, - (6,24): 18446744072635809792, 18446744071562067968, 18446744069414584320, - (6,27): 18446744065119617024, 18446744056529682432, 18446744039349813248, - (6,30): 18446744004990074880, 18446743936270598144, 18446743798831644672, - (6,33): 18446743523953737728, 18446742974197923840, 18446741874686296064, - (6,36): 18446739675663040512, 18446735277616529408, 18446726481523507200, - (6,39): 18446708889337462784, 18446673704965373952, 18446603336221196288, - (6,42): 18446462598732840960, 18446181123756130304, 18445618173802708992, - (6,45): 18444492273895866368, 18442240474082181120, 18437736874454810624, - (6,48): 18428729675200069632, 18410715276690587648, 18374686479671623680, - (6,51): 18302628885633695744, 18158513697557839872, 17870283321406128128, - (6,54): 17293822569102704640, 16140901064495857664, 13835058055282163712, - (6,57): 9223372036854775808, 0, 0, 0, 0, 0, 0, - (7,0): 18446744073709551488, 18446744073709551360, 18446744073709551104, - (7,3): 18446744073709550592, 18446744073709549568, 18446744073709547520, - (7,6): 18446744073709543424, 18446744073709535232, 18446744073709518848, - (7,9): 18446744073709486080, 18446744073709420544, 18446744073709289472, - (7,12): 18446744073709027328, 18446744073708503040, 18446744073707454464, - (7,15): 18446744073705357312, 18446744073701163008, 18446744073692774400, - (7,18): 18446744073675997184, 18446744073642442752, 18446744073575333888, - (7,21): 18446744073441116160, 18446744073172680704, 18446744072635809792, - (7,24): 18446744071562067968, 18446744069414584320, 18446744065119617024, - (7,27): 18446744056529682432, 18446744039349813248, 18446744004990074880, - (7,30): 18446743936270598144, 18446743798831644672, 18446743523953737728, - (7,33): 18446742974197923840, 18446741874686296064, 18446739675663040512, - (7,36): 18446735277616529408, 18446726481523507200, 18446708889337462784, - (7,39): 18446673704965373952, 18446603336221196288, 18446462598732840960, - (7,42): 18446181123756130304, 18445618173802708992, 18444492273895866368, - (7,45): 18442240474082181120, 18437736874454810624, 18428729675200069632, - (7,48): 18410715276690587648, 18374686479671623680, 18302628885633695744, - (7,51): 18158513697557839872, 17870283321406128128, 17293822569102704640, - (7,54): 16140901064495857664, 13835058055282163712, 9223372036854775808, - (7,57): 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl deleted file mode 100644 index 0302105..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl +++ /dev/null @@ -1,175 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=1 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, - (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (0,63): 4611686018427387904, - (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (2,60): 6917529027641081856, 4611686018427387904, 0, 0, - (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (3,60): 4611686018427387904, 0, 0, 0, - (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (4,61): 0, 0, 0, - (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (7,58): 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl deleted file mode 100644 index 6a9b503..0000000 --- a/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl +++ /dev/null @@ -1,172 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU64BITS" { - DATATYPE H5T_STD_U64LE - DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } - PACKED_BITS OFFSET=0 LENGTH=63 - DATA { - (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, - (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, - (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (1,60): 6917529027641081856, 4611686018427387904, 0, 0, - (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, - (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (2,60): 4611686018427387904, 0, 0, 0, - (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, - (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (3,61): 0, 0, 0, - (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, - (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, - (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, - (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, - (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, - (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, - (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, - (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, - (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, - (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, - (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, - (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, - (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, - (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, - (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, - (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, - (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, - (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, - (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, - (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, - (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, - (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, - (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, - (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, - (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, - (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, - (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, - (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, - (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, - (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, - (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, - (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, - (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, - (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, - (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, - (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, - (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, - (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, - (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, - (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, - (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, - (6,58): 0, 0, 0, 0, 0, 0, - (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, - (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, - (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, - (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, - (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, - (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, - (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, - (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, - (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, - (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, - (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, - (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, - (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, - (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, - (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, - (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, - (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, - (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, - (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedLongWhole.ddl b/tools/testfiles/tpbitsUnsignedLongWhole.ddl deleted file mode 100644 index 50ad02f..0000000 --- a/tools/testfiles/tpbitsUnsignedLongWhole.ddl +++ /dev/null @@ -1,59 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU32BITS" { - DATATYPE H5T_STD_U32LE - DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } - PACKED_BITS OFFSET=0 LENGTH=32 - DATA { - (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, - (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (0,30): 3221225472, 2147483648, - (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, - (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (1,30): 2147483648, 0, - (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, - (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, - (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, - (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, - (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, - (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, - (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, - (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, - (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, - (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, - (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, - (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, - (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, - (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, - (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, - (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, - (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, - (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, - (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, - (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, - (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, - (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, - (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, - (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, - (6,25): 2147483648, 0, 0, 0, 0, 0, 0, - (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, - (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, - (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, - (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, - (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, - (7,27): 0, 0, 0, 0, 0 - } -} -} diff --git a/tools/testfiles/tpbitsUnsignedWhole.ddl b/tools/testfiles/tpbitsUnsignedWhole.ddl deleted file mode 100644 index 7c9e736..0000000 --- a/tools/testfiles/tpbitsUnsignedWhole.ddl +++ /dev/null @@ -1,17 +0,0 @@ -HDF5 "packedbits.h5" { -DATASET "/DU08BITS" { - DATATYPE H5T_STD_U8LE - DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } - PACKED_BITS OFFSET=0 LENGTH=8 - DATA { - (0,0): 255, 254, 252, 248, 240, 224, 192, 128, - (1,0): 254, 252, 248, 240, 224, 192, 128, 0, - (2,0): 252, 248, 240, 224, 192, 128, 0, 0, - (3,0): 248, 240, 224, 192, 128, 0, 0, 0, - (4,0): 240, 224, 192, 128, 0, 0, 0, 0, - (5,0): 224, 192, 128, 0, 0, 0, 0, 0, - (6,0): 192, 128, 0, 0, 0, 0, 0, 0, - (7,0): 128, 0, 0, 0, 0, 0, 0, 0 - } -} -} -- cgit v0.12 From e29904660a01b137e8470a8fe71d2d73a3f76538 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 12 Jun 2015 17:55:18 -0500 Subject: [svn-r27198] Set "entire_chunk" to false in H5D__chunk_write() for point selection as duplicate points are not checked to determine that it is really an "entire chunk". The bug appears from running the mdset.c test. This is a short-term fix for the problem. --- src/H5Dchunk.c | 8 ++++---- src/H5Dpkg.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index e22eb3a..af5123c 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -722,7 +722,6 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf unsigned f_ndims; /* The number of dimensions of the file's dataspace */ int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */ H5SL_node_t *curr_node; /* Current node in skip list */ - H5S_sel_type fsel_type; /* Selection type on disk */ char bogus; /* "bogus" buffer to pass to selection iterator */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -836,13 +835,13 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf fm->use_single = FALSE; /* Get type of selection on disk & in memory */ - if((fsel_type = H5S_GET_SELECT_TYPE(file_space)) < H5S_SEL_NONE) + if((fm->fsel_type = H5S_GET_SELECT_TYPE(file_space)) < H5S_SEL_NONE) HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection") if((fm->msel_type = H5S_GET_SELECT_TYPE(mem_space)) < H5S_SEL_NONE) HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection") /* If the selection is NONE or POINTS, set the flag to FALSE */ - if(fsel_type == H5S_SEL_POINTS || fsel_type == H5S_SEL_NONE) + if(fm->fsel_type == H5S_SEL_POINTS || fm->fsel_type == H5S_SEL_NONE) sel_hyper_flag = FALSE; else sel_hyper_flag = TRUE; @@ -2014,7 +2013,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Determine if we will access all the data in the chunk */ if(dst_accessed_bytes != ctg_store.contig.dset_size || - (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size) + (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size || + fm->fsel_type == H5S_SEL_POINTS) entire_chunk = FALSE; /* Set chunk's [scaled] coordinates */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 815dae4..1476229 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -337,6 +337,7 @@ typedef struct H5D_chunk_map_t { H5S_sel_iter_t mem_iter; /* Iterator for elements in memory selection */ unsigned m_ndims; /* Number of dimensions for memory dataspace */ H5S_sel_type msel_type; /* Selection type in memory */ + H5S_sel_type fsel_type; /* Selection type in file */ H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */ -- cgit v0.12 From 65e76690fdafd30540acfd37d82ada689e363e6b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 12 Jun 2015 22:40:33 -0500 Subject: [svn-r27199] Description: Large code cleanups and optimizations, in preparation for the upcoming v3 metadata cache merge. Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel --- src/H5AC.c | 3043 +++++++++++++++++++-------------------------------- src/H5ACpkg.h | 19 - src/H5ACprivate.h | 21 +- src/H5C.c | 42 +- src/H5Cprivate.h | 10 +- test/cache_api.c | 216 +--- test/cache_common.c | 10 +- test/cache_common.h | 7 - 8 files changed, 1206 insertions(+), 2162 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index c5466be..db5a06f 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -27,6 +27,10 @@ *------------------------------------------------------------------------- */ +/****************/ +/* Module Setup */ +/****************/ + #define H5AC_PACKAGE /*suppress error about including H5ACpkg */ #define H5C_PACKAGE /*suppress error about including H5Cpkg */ #define H5F_PACKAGE /*suppress error about including H5Fpkg */ @@ -34,10 +38,9 @@ /* Interface initialization */ #define H5_INTERFACE_INIT_FUNC H5AC_init_interface -#ifdef H5_HAVE_PARALLEL -#include -#endif /* H5_HAVE_PARALLEL */ - +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACpkg.h" /* Metadata cache */ #include "H5Cpkg.h" /* Cache */ @@ -51,13 +54,16 @@ #include "H5Pprivate.h" /* Property lists */ -#ifdef H5_HAVE_PARALLEL +/****************/ +/* Local Macros */ +/****************/ -/* Declare a free list to manage the H5AC_aux_t struct */ -H5FL_DEFINE_STATIC(H5AC_aux_t); -#endif /* H5_HAVE_PARALLEL */ +/******************/ +/* Local Typedefs */ +/******************/ +#ifdef H5_HAVE_PARALLEL /**************************************************************************** * * structure H5AC_slist_entry_t @@ -69,143 +75,135 @@ H5FL_DEFINE_STATIC(H5AC_aux_t); * allocated structure to store these offsets in. This structure serves * that purpose. Its fields are as follows: * - * magic: Unsigned 32 bit integer always set to - * H5AC__H5AC_SLIST_ENTRY_T_MAGIC. This field is used to - * validate pointers to instances of H5AC_slist_entry_t. - * * addr: file offset of a metadata entry. Entries are added to this * list (if they aren't there already) when they are marked * dirty in an unprotect, inserted, or moved. They are * removed when they appear in a clean entries broadcast. * ****************************************************************************/ - -#ifdef H5_HAVE_PARALLEL - -#define H5AC__H5AC_SLIST_ENTRY_T_MAGIC 0x00D0A02 - typedef struct H5AC_slist_entry_t { - uint32_t magic; - haddr_t addr; } H5AC_slist_entry_t; -/* Declare a free list to manage the H5AC_slist_entry_t struct */ -H5FL_DEFINE_STATIC(H5AC_slist_entry_t); +/* User data for address list building callbacks */ +typedef struct H5AC_addr_list_ud_t +{ + H5AC_aux_t * aux_ptr; /* 'Auxiliary' parallel cache info */ + haddr_t * addr_buf_ptr; /* Array to store addresses */ + int i; /* Counter for position in array */ +} H5AC_addr_list_ud_t; +#endif /* H5_HAVE_PARALLEL */ + +/********************/ +/* Local Prototypes */ +/********************/ + +static herr_t H5AC__check_if_write_permitted(const H5F_t *f, + hbool_t *write_permitted_ptr); +static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, + H5C_auto_size_ctl_t *int_conf_ptr); + +#ifdef H5_HAVE_PARALLEL +static herr_t H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, + int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); +static herr_t H5AC__broadcast_clean_list(H5AC_t *cache_ptr); +static herr_t H5AC__construct_candidate_list(H5AC_t *cache_ptr, + H5AC_aux_t *aux_ptr, int sync_point_op); +static herr_t H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, + int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); +static herr_t H5AC__flush_entries(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__log_deleted_entry(const H5AC_info_t *entry_ptr); +static herr_t H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr); +static herr_t H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, + hbool_t was_dirty, unsigned flags); +static herr_t H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr); +static herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, + haddr_t new_addr); +static herr_t H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, + hid_t dxpl_id); +static herr_t H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr, + haddr_t **haddr_buf_ptr_ptr); +static herr_t H5AC__receive_candidate_list(const H5AC_t *cache_ptr, + int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); +static herr_t H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t primary_dxpl_id, + hid_t secondary_dxpl_id); +static herr_t H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates, + haddr_t *candidates_list_ptr); +static herr_t H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op); #endif /* H5_HAVE_PARALLEL */ -/* - * Private file-scope variables. - */ +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ /* Default dataset transfer property list for metadata I/O calls */ /* (Collective set, "block before metadata write" set and "library internal" set) */ /* (Global variable definition, declaration is in H5ACprivate.h also) */ -hid_t H5AC_dxpl_id=(-1); +hid_t H5AC_dxpl_id = (-1); /* Dataset transfer property list for independent metadata I/O calls */ /* (just "library internal" set - i.e. independent transfer mode) */ /* (Global variable definition, declaration is in H5ACprivate.h also) */ H5P_genplist_t *H5AC_ind_dxpl_g = NULL; -hid_t H5AC_ind_dxpl_id=(-1); - - -/* - * Private file-scope function declarations: - */ +hid_t H5AC_ind_dxpl_id = (-1); -static herr_t H5AC_check_if_write_permitted(const H5F_t *f, - hid_t dxpl_id, - hbool_t * write_permitted_ptr); -static herr_t H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr, - H5C_auto_size_ctl_t * int_conf_ptr); +/*******************/ +/* Local Variables */ +/*******************/ #ifdef H5_HAVE_PARALLEL -static herr_t H5AC_broadcast_candidate_list(H5AC_t * cache_ptr, - int * num_entries_ptr, - haddr_t ** haddr_buf_ptr_ptr); - -static herr_t H5AC_broadcast_clean_list(H5AC_t * cache_ptr); - -static herr_t H5AC_construct_candidate_list(H5AC_t * cache_ptr, - H5AC_aux_t * aux_ptr, - int sync_point_op); - -static herr_t H5AC_copy_candidate_list_to_buffer(H5AC_t * cache_ptr, - int * num_entries_ptr, - haddr_t ** haddr_buf_ptr_ptr, - size_t * MPI_Offset_buf_size_ptr, - MPI_Offset ** MPI_Offset_buf_ptr_ptr); - -static herr_t H5AC_flush_entries(H5F_t *f); - -static herr_t H5AC_log_deleted_entry(H5AC_t * cache_ptr, - H5AC_info_t * entry_ptr, - haddr_t addr, - unsigned int flags); - -static herr_t H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, - haddr_t addr); - -static herr_t H5AC_log_flushed_entry(H5C_t * cache_ptr, - haddr_t addr, - hbool_t was_dirty, - unsigned flags, - int type_id); - -static herr_t H5AC_log_moved_entry(const H5F_t * f, - haddr_t old_addr, - haddr_t new_addr); - -static herr_t H5AC_log_inserted_entry(H5AC_t * cache_ptr, - H5AC_info_t * entry_ptr); - -static herr_t H5AC_propagate_and_apply_candidate_list(H5F_t * f, - hid_t dxpl_id, - H5AC_t * cache_ptr); - -static herr_t H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, - hid_t dxpl_id, - H5AC_t * cache_ptr); - -static herr_t H5AC_receive_candidate_list(H5AC_t * cache_ptr, - int * num_entries_ptr, - haddr_t ** haddr_buf_ptr_ptr); - -static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - H5AC_t * cache_ptr); - -static herr_t H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr, - int num_candidates, - haddr_t * candidates_list_ptr); - -herr_t H5AC_rsp__dist_md_write__flush(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr); - -herr_t H5AC_rsp__dist_md_write__flush_to_min_clean(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr); - -herr_t H5AC_rsp__p0_only__flush(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr); +/* Declare a free list to manage the H5AC_aux_t struct */ +H5FL_DEFINE_STATIC(H5AC_aux_t); -herr_t H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr); +/* Declare a free list to manage the H5AC_slist_entry_t struct */ +H5FL_DEFINE_STATIC(H5AC_slist_entry_t); +#endif /* H5_HAVE_PARALLEL */ -static herr_t H5AC_run_sync_point(H5F_t *f, - hid_t dxpl_id, - int sync_point_op); +static const char *H5AC_entry_type_names[H5AC_NTYPES] = +{ + "B-tree nodes", + "symbol table nodes", + "local heap prefixes", + "local heap data blocks", + "global heaps", + "object headers", + "object header chunks", + "v2 B-tree headers", + "v2 B-tree internal nodes", + "v2 B-tree leaf nodes", + "fractal heap headers", + "fractal heap direct blocks", + "fractal heap indirect blocks", + "free space headers", + "free space sections", + "shared OH message master table", + "shared OH message index", + "extensible array headers", + "extensible array index blocks", + "extensible array super blocks", + "extensible array data blocks", + "extensible array data block pages", + "fixed array headers", + "fixed array data block", + "fixed array data block pages", + "superblock", + "test entry" /* for testing only -- not used for actual files */ +}; -#endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- @@ -232,7 +230,7 @@ H5AC_init(void) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5AC_init() */ /*------------------------------------------------------------------------- @@ -273,8 +271,8 @@ H5AC_init_interface(void) /* Insert 'collective metadata write' property */ coll_meta_write = 1; if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") /* Get an ID for the independent H5AC dxpl */ if((H5AC_ind_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) @@ -287,8 +285,8 @@ H5AC_init_interface(void) /* Insert 'collective metadata write' property */ coll_meta_write = 0; if(H5P_insert(H5AC_ind_dxpl_g, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") #else /* H5_HAVE_PARALLEL */ /* Sanity check */ HDassert(H5P_LST_DATASET_XFER_ID_g!=(-1)); @@ -297,7 +295,7 @@ H5AC_init_interface(void) H5AC_ind_dxpl_id = H5P_DATASET_XFER_DEFAULT; /* Get the property list objects for the IDs */ - if (NULL == (H5AC_ind_dxpl_g = (H5P_genplist_t *)H5I_object(H5AC_ind_dxpl_id))) + if(NULL == (H5AC_ind_dxpl_g = (H5P_genplist_t *)H5I_object(H5AC_ind_dxpl_id))) HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list object") #endif /* H5_HAVE_PARALLEL */ @@ -328,15 +326,14 @@ H5AC_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR - if (H5_interface_initialize_g) { + if(H5_interface_initialize_g) { #ifdef H5_HAVE_PARALLEL if(H5AC_dxpl_id > 0 || H5AC_ind_dxpl_id > 0) { /* Indicate more work to do */ n = 1; /* H5I */ /* Close H5AC dxpl */ - if(H5I_dec_ref(H5AC_dxpl_id) < 0 || - H5I_dec_ref(H5AC_ind_dxpl_id) < 0) + if(H5I_dec_ref(H5AC_dxpl_id) < 0 || H5I_dec_ref(H5AC_ind_dxpl_id) < 0) H5E_clear_stack(NULL); /*ignore error*/ else { /* Reset static IDs */ @@ -347,50 +344,22 @@ H5AC_term_interface(void) H5_interface_initialize_g = 0; } /* end else */ } /* end if */ - else -#else /* H5_HAVE_PARALLEL */ + else { +#endif /* H5_HAVE_PARALLEL */ /* Reset static IDs */ - H5AC_dxpl_id=(-1); - H5AC_ind_dxpl_id=(-1); + H5AC_dxpl_id = (-1); + H5AC_ind_dxpl_id = (-1); +#ifdef H5_HAVE_PARALLEL + } /* end else */ #endif /* H5_HAVE_PARALLEL */ - /* Reset interface initialization flag */ - H5_interface_initialize_g = 0; + + /* Reset interface initialization flag */ + H5_interface_initialize_g = 0; } /* end if */ FUNC_LEAVE_NOAPI(n) } /* end H5AC_term_interface() */ -static const char * H5AC_entry_type_names[H5AC_NTYPES] = -{ - "B-tree nodes", - "symbol table nodes", - "local heap prefixes", - "local heap data blocks", - "global heaps", - "object headers", - "object header chunks", - "v2 B-tree headers", - "v2 B-tree internal nodes", - "v2 B-tree leaf nodes", - "fractal heap headers", - "fractal heap direct blocks", - "fractal heap indirect blocks", - "free space headers", - "free space sections", - "shared OH message master table", - "shared OH message index", - "extensible array headers", - "extensible array index blocks", - "extensible array super blocks", - "extensible array data blocks", - "extensible array data block pages", - "fixed array headers", - "fixed array data block", - "fixed array data block pages", - "superblock", - "test entry" /* for testing only -- not used for actual files */ -}; - /*------------------------------------------------------------------------- * Function: H5AC_create @@ -411,8 +380,7 @@ static const char * H5AC_entry_type_names[H5AC_NTYPES] = *------------------------------------------------------------------------- */ herr_t -H5AC_create(const H5F_t *f, - H5AC_cache_config_t *config_ptr) +H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) { #ifdef H5_HAVE_PARALLEL char prefix[H5C__PREFIX_LEN] = ""; @@ -422,6 +390,7 @@ H5AC_create(const H5F_t *f, FUNC_ENTER_NOAPI(FAIL) + /* Check arguments */ HDassert(f); HDassert(NULL == f->shared->cache); HDassert(config_ptr != NULL) ; @@ -429,7 +398,7 @@ H5AC_create(const H5F_t *f, HDcompile_assert(H5C__MAX_NUM_TYPE_IDS == H5AC_NTYPES); if(H5AC_validate_config(config_ptr) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache configuration") #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { @@ -467,11 +436,8 @@ H5AC_create(const H5F_t *f, aux_ptr->move_dirty_bytes_updates = 0; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ aux_ptr->d_slist_ptr = NULL; - aux_ptr->d_slist_len = 0; aux_ptr->c_slist_ptr = NULL; - aux_ptr->c_slist_len = 0; aux_ptr->candidate_slist_ptr = NULL; - aux_ptr->candidate_slist_len = 0; aux_ptr->write_done = NULL; aux_ptr->sync_point_done = NULL; @@ -492,66 +458,50 @@ H5AC_create(const H5F_t *f, if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.") - if(aux_ptr != NULL) { - if(aux_ptr->mpi_rank == 0) { + if(aux_ptr != NULL) + if(aux_ptr->mpi_rank == 0) f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - H5AC_check_if_write_permitted, - TRUE, - H5AC_log_flushed_entry, - (void *)aux_ptr); - } else { + H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + H5AC__check_if_write_permitted, TRUE, H5AC__log_flushed_entry, + (void *)aux_ptr); + else f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - H5AC_check_if_write_permitted, - TRUE, - NULL, - (void *)aux_ptr); - } - } else { + H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + H5AC__check_if_write_permitted, TRUE, NULL, + (void *)aux_ptr); + else f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - H5AC_check_if_write_permitted, - TRUE, - NULL, - NULL); - } - } else { + H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + H5AC__check_if_write_permitted, TRUE, NULL, NULL); + } /* end if */ + else { #endif /* H5_HAVE_PARALLEL */ /* The default max cache size and min clean size will frequently be * overwritten shortly by the subsequent set resize config call. * -- JRM */ f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - H5AC_check_if_write_permitted, - TRUE, - NULL, - NULL); + H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + H5AC__check_if_write_permitted, TRUE, NULL, NULL); #ifdef H5_HAVE_PARALLEL - } + } /* end else */ #endif /* H5_HAVE_PARALLEL */ if(NULL == f->shared->cache) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") #ifdef H5_HAVE_PARALLEL - if(aux_ptr != NULL) { + if(aux_ptr != NULL) if(H5C_set_prefix(f->shared->cache, prefix) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "H5C_set_prefix() failed") - } /* end if */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "H5C_set_prefix() failed") #endif /* H5_HAVE_PARALLEL */ if(H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "auto resize configuration failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "auto resize configuration failed") done: #ifdef H5_HAVE_PARALLEL @@ -560,13 +510,10 @@ done: if(aux_ptr != NULL) { if(aux_ptr->d_slist_ptr != NULL) H5SL_close(aux_ptr->d_slist_ptr); - if(aux_ptr->c_slist_ptr != NULL) H5SL_close(aux_ptr->c_slist_ptr); - if(aux_ptr->candidate_slist_ptr != NULL) H5SL_close(aux_ptr->candidate_slist_ptr); - aux_ptr->magic = 0; aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); } /* end if */ @@ -623,7 +570,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ - if(H5AC_flush_entries(f) < 0) + if(H5AC__flush_entries(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") #endif /* H5_HAVE_PARALLEL */ @@ -665,13 +612,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_expunge_entry(H5F_t *f, - hid_t dxpl_id, - const H5AC_class_t *type, - haddr_t addr, - unsigned flags) +H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, + haddr_t addr, unsigned flags) { - herr_t result; #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; @@ -680,6 +623,7 @@ H5AC_expunge_entry(H5F_t *f, FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); @@ -696,41 +640,21 @@ H5AC_expunge_entry(H5F_t *f, * necessary in the trace file. Write the return value to catch occult * errors. */ - if ( ( cache_ptr != NULL ) && - ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_expunge_entry 0x%lx %d", - (unsigned long)addr, - (int)(type->id)); - } + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)addr, (int)(type->id)); } #endif /* H5AC__TRACE_FILE_ENABLED */ - result = H5C_expunge_entry(f, - dxpl_id, - H5AC_dxpl_id, - type, - addr, - flags); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \ - "H5C_expunge_entry() failed.") - } + if(H5C_expunge_entry(f, dxpl_id, H5AC_dxpl_id, type, addr, flags) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed.") done: - #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + if(trace_file_ptr != NULL) HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); - } #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_expunge_entry() */ @@ -765,6 +689,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); @@ -773,21 +698,18 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) /* For the flush, only the flags are really necessary in the trace file. * Write the result to catch occult errors. */ - if((f != NULL) && - (f->shared != NULL) && - (f->shared->cache != NULL) && - (H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && - (trace_file_ptr != NULL)) - sprintf(trace, "H5AC_flush"); + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + sprintf(trace, "%s", FUNC); #endif /* H5AC__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ - if(H5AC_flush_entries(f) < 0) + if(H5AC__flush_entries(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") #endif /* H5_HAVE_PARALLEL */ /* Flush the cache */ + /* (Again, in parallel - writes out the superblock) */ if(H5C_flush_cache(f, dxpl_id, H5AC_dxpl_id, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.") @@ -808,12 +730,12 @@ done: * cache contains an entry at that location. If it does, * also determine whether the entry is dirty, protected, * pinned, etc. and return that information to the caller - * in *status_ptr. + * in *status. * * If the specified entry doesn't exist, set *status_ptr * to zero. * - * On error, the value of *status_ptr is undefined. + * On error, the value of *status is undefined. * * Return: Non-negative on success/Negative on failure * @@ -823,44 +745,40 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_get_entry_status(const H5F_t *f, - haddr_t addr, - unsigned * status_ptr) +H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) { - hbool_t in_cache; - hbool_t is_dirty; - hbool_t is_protected; - hbool_t is_pinned; - hbool_t is_flush_dep_child; - hbool_t is_flush_dep_parent; - size_t entry_size; - unsigned status = 0; + hbool_t in_cache; /* Entry @ addr is in the cache */ + hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */ + hbool_t is_protected; /* Entry @ addr is in the cache and protected */ + hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */ + hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ + hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if((f == NULL) || (!H5F_addr_defined(addr)) || (status_ptr == NULL)) + if((f == NULL) || (!H5F_addr_defined(addr)) || (status == NULL)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") - if(H5C_get_entry_status(f, addr, &entry_size, &in_cache, &is_dirty, + if(H5C_get_entry_status(f, addr, NULL, &in_cache, &is_dirty, &is_protected, &is_pinned, &is_flush_dep_parent, &is_flush_dep_child) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed.") if(in_cache) { - status |= H5AC_ES__IN_CACHE; + *status |= H5AC_ES__IN_CACHE; if(is_dirty) - status |= H5AC_ES__IS_DIRTY; + *status |= H5AC_ES__IS_DIRTY; if(is_protected) - status |= H5AC_ES__IS_PROTECTED; + *status |= H5AC_ES__IS_PROTECTED; if(is_pinned) - status |= H5AC_ES__IS_PINNED; + *status |= H5AC_ES__IS_PINNED; if(is_flush_dep_parent) - status |= H5AC_ES__IS_FLUSH_DEP_PARENT; + *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; if(is_flush_dep_child) - status |= H5AC_ES__IS_FLUSH_DEP_CHILD; + *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; } /* end if */ - - *status_ptr = status; + else + *status = 0; done: FUNC_LEAVE_NOAPI(ret_value) @@ -895,6 +813,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); @@ -916,17 +835,9 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add * Note that some data is not available right now -- put what we can * in the trace buffer now, and fill in the rest at the end. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_insert_entry 0x%lx %d 0x%x", - (unsigned long)addr, - type->id, - flags); - } + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + sprintf(trace, "%s 0x%lx %d 0x%x", FUNC, (unsigned long)addr, type->id, + flags); #endif /* H5AC__TRACE_FILE_ENABLED */ /* Insert entry into metadata cache */ @@ -934,10 +845,9 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed") #if H5AC__TRACE_FILE_ENABLED - if(trace_file_ptr != NULL) { + if(trace_file_ptr != NULL) /* make note of the entry size */ trace_entry_size = ((H5C_cache_entry_t *)thing)->size; - } #endif /* H5AC__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL @@ -946,12 +856,12 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr)) { /* Log the new entry */ - if(H5AC_log_inserted_entry(f->shared->cache, (H5AC_info_t *)thing) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5AC_log_inserted_entry() failed") + if(H5AC__log_inserted_entry((H5AC_info_t *)thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5AC__log_inserted_entry() failed") /* Check if we should try to flush */ if(aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) - if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") } /* end if */ } @@ -959,11 +869,8 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add done: #if H5AC__TRACE_FILE_ENABLED - if(trace_file_ptr != NULL) { - HDfprintf(trace_file_ptr, "%s %d %d\n", trace, - (int)trace_entry_size, - (int)ret_value); - } + if(trace_file_ptr != NULL) + HDfprintf(trace_file_ptr, "%s %d %d\n", trace, (int)trace_entry_size, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) @@ -1002,8 +909,7 @@ H5AC_mark_entry_dirty(void *thing) * is really necessary in the trace file. Write the result to catch * occult errors. */ - if((H5C_get_trace_file_ptr_from_entry((const H5C_cache_entry_t *) thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing))) sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -1017,10 +923,9 @@ H5AC_mark_entry_dirty(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); if((!entry_ptr->is_dirty) && (!entry_ptr->is_protected) && - (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr)) { - if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0) + (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr)) + if(H5AC__log_dirtied_entry(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") - } /* end if */ } #endif /* H5_HAVE_PARALLEL */ @@ -1059,12 +964,13 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL - H5AC_aux_t * aux_ptr; + H5AC_aux_t *aux_ptr; #endif /* H5_HAVE_PARALLEL */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared->cache); HDassert(type); @@ -1077,25 +983,16 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne * necessary in the trace file. Include the type id so we don't have to * look it up. Also write the result to catch occult errors. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_move_entry 0x%lx 0x%lx %d", - (unsigned long)old_addr, - (unsigned long)new_addr, - (int)(type->id)); - } + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + sprintf(trace, "%s 0x%lx 0x%lx %d", FUNC, (unsigned long)old_addr, + (unsigned long)new_addr, (int)(type->id)); #endif /* H5AC__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL /* Log moving the entry */ - if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr)) { - if(H5AC_log_moved_entry(f, old_addr, new_addr) < 0) + if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr)) + if(H5AC__log_moved_entry(f, old_addr, new_addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log moved entry") - } /* end if */ #endif /* H5_HAVE_PARALLEL */ if(H5C_move_entry(f->shared->cache, type, old_addr, new_addr) < 0) @@ -1103,10 +1000,9 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ - if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) { - if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) + if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") - } /* end if */ #endif /* H5_HAVE_PARALLEL */ done: @@ -1150,8 +1046,7 @@ H5AC_pin_protected_entry(void *thing) /* For the pin protected entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if((H5C_get_trace_file_ptr_from_entry((const H5C_cache_entry_t *)thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing))) sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -1198,10 +1093,8 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) HDassert(child_thing); #if H5AC__TRACE_FILE_ENABLED - if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)parent_thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) - sprintf(trace, "%s %lx %lx", - FUNC, + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(parent_thing))) + sprintf(trace, "%s %lx %lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)parent_thing)->addr), (unsigned long)(((H5C_cache_entry_t *)child_thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -1244,15 +1137,11 @@ done: *------------------------------------------------------------------------- */ void * -H5AC_protect(H5F_t *f, - hid_t dxpl_id, - const H5AC_class_t *type, - haddr_t addr, - void *udata, - H5AC_protect_t rw) +H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, + void *udata, H5AC_protect_t rw) { unsigned protect_flags = H5C__NO_FLAGS_SET; - void * thing = (void *)NULL; + void * thing; /* Pointer to native data structure for entry */ #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; size_t trace_entry_size = 0; @@ -1262,7 +1151,7 @@ H5AC_protect(H5F_t *f, FUNC_ENTER_NOAPI(NULL) - /* check args */ + /* Sanity check */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); @@ -1281,11 +1170,7 @@ H5AC_protect(H5F_t *f, * sanity check. Also indicate whether the call was successful to * catch occult errors. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) { const char * rw_string; @@ -1302,53 +1187,34 @@ H5AC_protect(H5F_t *f, rw_string = "???"; } - sprintf(trace, "H5AC_protect 0x%lx %d %s", - (unsigned long)addr, - (int)(type->id), - rw_string); + sprintf(trace, "%s 0x%lx %d %s", FUNC, (unsigned long)addr, + (int)(type->id), rw_string); } #endif /* H5AC__TRACE_FILE_ENABLED */ if ( rw == H5AC_READ ) protect_flags |= H5C__READ_ONLY_FLAG; - thing = H5C_protect(f, - dxpl_id, - H5AC_dxpl_id, - type, - addr, - udata, - protect_flags); - - if ( thing == NULL ) { + if(NULL == (thing = H5C_protect(f, dxpl_id, H5AC_dxpl_id, type, addr, udata, protect_flags))) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed.") - } #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - - /* make note of the entry size */ + if(trace_file_ptr != NULL) + /* Make note of the entry size */ trace_entry_size = ((H5C_cache_entry_t *)thing)->size; - } #endif /* H5AC__TRACE_FILE_ENABLED */ /* Set return value */ ret_value = thing; done: - #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - - HDfprintf(trace_file_ptr, "%s %d %d\n", trace, - (int)trace_entry_size, - (int)(ret_value != NULL)); - } + if(trace_file_ptr != NULL) + HDfprintf(trace_file_ptr, "%s %d %d\n", trace, (int)trace_entry_size, (int)(ret_value != NULL)); #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_protect() */ @@ -1383,8 +1249,7 @@ H5AC_resize_entry(void *thing, size_t new_size) * really necessary in the trace file. Write the result to catch * occult errors. */ - if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing))) sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr), (int)new_size); @@ -1401,10 +1266,9 @@ H5AC_resize_entry(void *thing, size_t new_size) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) { - if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0) + if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) + if(H5AC__log_dirtied_entry(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") - } /* end if */ } #endif /* H5_HAVE_PARALLEL */ @@ -1449,8 +1313,7 @@ H5AC_unpin_entry(void *thing) /* For the unpin entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing))) sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -1496,10 +1359,8 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) HDassert(child_thing); #if H5AC__TRACE_FILE_ENABLED - if((H5C_get_trace_file_ptr_from_entry((H5C_cache_entry_t *)parent_thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) - sprintf(trace, "%s %llx %llx", - FUNC, + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(parent_thing))) + sprintf(trace, "%s %llx %llx", FUNC, (unsigned long long)(((H5C_cache_entry_t *)parent_thing)->addr), (unsigned long long)(((H5C_cache_entry_t *)child_thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -1572,6 +1433,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); @@ -1588,21 +1450,13 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, * new size are really necessary in the trace file. Write the return * value to catch occult errors. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_unprotect 0x%lx %d", - (unsigned long)addr, - (int)(type->id)); - } + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)addr, (int)(type->id)); #endif /* H5AC__TRACE_FILE_ENABLED */ - dirtied = (hbool_t)( ( (flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG ) || - ( ((H5AC_info_t *)thing)->dirtied ) ); - deleted = (hbool_t)( (flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG ); + dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || + (((H5AC_info_t *)thing)->dirtied)); + deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG); /* Check if the size changed out from underneath us, if we're not deleting * the entry. @@ -1611,24 +1465,21 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, size_t curr_size = 0; if((type->size)(f, thing, &curr_size) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") if(((H5AC_info_t *)thing)->size != curr_size) HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, FAIL, "size of entry changed") } /* end if */ #ifdef H5_HAVE_PARALLEL - if((dirtied) && (((H5AC_info_t *)thing)->is_dirty == FALSE) && - (NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr))) { - if(H5AC_log_dirtied_entry((H5AC_info_t *)thing, addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry") - } /* end if */ + if(NULL != (aux_ptr = (H5AC_aux_t *)f->shared->cache->aux_ptr)) { + if(dirtied && ((H5AC_info_t *)thing)->is_dirty == FALSE) + if(H5AC__log_dirtied_entry((H5AC_info_t *)thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry") - if((deleted) && - (NULL != (aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr))) && - (aux_ptr->mpi_rank == 0)) { - if(H5AC_log_deleted_entry(f->shared->cache, (H5AC_info_t *)thing, addr, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC_log_deleted_entry() failed.") + if(deleted && aux_ptr->mpi_rank == 0) + if(H5AC__log_deleted_entry((H5AC_info_t *)thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed.") } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -1637,17 +1488,15 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ - if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) { - if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) + if(H5AC__run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") - } /* end if */ #endif /* H5_HAVE_PARALLEL */ done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) - HDfprintf(trace_file_ptr, "%s 0x%x %d\n", - trace, (unsigned)flags, (int)ret_value); + HDfprintf(trace_file_ptr, "%s 0x%x %d\n", trace, (unsigned)flags, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) @@ -1678,12 +1527,11 @@ H5AC_set_sync_point_done_callback(H5C_t * cache_ptr, FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(cache_ptr && (cache_ptr->magic == H5C__H5C_T_MAGIC)); - aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); aux_ptr->sync_point_done = sync_point_done; @@ -1708,17 +1556,15 @@ H5AC_set_sync_point_done_callback(H5C_t * cache_ptr, */ #ifdef H5_HAVE_PARALLEL herr_t -H5AC_set_write_done_callback(H5C_t * cache_ptr, - void (* write_done)(void)) +H5AC_set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)) { H5AC_aux_t * aux_ptr; FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(cache_ptr && (cache_ptr->magic == H5C__H5C_T_MAGIC)); - aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - HDassert( aux_ptr != NULL ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); @@ -1728,6 +1574,7 @@ H5AC_set_write_done_callback(H5C_t * cache_ptr, } /* H5AC_set_write_done_callback() */ #endif /* H5_HAVE_PARALLEL */ +#ifndef NDEBUG /* debugging functions */ /*------------------------------------------------------------------------- * Function: H5AC_stats @@ -1744,10 +1591,9 @@ H5AC_set_write_done_callback(H5C_t * cache_ptr, herr_t H5AC_stats(const H5F_t *f) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); @@ -1755,8 +1601,7 @@ H5AC_stats(const H5F_t *f) /* at present, this can't fail */ (void)H5C_stats(f->shared->cache, H5F_OPEN_NAME(f), FALSE); -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5AC_stats() */ @@ -1780,18 +1625,18 @@ H5AC_dump_cache(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); - if ( H5C_dump_cache(f->shared->cache, H5F_OPEN_NAME(f)) < 0 ) { - + if(H5C_dump_cache(f->shared->cache, H5F_OPEN_NAME(f)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_dump_cache() failed.") - } done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_dump_cache() */ +#endif /* NDEBUG */ /*------------------------------------------------------------------------- @@ -1807,59 +1652,36 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, - H5AC_cache_config_t *config_ptr) +H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, + H5AC_cache_config_t *config_ptr) { - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ - hbool_t evictions_enabled; H5C_auto_size_ctl_t internal_config; + hbool_t evictions_enabled; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if ( ( cache_ptr == NULL ) - || + /* Check args */ + if((cache_ptr == NULL) || #ifdef H5_HAVE_PARALLEL - ( ( cache_ptr->aux_ptr != NULL ) - && - ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic - != - H5AC__H5AC_AUX_T_MAGIC - ) - ) - || + ((cache_ptr->aux_ptr != NULL) && + (((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC)) + || #endif /* H5_HAVE_PARALLEL */ - ( config_ptr == NULL ) - || - ( config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) - ) - { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Bad cache_ptr or config_ptr on entry.") - - } - - result = H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr, - &internal_config); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_cache_auto_resize_config() failed.") - } + (config_ptr == NULL) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry.") + /* Retrieve the configuration */ + if(H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr, &internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed.") if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed.") - if ( internal_config.rpt_fcn == NULL ) { - + /* Set the information to return */ + if(internal_config.rpt_fcn == NULL) config_ptr->rpt_fcn_enabled = FALSE; - - } else { - + else config_ptr->rpt_fcn_enabled = TRUE; - } - config_ptr->open_trace_file = FALSE; config_ptr->close_trace_file = FALSE; config_ptr->trace_file_name[0] = '\0'; @@ -1883,35 +1705,24 @@ H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, config_ptr->decrement = internal_config.decrement; config_ptr->apply_max_decrement = internal_config.apply_max_decrement; config_ptr->max_decrement = internal_config.max_decrement; - config_ptr->epochs_before_eviction = - (int)(internal_config.epochs_before_eviction); + config_ptr->epochs_before_eviction = (int)(internal_config.epochs_before_eviction); config_ptr->apply_empty_reserve = internal_config.apply_empty_reserve; config_ptr->empty_reserve = internal_config.empty_reserve; - #ifdef H5_HAVE_PARALLEL - if ( cache_ptr->aux_ptr != NULL ) { - - config_ptr->dirty_bytes_threshold = - ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold; - config_ptr->metadata_write_strategy = - ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy; - - } else { + if(cache_ptr->aux_ptr != NULL) { + config_ptr->dirty_bytes_threshold = ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold; + config_ptr->metadata_write_strategy = ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy; + } /* end if */ + else { #endif /* H5_HAVE_PARALLEL */ - - config_ptr->dirty_bytes_threshold = - H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD; - config_ptr->metadata_write_strategy = - H5AC__DEFAULT_METADATA_WRITE_STRATEGY; - + config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD; + config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; #ifdef H5_HAVE_PARALLEL - } + } /* end else */ #endif /* H5_HAVE_PARALLEL */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_get_cache_auto_resize_config() */ @@ -1928,33 +1739,19 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_get_cache_size(H5AC_t * cache_ptr, - size_t * max_size_ptr, - size_t * min_clean_size_ptr, - size_t * cur_size_ptr, - int32_t * cur_num_entries_ptr) +H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, + size_t *cur_size_ptr, int32_t *cur_num_entries_ptr) { - herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - result = H5C_get_cache_size((H5C_t *)cache_ptr, - max_size_ptr, - min_clean_size_ptr, - cur_size_ptr, - cur_num_entries_ptr); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_cache_size() failed.") - } + if(H5C_get_cache_size((H5C_t *)cache_ptr, max_size_ptr, min_clean_size_ptr, + cur_size_ptr, cur_num_entries_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed.") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_get_cache_size() */ @@ -1971,7 +1768,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, double * hit_rate_ptr) +H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2000,23 +1797,15 @@ done: herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr) { - herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - result = H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_reset_cache_hit_rate_stats() failed.") - } + if(H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed.") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_reset_cache_hit_rate_stats() */ @@ -2033,124 +1822,84 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, - H5AC_cache_config_t *config_ptr) +H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr) { - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ H5C_auto_size_ctl_t internal_config; #if H5AC__TRACE_FILE_ENABLED H5AC_cache_config_t trace_config = H5AC__DEFAULT_CACHE_CONFIG; FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert( cache_ptr ); + /* Sanity checks */ + HDassert(cache_ptr); #if H5AC__TRACE_FILE_ENABLED /* Make note of the new configuration. Don't look up the trace file * pointer, as that may change before we use it. */ - if ( config_ptr != NULL ) { - + if(config_ptr != NULL) trace_config = *config_ptr; - - } #endif /* H5AC__TRACE_FILE_ENABLED */ - if ( ( cache_ptr == NULL ) + if((cache_ptr == NULL) #ifdef H5_HAVE_PARALLEL - || - ( ( cache_ptr->aux_ptr != NULL ) - && - ( - ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic - != - H5AC__H5AC_AUX_T_MAGIC - ) - ) + || ((cache_ptr->aux_ptr != NULL) && + (((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC)) #endif /* H5_HAVE_PARALLEL */ - ) { - + ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.") - } - - result = H5AC_validate_config(config_ptr); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration"); - } - - if ( config_ptr->open_trace_file ) { - - FILE * file_ptr = NULL; - - if ( H5C_get_trace_file_ptr(cache_ptr, &file_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_trace_file_ptr() failed.") - } - - if ( ( ! ( config_ptr->close_trace_file ) ) && - ( file_ptr != NULL ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Trace file already open.") - } - } - if ( config_ptr->close_trace_file ) { + /* Validate external configuration */ + if(H5AC_validate_config(config_ptr) != SUCCEED) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache configuration"); - if ( H5AC_close_trace_file(cache_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5AC_close_trace_file() failed.") - } - } + if(config_ptr->open_trace_file) { + FILE * file_ptr; - if ( config_ptr->open_trace_file ) { + if(NULL == (file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed.") - if ( H5AC_open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0 ) - { + if((!(config_ptr->close_trace_file)) && (file_ptr != NULL)) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open.") + } /* end if */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "H5AC_open_trace_file() failed.") - } - } + /* Close & reopen trace file, if requested */ + if(config_ptr->close_trace_file) + if(H5AC_close_trace_file(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_close_trace_file() failed.") + if(config_ptr->open_trace_file) + if(H5AC_open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC_open_trace_file() failed.") - if(H5AC_ext_config_2_int_config(config_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_ext_config_2_int_config() failed.") + /* Convert external configuration to internal representation */ + if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.") + /* Set configuration */ if(H5C_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.") - if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.") #ifdef H5_HAVE_PARALLEL - if ( cache_ptr->aux_ptr != NULL ) { - - ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold = - config_ptr->dirty_bytes_threshold; - - ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy = - config_ptr->metadata_write_strategy; - } + /* Set parallel configuration values */ + /* (Which are only held in the H5AC layer -QAK) */ + if(cache_ptr->aux_ptr != NULL) { + ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold = config_ptr->dirty_bytes_threshold; + ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy = config_ptr->metadata_write_strategy; + } /* end if */ #endif /* H5_HAVE_PARALLEL */ done: - #if H5AC__TRACE_FILE_ENABLED /* For the set cache auto resize config call, only the contents * of the config is necessary in the trace file. Write the return * value to catch occult errors. */ - if ( ( cache_ptr != NULL ) && - ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - + if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) HDfprintf(trace_file_ptr, "%s %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %f %f %d %d %d %f %f %d %d %d %d %f %zu %d %d\n", "H5AC_set_cache_auto_resize_config", @@ -2185,11 +1934,9 @@ done: trace_config.dirty_bytes_threshold, trace_config.metadata_write_strategy, (int)ret_value); - } #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_set_cache_auto_resize_config() */ @@ -2216,27 +1963,18 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_validate_config(H5AC_cache_config_t * config_ptr) +H5AC_validate_config(H5AC_cache_config_t *config_ptr) { H5C_auto_size_ctl_t internal_config; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Check args */ if(config_ptr == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") - + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") if(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.") - - if((config_ptr->rpt_fcn_enabled != TRUE) && (config_ptr->rpt_fcn_enabled != FALSE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.") - - if((config_ptr->open_trace_file != TRUE) && (config_ptr->open_trace_file != FALSE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->open_trace_file must be either TRUE or FALSE.") - - if((config_ptr->close_trace_file != TRUE) && (config_ptr->close_trace_file != FALSE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->close_trace_file must be either TRUE or FALSE.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version.") /* don't bother to test trace_file_name unless open_trace_file is TRUE */ if(config_ptr->open_trace_file) { @@ -2247,45 +1985,32 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) * sanity checks on the length of the file name. */ name_len = HDstrlen(config_ptr->trace_file_name); + if(name_len == 0) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.") + else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.") + } /* end if */ - if(name_len == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.") - } else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.") - } - } - - if ( ( config_ptr->evictions_enabled != TRUE ) && - ( config_ptr->evictions_enabled != FALSE ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "config_ptr->evictions_enabled must be either TRUE or FALSE.") - } - - if ( ( config_ptr->evictions_enabled == FALSE ) && - ( ( config_ptr->incr_mode != H5C_incr__off ) || - ( config_ptr->flash_incr_mode != H5C_flash_incr__off ) || - ( config_ptr->decr_mode != H5C_decr__off ) ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Can't disable evictions while auto-resize is enabled.") - } + if((config_ptr->evictions_enabled == FALSE) && + ((config_ptr->incr_mode != H5C_incr__off) || + (config_ptr->flash_incr_mode != H5C_flash_incr__off) || + (config_ptr->decr_mode != H5C_decr__off))) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled.") - if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.") - } else if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.") - } + if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.") + else if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.") if((config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY) && (config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range.") - if(H5AC_ext_config_2_int_config(config_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_ext_config_2_int_config() failed.") + if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.") if(H5C_validate_resize_config(&internal_config, H5C_RESIZE_CFG__VALIDATE_ALL) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error(s) in new config.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config.") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2309,44 +2034,29 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_close_trace_file(H5AC_t * cache_ptr) - +H5AC_close_trace_file(H5AC_t *cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ FILE * trace_file_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if ( cache_ptr == NULL ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL cache_ptr on entry.") - } + if(cache_ptr == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL cache_ptr on entry.") - if ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) < 0 ) { + if(NULL == (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed.") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_trace_file_ptr() failed.") - } - - if ( trace_file_ptr != NULL ) { - - if ( H5C_set_trace_file_ptr(cache_ptr, NULL) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_set_trace_file_ptr() failed.") - } - - if ( HDfclose(trace_file_ptr) != 0 ) { + if(trace_file_ptr != NULL) { + if(H5C_set_trace_file_ptr(cache_ptr, NULL) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_trace_file_ptr() failed.") - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, \ - "can't close metadata cache trace file") - } - } + if(HDfclose(trace_file_ptr) != 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close metadata cache trace file") + } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_close_trace_file() */ @@ -2367,99 +2077,57 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_open_trace_file(H5AC_t * cache_ptr, - const char * trace_file_name) +H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name) { - herr_t ret_value = SUCCEED; /* Return value */ char file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 2]; FILE * file_ptr = NULL; #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) HDassert(cache_ptr); - if ( cache_ptr == NULL ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cache_ptr NULL on entry.") - } - - if ( trace_file_name == NULL ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "NULL trace_file_name on entry.") - } - - if ( HDstrlen(trace_file_name) > H5AC__MAX_TRACE_FILE_NAME_LEN ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trace file name too long.") - } - - if ( H5C_get_trace_file_ptr(cache_ptr, &file_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_trace_file_ptr() failed.") - } - - if ( file_ptr != NULL ) { - - HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "trace file already open.") - } + /* Check args */ + if(cache_ptr == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "cache_ptr NULL on entry.") + if(trace_file_name == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL trace_file_name on entry.") + if(HDstrlen(trace_file_name) > H5AC__MAX_TRACE_FILE_NAME_LEN) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "trace file name too long.") + if(NULL != (file_ptr = H5C_get_trace_file_ptr(cache_ptr))) + HGOTO_ERROR(H5E_CACHE, H5E_FILEOPEN, FAIL, "trace file already open.") #ifdef H5_HAVE_PARALLEL - aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - if ( cache_ptr->aux_ptr == NULL ) { - + if(cache_ptr->aux_ptr == NULL) sprintf(file_name, "%s", trace_file_name); - - } else { - - if ( aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC ) { - + else { + if(aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr->magic.") - } sprintf(file_name, "%s.%d", trace_file_name, aux_ptr->mpi_rank); + } /* end else */ - } - - if ( HDstrlen(file_name) > - H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "cooked trace file name too long.") - } - + if(HDstrlen(file_name) > H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cooked trace file name too long.") #else /* H5_HAVE_PARALLEL */ - - HDsnprintf(file_name, - (size_t)(H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1), + HDsnprintf(file_name, (size_t)(H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1), "%s", trace_file_name); - #endif /* H5_HAVE_PARALLEL */ - if ( (file_ptr = HDfopen(file_name, "w")) == NULL ) { - - /* trace file open failed */ + if((file_ptr = HDfopen(file_name, "w")) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "trace file open failed.") - } HDfprintf(file_ptr, "### HDF5 metadata cache trace file version 1 ###\n"); - if ( H5C_set_trace_file_ptr(cache_ptr, file_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_set_trace_file_ptr() failed.") - } + if(H5C_set_trace_file_ptr(cache_ptr, file_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_trace_file_ptr() failed.") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_open_trace_file() */ @@ -2483,8 +2151,7 @@ done: */ #ifdef H5_HAVE_PARALLEL herr_t -H5AC_add_candidate(H5AC_t * cache_ptr, - haddr_t addr) +H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr) { H5AC_aux_t * aux_ptr; H5AC_slist_entry_t * slist_entry_ptr = NULL; @@ -2492,36 +2159,31 @@ H5AC_add_candidate(H5AC_t * cache_ptr, FUNC_ENTER_NOAPI(FAIL) - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + HDassert(aux_ptr->candidate_slist_ptr != NULL); - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); - HDassert( aux_ptr->candidate_slist_ptr != NULL ); - - /* If the supplied address appears in the candidate list, scream and die. */ - if(NULL != H5SL_search(aux_ptr->candidate_slist_ptr, (void *)(&addr))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry already in candidate slist.") - - /* otherwise, construct an entry for the supplied address, and insert + /* Construct an entry for the supplied address, and insert * it into the candidate slist. */ - if(NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "Can't allocate candidate slist entry .") - - slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC; + if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate candidate slist entry") slist_entry_ptr->addr = addr; if(H5SL_insert(aux_ptr->candidate_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.") - - aux_ptr->candidate_slist_len += 1; + HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist") done: + /* Clean up on error */ + if(ret_value < 0) + if(slist_entry_ptr) + slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); + FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_add_candidate() */ #endif /* H5_HAVE_PARALLEL */ @@ -2568,33 +2230,22 @@ done: * * Programmer: John Mainzer, 5/30/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #ifndef NDEBUG herr_t -H5AC_get_entry_ptr_from_addr(const H5F_t *f, - haddr_t addr, - void ** entry_ptr_ptr) +H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if ( H5C_get_entry_ptr_from_addr(f, addr, entry_ptr_ptr) < 0 ) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_entry_ptr_from_addr() failed.") + if(H5C_get_entry_ptr_from_addr(f, addr, entry_ptr_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_ptr_from_addr() failed") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_get_entry_ptr_from_addr() */ - #endif /* NDEBUG */ @@ -2624,36 +2275,23 @@ done: * * Programmer: John Mainzer, 5/30/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #ifndef NDEBUG herr_t -H5AC_verify_entry_type(const H5F_t *f, - haddr_t addr, - const H5AC_class_t * expected_type, - hbool_t * in_cache_ptr, - hbool_t * type_ok_ptr) +H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, const H5AC_class_t *expected_type, + hbool_t *in_cache_ptr, hbool_t *type_ok_ptr) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if ( H5C_verify_entry_type(f, addr, (const H5C_class_t *)expected_type, - in_cache_ptr, type_ok_ptr) < 0 ) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_verify_entry_type() failed.") + if(H5C_verify_entry_type(f, addr, expected_type, in_cache_ptr, type_ok_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_verify_entry_type() failed") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_verify_entry_type() */ - #endif /* NDEBUG */ @@ -2664,7 +2302,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5AC_broadcast_candidate_list() + * Function: H5AC__broadcast_candidate_list() * * Purpose: Broadcast the contents of the process 0 candidate entry * slist. In passing, also remove all entries from said @@ -2688,98 +2326,125 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_broadcast_candidate_list(H5AC_t * cache_ptr, - int * num_entries_ptr, - haddr_t ** haddr_buf_ptr_ptr) +H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, int *num_entries_ptr, + haddr_t **haddr_buf_ptr_ptr) { - hbool_t success = FALSE; H5AC_aux_t * aux_ptr = NULL; haddr_t * haddr_buf_ptr = NULL; - MPI_Offset * MPI_Offset_buf_ptr = NULL; - size_t buf_size = 0; int mpi_result; - int chk_num_entries = 0; - int num_entries = 0; + int num_entries; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->mpi_rank == 0 ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); - HDassert( aux_ptr->candidate_slist_ptr != NULL ); - HDassert( H5SL_count(aux_ptr->candidate_slist_ptr) == - (size_t)(aux_ptr->candidate_slist_len) ); - HDassert( num_entries_ptr != NULL ); - HDassert( *num_entries_ptr == 0 ); - HDassert( haddr_buf_ptr_ptr != NULL ); - HDassert( *haddr_buf_ptr_ptr == NULL ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->mpi_rank == 0); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + HDassert(aux_ptr->candidate_slist_ptr != NULL); + HDassert(num_entries_ptr != NULL); + HDassert(*num_entries_ptr == 0); + HDassert(haddr_buf_ptr_ptr != NULL); + HDassert(*haddr_buf_ptr_ptr == NULL); /* First broadcast the number of entries in the list so that the * receivers can set up buffers to receive them. If there aren't * any, we are done. */ - num_entries = aux_ptr->candidate_slist_len; + num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr); if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { + size_t buf_size = 0; + int chk_num_entries = 0; + /* convert the candidate list into the format we * are used to receiving from process 0, and also load it * into a buffer for transmission. */ - if(H5AC_copy_candidate_list_to_buffer(cache_ptr, &chk_num_entries, - &haddr_buf_ptr, &buf_size, &MPI_Offset_buf_ptr) < 0) + if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &chk_num_entries, &haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.") + HDassert(chk_num_entries == num_entries); + HDassert(haddr_buf_ptr != NULL); - HDassert( chk_num_entries == num_entries ); - HDassert( haddr_buf_ptr != NULL ); - HDassert( MPI_Offset_buf_ptr != NULL ); - HDassert( aux_ptr->candidate_slist_len == 0 ); - - /* Now broadcast the list of candidate entries -- if there is one. - * - * The peculiar structure of the following call to MPI_Bcast is - * due to MPI's (?) failure to believe in the MPI_Offset type. - * Thus the element type is MPI_BYTE, with size equal to the - * buf_size computed above. - */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)MPI_Offset_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result) + /* Now broadcast the list of candidate entries */ + buf_size = sizeof(haddr_t) * (size_t)num_entries; + if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)haddr_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) } /* end if */ - success = TRUE; + /* Pass the number of entries and the buffer pointer + * back to the caller. Do this so that we can use the same code + * to apply the candidate list to all the processes. + */ + *num_entries_ptr = num_entries; + *haddr_buf_ptr_ptr = haddr_buf_ptr; done: - if(MPI_Offset_buf_ptr != NULL) - MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr); - - if(success) { - /* Pass the number of entries and the buffer pointer - * back to the caller. Do this so that we can use the same code - * to apply the candidate list to all the processes. - */ - *num_entries_ptr = num_entries; - *haddr_buf_ptr_ptr = haddr_buf_ptr; - } else if(haddr_buf_ptr != NULL) { - haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); - } + if(ret_value < 0) + if(haddr_buf_ptr) + haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_broadcast_candidate_list() */ +} /* H5AC__broadcast_candidate_list() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_broadcast_clean_list() + * Function: H5AC__broadcast_clean_list_cb() + * + * Purpose: Skip list callback for building array of addresses for + * broadcasting the clean list. + * + * Return: Non-negative on success/Negative on failure. + * + * Programmer: Quincey Koziol, 6/12/15 + * + *------------------------------------------------------------------------- + */ +#ifdef H5_HAVE_PARALLEL +static herr_t +H5AC__broadcast_clean_list_cb(void *_item, void H5_ATTR_UNUSED *_key, + void *_udata) +{ + H5AC_slist_entry_t * slist_entry_ptr = (H5AC_slist_entry_t *)_item; /* Address of item */ + H5AC_addr_list_ud_t * udata = (H5AC_addr_list_ud_t *)_udata; /* Context for callback */ + haddr_t addr; + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(slist_entry_ptr); + HDassert(udata); + + /* Store the entry's address in the buffer */ + addr = slist_entry_ptr->addr; + udata->addr_buf_ptr[udata->i] = addr; + udata->i++; + + /* now release the entry */ + slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); + + /* and also remove the matching entry from the dirtied list + * if it exists. + */ + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(udata->aux_ptr->d_slist_ptr, (void *)(&addr)))) + slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5AC__broadcast_clean_list_cb() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * + * Function: H5AC__broadcast_clean_list() * * Purpose: Broadcast the contents of the process 0 cleaned entry * slist. In passing, also remove all entries from said @@ -2799,174 +2464,76 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_broadcast_clean_list(H5AC_t * cache_ptr) +H5AC__broadcast_clean_list(H5AC_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - haddr_t addr; haddr_t * addr_buf_ptr = NULL; - H5AC_aux_t * aux_ptr = NULL; - H5SL_node_t * slist_node_ptr = NULL; - H5AC_slist_entry_t * slist_entry_ptr = NULL; - MPI_Offset * buf_ptr = NULL; - size_t buf_size; - int i = 0; + H5AC_aux_t * aux_ptr; int mpi_result; int num_entries = 0; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)cache_ptr->aux_ptr; - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->mpi_rank == 0 ); - HDassert( aux_ptr->c_slist_ptr != NULL ); - HDassert( H5SL_count(aux_ptr->c_slist_ptr) == - (size_t)(aux_ptr->c_slist_len) ); - + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->mpi_rank == 0); + HDassert(aux_ptr->c_slist_ptr != NULL); /* First broadcast the number of entries in the list so that the * receives can set up a buffer to receive them. If there aren't * any, we are done. */ - num_entries = aux_ptr->c_slist_len; - - mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm); - - if ( mpi_result != MPI_SUCCESS ) { - - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result) + num_entries = (int)H5SL_count(aux_ptr->c_slist_ptr); + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) - } + if(num_entries > 0) { + H5AC_addr_list_ud_t udata; + size_t buf_size; - if ( num_entries > 0 ) - { /* allocate a buffer to store the list of entry base addresses in */ + buf_size = sizeof(haddr_t) * (size_t)num_entries; + if(NULL == (addr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for addr buffer") + + /* Set up user data for callback */ + udata.aux_ptr = aux_ptr; + udata.addr_buf_ptr = addr_buf_ptr; + udata.i = 0; + + /* Free all the clean list entries, building the address list in the callback */ + /* (Callback also removes the matching entries from the dirtied list) */ + if(H5SL_free(aux_ptr->c_slist_ptr, H5AC__broadcast_clean_list_cb, &udata) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "Can't build address list for clean entries") + + /* Now broadcast the list of cleaned entries */ + if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)addr_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) + } /* end if */ - buf_size = sizeof(MPI_Offset) * (size_t)num_entries; - - buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size); - - if ( buf_ptr == NULL ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "memory allocation failed for clean entry buffer") - } - - /* if the sync_point_done callback is defined, allocate the - * addr buffer as well. - */ - if ( aux_ptr->sync_point_done != NULL ) { - - addr_buf_ptr = (haddr_t *)H5MM_malloc((size_t)num_entries * sizeof(haddr_t)); - - if ( addr_buf_ptr == NULL ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "memory allocation failed for addr buffer") - } - } - - - /* now load the entry base addresses into the buffer, emptying the - * cleaned entry list in passing - */ - - while ( NULL != (slist_node_ptr = H5SL_first(aux_ptr->c_slist_ptr) ) ) - { - slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_item(slist_node_ptr); - - HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - - HDassert( i < num_entries ); - - addr = slist_entry_ptr->addr; - - if ( addr_buf_ptr != NULL ) { - - addr_buf_ptr[i] = addr; - } - - if ( H5FD_mpi_haddr_to_MPIOff(addr, &(buf_ptr[i])) < 0 ) { - - HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, \ - "can't convert from haddr to MPI off") - } - - i++; - - /* now remove the entry from the cleaned entry list */ - if ( H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) - != slist_entry_ptr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \ - "Can't delete entry from cleaned entry slist.") - } - - slist_entry_ptr->magic = 0; - slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->c_slist_len -= 1; - - HDassert( aux_ptr->c_slist_len >= 0 ); - - /* and also remove the matching entry from the dirtied list - * if it exists. - */ - if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL) { - HDassert( slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC ); - HDassert( slist_entry_ptr->addr == addr ); - - if(H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)) != slist_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.") - - slist_entry_ptr->magic = 0; - slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->d_slist_len -= 1; - - HDassert( aux_ptr->d_slist_len >= 0 ); - } /* end if */ - } /* while */ - - - /* Now broadcast the list of cleaned entries -- if there is one. - * - * The peculiar structure of the following call to MPI_Bcast is - * due to MPI's (?) failure to believe in the MPI_Offset type. - * Thus the element type is MPI_BYTE, with size equal to the - * buf_size computed above. - */ - - mpi_result = MPI_Bcast((void *)buf_ptr, (int)buf_size, MPI_BYTE, 0, - aux_ptr->mpi_comm); - - if ( mpi_result != MPI_SUCCESS ) { - - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result) - } - } - - if(aux_ptr->sync_point_done != NULL) + /* if it is defined, call the sync point done callback. Note + * that this callback is defined purely for testing purposes, + * and should be undefined under normal operating circumstances. + */ + if(aux_ptr->sync_point_done) (aux_ptr->sync_point_done)(num_entries, addr_buf_ptr); done: - if(buf_ptr != NULL) - buf_ptr = (MPI_Offset *)H5MM_xfree((void *)buf_ptr); - if(addr_buf_ptr != NULL) + if(addr_buf_ptr) addr_buf_ptr = (haddr_t *)H5MM_xfree((void *)addr_buf_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_broadcast_clean_list() */ +} /* H5AC__broadcast_clean_list() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_check_if_write_permitted + * Function: H5AC__check_if_write_permitted * * Purpose: Determine if a write is permitted under the current * circumstances, and set *write_permitted_ptr accordingly. @@ -2983,62 +2550,44 @@ done: * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_PARALLEL -static herr_t -H5AC_check_if_write_permitted(const H5F_t *f, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t * write_permitted_ptr) -#else /* H5_HAVE_PARALLEL */ static herr_t -H5AC_check_if_write_permitted(const H5F_t H5_ATTR_UNUSED * f, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t * write_permitted_ptr) +H5AC__check_if_write_permitted(const H5F_t +#ifndef H5_HAVE_PARALLEL +H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ + *f, hbool_t *write_permitted_ptr) { - hbool_t write_permitted = TRUE; - herr_t ret_value = SUCCEED; /* Return value */ #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ + hbool_t write_permitted = TRUE; - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_NOERR #ifdef H5_HAVE_PARALLEL - HDassert( f != NULL ); - HDassert( f->shared != NULL ); - HDassert( f->shared->cache != NULL ); - + /* Sanity checks */ + HDassert(f != NULL); + HDassert(f->shared != NULL); + HDassert(f->shared->cache != NULL); aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr); + if(aux_ptr != NULL) { + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - if ( aux_ptr != NULL ) { - - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - - if ( ( aux_ptr->mpi_rank == 0 ) || - ( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ) ) { - + if((aux_ptr->mpi_rank == 0) || (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) write_permitted = aux_ptr->write_permitted; - - } else { - + else write_permitted = FALSE; - } - } + } /* end if */ #endif /* H5_HAVE_PARALLEL */ *write_permitted_ptr = write_permitted; -done: - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5AC_check_if_write_permitted() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5AC__check_if_write_permitted() */ /*------------------------------------------------------------------------- - * Function: H5AC_construct_candidate_list() + * Function: H5AC__construct_candidate_list() * * Purpose: In the parallel case when the metadata_write_strategy is * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, process 0 uses @@ -3058,29 +2607,26 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_construct_candidate_list(H5AC_t * cache_ptr, - H5AC_aux_t * aux_ptr, - int sync_point_op) +H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t *aux_ptr, + int sync_point_op) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); - HDassert( ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE ) || - ( aux_ptr->mpi_rank == 0 ) ); - HDassert( aux_ptr->d_slist_ptr != NULL ); - HDassert( aux_ptr->c_slist_ptr != NULL ); - HDassert( aux_ptr->c_slist_len == 0 ); - HDassert( aux_ptr->candidate_slist_ptr != NULL ); - HDassert( aux_ptr->candidate_slist_len == 0 ); - HDassert( ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN ) || - ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE ) ); + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE) || (aux_ptr->mpi_rank == 0)); + HDassert(aux_ptr->d_slist_ptr != NULL); + HDassert(aux_ptr->c_slist_ptr != NULL); + HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); + HDassert(aux_ptr->candidate_slist_ptr != NULL); + HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); + HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || (sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE)); switch(sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: @@ -3100,13 +2646,52 @@ H5AC_construct_candidate_list(H5AC_t * cache_ptr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_construct_candidate_list() */ +} /* H5AC__construct_candidate_list() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * + * Function: H5AC__copy_candidate_list_to_buffer_cb + * + * Purpose: Skip list callback for building array of addresses for + * broadcasting the candidate list. + * + * Return: Return SUCCEED on success, and FAIL on failure. + * + * Programmer: Quincey Koziol, 6/12/15 + * + *------------------------------------------------------------------------- + */ +#ifdef H5_HAVE_PARALLEL +static herr_t +H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, + void *_udata) +{ + H5AC_slist_entry_t * slist_entry_ptr = (H5AC_slist_entry_t *)_item; /* Address of item */ + H5AC_addr_list_ud_t * udata = (H5AC_addr_list_ud_t *)_udata; /* Context for callback */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(slist_entry_ptr); + HDassert(udata); + + /* Store the entry's address in the buffer */ + udata->addr_buf_ptr[udata->i] = slist_entry_ptr->addr; + udata->i++; + + /* now release the entry */ + slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5AC__copy_candidate_list_to_buffer_cb() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_copy_candidate_list_to_buffer + * Function: H5AC__copy_candidate_list_to_buffer * * Purpose: Allocate buffer(s) and copy the contents of the candidate * entry slist into it (them). In passing, remove all @@ -3137,123 +2722,68 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_copy_candidate_list_to_buffer(H5AC_t * cache_ptr, - int * num_entries_ptr, - haddr_t ** haddr_buf_ptr_ptr, - size_t * MPI_Offset_buf_size_ptr, - MPI_Offset ** MPI_Offset_buf_ptr_ptr) +H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, int *num_entries_ptr, + haddr_t **haddr_buf_ptr_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - hbool_t success = FALSE; - haddr_t addr; H5AC_aux_t * aux_ptr = NULL; - H5SL_node_t * slist_node_ptr = NULL; - H5AC_slist_entry_t * slist_entry_ptr = NULL; - MPI_Offset * MPI_Offset_buf_ptr = NULL; + H5AC_addr_list_ud_t udata; haddr_t * haddr_buf_ptr = NULL; size_t buf_size; - int i = 0; int num_entries = 0; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + HDassert(aux_ptr->candidate_slist_ptr != NULL); + HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) > 0); + HDassert(num_entries_ptr != NULL); + HDassert(*num_entries_ptr == 0); + HDassert(haddr_buf_ptr_ptr != NULL); + HDassert(*haddr_buf_ptr_ptr == NULL); - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); - HDassert( aux_ptr->candidate_slist_ptr != NULL ); - HDassert( H5SL_count(aux_ptr->candidate_slist_ptr) == - (size_t)(aux_ptr->candidate_slist_len) ); - HDassert( aux_ptr->candidate_slist_len > 0 ); - HDassert( num_entries_ptr != NULL ); - HDassert( *num_entries_ptr == 0 ); - HDassert( haddr_buf_ptr_ptr != NULL ); - HDassert( *haddr_buf_ptr_ptr == NULL ); - - num_entries = aux_ptr->candidate_slist_len; + num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr); /* allocate a buffer(s) to store the list of candidate entry * base addresses in */ - if(MPI_Offset_buf_ptr_ptr != NULL) { - HDassert( MPI_Offset_buf_size_ptr != NULL ); + buf_size = sizeof(haddr_t) * (size_t)num_entries; + if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer") - /* allocate a buffer of MPI_Offset */ - buf_size = sizeof(MPI_Offset) * (size_t)num_entries; - if(NULL == (MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for MPI_Offset buffer") - } /* end if */ + /* Set up user data for callback */ + udata.aux_ptr = aux_ptr; + udata.addr_buf_ptr = haddr_buf_ptr; + udata.i = 0; - /* allocate a buffer of haddr_t */ - if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)num_entries))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for haddr buffer") + /* Free all the candidate list entries, building the address list in the callback */ + if(H5SL_free(aux_ptr->candidate_slist_ptr, H5AC__copy_candidate_list_to_buffer_cb, &udata) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "Can't build address list for candidate entries") - /* now load the entry base addresses into the buffer, emptying the - * candidate entry list in passing + /* Pass the number of entries and the buffer pointer + * back to the caller. */ - while(NULL != (slist_node_ptr = H5SL_first(aux_ptr->candidate_slist_ptr))) { - slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_item(slist_node_ptr); - - HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert( i < num_entries ); - - addr = slist_entry_ptr->addr; - haddr_buf_ptr[i] = addr; - if(MPI_Offset_buf_ptr != NULL) { - if(H5FD_mpi_haddr_to_MPIOff(addr, &(MPI_Offset_buf_ptr[i])) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off") - } /* end if */ - - i++; - - /* now remove the entry from the cleaned entry list */ - if(H5SL_remove(aux_ptr->candidate_slist_ptr, (void *)(&addr)) != slist_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from candidate entry slist.") - - slist_entry_ptr->magic = 0; - slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->candidate_slist_len -= 1; - - HDassert( aux_ptr->candidate_slist_len >= 0 ); - } /* while */ - HDassert( aux_ptr->candidate_slist_len == 0 ); - - success = TRUE; + *num_entries_ptr = num_entries; + *haddr_buf_ptr_ptr = haddr_buf_ptr; done: - if(success) { - /* Pass the number of entries and the buffer pointer - * back to the caller. - */ - *num_entries_ptr = num_entries; - *haddr_buf_ptr_ptr = haddr_buf_ptr; - - if(MPI_Offset_buf_ptr_ptr != NULL) { - HDassert( MPI_Offset_buf_ptr != NULL); - *MPI_Offset_buf_size_ptr = buf_size; - *MPI_Offset_buf_ptr_ptr = MPI_Offset_buf_ptr; - } /* end if */ - } /* end if */ - else { - if(MPI_Offset_buf_ptr != NULL) - MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr); - if(haddr_buf_ptr != NULL) + if(ret_value < 0) + if(haddr_buf_ptr) haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); - } /* end else */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_copy_candidate_list_to_buffer() */ +} /* H5AC__copy_candidate_list_to_buffer() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_ext_config_2_int_config() + * Function: H5AC__ext_config_2_int_config() * * Purpose: Utility function to translate an instance of * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t. @@ -3271,30 +2801,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr, - H5C_auto_size_ctl_t * int_conf_ptr) +H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, + H5C_auto_size_ctl_t *int_conf_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC - if ( ( ext_conf_ptr == NULL ) || - ( ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) || - ( int_conf_ptr == NULL ) ) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Bad ext_conf_ptr or inf_conf_ptr on entry.") - } + if((ext_conf_ptr == NULL) || (ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) || + (int_conf_ptr == NULL)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry.") int_conf_ptr->version = H5C__CURR_AUTO_SIZE_CTL_VER; - - if ( ext_conf_ptr->rpt_fcn_enabled ) { - + if(ext_conf_ptr->rpt_fcn_enabled) int_conf_ptr->rpt_fcn = H5C_def_auto_resize_rpt_fcn; - - } else { - + else int_conf_ptr->rpt_fcn = NULL; - } int_conf_ptr->set_initial_size = ext_conf_ptr->set_initial_size; int_conf_ptr->initial_size = ext_conf_ptr->initial_size; @@ -3323,18 +2845,17 @@ H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_ext_config_2_int_config() */ +} /* H5AC__ext_config_2_int_config() */ /*------------------------------------------------------------------------- * - * Function: H5AC_log_deleted_entry() + * Function: H5AC__log_deleted_entry() * - * Purpose: Log an entry for which H5C__DELETED_FLAG has been set. + * Purpose: Log an entry which has been deleted. * - * If mpi_rank is 0, we must make sure that the entry doesn't - * appear in the cleaned or dirty entry lists. Otherwise, - * we have nothing to do. + * Only called for mpi_rank 0. We must make sure that the entry + * doesn't appear in the cleaned or dirty entry lists. * * Return SUCCEED on success, and FAIL on failure. * @@ -3346,80 +2867,48 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_deleted_entry(H5AC_t * cache_ptr, - H5AC_info_t * entry_ptr, - haddr_t addr, - unsigned int flags) +H5AC__log_deleted_entry(const H5AC_info_t *entry_ptr) { + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; H5AC_slist_entry_t * slist_entry_ptr = NULL; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) + haddr_t addr; - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC_NOERR + /* Sanity checks */ + HDassert(entry_ptr); + addr = entry_ptr->addr; + cache_ptr = entry_ptr->cache_ptr; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->mpi_rank == 0); + HDassert(aux_ptr->d_slist_ptr != NULL); + HDassert(aux_ptr->c_slist_ptr != NULL); - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - - HDassert( entry_ptr != NULL ); - HDassert( entry_ptr->addr == addr ); - - HDassert( (flags & H5C__DELETED_FLAG) != 0 ); - - if(aux_ptr->mpi_rank == 0) { - HDassert( aux_ptr->d_slist_ptr != NULL ); - HDassert( aux_ptr->c_slist_ptr != NULL ); - - /* if the entry appears in the dirtied entry slist, remove it. */ - if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL) { - HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert(slist_entry_ptr->addr == addr); - - if(H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)) != slist_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.") - - slist_entry_ptr->magic = 0; - slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->d_slist_len -= 1; - - HDassert( aux_ptr->d_slist_len >= 0 ); - } /* end if */ - - /* if the entry appears in the cleaned entry slist, remove it. */ - if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr))) != NULL) { - HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert(slist_entry_ptr->addr == addr); - - if(H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) != slist_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from cleaned entry slist.") - - slist_entry_ptr->magic = 0; - slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->c_slist_len -= 1; + /* if the entry appears in the dirtied entry slist, remove it. */ + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)))) + slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - HDassert( aux_ptr->c_slist_len >= 0 ); - } /* end if */ - } /* if */ + /* if the entry appears in the cleaned entry slist, remove it. */ + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)))) + slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_log_deleted_entry() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5AC__log_deleted_entry() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_log_dirtied_entry() + * Function: H5AC__log_dirtied_entry() * * Purpose: Update the dirty_bytes count for a newly dirtied entry. * - * If mpi_rank isnt 0, this simply means adding the size + * If mpi_rank isn't 0, this simply means adding the size * of the entries to the dirty_bytes count. * * If mpi_rank is 0, we must first check to see if the entry @@ -3438,103 +2927,73 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, - haddr_t addr) +H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( entry_ptr ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->is_dirty == FALSE ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(entry_ptr); + HDassert(entry_ptr->is_dirty == FALSE); cache_ptr = entry_ptr->cache_ptr; - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - - if ( aux_ptr->mpi_rank == 0 ) { - H5AC_slist_entry_t * slist_entry_ptr; - - HDassert( aux_ptr->d_slist_ptr != NULL ); - HDassert( aux_ptr->c_slist_ptr != NULL ); + if(aux_ptr->mpi_rank == 0) { + H5AC_slist_entry_t *slist_entry_ptr; + haddr_t addr = entry_ptr->addr; - if ( H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr)) == NULL ) { + /* Sanity checks */ + HDassert(aux_ptr->d_slist_ptr != NULL); + HDassert(aux_ptr->c_slist_ptr != NULL); + if(NULL == H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) { /* insert the address of the entry in the dirty entry list, and * add its size to the dirty_bytes count. */ - if ( NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)) ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "Can't allocate dirty slist entry .") - } - - slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC; + if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate dirty slist entry .") slist_entry_ptr->addr = addr; - if ( H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, - &(slist_entry_ptr->addr)) < 0 ) { + if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.") - HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \ - "can't insert entry into dirty entry slist.") - } - - aux_ptr->d_slist_len += 1; aux_ptr->dirty_bytes += entry_ptr->size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION aux_ptr->unprotect_dirty_bytes += entry_ptr->size; aux_ptr->unprotect_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ - } - - if(H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr)) != NULL) { - /* the entry is dirty. If it exists on the cleaned entries list, - * remove it. - */ - if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr))) != NULL) { - HDassert(slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert(slist_entry_ptr->addr == addr); - - if(H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) != slist_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from clean entry slist.") - - slist_entry_ptr->magic = 0; - slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->c_slist_len -= 1; - - HDassert( aux_ptr->c_slist_len >= 0 ); - } /* end if */ } /* end if */ - } else { + /* the entry is dirty. If it exists on the cleaned entries list, + * remove it. + */ + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)))) + slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); + } /* end if */ + else { aux_ptr->dirty_bytes += entry_ptr->size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION aux_ptr->unprotect_dirty_bytes += entry_size; aux_ptr->unprotect_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ - } + } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5AC_log_dirtied_entry() */ +} /* H5AC__log_dirtied_entry() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_log_flushed_entry() + * Function: H5AC__log_flushed_entry() * * Purpose: Update the clean entry slist for the flush of an entry -- * specifically, if the entry has been cleared, remove it @@ -3555,117 +3014,58 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_flushed_entry(H5C_t * cache_ptr, - haddr_t addr, - hbool_t was_dirty, - unsigned flags, - int H5_ATTR_UNUSED type_id) +H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, hbool_t was_dirty, + unsigned flags) { - herr_t ret_value = SUCCEED; /* Return value */ hbool_t cleared; H5AC_aux_t * aux_ptr; H5AC_slist_entry_t * slist_entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC - FUNC_ENTER_NOAPI(FAIL) - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - + /* Sanity check */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->mpi_rank == 0); + HDassert(aux_ptr->c_slist_ptr != NULL); - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->mpi_rank == 0 ); - HDassert( aux_ptr->c_slist_ptr != NULL ); - - cleared = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0 ); - - if ( cleared ) { + /* Set local flags */ + cleared = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + if(cleared) { /* If the entry has been cleared, must remove it from both the * cleaned list and the dirtied list. */ - - if ( (slist_entry_ptr = (H5AC_slist_entry_t *) - H5SL_search(aux_ptr->c_slist_ptr, - (void *)(&addr))) != NULL ) { - - HDassert( slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert( slist_entry_ptr->addr == addr ); - - if ( H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) - != slist_entry_ptr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \ - "Can't delete entry from clean entry slist.") - } - - slist_entry_ptr->magic = 0; + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)))) slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->c_slist_len -= 1; - - HDassert( aux_ptr->c_slist_len >= 0 ); - } - - if ( (slist_entry_ptr = (H5AC_slist_entry_t *) - H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL ) { - - HDassert( slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert( slist_entry_ptr->addr == addr ); - - if ( H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)) - != slist_entry_ptr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \ - "Can't delete entry from dirty entry slist.") - } - - slist_entry_ptr->magic = 0; + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)))) slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - - aux_ptr->d_slist_len -= 1; - - HDassert( aux_ptr->d_slist_len >= 0 ); - } - } else if ( was_dirty ) { - - if ( H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr)) == NULL ) { - + } /* end if */ + else if(was_dirty) { + if(NULL == H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr))) { /* insert the address of the entry in the clean entry list. */ + if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate clean slist entry .") + slist_entry_ptr->addr = addr; - if ( NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)) ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "Can't allocate clean slist entry .") - } - - slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC; - slist_entry_ptr->addr = addr; - - if ( H5SL_insert(aux_ptr->c_slist_ptr, slist_entry_ptr, - &(slist_entry_ptr->addr)) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \ - "can't insert entry into clean entry slist.") - } - - aux_ptr->c_slist_len += 1; - } - } + if(H5SL_insert(aux_ptr->c_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into clean entry slist.") + } /* end if */ + } /* end else-if */ done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5AC_log_flushed_entry() */ +} /* H5AC__log_flushed_entry() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_log_inserted_entry() + * Function: H5AC__log_inserted_entry() * * Purpose: Update the dirty_bytes count for a newly inserted entry. * @@ -3685,48 +3085,44 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_inserted_entry(H5AC_t * cache_ptr, - H5AC_info_t * entry_ptr) +H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr) { + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(entry_ptr); + cache_ptr = entry_ptr->cache_ptr; HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - HDassert(aux_ptr != NULL); HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - HDassert( entry_ptr != NULL ); - if(aux_ptr->mpi_rank == 0) { - H5AC_slist_entry_t * slist_entry_ptr; + H5AC_slist_entry_t *slist_entry_ptr; HDassert(aux_ptr->d_slist_ptr != NULL); HDassert(aux_ptr->c_slist_ptr != NULL); - if(NULL != H5SL_search(aux_ptr->d_slist_ptr, (void *)(&entry_ptr->addr))) + /* Entry to insert should not be in dirty list currently */ + if(NULL != H5SL_search(aux_ptr->d_slist_ptr, (const void *)(&entry_ptr->addr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Inserted entry already in dirty slist.") /* insert the address of the entry in the dirty entry list, and * add its size to the dirty_bytes count. */ - if(NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "Can't allocate dirty slist entry .") - - slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC; + if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate dirty slist entry .") slist_entry_ptr->addr = entry_ptr->addr; - - if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0 ) + if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.") - aux_ptr->d_slist_len += 1; - - if(NULL != H5SL_search(aux_ptr->c_slist_ptr, (void *)(&entry_ptr->addr))) + /* Entry to insert should not be in clean list either */ + if(NULL != H5SL_search(aux_ptr->c_slist_ptr, (const void *)(&entry_ptr->addr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Inserted entry in clean slist.") } /* end if */ @@ -3739,13 +3135,13 @@ H5AC_log_inserted_entry(H5AC_t * cache_ptr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_log_inserted_entry() */ +} /* H5AC__log_inserted_entry() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_log_moved_entry() + * Function: H5AC__log_moved_entry() * * Purpose: Update the dirty_bytes count for a moved entry. * @@ -3756,8 +3152,8 @@ done: * moving in a collective operation and immediately after * unprotecting the target entry. * - * This function uses this invarient, and will cause arcane - * failures if it is not met. If maintaining this invarient + * This function uses this invariant, and will cause arcane + * failures if it is not met. If maintaining this invariant * becomes impossible, we will have to rework this function * extensively, and likely include a bit of IPC for * synchronization. A better option might be to subsume @@ -3791,100 +3187,52 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_moved_entry(const H5F_t *f, - haddr_t old_addr, - haddr_t new_addr) +H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) { - H5AC_t * cache_ptr; + H5AC_t * cache_ptr; + H5AC_aux_t * aux_ptr; hbool_t entry_in_cache; hbool_t entry_dirty; size_t entry_size; - H5AC_aux_t * aux_ptr = NULL; - H5AC_slist_entry_t * slist_entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( f ); - HDassert( f->shared ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); cache_ptr = (H5AC_t *)f->shared->cache; - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); /* get entry status, size, etc here */ - if ( H5C_get_entry_status(f, old_addr, &entry_size, &entry_in_cache, - &entry_dirty, NULL, NULL, NULL, NULL) < 0 ) { - + if(H5C_get_entry_status(f, old_addr, &entry_size, &entry_in_cache, + &entry_dirty, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get entry status.") - - } else if ( ! entry_in_cache ) { - - HDassert( entry_in_cache ); + if(!entry_in_cache) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry not in cache.") - } - if ( aux_ptr->mpi_rank == 0 ) { + if(aux_ptr->mpi_rank == 0) { + H5AC_slist_entry_t * slist_entry_ptr; - HDassert( aux_ptr->d_slist_ptr != NULL ); - HDassert( aux_ptr->c_slist_ptr != NULL ); + HDassert(aux_ptr->d_slist_ptr != NULL); + HDassert(aux_ptr->c_slist_ptr != NULL); /* if the entry appears in the cleaned entry slist, under its old * address, remove it. */ - if ( (slist_entry_ptr = (H5AC_slist_entry_t *) - H5SL_search(aux_ptr->c_slist_ptr, (void *)(&old_addr))) != NULL ) { - - HDassert( slist_entry_ptr->magic == - H5AC__H5AC_SLIST_ENTRY_T_MAGIC ); - HDassert( slist_entry_ptr->addr == old_addr ); - - if ( H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&old_addr)) - != slist_entry_ptr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \ - "Can't delete entry from cleaned entry slist.") - } - - slist_entry_ptr->magic = 0; + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&old_addr)))) slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); - aux_ptr->c_slist_len -= 1; - - HDassert( aux_ptr->c_slist_len >= 0 ); - } - /* if the entry appears in the dirtied entry slist under its old * address, remove it, but don't free it. Set addr to new_addr. */ - if ( (slist_entry_ptr = (H5AC_slist_entry_t *) - H5SL_search(aux_ptr->d_slist_ptr, (void *)(&old_addr))) != NULL ) { - - HDassert( slist_entry_ptr->magic == - H5AC__H5AC_SLIST_ENTRY_T_MAGIC ); - HDassert( slist_entry_ptr->addr == old_addr ); - - if ( H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&old_addr)) - != slist_entry_ptr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, \ - "Can't delete entry from dirty entry slist.") - } - + if(NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&old_addr)))) slist_entry_ptr->addr = new_addr; - - aux_ptr->d_slist_len -= 1; - - HDassert( aux_ptr->d_slist_len >= 0 ); - - } else { - + else { /* otherwise, allocate a new entry that is ready * for insertion, and increment dirty_bytes. * @@ -3892,61 +3240,40 @@ H5AC_log_moved_entry(const H5F_t *f, * list under its old address implies that it must have * been clean to start with. */ - - HDassert( !entry_dirty ); - - if ( NULL == (slist_entry_ptr = H5FL_CALLOC(H5AC_slist_entry_t)) ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "Can't allocate dirty slist entry .") - } - - slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC; - slist_entry_ptr->addr = new_addr; + HDassert(!entry_dirty); + if(NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate dirty slist entry .") + slist_entry_ptr->addr = new_addr; aux_ptr->dirty_bytes += entry_size; -#if H5AC_DEBUG_DIRTY_BYTES_CREATION - aux_ptr->move_dirty_bytes += entry_size; - aux_ptr->move_dirty_bytes_updates += 1; -#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ - } - - /* verify that there is no entry at new_addr in the dirty slist */ - if ( H5SL_search(aux_ptr->d_slist_ptr, (void *)(&new_addr)) != NULL ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "dirty slist already contains entry at new_addr.") - } - - /* insert / reinsert the entry in the dirty slist */ - if ( H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, - &(slist_entry_ptr->addr)) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \ - "can't insert entry into dirty entry slist.") - } - - aux_ptr->d_slist_len += 1; - - } else if ( ! entry_dirty ) { +#if H5AC_DEBUG_DIRTY_BYTES_CREATION + aux_ptr->move_dirty_bytes += entry_size; + aux_ptr->move_dirty_bytes_updates += 1; +#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ + } /* end else */ + /* insert / reinsert the entry in the dirty slist */ + if(H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "can't insert entry into dirty entry slist.") + } /* end if */ + else if(!entry_dirty) { aux_ptr->dirty_bytes += entry_size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION aux_ptr->move_dirty_bytes += entry_size; aux_ptr->move_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ - } + } /* end else-if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_log_moved_entry() */ +} /* H5AC__log_moved_entry() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_propagate_and_apply_candidate_list + * Function: H5AC__propagate_and_apply_candidate_list * * Purpose: Prior to the addition of support for multiple metadata * write strategies, in PHDF5, only the metadata cache with @@ -4042,42 +3369,41 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_propagate_and_apply_candidate_list(H5F_t * f, - hid_t dxpl_id, - H5AC_t * cache_ptr) +H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) { - int mpi_code; - int num_candidates = 0; - haddr_t * candidates_list_ptr = NULL; + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; + haddr_t * candidates_list_ptr = NULL; + int mpi_result; + int num_candidates = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); /* to prevent "messages from the future" we must synchronize all * processes before we write any entries. */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) if(aux_ptr->mpi_rank == 0) { - if(H5AC_broadcast_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0) + if(H5AC__broadcast_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast candidate slist.") - HDassert( aux_ptr->candidate_slist_len == 0 ); + HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); } /* end if */ else { - if(H5AC_receive_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0) + if(H5AC__receive_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive candidate broadcast.") } /* end else */ @@ -4089,55 +3415,59 @@ H5AC_propagate_and_apply_candidate_list(H5F_t * f, * distributing the writes across the processes. */ + /* Enable writes during this operation */ aux_ptr->write_permitted = TRUE; - result = H5C_apply_candidate_list(f, - dxpl_id, - dxpl_id, - cache_ptr, - num_candidates, - candidates_list_ptr, - aux_ptr->mpi_rank, - aux_ptr->mpi_size); + /* Apply the candidate list */ + result = H5C_apply_candidate_list(f, dxpl_id, dxpl_id, cache_ptr, num_candidates, + candidates_list_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); + /* Disable writes again */ aux_ptr->write_permitted = FALSE; + /* Check for error on the write operation */ if(result < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.") - if(aux_ptr->write_done != NULL) + /* this code exists primarily for the test bed -- it allows us to + * enforce posix semantics on the server that pretends to be a + * file system in our parallel tests. + */ + if(aux_ptr->write_done) (aux_ptr->write_done)(); /* to prevent "messages from the past" we must synchronize all * processes again before we go on. */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 2", mpi_code) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) - if(aux_ptr->mpi_rank == 0) { - if(H5AC_tidy_cache_0_lists(cache_ptr, num_candidates, candidates_list_ptr) < 0) + /* if this is process zero, tidy up the dirtied, + * and flushed and still clean lists. + */ + if(aux_ptr->mpi_rank == 0) + if(H5AC__tidy_cache_0_lists(cache_ptr, num_candidates, candidates_list_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't tidy up process 0 lists.") - } /* end if */ } /* end if */ /* if it is defined, call the sync point done callback. Note * that this callback is defined purely for testing purposes, * and should be undefined under normal operating circumstances. */ - if(aux_ptr->sync_point_done != NULL) + if(aux_ptr->sync_point_done) (aux_ptr->sync_point_done)(num_candidates, candidates_list_ptr); done: - if(candidates_list_ptr != NULL) + if(candidates_list_ptr) candidates_list_ptr = (haddr_t *)H5MM_xfree((void *)candidates_list_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_propagate_and_apply_candidate_list() */ +} /* H5AC__propagate_and_apply_candidate_list() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_propagate_flushed_and_still_clean_entries_list + * Function: H5AC__propagate_flushed_and_still_clean_entries_list * * Purpose: In PHDF5, if the process 0 only metadata write strategy * is selected, only the metadata cache with mpi rank 0 is @@ -4209,47 +3539,48 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, - hid_t dxpl_id, - H5AC_t * cache_ptr) +H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id) { + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - HDassert(aux_ptr != NULL); HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - HDassert(aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); if(aux_ptr->mpi_rank == 0) { - if(H5AC_broadcast_clean_list(cache_ptr) < 0) + if(H5AC__broadcast_clean_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast clean slist.") - HDassert( aux_ptr->c_slist_len == 0 ); + HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); } /* end if */ else { - if(H5AC_receive_and_apply_clean_list(f, dxpl_id, H5AC_dxpl_id, cache_ptr) < 0) + if(H5AC__receive_and_apply_clean_list(f, dxpl_id, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_propagate_flushed_and_still_clean_entries_list() */ +} /* H5AC__propagate_flushed_and_still_clean_entries_list() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_receive_and_apply_clean_list() + * Function: H5AC_receive_haddr_list() * - * Purpose: Receive the list of cleaned entries from process 0, - * and mark the specified entries as clean. + * Purpose: Receive the list of entry addresses from process 0, + * and return it in a buffer pointed to by *haddr_buf_ptr_ptr. + * Note that the caller must free this buffer if it is + * returned. * * This function must only be called by the process with * MPI_rank greater than 0. @@ -4258,104 +3589,132 @@ done: * * Return: Non-negative on success/Negative on failure. * - * Programmer: John Mainzer, 7/4/05 + * Programmer: Quincey Koziol, 6/11/2015 * *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_receive_and_apply_clean_list(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - H5AC_t * cache_ptr) +H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr, + haddr_t **haddr_buf_ptr_ptr) { - H5AC_aux_t * aux_ptr; haddr_t * haddr_buf_ptr = NULL; - MPI_Offset * MPI_Offset_buf_ptr = NULL; int mpi_result; - int num_entries = 0; + int num_entries; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( f != NULL ); - HDassert( f->shared->cache == cache_ptr ); - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - - aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + FUNC_ENTER_STATIC - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->mpi_rank != 0 ); + /* Sanity checks */ + HDassert(num_entries_ptr != NULL); + HDassert(*num_entries_ptr == 0); + HDassert(haddr_buf_ptr_ptr != NULL); + HDassert(*haddr_buf_ptr_ptr == NULL); /* First receive the number of entries in the list so that we * can set up a buffer to receive them. If there aren't * any, we are done. */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result) + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { size_t buf_size; - int i; /* allocate buffers to store the list of entry base addresses in */ - buf_size = sizeof(MPI_Offset) * (size_t)num_entries; - if(NULL == (MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for receive buffer") - if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)num_entries))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for haddr buffer") - - /* Now receive the list of cleaned entries - * - * The peculiar structure of the following call to MPI_Bcast is - * due to MPI's (?) failure to believe in the MPI_Offset type. - * Thus the element type is MPI_BYTE, with size equal to the - * buf_size computed above. - */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)MPI_Offset_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result) + buf_size = sizeof(haddr_t) * (size_t)num_entries; + if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer") + + /* Now receive the list of candidate entries */ + if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)haddr_buf_ptr, (int)buf_size, MPI_BYTE, 0, mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) + } /* end if */ + + /* finally, pass the number of entries and the buffer pointer + * back to the caller. + */ + *num_entries_ptr = num_entries; + *haddr_buf_ptr_ptr = haddr_buf_ptr; + +done: + if(ret_value < 0) + if(haddr_buf_ptr) + haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_receive_haddr_list() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * + * Function: H5AC__receive_and_apply_clean_list() + * + * Purpose: Receive the list of cleaned entries from process 0, + * and mark the specified entries as clean. + * + * This function must only be called by the process with + * MPI_rank greater than 0. + * + * Return SUCCEED on success, and FAIL on failure. + * + * Return: Non-negative on success/Negative on failure. + * + * Programmer: John Mainzer, 7/4/05 + * + *------------------------------------------------------------------------- + */ +#ifdef H5_HAVE_PARALLEL +static herr_t +H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id) +{ + H5AC_t * cache_ptr; + H5AC_aux_t * aux_ptr; + haddr_t * haddr_buf_ptr = NULL; + int num_entries = 0; + herr_t ret_value = SUCCEED; /* Return value */ - /* translate the MPI_Offsets to haddr_t */ - i = 0; - while(i < num_entries) { - haddr_buf_ptr[i] = H5FD_mpi_MPIOff_to_haddr(MPI_Offset_buf_ptr[i]); + FUNC_ENTER_STATIC - if(haddr_buf_ptr[i] == HADDR_UNDEF) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert MPI off to haddr") + /* Sanity check */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->mpi_rank != 0); - i++; - } /* end while */ + /* Retrieve the clean list from process 0 */ + if(H5AC__receive_haddr_list(aux_ptr->mpi_comm, &num_entries, &haddr_buf_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't receive clean list") + if(num_entries > 0) /* mark the indicated entries as clean */ - if(H5C_mark_entries_as_clean(f, primary_dxpl_id, secondary_dxpl_id, - (int32_t)num_entries, &(haddr_buf_ptr[0])) < 0) + if(H5C_mark_entries_as_clean(f, primary_dxpl_id, secondary_dxpl_id, (int32_t)num_entries, haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.") - } /* end if */ /* if it is defined, call the sync point done callback. Note * that this callback is defined purely for testing purposes, * and should be undefined under normal operating circumstances. */ - if(aux_ptr->sync_point_done != NULL) + if(aux_ptr->sync_point_done) (aux_ptr->sync_point_done)(num_entries, haddr_buf_ptr); done: - if(MPI_Offset_buf_ptr != NULL) - MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr); - if(haddr_buf_ptr != NULL) + if(haddr_buf_ptr) haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_receive_and_apply_clean_list() */ +} /* H5AC__receive_and_apply_clean_list() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- * - * Function: H5AC_receive_candidate_list() + * Function: H5AC__receive_candidate_list() * * Purpose: Receive the list of candidate entries from process 0, * and return it in a buffer pointed to by *haddr_buf_ptr_ptr. @@ -4375,105 +3734,39 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_receive_candidate_list(H5AC_t * cache_ptr, - int * num_entries_ptr, - haddr_t ** haddr_buf_ptr_ptr) +H5AC__receive_candidate_list(const H5AC_t *cache_ptr, int *num_entries_ptr, + haddr_t **haddr_buf_ptr_ptr) { - hbool_t success = FALSE; H5AC_aux_t * aux_ptr; - haddr_t * haddr_buf_ptr = NULL; - MPI_Offset * MPI_Offset_buf_ptr = NULL; - int mpi_result; - int num_entries; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->mpi_rank != 0); + HDassert(aux_ptr-> metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + HDassert(num_entries_ptr != NULL); + HDassert(*num_entries_ptr == 0); + HDassert(haddr_buf_ptr_ptr != NULL); + HDassert(*haddr_buf_ptr_ptr == NULL); - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->mpi_rank != 0 ); - HDassert( aux_ptr-> metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); - - HDassert( num_entries_ptr != NULL ); - HDassert( *num_entries_ptr == 0 ); - - HDassert( haddr_buf_ptr_ptr != NULL ); - HDassert( *haddr_buf_ptr_ptr == NULL ); - - - /* First receive the number of entries in the list so that we - * can set up a buffer to receive them. If there aren't - * any, we are done. - */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 1", mpi_result) - - if(num_entries > 0) { - size_t buf_size; - int i; - - /* allocate buffers to store the list of entry base addresses in */ - buf_size = sizeof(MPI_Offset) * (size_t)num_entries; - - if(NULL == (MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for receive buffer") - if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)num_entries))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for haddr buffer") - - /* Now receive the list of candidate entries - * - * The peculiar structure of the following call to MPI_Bcast is - * due to MPI's (?) failure to believe in the MPI_Offset type. - * Thus the element type is MPI_BYTE, with size equal to the - * buf_size computed above. - */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)MPI_Offset_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed 2", mpi_result) - - /* translate the MPI_Offsets to haddr_t */ - i = 0; - while(i < num_entries) { - haddr_buf_ptr[i] = H5FD_mpi_MPIOff_to_haddr(MPI_Offset_buf_ptr[i]); - - if(haddr_buf_ptr[i] == HADDR_UNDEF) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert MPI off to haddr") - - i++; - } /* end while */ - } /* end if */ - - success = TRUE; + /* Retrieve the candidate list from process 0 */ + if(H5AC__receive_haddr_list(aux_ptr->mpi_comm, num_entries_ptr, haddr_buf_ptr_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't receive clean list") done: - if(MPI_Offset_buf_ptr != NULL) - MPI_Offset_buf_ptr = (MPI_Offset *)H5MM_xfree((void *)MPI_Offset_buf_ptr); - - if(success) { - /* finally, pass the number of entries and the buffer pointer - * back to the caller. Do this so that we can use the same code - * to apply the candidate list to all the processes. - */ - *num_entries_ptr = num_entries; - *haddr_buf_ptr_ptr = haddr_buf_ptr; - } /* end if */ - else { - if(haddr_buf_ptr != NULL) - haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); - } /* end else */ - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_receive_candidate_list() */ +} /* H5AC__receive_candidate_list() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_rsp__dist_md_write__flush + * Function: H5AC__rsp__dist_md_write__flush * * Purpose: Routine for handling the details of running a sync point * that is triggered by a flush -- which in turn must have been @@ -4522,31 +3815,27 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t -H5AC_rsp__dist_md_write__flush(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr) +static herr_t +H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) { - int mpi_code; - int num_entries = 0; - haddr_t * haddr_buf_ptr = NULL; + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; + haddr_t * haddr_buf_ptr = NULL; + int mpi_result; + int num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( f != NULL ); - HDassert( f->shared->cache == cache_ptr ); - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); /* first construct the candidate list -- initially, this will be in the * form of a skip list. We will convert it later. @@ -4554,33 +3843,30 @@ H5AC_rsp__dist_md_write__flush(H5F_t *f, if(H5C_construct_candidate_list__clean_cache(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate list.") - if(aux_ptr->candidate_slist_len > 0) { + if(H5SL_count(aux_ptr->candidate_slist_ptr) > 0) { herr_t result; /* convert the candidate list into the format we * are used to receiving from process 0. */ - if(H5AC_copy_candidate_list_to_buffer(cache_ptr, &num_entries, &haddr_buf_ptr, NULL, NULL) < 0) + if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &num_entries, &haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.") /* initial sync point barrier */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) - /* apply the candidate list */ + /* Enable writes during this operation */ aux_ptr->write_permitted = TRUE; - result = H5C_apply_candidate_list(f, - dxpl_id, - dxpl_id, - cache_ptr, - num_entries, - haddr_buf_ptr, - aux_ptr->mpi_rank, - aux_ptr->mpi_size); + /* Apply the candidate list */ + result = H5C_apply_candidate_list(f, dxpl_id, dxpl_id, cache_ptr, num_entries, + haddr_buf_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); + /* Disable writes again */ aux_ptr->write_permitted = FALSE; + /* Check for error on the write operation */ if(result < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.") @@ -4588,40 +3874,39 @@ H5AC_rsp__dist_md_write__flush(H5F_t *f, * enforce posix semantics on the server that pretends to be a * file system in our parallel tests. */ - if(aux_ptr->write_done != NULL) + if(aux_ptr->write_done) (aux_ptr->write_done)(); /* final sync point barrier */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) /* if this is process zero, tidy up the dirtied, * and flushed and still clean lists. */ - if(aux_ptr->mpi_rank == 0) { - if(H5AC_tidy_cache_0_lists(cache_ptr, num_entries, haddr_buf_ptr) < 0) + if(aux_ptr->mpi_rank == 0) + if(H5AC__tidy_cache_0_lists(cache_ptr, num_entries, haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't tidy up process 0 lists.") - } /* end if */ } /* end if */ /* if it is defined, call the sync point done callback. Note * that this callback is defined purely for testing purposes, * and should be undefined under normal operating circumstances. */ - if(aux_ptr->sync_point_done != NULL) + if(aux_ptr->sync_point_done) (aux_ptr->sync_point_done)(num_entries, haddr_buf_ptr); done: - if(haddr_buf_ptr != NULL) + if(haddr_buf_ptr) haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_rsp__dist_md_write__flush() */ +} /* H5AC__rsp__dist_md_write__flush() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_rsp__dist_md_write__flush_to_min_clean + * Function: H5AC__rsp__dist_md_write__flush_to_min_clean * * Purpose: Routine for handling the details of running a sync point * triggered by the accumulation of dirty metadata (as @@ -4675,29 +3960,25 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t -H5AC_rsp__dist_md_write__flush_to_min_clean(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr) +static herr_t +H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) { - hbool_t evictions_enabled; + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; + hbool_t evictions_enabled; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( f != NULL ); - HDassert( f->shared->cache == cache_ptr ); - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); /* Query if evictions are allowed */ if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0) @@ -4705,24 +3986,23 @@ H5AC_rsp__dist_md_write__flush_to_min_clean(H5F_t *f, if(evictions_enabled) { /* construct candidate list -- process 0 only */ - if(aux_ptr->mpi_rank == 0) { - if(H5AC_construct_candidate_list(cache_ptr, aux_ptr, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(aux_ptr->mpi_rank == 0) + if(H5AC__construct_candidate_list(cache_ptr, aux_ptr, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate list.") - } /* mpi rank == 0 */ /* propagate and apply candidate list -- all processes */ - if(H5AC_propagate_and_apply_candidate_list(f, dxpl_id, cache_ptr) < 0) + if(H5AC__propagate_and_apply_candidate_list(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate and apply candidate list.") } /* evictions enabled */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_rsp__dist_md_write__flush_to_min_clean() */ +} /* H5AC__rsp__dist_md_write__flush_to_min_clean() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_rsp__p0_only__flush + * Function: H5AC__rsp__p0_only__flush * * Purpose: Routine for handling the details of running a sync point * that is triggered a flush -- which in turn must have been @@ -4758,67 +4038,70 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t -H5AC_rsp__p0_only__flush(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr) +static herr_t +H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) { - int mpi_code; + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; + int mpi_result; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( f != NULL ); - HDassert( f->shared->cache == cache_ptr ); - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ); - + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); /* to prevent "messages from the future" we must * synchronize all processes before we start the flush. * Hence the following barrier. */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed 1", mpi_code) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) /* Flush data to disk, from rank 0 process */ if(aux_ptr->mpi_rank == 0) { herr_t result; + /* Enable writes during this operation */ aux_ptr->write_permitted = TRUE; + /* Flush the cache */ result = H5C_flush_cache(f, dxpl_id, dxpl_id, H5AC__NO_FLAGS_SET); + /* Disable writes again */ aux_ptr->write_permitted = FALSE; + /* Check for error on the write operation */ if(result < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") - if(aux_ptr->write_done != NULL) + /* this code exists primarily for the test bed -- it allows us to + * enforce posix semantics on the server that pretends to be a + * file system in our parallel tests. + */ + if(aux_ptr->write_done) (aux_ptr->write_done)(); } /* end if */ /* Propagate cleaned entries to other ranks. */ - if(H5AC_propagate_flushed_and_still_clean_entries_list(f, H5AC_dxpl_id, cache_ptr) < 0) + if(H5AC__propagate_flushed_and_still_clean_entries_list(f, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_rsp__p0_only__flush() */ +} /* H5AC__rsp__p0_only__flush() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_rsp__p0_only__flush_to_min_clean + * Function: H5AC__rsp__p0_only__flush_to_min_clean * * Purpose: Routine for handling the details of running a sync point * triggered by the accumulation of dirty metadata (as @@ -4860,29 +4143,25 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t -H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f, - hid_t dxpl_id, - H5AC_t * cache_ptr) +static herr_t +H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) { - hbool_t evictions_enabled; + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; + hbool_t evictions_enabled; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( f != NULL ); - HDassert( f->shared->cache == cache_ptr ); - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); /* Query if evictions are allowed */ if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0) @@ -4896,14 +4175,14 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f, * Otherwise, do nothing. */ if(evictions_enabled) { - int mpi_code; + int mpi_result; /* to prevent "messages from the future" we must synchronize all * processes before we start the flush. This synchronization may * already be done -- hence the do_barrier parameter. */ - if(MPI_SUCCESS != (mpi_code = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) + if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) if(0 == aux_ptr->mpi_rank) { herr_t result; @@ -4913,12 +4192,17 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f, * Note that it is quite possible that no entries will be * flushed. */ + + /* Enable writes during this operation */ aux_ptr->write_permitted = TRUE; + /* Flush the cache */ result = H5C_flush_to_min_clean(f, dxpl_id, H5AC_dxpl_id); + /* Disable writes again */ aux_ptr->write_permitted = FALSE; + /* Check for error on the write operation */ if(result < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_flush_to_min_clean() failed.") @@ -4926,22 +4210,22 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f, * to enforce POSIX semantics on the process used to simulate * reads and writes in t_cache.c. */ - if(aux_ptr->write_done != NULL) + if(aux_ptr->write_done) (aux_ptr->write_done)(); } /* end if */ - if(H5AC_propagate_flushed_and_still_clean_entries_list(f, dxpl_id, cache_ptr) < 0) + if(H5AC__propagate_flushed_and_still_clean_entries_list(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_rsp__p0_only__flush_to_min_clean() */ +} /* H5AC__rsp__p0_only__flush_to_min_clean() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_run_sync_point + * Function: H5AC__run_sync_point * * Purpose: Top level routine for managing a sync point between all * meta data caches in the parallel case. Since all caches @@ -4972,56 +4256,49 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t -H5AC_run_sync_point(H5F_t *f, - hid_t dxpl_id, - int sync_point_op) +static herr_t +H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op) { - H5AC_t * cache_ptr; + H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) - - HDassert( f != NULL ); + FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); cache_ptr = f->shared->cache; - - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - - HDassert( ( sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN ) || - ( sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ) ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || + (sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)); #if H5AC_DEBUG_DIRTY_BYTES_CREATION - HDfprintf(stdout, - "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu/%u\n", - aux_ptr->mpi_rank, - aux_ptr->dirty_bytes_propagations, - aux_ptr->unprotect_dirty_bytes, - aux_ptr->unprotect_dirty_bytes_updates, - aux_ptr->insert_dirty_bytes, - aux_ptr->insert_dirty_bytes_updates, - aux_ptr->rename_dirty_bytes, - aux_ptr->rename_dirty_bytes_updates); +HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu/%u\n", + aux_ptr->mpi_rank, + aux_ptr->dirty_bytes_propagations, + aux_ptr->unprotect_dirty_bytes, + aux_ptr->unprotect_dirty_bytes_updates, + aux_ptr->insert_dirty_bytes, + aux_ptr->insert_dirty_bytes_updates, + aux_ptr->rename_dirty_bytes, + aux_ptr->rename_dirty_bytes_updates); #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ switch(aux_ptr->metadata_write_strategy) { case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: switch(sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: - if(H5AC_rsp__p0_only__flush_to_min_clean(f, dxpl_id, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__p0_only__flush_to_min_clean() failed.") + if(H5AC__rsp__p0_only__flush_to_min_clean(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush_to_min_clean() failed.") break; case H5AC_SYNC_POINT_OP__FLUSH_CACHE: - if(H5AC_rsp__p0_only__flush(f, dxpl_id, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__p0_only__flush() failed.") + if(H5AC__rsp__p0_only__flush(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush() failed.") break; default: @@ -5033,13 +4310,13 @@ H5AC_run_sync_point(H5F_t *f, case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: switch(sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: - if(H5AC_rsp__dist_md_write__flush_to_min_clean(f, dxpl_id, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__dist_md_write__flush() failed.") + if(H5AC__rsp__dist_md_write__flush_to_min_clean(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush_to_min_clean() failed.") break; case H5AC_SYNC_POINT_OP__FLUSH_CACHE: - if(H5AC_rsp__dist_md_write__flush(f, dxpl_id, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC_rsp__dist_md_write__flush() failed.") + if(H5AC__rsp__dist_md_write__flush(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush() failed.") break; default: @@ -5068,12 +4345,12 @@ H5AC_run_sync_point(H5F_t *f, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_run_sync_point() */ +} /* H5AC__run_sync_point() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_tidy_cache_0_lists() + * Function: H5AC__tidy_cache_0_lists() * * Purpose: In the distributed metadata write strategy, not all dirty * entries are written by process 0 -- thus we must tidy @@ -5109,29 +4386,24 @@ done: */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr, - int num_candidates, - haddr_t * candidates_list_ptr) - +H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates, + haddr_t *candidates_list_ptr) { - int i; H5AC_aux_t * aux_ptr; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) + int i; - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC_NOERR + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); - - HDassert( aux_ptr != NULL ); - HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( aux_ptr->metadata_write_strategy == - H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED ); - HDassert( aux_ptr->mpi_rank == 0 ); - HDassert( num_candidates > 0 ); - HDassert( candidates_list_ptr != NULL ); + HDassert(aux_ptr != NULL); + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + HDassert(aux_ptr->mpi_rank == 0); + HDassert(num_candidates > 0); + HDassert(candidates_list_ptr != NULL); /* clean up dirtied and flushed and still clean lists by removing * all entries on the candidate list. Cleared entries should @@ -5147,50 +4419,22 @@ H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr, addr = candidates_list_ptr[i]; - /* addr must be either on the dirtied list, or on the flushed + /* addr may be either on the dirtied list, or on the flushed * and still clean list. Remove it. */ - d_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->d_slist_ptr, (void *)&addr); - if(d_slist_entry_ptr != NULL) { - HDassert(d_slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert(d_slist_entry_ptr->addr == addr); - - if(H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)) != d_slist_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.") - - d_slist_entry_ptr->magic = 0; + if(NULL != (d_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)&addr))) d_slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, d_slist_entry_ptr); - - aux_ptr->d_slist_len -= 1; - - HDassert(aux_ptr->d_slist_len >= 0); - } /* end if */ - - c_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->c_slist_ptr, (void *)&addr); - if(c_slist_entry_ptr != NULL) { - HDassert(c_slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC); - HDassert(c_slist_entry_ptr->addr == addr); - - if(H5SL_remove(aux_ptr->c_slist_ptr, (void *)(&addr)) != c_slist_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from clean entry slist.") - - c_slist_entry_ptr->magic = 0; + if(NULL != (c_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->c_slist_ptr, (void *)&addr))) c_slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, c_slist_entry_ptr); - - aux_ptr->c_slist_len -= 1; - - HDassert( aux_ptr->c_slist_len >= 0 ); - } /* end if */ } /* end for */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_tidy_cache_0_lists() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5AC__tidy_cache_0_lists() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5AC_flush_entries + * Function: H5AC__flush_entries * * Purpose: Flush the metadata cache associated with the specified file, * only writing from rank 0, but propagating the cleaned entries @@ -5206,25 +4450,25 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t -H5AC_flush_entries(H5F_t *f) +static herr_t +H5AC__flush_entries(H5F_t *f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(f); HDassert(f->shared->cache); /* Check if we have >1 ranks */ - if(f->shared->cache->aux_ptr) { - if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0) + if(f->shared->cache->aux_ptr) + if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_flush_entries() */ +} /* H5AC__flush_entries() */ #endif /* H5_HAVE_PARALLEL */ @@ -5244,15 +4488,13 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_ignore_tags(H5F_t * f) +H5AC_ignore_tags(const H5F_t *f) { - /* Variable Declarations */ herr_t ret_value = SUCCEED; - /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) - /* Assertions */ + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->cache); @@ -5279,28 +4521,25 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag) +H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag) { - /* Variable Declarations */ - H5P_genplist_t *dxpl; /* dataset transfer property list */ + H5P_genplist_t *dxpl; /* dataset transfer property list */ herr_t ret_value = SUCCEED; - /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Check Arguments */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") + HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a property list") - /* Get the current tag value and return that (if prev_tag is NOT null)*/ - if(prev_tag) { + /* Get the current tag value and return that (if prev_tag is NOT null) */ + if(prev_tag) if((H5P_get(dxpl, "H5AC_metadata_tag", prev_tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query dxpl") - } /* end if */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to query dxpl") /* Set the provided tag value in the dxpl_id. */ if(H5P_set(dxpl, "H5AC_metadata_tag", &metadata_tag) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set property in dxpl") + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set property in dxpl") done: FUNC_LEAVE_NOAPI(ret_value) @@ -5322,21 +4561,17 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag) +H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) { - herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Assertions */ + /* Sanity checks */ HDassert(f); HDassert(f->shared); /* Call cache-level function to retag entries */ H5C_retag_copied_metadata(f->shared->cache, metadata_tag); -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5AC_retag_copied_metadata */ diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 5b8ac86..950bdea 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -297,11 +297,6 @@ * To reitterate, this field is only used on process 0 -- it * should be NULL on all other processes. * - * d_slist_len: Integer field containing the number of entries in the - * dirty entry list. This field should always contain the - * value 0 on all processes other than process 0. It exists - * primarily for sanity checking. - * * c_slist_ptr: Pointer to an instance of H5SL_t used to maintain a list * of entries that were dirty, have been flushed * to disk since the last clean entries broadcast, and are @@ -312,11 +307,6 @@ * the next clean entries broadcast. The list emptied after * each broadcast. * - * c_slist_len: Integer field containing the number of entries in the clean - * entries list (*c_slist_ptr). This field should always - * contain the value 0 on all processes other than process 0. - * It exists primarily for sanity checking. - * * The following two fields are used only when metadata_write_strategy * is H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. * @@ -325,9 +315,6 @@ * point. This list is then broadcast to the other processes, * which then either flush or mark clean all entries on it. * - * candidate_slist_len: Integer field containing the number of entries on the - * candidate list. It exists primarily for sanity checking. - * * write_done: In the parallel test bed, it is necessary to ensure that * all writes to the server process from cache 0 complete * before it enters the barrier call with the other caches. @@ -394,16 +381,10 @@ typedef struct H5AC_aux_t H5SL_t * d_slist_ptr; - int32_t d_slist_len; - H5SL_t * c_slist_ptr; - int32_t c_slist_len; - H5SL_t * candidate_slist_ptr; - int32_t candidate_slist_len; - void (* write_done)(void); void (* sync_point_done)(int num_writes, diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index e259a24..a4e7c5a 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -363,8 +363,6 @@ H5_DLL herr_t H5AC_set_sync_point_done_callback(H5C_t *cache_ptr, void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl)); H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)); -H5_DLL herr_t H5AC_stats(const H5F_t *f); -H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, @@ -374,27 +372,24 @@ H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr); H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); - H5_DLL herr_t H5AC_close_trace_file(H5AC_t *cache_ptr); H5_DLL herr_t H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name); -H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag); -H5_DLL herr_t H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag); -H5_DLL herr_t H5AC_ignore_tags(H5F_t * f); +H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag); +H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag); +H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr); #endif /* H5_HAVE_PARALLEL */ #ifndef NDEBUG /* debugging functions */ - +H5_DLL herr_t H5AC_stats(const H5F_t *f); +H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, - void ** entry_ptr_ptr); - + void ** entry_ptr_ptr); H5_DLL herr_t H5AC_verify_entry_type(const H5F_t * f, haddr_t addr, - const H5AC_class_t * expected_type, - hbool_t * in_cache_ptr, - hbool_t * type_ok_ptr); - + const H5AC_class_t * expected_type, hbool_t * in_cache_ptr, + hbool_t * type_ok_ptr); #endif /* NDEBUG */ /* end debugging functions */ #endif /* !_H5ACprivate_H */ diff --git a/src/H5C.c b/src/H5C.c index a5eaa93..d6a89e6 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -2127,9 +2127,7 @@ H5C_flush_to_min_clean(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, - &write_permitted); + result = (cache_ptr->check_write_permitted)(f, &write_permitted); if ( result < 0 ) { @@ -2569,25 +2567,23 @@ done: * file logging is turned off), or contain a pointer to the * open file to which trace file data is to be written. * - * Return: Non-negative on success/Negative on failure + * Return: Non-NULL trace file pointer (can't fail) * * Programmer: John Mainzer * 1/20/06 * *------------------------------------------------------------------------- */ -herr_t -H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr) +FILE * +H5C_get_trace_file_ptr(const H5C_t *cache_ptr) { FUNC_ENTER_NOAPI_NOERR + /* Check arguments */ HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(trace_file_ptr_ptr); - *trace_file_ptr_ptr = cache_ptr->trace_file_ptr; - - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_LEAVE_NOAPI(cache_ptr->trace_file_ptr) } /* H5C_get_trace_file_ptr() */ @@ -2600,16 +2596,15 @@ H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr) * file logging is turned off), or contain a pointer to the * open file to which trace file data is to be written. * - * Return: Non-negative on success/Negative on failure + * Return: Non-NULL trace file pointer (can't fail) * * Programmer: Quincey Koziol * 6/9/08 * *------------------------------------------------------------------------- */ -herr_t -H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, - FILE **trace_file_ptr_ptr) +FILE * +H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr) { FUNC_ENTER_NOAPI_NOERR @@ -2617,9 +2612,7 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, HDassert(entry_ptr); HDassert(entry_ptr->cache_ptr); - H5C_get_trace_file_ptr(entry_ptr->cache_ptr, trace_file_ptr_ptr); - - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_LEAVE_NOAPI(H5C_get_trace_file_ptr(entry_ptr->cache_ptr)) } /* H5C_get_trace_file_ptr_from_entry() */ @@ -2820,9 +2813,7 @@ H5C_insert_entry(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, - &write_permitted); + result = (cache_ptr->check_write_permitted)(f, &write_permitted); if ( result < 0 ) { @@ -3934,9 +3925,7 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, - &write_permitted); + result = (cache_ptr->check_write_permitted)(f, &write_permitted); if ( result < 0 ) { @@ -4083,9 +4072,7 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, - &write_permitted); + result = (cache_ptr->check_write_permitted)(f, &write_permitted); if ( result < 0 ) { @@ -8611,8 +8598,7 @@ H5C_flush_single_entry(H5F_t * f, if ( cache_ptr->log_flush ) { - status = (cache_ptr->log_flush)(cache_ptr, addr, was_dirty, - flags, type_id); + status = (cache_ptr->log_flush)(cache_ptr, addr, was_dirty, flags); if ( status < 0 ) { diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index c9679f4..301dd19 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -170,14 +170,12 @@ typedef struct H5C_class_t { /* Type defintions of call back functions used by the cache as a whole */ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, - hid_t dxpl_id, hbool_t * write_permitted_ptr); typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, haddr_t addr, hbool_t was_dirty, - unsigned flags, - int type_id); + unsigned flags); /* Upper and lower limits on cache size. These limits are picked * out of a hat -- you should be able to change them as necessary. @@ -1142,10 +1140,8 @@ H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr, hbool_t * evictions_enabled_ptr); -H5_DLL herr_t H5C_get_trace_file_ptr(const H5C_t *cache_ptr, - FILE **trace_file_ptr_ptr); -H5_DLL herr_t H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, - FILE **trace_file_ptr_ptr); +H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr); +H5_DLL FILE *H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr); H5_DLL herr_t H5C_insert_entry(H5F_t * f, hid_t primary_dxpl_id, diff --git a/test/cache_api.c b/test/cache_api.c index 51dda99..3c0871f 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1526,6 +1526,8 @@ mdc_api_call_smoke_check(int express_test) /* The following array of invalid external MDC cache configurations is * used to test error rejection in the MDC related API calls. + * + * Note: It is assumed that boolean parameters are only set to TRUE/FALSE. */ #define NUM_INVALID_CONFIGS 42 @@ -1568,112 +1570,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 1 -- bad rpt_fcn_enabled */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ (hbool_t)-1, - /* hbool_t open_trace_file = */ FALSE, - /* hbool_t close_trace_file = */ FALSE, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ TRUE, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ TRUE, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 2 -- bad open_trace_file */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ FALSE, - /* hbool_t open_trace_file = */ (hbool_t)-1, - /* hbool_t close_trace_file = */ FALSE, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ TRUE, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ TRUE, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 3 -- bad close_trace_file */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ FALSE, - /* hbool_t open_trace_file = */ FALSE, - /* hbool_t close_trace_file = */ (hbool_t)-1, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ TRUE, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ TRUE, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 4 -- open_trace_file == TRUE and empty trace_file_name */ + /* 1 -- open_trace_file == TRUE and empty trace_file_name */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ TRUE, @@ -1708,7 +1605,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 5 -- bad set_initial_size */ + /* 2 -- bad set_initial_size */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1743,7 +1640,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 6 -- max_size too big */ + /* 3 -- max_size too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1778,7 +1675,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 7 -- min_size too small */ + /* 4 -- min_size too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1813,7 +1710,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 8 -- min_size > max_size */ + /* 5 -- min_size > max_size */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1848,7 +1745,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 9 -- initial size out of range (too big) */ + /* 6 -- initial size out of range (too big) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1883,7 +1780,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 10 -- initial_size out of range (too small) */ + /* 7 -- initial_size out of range (too small) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1918,7 +1815,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 11 -- min_clean_fraction too big */ + /* 8 -- min_clean_fraction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1953,7 +1850,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 12 -- min_clean_fraction too small */ + /* 9 -- min_clean_fraction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1988,7 +1885,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 13 -- epoch_length too small */ + /* 10 -- epoch_length too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2023,7 +1920,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 14 -- epoch_length too big */ + /* 11 -- epoch_length too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2058,7 +1955,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 15 -- invalid incr_mode */ + /* 12 -- invalid incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2093,7 +1990,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 16 -- lower_hr_threshold too small */ + /* 13 -- lower_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2128,7 +2025,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 17 -- lower_hr_threshold too big */ + /* 14 -- lower_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2163,7 +2060,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 18 -- increment too small */ + /* 15 -- increment too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2198,42 +2095,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 19 -- bad apply_max_increment */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ FALSE, - /* hbool_t open_trace_file = */ FALSE, - /* hbool_t close_trace_file = */ FALSE, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ TRUE, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ (hbool_t)-1, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 20 -- invalid flash_incr_mode */ + /* 16 -- invalid flash_incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2268,7 +2130,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 21 -- flash_multiple too small */ + /* 17 -- flash_multiple too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2303,7 +2165,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 22 -- flash_multiple too big */ + /* 18 -- flash_multiple too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2338,7 +2200,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 23 -- flash_threshold too small */ + /* 19 -- flash_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2373,7 +2235,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 24 -- flash_threshold too big */ + /* 20 -- flash_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2408,7 +2270,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 25 -- bad decr_mode */ + /* 21 -- bad decr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2443,7 +2305,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 26 -- upper_hr_threshold too big */ + /* 22 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2478,7 +2340,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 27 -- decrement too small */ + /* 23 -- decrement too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2513,7 +2375,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 28 -- decrement too big */ + /* 24 -- decrement too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2548,7 +2410,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 29 -- epochs_before_eviction too small */ + /* 25 -- epochs_before_eviction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2583,7 +2445,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 30 -- epochs_before_eviction too big */ + /* 26 -- epochs_before_eviction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2618,7 +2480,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 31 -- invalid apply_empty_reserve */ + /* 27 -- invalid apply_empty_reserve */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2653,7 +2515,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 32 -- empty_reserve too small */ + /* 28 -- empty_reserve too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2688,7 +2550,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 33 -- empty_reserve too big */ + /* 29 -- empty_reserve too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2723,7 +2585,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 34 -- upper_hr_threshold too small */ + /* 30 -- upper_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2758,7 +2620,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 35 -- upper_hr_threshold too big */ + /* 31 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2793,7 +2655,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 36 -- upper_hr_threshold <= lower_hr_threshold */ + /* 32 -- upper_hr_threshold <= lower_hr_threshold */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2828,7 +2690,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 37 -- dirty_bytes_threshold too small */ + /* 33 -- dirty_bytes_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2863,7 +2725,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 38 -- dirty_bytes_threshold too big */ + /* 34 -- dirty_bytes_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2898,7 +2760,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 39 -- attempt to disable evictions when auto incr enabled */ + /* 35 -- attempt to disable evictions when auto incr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2933,7 +2795,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 40 -- attempt to disable evictions when auto decr enabled */ + /* 36 -- attempt to disable evictions when auto decr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2968,7 +2830,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 41 -- unknown metadata write strategy */ + /* 37 -- unknown metadata write strategy */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, diff --git a/test/cache_common.c b/test/cache_common.c index 12001b2..4abc0f4 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -475,18 +475,14 @@ addr_to_type_and_index(haddr_t addr, * *------------------------------------------------------------------------- */ - -herr_t -check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t *write_permitted_ptr) +static herr_t +check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr) { + HDassert(write_permitted_ptr); - HDassert( write_permitted_ptr ); *write_permitted_ptr = write_permitted; return(SUCCEED); - } /* check_write_permitted() */ diff --git a/test/cache_common.h b/test/cache_common.h index a309fa4..be3195b 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -532,13 +532,6 @@ extern const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES]; extern const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES]; extern const char * entry_type_names[NUMBER_OF_ENTRY_TYPES]; - -/* call back function declarations: */ - -herr_t check_write_permitted(const H5F_t * f, - hid_t dxpl_id, - hbool_t * write_permitted_ptr); - /* callback table extern */ extern const H5C_class_t types[NUMBER_OF_ENTRY_TYPES]; -- cgit v0.12 From 83208611cbac1fe77907a635a8877248d5ee47f9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 15 Jun 2015 07:59:14 -0500 Subject: [svn-r27201] Changed location of packed bits testfiles --- MANIFEST | 108 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/MANIFEST b/MANIFEST index bd6928c..6a596ac 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1678,60 +1678,60 @@ ./tools/h5dump/errfiles/tslink-D.err # h5dump packed bits validation -./tools/testfiles/tnofilename-with-packed-bits.ddl -./tools/testfiles/tpbitsLengthPositive.ddl -./tools/testfiles/tpbitsMaxExceeded.ddl -./tools/testfiles/tpbitsSigned.ddl -./tools/testfiles/tpbitsSigned2.ddl -./tools/testfiles/tpbitsSigned4.ddl -./tools/testfiles/tpbitsSignedWhole.ddl -./tools/testfiles/tpbitsSignedInt.ddl -./tools/testfiles/tpbitsSignedInt4.ddl -./tools/testfiles/tpbitsSignedInt8.ddl -./tools/testfiles/tpbitsSignedIntWhole.ddl -./tools/testfiles/tpbitsSignedLong.ddl -./tools/testfiles/tpbitsSignedLong8.ddl -./tools/testfiles/tpbitsSignedLong16.ddl -./tools/testfiles/tpbitsSignedLongWhole.ddl -./tools/testfiles/tpbitsSignedLongLong.ddl -./tools/testfiles/tpbitsSignedLongLong16.ddl -./tools/testfiles/tpbitsSignedLongLong32.ddl -./tools/testfiles/tpbitsSignedLongLongWhole.ddl -./tools/testfiles/tpbitsSignedLongLongWhole1.ddl -./tools/testfiles/tpbitsSignedLongLongWhole63.ddl -./tools/testfiles/tpbitsOffsetNegative.ddl -./tools/testfiles/tpbitsUnsigned.ddl -./tools/testfiles/tpbitsUnsigned2.ddl -./tools/testfiles/tpbitsUnsigned4.ddl -./tools/testfiles/tpbitsUnsignedWhole.ddl -./tools/testfiles/tpbitsUnsignedInt.ddl -./tools/testfiles/tpbitsUnsignedInt4.ddl -./tools/testfiles/tpbitsUnsignedInt8.ddl -./tools/testfiles/tpbitsUnsignedIntWhole.ddl -./tools/testfiles/tpbitsUnsignedLong.ddl -./tools/testfiles/tpbitsUnsignedLong8.ddl -./tools/testfiles/tpbitsUnsignedLong16.ddl -./tools/testfiles/tpbitsUnsignedLongWhole.ddl -./tools/testfiles/tpbitsUnsignedLongLong.ddl -./tools/testfiles/tpbitsUnsignedLongLong16.ddl -./tools/testfiles/tpbitsUnsignedLongLong32.ddl -./tools/testfiles/tpbitsUnsignedLongLongWhole.ddl -./tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl -./tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl -./tools/testfiles/tpbitsMax.ddl -./tools/testfiles/packedbits.h5 -./tools/testfiles/tpbitsArray.ddl -./tools/testfiles/tpbitsCompound.ddl -./tools/testfiles/tpbitsIncomplete.ddl -./tools/testfiles/tpbitsLengthExceeded.ddl -./tools/testfiles/tpbitsCharLengthExceeded.ddl -./tools/testfiles/tpbitsIntLengthExceeded.ddl -./tools/testfiles/tpbitsLongLengthExceeded.ddl -./tools/testfiles/tpbitsOffsetExceeded.ddl -./tools/testfiles/tpbitsCharOffsetExceeded.ddl -./tools/testfiles/tpbitsIntOffsetExceeded.ddl -./tools/testfiles/tpbitsLongOffsetExceeded.ddl -./tools/testfiles/tpbitsOverlapped.ddl +./tools/testfiles/pbits/tnofilename-with-packed-bits.ddl +./tools/testfiles/pbits/tpbitsLengthPositive.ddl +./tools/testfiles/pbits/tpbitsMaxExceeded.ddl +./tools/testfiles/pbits/tpbitsSigned.ddl +./tools/testfiles/pbits/tpbitsSigned2.ddl +./tools/testfiles/pbits/tpbitsSigned4.ddl +./tools/testfiles/pbits/tpbitsSignedWhole.ddl +./tools/testfiles/pbits/tpbitsSignedInt.ddl +./tools/testfiles/pbits/tpbitsSignedInt4.ddl +./tools/testfiles/pbits/tpbitsSignedInt8.ddl +./tools/testfiles/pbits/tpbitsSignedIntWhole.ddl +./tools/testfiles/pbits/tpbitsSignedLong.ddl +./tools/testfiles/pbits/tpbitsSignedLong8.ddl +./tools/testfiles/pbits/tpbitsSignedLong16.ddl +./tools/testfiles/pbits/tpbitsSignedLongWhole.ddl +./tools/testfiles/pbits/tpbitsSignedLongLong.ddl +./tools/testfiles/pbits/tpbitsSignedLongLong16.ddl +./tools/testfiles/pbits/tpbitsSignedLongLong32.ddl +./tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl +./tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl +./tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl +./tools/testfiles/pbits/tpbitsOffsetNegative.ddl +./tools/testfiles/pbits/tpbitsUnsigned.ddl +./tools/testfiles/pbits/tpbitsUnsigned2.ddl +./tools/testfiles/pbits/tpbitsUnsigned4.ddl +./tools/testfiles/pbits/tpbitsUnsignedWhole.ddl +./tools/testfiles/pbits/tpbitsUnsignedInt.ddl +./tools/testfiles/pbits/tpbitsUnsignedInt4.ddl +./tools/testfiles/pbits/tpbitsUnsignedInt8.ddl +./tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl +./tools/testfiles/pbits/tpbitsUnsignedLong.ddl +./tools/testfiles/pbits/tpbitsUnsignedLong8.ddl +./tools/testfiles/pbits/tpbitsUnsignedLong16.ddl +./tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl +./tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl +./tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl +./tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl +./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl +./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl +./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl +./tools/testfiles/pbits/tpbitsMax.ddl +./tools/testfiles/pbits/packedbits.h5 +./tools/testfiles/pbits/tpbitsArray.ddl +./tools/testfiles/pbits/tpbitsCompound.ddl +./tools/testfiles/pbits/tpbitsIncomplete.ddl +./tools/testfiles/pbits/tpbitsLengthExceeded.ddl +./tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl +./tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl +./tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl +./tools/testfiles/pbits/tpbitsOffsetExceeded.ddl +./tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl +./tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl +./tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl +./tools/testfiles/pbits/tpbitsOverlapped.ddl # h5dump h5import validation ./tools/testfiles/out3.h5import -- cgit v0.12 From b5a6740703d3dcc6f2c56c9e950507390be99a2c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 15 Jun 2015 08:10:14 -0500 Subject: [svn-r27202] Except one file is used by other tests! --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 6a596ac..1cac0e1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1719,7 +1719,6 @@ ./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl ./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl ./tools/testfiles/pbits/tpbitsMax.ddl -./tools/testfiles/pbits/packedbits.h5 ./tools/testfiles/pbits/tpbitsArray.ddl ./tools/testfiles/pbits/tpbitsCompound.ddl ./tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -1732,6 +1731,7 @@ ./tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl ./tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl ./tools/testfiles/pbits/tpbitsOverlapped.ddl +./tools/testfiles/packedbits.h5 # h5dump h5import validation ./tools/testfiles/out3.h5import -- cgit v0.12 From adbb64c6cd100915dfd62235c10d48a3b4162bd9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 15 Jun 2015 11:07:38 -0500 Subject: [svn-r27204] Description: Clean up compiler warnings before merging in v3 metadata cache changes from branch. Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel --- hl/test/test_lite.c | 16 +- hl/test/test_packet.c | 4 +- hl/test/test_table.c | 26 +- src/H5C.c | 41 +- src/H5Cpkg.h | 6476 ++++++++++++++++++++++++------------------------- src/H5Cprivate.h | 617 ++--- test/cache.c | 510 ++-- test/cache_api.c | 59 +- test/cache_common.c | 107 +- test/cache_common.h | 19 +- test/cmpd_dset.c | 20 +- test/cross_read.c | 2 +- test/dsets.c | 20 +- test/h5test.h | 18 - test/hyperslab.c | 2 +- test/tarray.c | 18 +- test/tattr.c | 10 +- test/tgenprop.c | 12 +- test/th5s.c | 2 +- test/tmisc.c | 16 +- test/tvltypes.c | 14 +- testpar/t_cache.c | 417 ++-- 22 files changed, 4056 insertions(+), 4370 deletions(-) diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 2337610..d4e5f93 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -300,7 +300,7 @@ static int test_dsets( void ) for (i = 0; i < DIM; i++) { - if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) { + if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) { goto out; } } @@ -311,7 +311,7 @@ static int test_dsets( void ) for (i = 0; i < DIM; i++) { - if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) { + if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) { goto out; } } @@ -336,7 +336,7 @@ static int test_dsets( void ) for (i = 0; i < DIM; i++) { - if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) { + if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) { goto out; } } @@ -347,7 +347,7 @@ static int test_dsets( void ) for (i = 0; i < DIM; i++) { - if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) { + if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) { goto out; } } @@ -959,7 +959,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) for (i = 0; i < 5; i++) { - if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) { + if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) { return -1; } } @@ -970,7 +970,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) for (i = 0; i < 5; i++) { - if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) { + if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) { return -1; } } @@ -1003,7 +1003,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) for (i = 0; i < 5; i++) { - if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) { + if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) { return -1; } } @@ -1014,7 +1014,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) for (i = 0; i < 5; i++) { - if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) { + if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) { return -1; } } diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 256892b..345aecb 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -75,8 +75,8 @@ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf ) if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || - !FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) || - !DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) { + !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) || + !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) { return -1; } return 0; diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 3bc5e5f..c9c3c19 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -166,8 +166,8 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ) if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || - !FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) || - !DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) + !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) || + !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) { HDfprintf(stderr,"read and write buffers have differences\n"); HDfprintf(stderr,"%s %ld %f %f %d\n", @@ -1140,7 +1140,7 @@ static int test_table(hid_t fid, int do_write) { if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati || rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi || - !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) ) + !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) ) { HDfprintf(stderr,"%ld %f %d\n", rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati); @@ -1202,7 +1202,7 @@ static int test_table(hid_t fid, int do_write) /* Compare the extracted table with the initial values */ for ( i = 0; i < NRECORDS; i++ ) { - if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) { + if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) { goto out; } } @@ -1265,7 +1265,7 @@ static int test_table(hid_t fid, int do_write) for( i = 0; i < NRECORDS; i++ ) { if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || - !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) { + !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) { goto out; } } @@ -1294,7 +1294,7 @@ static int test_table(hid_t fid, int do_write) { hsize_t iistart = start; if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) || - !FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) { + !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) { goto out; } } @@ -1353,7 +1353,7 @@ static int test_table(hid_t fid, int do_write) { if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati || rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi || - !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) ) + !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) ) goto out; } } @@ -1406,7 +1406,7 @@ static int test_table(hid_t fid, int do_write) /* compare the extracted table with the initial values */ for( i = 0; i < NRECORDS; i++ ) { - if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) { + if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) { goto out; } } @@ -1472,7 +1472,7 @@ static int test_table(hid_t fid, int do_write) for( i = 0; i < NRECORDS; i++ ) { if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || - !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) { + !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) { goto out; } } @@ -1503,7 +1503,7 @@ static int test_table(hid_t fid, int do_write) { int iistart = (int) start; if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) || - !FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) { + !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) { goto out; } } @@ -1546,8 +1546,8 @@ static int test_table(hid_t fid, int do_write) if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || rbuf2[i].lati != wbuf[i].lati || rbuf2[i].longi != wbuf[i].longi || - !FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) || - !DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) || + !H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) || + !H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) || rbuf2[i].new_field != buf_new[i] ) { goto out; } @@ -1587,7 +1587,7 @@ static int test_table(hid_t fid, int do_write) if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || rbuf3[i].lati != wbuf[i].lati || rbuf3[i].longi != wbuf[i].longi || - !DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) { + !H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) { goto out; } } diff --git a/src/H5C.c b/src/H5C.c index d6a89e6..5cdd65f 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -1718,10 +1718,10 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign H5C_cache_entry_t * entry_ptr = NULL; H5C_cache_entry_t * next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - int64_t flushed_entries_count; - size_t flushed_entries_size; - int64_t initial_slist_len; - size_t initial_slist_size; + int64_t flushed_entries_count = 0; + int64_t flushed_entries_size = 0; + int64_t initial_slist_len = 0; + size_t initial_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ FUNC_ENTER_NOAPI(FAIL) @@ -1943,7 +1943,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign if(entry_ptr->flush_dep_height == curr_flush_dep_height ) { #if H5C_DO_SANITY_CHECKS flushed_entries_count++; - flushed_entries_size += entry_ptr->size; + flushed_entries_size += (int64_t)entry_ptr->size; #endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, primary_dxpl_id, @@ -1976,7 +1976,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign if(entry_ptr->flush_dep_height == curr_flush_dep_height ) { #if H5C_DO_SANITY_CHECKS flushed_entries_count++; - flushed_entries_size += entry_ptr->size; + flushed_entries_size += (int64_t)entry_ptr->size; #endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, primary_dxpl_id, @@ -2027,8 +2027,8 @@ end_of_inner_loop: HDassert( (initial_slist_len + cache_ptr->slist_len_increase - flushed_entries_count) == cache_ptr->slist_len ); - HDassert( (initial_slist_size + - (size_t)(cache_ptr->slist_size_increase) - + HDassert( (size_t)((int64_t)initial_slist_size + + cache_ptr->slist_size_increase - flushed_entries_size) == cache_ptr->slist_size ); #endif /* H5C_DO_SANITY_CHECKS */ @@ -4647,8 +4647,6 @@ H5C_stats(H5C_t * cache_ptr, #endif /* H5C_COLLECT_CACHE_STATS */ display_detailed_stats) { - herr_t ret_value = SUCCEED; /* Return value */ - #if H5C_COLLECT_CACHE_STATS int i; int64_t total_hits = 0; @@ -4680,11 +4678,12 @@ H5C_stats(H5C_t * cache_ptr, size_t aggregate_max_size = 0; int32_t aggregate_max_pins = 0; double hit_rate; - double average_successful_search_depth = 0.0; - double average_failed_search_depth = 0.0; - double average_entries_skipped_per_calls_to_msic = 0.0; - double average_entries_scanned_per_calls_to_msic = 0.0; + double average_successful_search_depth = 0.0f; + double average_failed_search_depth = 0.0f; + double average_entries_skipped_per_calls_to_msic = 0.0f; + double average_entries_scanned_per_calls_to_msic = 0.0f; #endif /* H5C_COLLECT_CACHE_STATS */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -4748,10 +4747,10 @@ H5C_stats(H5C_t * cache_ptr, if ( ( total_hits > 0 ) || ( total_misses > 0 ) ) { - hit_rate = 100.0 * ((double)(total_hits)) / + hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses)); } else { - hit_rate = 0.0; + hit_rate = 0.0f; } if ( cache_ptr->successful_ht_searches > 0 ) { @@ -4918,7 +4917,7 @@ H5C_stats(H5C_t * cache_ptr, HDfprintf(stdout, "%s MSIC: Average/max entries skipped = %lf / %ld\n", cache_ptr->prefix, - (float)average_entries_skipped_per_calls_to_msic, + (double)average_entries_skipped_per_calls_to_msic, (long)(cache_ptr->max_entries_skipped_in_msic)); if (cache_ptr->calls_to_msic > 0) { @@ -4929,7 +4928,7 @@ H5C_stats(H5C_t * cache_ptr, HDfprintf(stdout, "%s MSIC: Average/max entries scanned = %lf / %ld\n", cache_ptr->prefix, - (float)average_entries_scanned_per_calls_to_msic, + (double)average_entries_scanned_per_calls_to_msic, (long)(cache_ptr->max_entries_scanned_in_msic)); HDfprintf(stdout, "%s MSIC: Scanned to make space(evict) = %lld\n", @@ -4973,10 +4972,10 @@ H5C_stats(H5C_t * cache_ptr, if ( ( cache_ptr->hits[i] > 0 ) || ( cache_ptr->misses[i] > 0 ) ) { - hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) / + hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) / ((double)(cache_ptr->hits[i] + cache_ptr->misses[i])); } else { - hit_rate = 0.0; + hit_rate = 0.0f; } HDfprintf(stdout, @@ -8229,7 +8228,6 @@ H5C_flush_single_entry(H5F_t * f, hbool_t was_dirty; hbool_t destroy_entry; herr_t status; - int type_id; unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -8330,7 +8328,6 @@ H5C_flush_single_entry(H5F_t * f, #endif /* H5_HAVE_PARALLEL */ was_dirty = entry_ptr->is_dirty; - type_id = entry_ptr->type->id; entry_ptr->flush_marker = FALSE; diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 7c278e8..5df84cd 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -35,14 +35,16 @@ #ifndef _H5Cpkg_H #define _H5Cpkg_H - /* Get package's private header */ #include "H5Cprivate.h" - -/* Get needed headers */ +/* Other private headers needed by this file */ #include "H5SLprivate.h" /* Skip lists */ +/**************************/ +/* Package Private Macros */ +/**************************/ + /* With the introduction of the fractal heap, it is now possible for * entries to be dirtied, resized, and/or moved in the flush callbacks. * As a result, on flushes, it may be necessary to make multiple passes @@ -53,3552 +55,3536 @@ * * -- JRM */ - #define H5C__MAX_PASSES_ON_FLUSH 4 - +/* Cache configuration settings */ +#define H5C__HASH_TABLE_LEN (64 * 1024) /* must be a power of 2 */ +#define H5C__H5C_T_MAGIC 0x005CAC0E +#define H5C__MAX_NUM_TYPE_IDS 27 +#define H5C__PREFIX_LEN 32 /**************************************************************************** * - * structure H5C_t - * - * Catchall structure for all variables specific to an instance of the cache. - * - * While the individual fields of the structure are discussed below, the - * following overview may be helpful. - * - * Entries in the cache are stored in an instance of H5TB_TREE, indexed on - * the entry's disk address. While the H5TB_TREE is less efficient than - * hash table, it keeps the entries in address sorted order. As flushes - * in parallel mode are more efficient if they are issued in increasing - * address order, this is a significant benefit. Also the H5TB_TREE code - * was readily available, which reduced development time. - * - * While the cache was designed with multiple replacement policies in mind, - * at present only a modified form of LRU is supported. - * - * JRM - 4/26/04 - * - * Profiling has indicated that searches in the instance of H5TB_TREE are - * too expensive. To deal with this issue, I have augmented the cache - * with a hash table in which all entries will be stored. Given the - * advantages of flushing entries in increasing address order, the TBBT - * is retained, but only dirty entries are stored in it. At least for - * now, we will leave entries in the TBBT after they are flushed. - * - * Note that index_size and index_len now refer to the total size of - * and number of entries in the hash table. - * - * JRM - 7/19/04 - * - * The TBBT has since been replaced with a skip list. This change - * greatly predates this note. - * - * JRM - 9/26/05 - * - * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. - * This field is used to validate pointers to instances of - * H5C_t. - * - * flush_in_progress: Boolean flag indicating whether a flush is in - * progress. - * - * trace_file_ptr: File pointer pointing to the trace file, which is used - * to record cache operations for use in simulations and design - * studies. This field will usually be NULL, indicating that - * no trace file should be recorded. - * - * Since much of the code supporting the parallel metadata - * cache is in H5AC, we don't write the trace file from - * H5C. Instead, H5AC reads the trace_file_ptr as needed. - * - * When we get to using H5C in other places, we may add - * code to write trace file data at the H5C level as well. - * - * aux_ptr: Pointer to void used to allow wrapper code to associate - * its data with an instance of H5C_t. The H5C cache code - * sets this field to NULL, and otherwise leaves it alone. - * - * max_type_id: Integer field containing the maximum type id number assigned - * to a type of entry in the cache. All type ids from 0 to - * max_type_id inclusive must be defined. The names of the - * types are stored in the type_name_table discussed below, and - * indexed by the ids. - * - * type_name_table_ptr: Pointer to an array of pointer to char of length - * max_type_id + 1. The strings pointed to by the entries - * in the array are the names of the entry types associated - * with the indexing type IDs. - * - * max_cache_size: Nominal maximum number of bytes that may be stored in the - * cache. This value should be viewed as a soft limit, as the - * cache can exceed this value under the following circumstances: - * - * a) All entries in the cache are protected, and the cache is - * asked to insert a new entry. In this case the new entry - * will be created. If this causes the cache to exceed - * max_cache_size, it will do so. The cache will attempt - * to reduce its size as entries are unprotected. - * - * b) When running in parallel mode, the cache may not be - * permitted to flush a dirty entry in response to a read. - * If there are no clean entries available to evict, the - * cache will exceed its maximum size. Again the cache - * will attempt to reduce its size to the max_cache_size - * limit on the next cache write. - * - * c) When an entry increases in size, the cache may exceed - * the max_cache_size limit until the next time the cache - * attempts to load or insert an entry. - * - * min_clean_size: Nominal minimum number of clean bytes in the cache. - * The cache attempts to maintain this number of bytes of - * clean data so as to avoid case b) above. Again, this is - * a soft limit. - * - * - * In addition to the call back functions required for each entry, the - * cache requires the following call back functions for this instance of - * the cache as a whole: - * - * check_write_permitted: In certain applications, the cache may not - * be allowed to write to disk at certain time. If specified, - * the check_write_permitted function is used to determine if - * a write is permissible at any given point in time. - * - * If no such function is specified (i.e. this field is NULL), - * the cache uses the following write_permitted field to - * determine whether writes are permitted. - * - * write_permitted: If check_write_permitted is NULL, this boolean flag - * indicates whether writes are permitted. + * We maintain doubly linked lists of instances of H5C_cache_entry_t for a + * variety of reasons -- protected list, LRU list, and the clean and dirty + * LRU lists at present. The following macros support linking and unlinking + * of instances of H5C_cache_entry_t by both their regular and auxilary next + * and previous pointers. * - * log_flush: If provided, this function is called whenever a dirty - * entry is flushed to disk. + * The size and length fields are also maintained. * + * Note that the relevant pair of prev and next pointers are presumed to be + * NULL on entry in the insertion macros. * - * In cases where memory is plentiful, and performance is an issue, it may - * be useful to disable all cache evictions, and thereby postpone metadata - * writes. The following field is used to implement this. + * Finally, observe that the sanity checking macros evaluate to the empty + * string when H5C_DO_SANITY_CHECKS is FALSE. They also contain calls + * to the HGOTO_ERROR macro, which may not be appropriate in all cases. + * If so, we will need versions of the insertion and deletion macros which + * do not reference the sanity checking macros. + * JRM - 5/5/04 * - * evictions_enabled: Boolean flag that is initialized to TRUE. When - * this flag is set to FALSE, the metadata cache will not - * attempt to evict entries to make space for newly protected - * entries, and instead the will grow without limit. - * - * Needless to say, this feature must be used with care. + * Changes: * + * - Removed the line: * - * The cache requires an index to facilitate searching for entries. The - * following fields support that index. + * ( ( (Size) == (entry_ptr)->size ) && ( (len) != 1 ) ) || * - * index_len: Number of entries currently in the hash table used to index - * the cache. + * from the H5C__DLL_PRE_REMOVE_SC macro. With the addition of the + * epoch markers used in the age out based cache size reduction algorithm, + * this invariant need not hold, as the epoch markers are of size 0. * - * index_size: Number of bytes of cache entries currently stored in the - * hash table used to index the cache. + * One could argue that I should have given the epoch markers a positive + * size, but this would break the index_size = LRU_list_size + pl_size + * + pel_size invariant. * - * This value should not be mistaken for footprint of the - * cache in memory. The average cache entry is small, and - * the cache has a considerable overhead. Multiplying the - * index_size by two should yield a conservative estimate - * of the cache's memory footprint. + * Alternatively, I could pass the current decr_mode in to the macro, + * and just skip the check whenever epoch markers may be in use. * - * clean_index_size: Number of bytes of clean entries currently stored in - * the hash table. Note that the index_size field (above) - * is also the sum of the sizes of all entries in the cache. - * Thus we should have the invarient that clean_index_size + - * dirty_index_size == index_size. + * However, any size errors should be caught when the cache is flushed + * and destroyed. Until we are tracking such an error, this should be + * good enough. + * JRM - 12/9/04 * - * WARNING: * - * 1) The clean_index_size field is not maintained by the - * index macros, as the hash table doesn't care whether - * the entry is clean or dirty. Instead the field is - * maintained in the H5C__UPDATE_RP macros. + * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: * - * 2) The value of the clean_index_size must not be mistaken - * for the current clean size of the cache. Rather, the - * clean size of the cache is the current value of - * clean_index_size plus the amount of empty space (if any) - * in the cache. + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * dirty_index_size: Number of bytes of dirty entries currently stored in - * the hash table. Note that the index_size field (above) - * is also the sum of the sizes of all entries in the cache. - * Thus we should have the invarient that clean_index_size + - * dirty_index_size == index_size. + * with: * - * WARNING: + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * 1) The dirty_index_size field is not maintained by the - * index macros, as the hash table doesn't care whether - * the entry is clean or dirty. Instead the field is - * maintained in the H5C__UPDATE_RP macros. + * Epoch markers have size 0, so we can now have a non-empty list with + * zero size. Hence the "( (Size) <= 0 )" clause cause false failures + * in the sanity check. Since "Size" is typically a size_t, it can't + * take on negative values, and thus the revised clause "( (Size) < 0 )" + * caused compiler warnings. + * JRM - 12/22/04 * - * index: Array of pointer to H5C_cache_entry_t of size - * H5C__HASH_TABLE_LEN. At present, this value is a power - * of two, not the usual prime number. + * - In the H5C__DLL_SC macro, replaced the lines: * - * I hope that the variable size of cache elements, the large - * hash table size, and the way in which HDF5 allocates space - * will combine to avoid problems with periodicity. If so, we - * can use a trivial hash function (a bit-and and a 3 bit left - * shift) with some small savings. + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || ( (cache_ptr)->size <= 0 ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * If not, it will become evident in the statistics. Changing - * to the usual prime number length hash table will require - * changing the H5C__HASH_FCN macro and the deletion of the - * H5C__HASH_MASK #define. No other changes should be required. + * with * + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || * - * When we flush the cache, we need to write entries out in increasing - * address order. An instance of a skip list is used to store dirty entries in - * sorted order. Whether it is cheaper to sort the dirty entries as needed, - * or to maintain the list is an open question. At a guess, it depends - * on how frequently the cache is flushed. We will see how it goes. + * Epoch markers have size 0, so we can now have a non-empty list with + * zero size. Hence the "( (Size) <= 0 )" clause cause false failures + * in the sanity check. Since "Size" is typically a size_t, it can't + * take on negative values, and thus the revised clause "( (Size) < 0 )" + * caused compiler warnings. + * JRM - 1/10/05 * - * For now at least, I will not remove dirty entries from the list as they - * are flushed. (this has been changed -- dirty entries are now removed from - * the skip list as they are flushed. JRM - 10/25/05) + * - Added the H5C__DLL_UPDATE_FOR_SIZE_CHANGE macro and the associated + * sanity checking macros. These macro are used to update the size of + * a DLL when one of its entries changes size. * - * slist_len: Number of entries currently in the skip list - * used to maintain a sorted list of dirty entries in the - * cache. + * JRM - 9/8/05 * - * slist_size: Number of bytes of cache entries currently stored in the - * skip list used to maintain a sorted list of - * dirty entries in the cache. - * - * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted - * list of dirty entries in the cache. This sorted list has - * two uses: - * - * a) It allows us to flush dirty entries in increasing address - * order, which results in significant savings. - * - * b) It facilitates checking for adjacent dirty entries when - * attempting to evict entries from the cache. While we - * don't use this at present, I hope that this will allow - * some optimizations when I get to it. - * - * num_last_entries: The number of entries in the cache that can only be - * flushed after all other entries in the cache have - * been flushed. At this time, this will only ever be - * one entry (the superblock), and the code has been - * protected with HDasserts to enforce this. This restraint - * can certainly be relaxed in the future if the need for - * multiple entries being flushed last arises, though - * explicit tests for that case should be added when said - * HDasserts are removed. - * - * With the addition of the fractal heap, the cache must now deal with - * the case in which entries may be dirtied, moved, or have their sizes - * changed during a flush. To allow sanity checks in this situation, the - * following two fields have been added. They are only compiled in when - * H5C_DO_SANITY_CHECKS is TRUE. - * - * slist_len_increase: Number of entries that have been added to the - * slist since the last time this field was set to zero. - * - * slist_size_increase: Total size of all entries that have been added - * to the slist since the last time this field was set to - * zero. - * - * - * When a cache entry is protected, it must be removed from the LRU - * list(s) as it cannot be either flushed or evicted until it is unprotected. - * The following fields are used to implement the protected list (pl). - * - * pl_len: Number of entries currently residing on the protected list. - * - * pl_size: Number of bytes of cache entries currently residing on the - * protected list. - * - * pl_head_ptr: Pointer to the head of the doubly linked list of protected - * entries. Note that cache entries on this list are linked - * by their next and prev fields. - * - * This field is NULL if the list is empty. - * - * pl_tail_ptr: Pointer to the tail of the doubly linked list of protected - * entries. Note that cache entries on this list are linked - * by their next and prev fields. - * - * This field is NULL if the list is empty. - * - * - * For very frequently used entries, the protect/unprotect overhead can - * become burdensome. To avoid this overhead, I have modified the cache - * to allow entries to be "pinned". A pinned entry is similar to a - * protected entry, in the sense that it cannot be evicted, and that - * the entry can be modified at any time. - * - * Pinning an entry has the following implications: - * - * 1) A pinned entry cannot be evicted. Thus unprotected - * pinned entries reside in the pinned entry list, instead - * of the LRU list(s) (or other lists maintained by the current - * replacement policy code). - * - * 2) A pinned entry can be accessed or modified at any time. - * Therefore, the cache must check with the entry owner - * before flushing it. If permission is denied, the - * cache just skips the entry in the flush. - * - * 3) A pinned entry can be marked as dirty (and possibly - * change size) while it is unprotected. - * - * 4) The flush-destroy code must allow pinned entries to - * be unpinned (and possibly unprotected) during the - * flush. - * - * Since pinned entries cannot be evicted, they must be kept on a pinned - * entry list (pel), instead of being entrusted to the replacement policy - * code. - * - * Maintaining the pinned entry list requires the following fields: - * - * pel_len: Number of entries currently residing on the pinned - * entry list. - * - * pel_size: Number of bytes of cache entries currently residing on - * the pinned entry list. - * - * pel_head_ptr: Pointer to the head of the doubly linked list of pinned - * but not protected entries. Note that cache entries on - * this list are linked by their next and prev fields. - * - * This field is NULL if the list is empty. - * - * pel_tail_ptr: Pointer to the tail of the doubly linked list of pinned - * but not protected entries. Note that cache entries on - * this list are linked by their next and prev fields. - * - * This field is NULL if the list is empty. - * - * - * The cache must have a replacement policy, and the fields supporting this - * policy must be accessible from this structure. - * - * While there has been interest in several replacement policies for - * this cache, the initial development schedule is tight. Thus I have - * elected to support only a modified LRU (least recently used) policy - * for the first cut. - * - * To further simplify matters, I have simply included the fields needed - * by the modified LRU in this structure. When and if we add support for - * other policies, it will probably be easiest to just add the necessary - * fields to this structure as well -- we only create one instance of this - * structure per file, so the overhead is not excessive. - * - * - * Fields supporting the modified LRU policy: - * - * See most any OS text for a discussion of the LRU replacement policy. - * - * When operating in parallel mode, we must ensure that a read does not - * cause a write. If it does, the process will hang, as the write will - * be collective and the other processes will not know to participate. - * - * To deal with this issue, I have modified the usual LRU policy by adding - * clean and dirty LRU lists to the usual LRU list. - * - * The clean LRU list is simply the regular LRU list with all dirty cache - * entries removed. - * - * Similarly, the dirty LRU list is the regular LRU list with all the clean - * cache entries removed. - * - * When reading in parallel mode, we evict from the clean LRU list only. - * This implies that we must try to ensure that the clean LRU list is - * reasonably well stocked at all times. - * - * We attempt to do this by trying to flush enough entries on each write - * to keep the cLRU_list_size >= min_clean_size. - * - * Even if we start with a completely clean cache, a sequence of protects - * without unprotects can empty the clean LRU list. In this case, the - * cache must grow temporarily. At the next write, we will attempt to - * evict enough entries to reduce index_size to less than max_cache_size. - * While this will usually be possible, all bets are off if enough entries - * are protected. - * - * Discussions of the individual fields used by the modified LRU replacement - * policy follow: - * - * LRU_list_len: Number of cache entries currently on the LRU list. - * - * Observe that LRU_list_len + pl_len must always equal - * index_len. - * - * LRU_list_size: Number of bytes of cache entries currently residing on the - * LRU list. - * - * Observe that LRU_list_size + pl_size must always equal - * index_size. - * - * LRU_head_ptr: Pointer to the head of the doubly linked LRU list. Cache - * entries on this list are linked by their next and prev fields. - * - * This field is NULL if the list is empty. - * - * LRU_tail_ptr: Pointer to the tail of the doubly linked LRU list. Cache - * entries on this list are linked by their next and prev fields. - * - * This field is NULL if the list is empty. - * - * cLRU_list_len: Number of cache entries currently on the clean LRU list. - * - * Observe that cLRU_list_len + dLRU_list_len must always - * equal LRU_list_len. - * - * cLRU_list_size: Number of bytes of cache entries currently residing on - * the clean LRU list. - * - * Observe that cLRU_list_size + dLRU_list_size must always - * equal LRU_list_size. - * - * cLRU_head_ptr: Pointer to the head of the doubly linked clean LRU list. - * Cache entries on this list are linked by their aux_next and - * aux_prev fields. - * - * This field is NULL if the list is empty. - * - * cLRU_tail_ptr: Pointer to the tail of the doubly linked clean LRU list. - * Cache entries on this list are linked by their aux_next and - * aux_prev fields. - * - * This field is NULL if the list is empty. - * - * dLRU_list_len: Number of cache entries currently on the dirty LRU list. - * - * Observe that cLRU_list_len + dLRU_list_len must always - * equal LRU_list_len. - * - * dLRU_list_size: Number of cache entries currently on the dirty LRU list. - * - * Observe that cLRU_list_len + dLRU_list_len must always - * equal LRU_list_len. - * - * dLRU_head_ptr: Pointer to the head of the doubly linked dirty LRU list. - * Cache entries on this list are linked by their aux_next and - * aux_prev fields. - * - * This field is NULL if the list is empty. - * - * dLRU_tail_ptr: Pointer to the tail of the doubly linked dirty LRU list. - * Cache entries on this list are linked by their aux_next and - * aux_prev fields. - * - * This field is NULL if the list is empty. - * - * - * Automatic cache size adjustment: - * - * While the default cache size is adequate for most cases, we can run into - * cases where the default is too small. Ideally, we will let the user - * adjust the cache size as required. However, this is not possible in all - * cases. Thus I have added automatic cache size adjustment code. - * - * The configuration for the automatic cache size adjustment is stored in - * the structure described below: - * - * size_increase_possible: Depending on the configuration data given - * in the resize_ctl field, it may or may not be possible - * to increase the size of the cache. Rather than test for - * all the ways this can happen, we simply set this flag when - * we receive a new configuration. - * - * flash_size_increase_possible: Depending on the configuration data given - * in the resize_ctl field, it may or may not be possible - * for a flash size increase to occur. We set this flag - * whenever we receive a new configuration so as to avoid - * repeated calculations. - * - * flash_size_increase_threshold: If a flash cache size increase is possible, - * this field is used to store the minimum size of a new entry - * or size increase needed to trigger a flash cache size - * increase. Note that this field must be updated whenever - * the size of the cache is changed. - * - * size_decrease_possible: Depending on the configuration data given - * in the resize_ctl field, it may or may not be possible - * to decrease the size of the cache. Rather than test for - * all the ways this can happen, we simply set this flag when - * we receive a new configuration. - * - * cache_full: Boolean flag used to keep track of whether the cache is - * full, so we can refrain from increasing the size of a - * cache which hasn't used up the space allotted to it. - * - * The field is initialized to FALSE, and then set to TRUE - * whenever we attempt to make space in the cache. - * - * resize_enabled: This is another convenience flag which is set whenever - * a new set of values for resize_ctl are provided. Very - * simply, - * - * resize_enabled = size_increase_possible || - * size_decrease_possible; - * - * size_decreased: Boolean flag set to TRUE whenever the maximum cache - * size is decreased. The flag triggers a call to - * H5C_make_space_in_cache() on the next call to H5C_protect(). - * - * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration - * data for automatic cache resizing. - * - * epoch_markers_active: Integer field containing the number of epoch - * markers currently in use in the LRU list. This value - * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1]. - * - * epoch_marker_active: Array of boolean of length H5C__MAX_EPOCH_MARKERS. - * This array is used to track which epoch markers are currently - * in use. - * - * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1. - * - * To manage the epoch marker cache entries, it is necessary - * to track their order in the LRU list. This is done with - * epoch_marker_ringbuf. When markers are inserted at the - * head of the LRU list, the index of the marker in the - * epoch_markers array is inserted at the tail of the ring - * buffer. When it becomes the epoch_marker_active'th marker - * in the LRU list, it will have worked its way to the head - * of the ring buffer as well. This allows us to remove it - * without scanning the LRU list if such is required. - * - * epoch_marker_ringbuf_first: Integer field containing the index of the - * first entry in the ring buffer. - * - * epoch_marker_ringbuf_last: Integer field containing the index of the - * last entry in the ring buffer. - * - * epoch_marker_ringbuf_size: Integer field containing the number of entries - * in the ring buffer. - * - * epoch_markers: Array of instances of H5C_cache_entry_t of length - * H5C__MAX_EPOCH_MARKERS. The entries are used as markers - * in the LRU list to identify cache entries that haven't - * been accessed for some (small) specified number of - * epochs. These entries (if any) can then be evicted and - * the cache size reduced -- ideally without evicting any - * of the current working set. Needless to say, the epoch - * length and the number of epochs before an unused entry - * must be chosen so that all, or almost all, the working - * set will be accessed before the limit. - * - * Epoch markers only appear in the LRU list, never in - * the index or slist. While they are of type - * H5C__EPOCH_MARKER_TYPE, and have associated class - * functions, these functions should never be called. - * - * The addr fields of these instances of H5C_cache_entry_t - * are set to the index of the instance in the epoch_markers - * array, the size is set to 0, and the type field points - * to the constant structure epoch_marker_class defined - * in H5C.c. The next and prev fields are used as usual - * to link the entry into the LRU list. - * - * All other fields are unused. - * - * - * Cache hit rate collection fields: - * - * We supply the current cache hit rate on request, so we must keep a - * simple cache hit rate computation regardless of whether statistics - * collection is enabled. The following fields support this capability. - * - * cache_hits: Number of cache hits since the last time the cache hit - * rate statistics were reset. Note that when automatic cache - * re-sizing is enabled, this field will be reset every automatic - * resize epoch. - * - * cache_accesses: Number of times the cache has been accessed while - * since the last since the last time the cache hit rate statistics - * were reset. Note that when automatic cache re-sizing is enabled, - * this field will be reset every automatic resize epoch. - * - * - * Statistics collection fields: - * - * When enabled, these fields are used to collect statistics as described - * below. The first set are collected only when H5C_COLLECT_CACHE_STATS - * is true. - * - * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been in cache when requested in - * the current epoch. - * - * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has not been in cache when - * requested in the current epoch. - * - * write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been write protected - * in the current epoch. - * - * Observe that (hits + misses) = (write_protects + read_protects). - * - * read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been read protected in - * the current epoch. - * - * Observe that (hits + misses) = (write_protects + read_protects). - * - * max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to maximum number of simultaneous read - * protects on any entry with type id equal to the array index - * in the current epoch. - * - * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been inserted into the - * cache in the current epoch. - * - * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has been inserted - * pinned into the cache in the current epoch. - * - * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times a dirty entry with type - * id equal to the array index has been cleared in the current - * epoch. - * - * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been written to disk in the - * current epoch. - * - * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been evicted from the cache in - * the current epoch. - * - * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been moved in the current - * epoch. - * - * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has been moved - * during its flush callback in the current epoch. - * - * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has been moved - * during a cache flush in the current epoch. - * - * pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been pinned in the current - * epoch. - * - * unpins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been unpinned in the current - * epoch. - * - * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been marked dirty while pinned - * in the current epoch. - * - * pinned_flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry - * with type id equal to the array index has been flushed while - * pinned in the current epoch. - * - * pinned_clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry - * with type id equal to the array index has been cleared while - * pinned in the current epoch. - * - * size_increases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has increased in - * size in the current epoch. - * - * size_decreases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has decreased in - * size in the current epoch. - * - * entry_flush_size_changes: Array of int64 of length - * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record - * the number of times an entry with type id equal to the - * array index has changed size while in its flush callback. - * - * cache_flush_size_changes: Array of int64 of length - * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record - * the number of times an entry with type id equal to the - * array index has changed size during a cache flush + ****************************************************************************/ + +#if H5C_DO_SANITY_CHECKS + +#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +if ( ( (head_ptr) == NULL ) || \ + ( (tail_ptr) == NULL ) || \ + ( (entry_ptr) == NULL ) || \ + ( (len) <= 0 ) || \ + ( (Size) < (entry_ptr)->size ) || \ + ( ( (entry_ptr)->prev == NULL ) && ( (head_ptr) != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ + ( ( (len) == 1 ) && \ + ( ! ( ( (head_ptr) == (entry_ptr) ) && \ + ( (tail_ptr) == (entry_ptr) ) && \ + ( (entry_ptr)->next == NULL ) && \ + ( (entry_ptr)->prev == NULL ) && \ + ( (Size) == (entry_ptr)->size ) \ + ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre remove SC failed") \ +} + +#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (head_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( (Size) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (head_ptr) != (tail_ptr) ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL sanity check failed") \ +} + +#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +if ( ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->next != NULL ) || \ + ( (entry_ptr)->prev != NULL ) || \ + ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (head_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (head_ptr) != (tail_ptr) ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre insert SC failed") \ +} + +#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +if ( ( (dll_len) <= 0 ) || \ + ( (dll_size) <= 0 ) || \ + ( (old_size) <= 0 ) || \ + ( (old_size) > (dll_size) ) || \ + ( (new_size) <= 0 ) || \ + ( ( (dll_len) == 1 ) && ( (old_size) != (dll_size) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL pre size update SC failed") \ +} + +#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +if ( ( (new_size) > (dll_size) ) || \ + ( ( (dll_len) == 1 ) && ( (new_size) != (dll_size) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL post size update SC failed") \ +} + +#else /* H5C_DO_SANITY_CHECKS */ + +#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) +#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) +#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) +#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) +#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) + +#endif /* H5C_DO_SANITY_CHECKS */ + + +#define H5C__DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +{ \ + H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (tail_ptr)->next = (entry_ptr); \ + (entry_ptr)->prev = (tail_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += (entry_ptr)->size; \ +} /* H5C__DLL_APPEND() */ + +#define H5C__DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +{ \ + H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (head_ptr)->prev = (entry_ptr); \ + (entry_ptr)->next = (head_ptr); \ + (head_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += entry_ptr->size; \ +} /* H5C__DLL_PREPEND() */ + +#define H5C__DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +{ \ + H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + { \ + if ( (head_ptr) == (entry_ptr) ) \ + { \ + (head_ptr) = (entry_ptr)->next; \ + if ( (head_ptr) != NULL ) \ + (head_ptr)->prev = NULL; \ + } \ + else \ + (entry_ptr)->prev->next = (entry_ptr)->next; \ + if ( (tail_ptr) == (entry_ptr) ) \ + { \ + (tail_ptr) = (entry_ptr)->prev; \ + if ( (tail_ptr) != NULL ) \ + (tail_ptr)->next = NULL; \ + } \ + else \ + (entry_ptr)->next->prev = (entry_ptr)->prev; \ + entry_ptr->next = NULL; \ + entry_ptr->prev = NULL; \ + (len)--; \ + (Size) -= entry_ptr->size; \ + } \ +} /* H5C__DLL_REMOVE() */ + +#define H5C__DLL_UPDATE_FOR_SIZE_CHANGE(dll_len, dll_size, old_size, new_size) \ +{ \ + H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ + (dll_size) -= (old_size); \ + (dll_size) += (new_size); \ + H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +} /* H5C__DLL_UPDATE_FOR_SIZE_CHANGE() */ + +#if H5C_DO_SANITY_CHECKS + +#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +if ( ( (hd_ptr) == NULL ) || \ + ( (tail_ptr) == NULL ) || \ + ( (entry_ptr) == NULL ) || \ + ( (len) <= 0 ) || \ + ( (Size) < (entry_ptr)->size ) || \ + ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ + ( ( (entry_ptr)->aux_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->aux_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ + ( ( (len) == 1 ) && \ + ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ + ( (entry_ptr)->aux_next == NULL ) && \ + ( (entry_ptr)->aux_prev == NULL ) && \ + ( (Size) == (entry_ptr)->size ) \ + ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "aux DLL pre remove SC failed") \ +} + +#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (head_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( (Size) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->aux_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL sanity check failed") \ +} + +#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +if ( ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->aux_next != NULL ) || \ + ( (entry_ptr)->aux_prev != NULL ) || \ + ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ + ( (hd_ptr) != (tail_ptr) ) \ + ) || \ + ( (len) < 0 ) || \ + ( ( (len) == 1 ) && \ + ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ + ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ + ) \ + ) || \ + ( ( (len) >= 1 ) && \ + ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->aux_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ + ) \ + ) \ + ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL pre insert SC failed") \ +} + +#else /* H5C_DO_SANITY_CHECKS */ + +#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) +#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) +#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) + +#endif /* H5C_DO_SANITY_CHECKS */ + + +#define H5C__AUX_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val)\ +{ \ + H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + fail_val) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (tail_ptr)->aux_next = (entry_ptr); \ + (entry_ptr)->aux_prev = (tail_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += entry_ptr->size; \ +} /* H5C__AUX_DLL_APPEND() */ + +#define H5C__AUX_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +{ \ + H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ + if ( (head_ptr) == NULL ) \ + { \ + (head_ptr) = (entry_ptr); \ + (tail_ptr) = (entry_ptr); \ + } \ + else \ + { \ + (head_ptr)->aux_prev = (entry_ptr); \ + (entry_ptr)->aux_next = (head_ptr); \ + (head_ptr) = (entry_ptr); \ + } \ + (len)++; \ + (Size) += entry_ptr->size; \ +} /* H5C__AUX_DLL_PREPEND() */ + +#define H5C__AUX_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +{ \ + H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ + { \ + if ( (head_ptr) == (entry_ptr) ) \ + { \ + (head_ptr) = (entry_ptr)->aux_next; \ + if ( (head_ptr) != NULL ) \ + (head_ptr)->aux_prev = NULL; \ + } \ + else \ + (entry_ptr)->aux_prev->aux_next = (entry_ptr)->aux_next; \ + if ( (tail_ptr) == (entry_ptr) ) \ + { \ + (tail_ptr) = (entry_ptr)->aux_prev; \ + if ( (tail_ptr) != NULL ) \ + (tail_ptr)->aux_next = NULL; \ + } \ + else \ + (entry_ptr)->aux_next->aux_prev = (entry_ptr)->aux_prev; \ + entry_ptr->aux_next = NULL; \ + entry_ptr->aux_prev = NULL; \ + (len)--; \ + (Size) -= entry_ptr->size; \ + } \ +} /* H5C__AUX_DLL_REMOVE() */ + + +/*********************************************************************** * - * total_ht_insertions: Number of times entries have been inserted into the - * hash table in the current epoch. + * Stats collection macros * - * total_ht_deletions: Number of times entries have been deleted from the - * hash table in the current epoch. + * The following macros must handle stats collection when this collection + * is enabled, and evaluate to the empty string when it is not. * - * successful_ht_searches: int64 containing the total number of successful - * searches of the hash table in the current epoch. + * The sole exception to this rule is + * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as + * the cache hit rate stats are always collected and available. * - * total_successful_ht_search_depth: int64 containing the total number of - * entries other than the targets examined in successful - * searches of the hash table in the current epoch. + * Changes: * - * failed_ht_searches: int64 containing the total number of unsuccessful - * searches of the hash table in the current epoch. + * JRM -- 3/21/06 + * Added / updated macros for pinned entry related stats. * - * total_failed_ht_search_depth: int64 containing the total number of - * entries examined in unsuccessful searches of the hash - * table in the current epoch. + * JRM -- 8/9/06 + * More pinned entry stats related updates. * - * max_index_len: Largest value attained by the index_len field in the - * current epoch. + * JRM -- 3/31/07 + * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on + * read and write protects. * - * max_index_size: Largest value attained by the index_size field in the - * current epoch. + * MAM -- 1/15/09 + * Created H5C__UPDATE_MAX_INDEX_SIZE_STATS to contain + * common code within macros that update the maximum + * index, clean_index, and dirty_index statistics fields. * - * max_clean_index_size: Largest value attained by the clean_index_size field - * in the current epoch. + ***********************************************************************/ + +#define H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) \ + (cache_ptr->cache_accesses)++; \ + if ( hit ) { \ + (cache_ptr->cache_hits)++; \ + } \ + +#if H5C_COLLECT_CACHE_STATS + +#define H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->index_size > (cache_ptr)->max_index_size ) \ + (cache_ptr)->max_index_size = (cache_ptr)->index_size; \ + if ( (cache_ptr)->clean_index_size > \ + (cache_ptr)->max_clean_index_size ) \ + (cache_ptr)->max_clean_index_size = \ + (cache_ptr)->clean_index_size; \ + if ( (cache_ptr)->dirty_index_size > \ + (cache_ptr)->max_dirty_index_size ) \ + (cache_ptr)->max_dirty_index_size = \ + (cache_ptr)->dirty_index_size; + +#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) \ + (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++; + +#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) \ + if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ + (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ + if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; + +#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \ + if ( cache_ptr->flush_in_progress ) { \ + ((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \ + } \ + if ( entry_ptr->flush_in_progress ) { \ + ((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \ + } \ + (((cache_ptr)->moves)[(entry_ptr)->type->id])++; + +#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\ + if ( cache_ptr->flush_in_progress ) { \ + ((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \ + } \ + if ( entry_ptr->flush_in_progress ) { \ + ((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \ + } \ + if ( (entry_ptr)->size < (new_size) ) { \ + ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ + (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ + } else if ( (entry_ptr)->size > (new_size) ) { \ + ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \ + } + +#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ + (cache_ptr)->total_ht_insertions++; + +#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ + (cache_ptr)->total_ht_deletions++; + +#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) \ + if ( success ) { \ + (cache_ptr)->successful_ht_searches++; \ + (cache_ptr)->total_successful_ht_search_depth += depth; \ + } else { \ + (cache_ptr)->failed_ht_searches++; \ + (cache_ptr)->total_failed_ht_search_depth += depth; \ + } + +#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \ + ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; + +#if H5C_COLLECT_CACHE_ENTRY_STATS + +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \ +{ \ + (entry_ptr)->accesses = 0; \ + (entry_ptr)->clears = 0; \ + (entry_ptr)->flushes = 0; \ + (entry_ptr)->pins = 0; \ +} + +#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ + ((entry_ptr)->clears)++; \ +} + +#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ + ((entry_ptr)->flushes)++; \ +} + +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->accesses > \ + ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] = \ + (entry_ptr)->accesses; \ + if ( (entry_ptr)->accesses < \ + ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] = \ + (entry_ptr)->accesses; \ + if ( (entry_ptr)->clears > \ + ((cache_ptr)->max_clears)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_clears)[(entry_ptr)->type->id] \ + = (entry_ptr)->clears; \ + if ( (entry_ptr)->flushes > \ + ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] \ + = (entry_ptr)->flushes; \ + if ( (entry_ptr)->size > \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ + = (entry_ptr)->size; \ + if ( (entry_ptr)->pins > \ + ((cache_ptr)->max_pins)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_pins)[(entry_ptr)->type->id] \ + = (entry_ptr)->pins; \ +} + +#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) { \ + (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + (entry_ptr)->pins++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ + (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ + if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ( (entry_ptr)->size > \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ + = (entry_ptr)->size; \ +} + +#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ +{ \ + if ( hit ) \ + ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ + else \ + ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ + if ( ! ((entry_ptr)->is_read_only) ) { \ + ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ + } else { \ + ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ + if ( ((entry_ptr)->ro_ref_count) > \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ + ((entry_ptr)->ro_ref_count); \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ + (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ + if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ + (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ + if ( (entry_ptr)->size > \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_size)[(entry_ptr)->type->id] = (entry_ptr)->size; \ + ((entry_ptr)->accesses)++; \ +} + +#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ +{ \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + (entry_ptr)->pins++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ +} + +#else /* H5C_COLLECT_CACHE_ENTRY_STATS */ + +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) + +#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ +{ \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ + (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ +} + +#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) \ + (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ +} + +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; + +#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ +{ \ + (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->is_pinned ) { \ + (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ + (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ + if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ +} + +#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ +{ \ + if ( hit ) \ + ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ + else \ + ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ + if ( ! ((entry_ptr)->is_read_only) ) \ + ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ + else { \ + ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ + if ( ((entry_ptr)->ro_ref_count) > \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \ + ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ + ((entry_ptr)->ro_ref_count); \ + } \ + if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ + (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ + if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ + (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ +} + +#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ +{ \ + ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ +} + +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ + +#else /* H5C_COLLECT_CACHE_STATS */ + +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) +#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) +#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) +#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) +#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) +#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) +#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) + +#endif /* H5C_COLLECT_CACHE_STATS */ + + +/*********************************************************************** * - * max_dirty_index_size: Largest value attained by the dirty_index_size field - * in the current epoch. + * Hash table access and manipulation macros: * - * max_slist_len: Largest value attained by the slist_len field in the - * current epoch. + * The following macros handle searches, insertions, and deletion in + * the hash table. * - * max_slist_size: Largest value attained by the slist_size field in the - * current epoch. + * When modifying these macros, remember to modify the similar macros + * in tst/cache.c * - * max_pl_len: Largest value attained by the pl_len field in the - * current epoch. + * Changes: * - * max_pl_size: Largest value attained by the pl_size field in the - * current epoch. + * - Updated existing index macros and sanity check macros to maintain + * the clean_index_size and dirty_index_size fields of H5C_t. Also + * added macros to allow us to track entry cleans and dirties. * - * max_pel_len: Largest value attained by the pel_len field in the - * current epoch. + * JRM -- 11/5/08 * - * max_pel_size: Largest value attained by the pel_size field in the - * current epoch. + ***********************************************************************/ + +/* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */ + +#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3) + +#define H5C__HASH_FCN(x) (int)(((x) & H5C__HASH_MASK) >> 3) + +#if H5C_DO_SANITY_CHECKS + +#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (entry_ptr) == NULL ) || \ + ( ! H5F_addr_defined((entry_ptr)->addr) ) || \ + ( (entry_ptr)->ht_next != NULL ) || \ + ( (entry_ptr)->ht_prev != NULL ) || \ + ( (entry_ptr)->size <= 0 ) || \ + ( H5C__HASH_FCN((entry_ptr)->addr) < 0 ) || \ + ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Pre HT insert SC failed") \ +} + +#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len < 1 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( ! H5F_addr_defined((entry_ptr)->addr) ) || \ + ( (entry_ptr)->size <= 0 ) || \ + ( H5C__HASH_FCN((entry_ptr)->addr) < 0 ) || \ + ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \ + ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ + == NULL ) || \ + ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ + != (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev == NULL ) ) || \ + ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] == \ + (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev != NULL ) ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ +} + +/* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ +#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( ! H5F_addr_defined(Addr) ) || \ + ( H5C__HASH_FCN(Addr) < 0 ) || \ + ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "Pre HT search SC failed") \ +} + +/* (Keep in sync w/H5C_TEST__POST_SUC_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ +#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len < 1 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ + ( H5F_addr_ne((entry_ptr)->addr, (Addr)) ) || \ + ( (entry_ptr)->size <= 0 ) || \ + ( ((cache_ptr)->index)[k] == NULL ) || \ + ( ( ((cache_ptr)->index)[k] != (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev == NULL ) ) || \ + ( ( ((cache_ptr)->index)[k] == (entry_ptr) ) && \ + ( (entry_ptr)->ht_prev != NULL ) ) || \ + ( ( (entry_ptr)->ht_prev != NULL ) && \ + ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->ht_next != NULL ) && \ + ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post successful HT search SC failed") \ +} + +/* (Keep in sync w/H5C_TEST__POST_HT_SHIFT_TO_FRONT macro in test/cache_common.h -QAK) */ +#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ +if ( ( (cache_ptr) == NULL ) || \ + ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ + ( (entry_ptr)->ht_prev != NULL ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post HT shift to front SC failed") \ +} + +#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (cache_ptr)->index_size <= 0 ) || \ + ( (new_size) <= 0 ) || \ + ( (old_size) > (cache_ptr)->index_size ) || \ + ( (new_size) <= 0 ) || \ + ( ( (cache_ptr)->index_len == 1 ) && \ + ( (cache_ptr)->index_size != (old_size) ) ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) || \ + ( ( !( was_clean ) || \ + ( (cache_ptr)->clean_index_size < (old_size) ) ) && \ + ( ( (was_clean) ) || \ + ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \ + ( (entry_ptr) == NULL ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT entry size change SC failed") \ +} + +#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr) \ +if ( ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (cache_ptr)->index_size <= 0 ) || \ + ( (new_size) > (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + \ + (cache_ptr)->dirty_index_size) ) || \ + ( ( !((entry_ptr)->is_dirty ) || \ + ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \ + ( ( ((entry_ptr)->is_dirty) ) || \ + ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \ + ( ( (cache_ptr)->index_len == 1 ) && \ + ( (cache_ptr)->index_size != (new_size) ) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT entry size change SC failed") \ +} + +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ +if ( \ + ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->is_dirty != FALSE ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->dirty_index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT update for entry clean SC failed") \ +} + +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ +if ( \ + ( (cache_ptr) == NULL ) || \ + ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ + ( (cache_ptr)->index_len <= 0 ) || \ + ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->is_dirty != TRUE ) || \ + ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->clean_index_size < (entry_ptr)->size ) || \ + ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT update for entry dirty SC failed") \ +} + +#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ +if ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT update for entry clean SC failed") \ +} + +#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ +if ( (cache_ptr)->index_size != \ + ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT update for entry dirty SC failed") \ +} + +#else /* H5C_DO_SANITY_CHECKS */ + +#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) +#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) +#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) +#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) +#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) +#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) +#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr) +#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) +#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) + +#endif /* H5C_DO_SANITY_CHECKS */ + + +#define H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, fail_val) \ +{ \ + int k; \ + H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ + k = H5C__HASH_FCN((entry_ptr)->addr); \ + if ( ((cache_ptr)->index)[k] == NULL ) \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + else { \ + (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ + (entry_ptr)->ht_next->ht_prev = (entry_ptr); \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + } \ + (cache_ptr)->index_len++; \ + (cache_ptr)->index_size += (entry_ptr)->size; \ + if ( (entry_ptr)->is_dirty ) \ + (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ + else \ + (cache_ptr)->clean_index_size += (entry_ptr)->size; \ + if ((entry_ptr)->flush_me_last) { \ + (cache_ptr)->num_last_entries++; \ + HDassert((cache_ptr)->num_last_entries == 1); \ + } \ + H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ +} + +#define H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) \ +{ \ + int k; \ + H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ + k = H5C__HASH_FCN((entry_ptr)->addr); \ + if ( (entry_ptr)->ht_next ) \ + (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ + if ( (entry_ptr)->ht_prev ) \ + (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ + if ( ((cache_ptr)->index)[k] == (entry_ptr) ) \ + ((cache_ptr)->index)[k] = (entry_ptr)->ht_next; \ + (entry_ptr)->ht_next = NULL; \ + (entry_ptr)->ht_prev = NULL; \ + (cache_ptr)->index_len--; \ + (cache_ptr)->index_size -= (entry_ptr)->size; \ + if ( (entry_ptr)->is_dirty ) \ + (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ + else \ + (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ + if ((entry_ptr)->flush_me_last) { \ + (cache_ptr)->num_last_entries--; \ + HDassert((cache_ptr)->num_last_entries == 0); \ + } \ + H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ +} + +#define H5C__SEARCH_INDEX(cache_ptr, Addr, entry_ptr, fail_val) \ +{ \ + int k; \ + int depth = 0; \ + H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ + k = H5C__HASH_FCN(Addr); \ + entry_ptr = ((cache_ptr)->index)[k]; \ + while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) { \ + (entry_ptr) = (entry_ptr)->ht_next; \ + (depth)++; \ + } \ + if ( entry_ptr ) { \ + H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ + if ( entry_ptr != ((cache_ptr)->index)[k] ) { \ + if ( (entry_ptr)->ht_next ) \ + (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ + HDassert( (entry_ptr)->ht_prev != NULL ); \ + (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ + ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \ + (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ + (entry_ptr)->ht_prev = NULL; \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ + } \ + } \ + H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ +} + +#define H5C__SEARCH_INDEX_NO_STATS(cache_ptr, Addr, entry_ptr, fail_val) \ +{ \ + int k; \ + int depth = 0; \ + H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ + k = H5C__HASH_FCN(Addr); \ + entry_ptr = ((cache_ptr)->index)[k]; \ + while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) { \ + (entry_ptr) = (entry_ptr)->ht_next; \ + (depth)++; \ + } \ + if ( entry_ptr ) { \ + H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ + if ( entry_ptr != ((cache_ptr)->index)[k] ) { \ + if ( (entry_ptr)->ht_next ) \ + (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ + HDassert( (entry_ptr)->ht_prev != NULL ); \ + (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ + ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \ + (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ + (entry_ptr)->ht_prev = NULL; \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ + } \ + } \ +} + +#define H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr) \ +{ \ + H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ + (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ + (cache_ptr)->clean_index_size += (entry_ptr)->size; \ + H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ +} + +#define H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) \ +{ \ + H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ + (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ + (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ + H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ +} + +#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ +{ \ + H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ + (cache_ptr)->index_size -= (old_size); \ + (cache_ptr)->index_size += (new_size); \ + if ( was_clean ) \ + (cache_ptr)->clean_index_size -= (old_size); \ + else \ + (cache_ptr)->dirty_index_size -= (old_size); \ + if ( (entry_ptr)->is_dirty ) \ + (cache_ptr)->dirty_index_size += (new_size); \ + else \ + (cache_ptr)->clean_index_size += (new_size); \ + H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr) \ +} + + +/************************************************************************** * - * calls_to_msic: Total number of calls to H5C_make_space_in_cache + * Skip list insertion and deletion macros: * - * total_entries_skipped_in_msic: Number of clean entries skipped while - * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * These used to be functions, but I converted them to macros to avoid some + * function call overhead. * - * total_entries_scanned_in_msic: Number of clean entries skipped while - * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + **************************************************************************/ + +/*------------------------------------------------------------------------- * - * max_entries_skipped_in_msic: Maximum number of clean entries skipped - * in any one call to H5C_make_space_in_cache(). + * Macro: H5C__INSERT_ENTRY_IN_SLIST * - * max_entries_scanned_in_msic: Maximum number of entries scanned over - * in any one call to H5C_make_space_in_cache(). + * Purpose: Insert the specified instance of H5C_cache_entry_t into + * the skip list in the specified instance of H5C_t. Update + * the associated length and size fields. * - * entries_scanned_to_make_space: Number of entries scanned only when looking - * for entries to evict in order to make space in cache. - - * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS - * and H5C_COLLECT_CACHE_ENTRY_STATS are true. + * Return: N/A * - * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been - * accessed in the current epoch. + * Programmer: John Mainzer, 5/10/04 * - * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the minimum number of times any single - * entry with type id equal to the array index has been - * accessed in the current epoch. + * Modifications: * - * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been cleared - * in the current epoch. + * JRM -- 7/21/04 + * Updated function to set the in_tree flag when inserting + * an entry into the tree. Also modified the function to + * update the tree size and len fields instead of the similar + * index fields. * - * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been - * flushed in the current epoch. + * All of this is part of the modifications to support the + * hash table. * - * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum size of any single entry - * with type id equal to the array index that has resided in - * the cache in the current epoch. + * JRM -- 7/27/04 + * Converted the function H5C_insert_entry_in_tree() into + * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of + * wringing a little more speed out of the cache. * - * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times that any single - * entry with type id equal to the array index that has been - * marked as pinned in the cache in the current epoch. + * Note that we don't bother to check if the entry is already + * in the tree -- if it is, H5SL_insert() will fail. * + * QAK -- 11/27/04 + * Switched over to using skip list routines. * - * Fields supporting testing: + * JRM -- 6/27/06 + * Added fail_val parameter. * - * prefix Array of char used to prefix debugging output. The - * field is intended to allow marking of output of with - * the processes mpi rank. + * JRM -- 8/25/06 + * Added the H5C_DO_SANITY_CHECKS version of the macro. * - * get_entry_ptr_from_addr_counter: Counter used to track the number of - * times the H5C_get_entry_ptr_from_addr() function has been - * called successfully. This field is only defined when - * NDEBUG is not #defined. + * This version maintains the slist_len_increase and + * slist_size_increase fields that are used in sanity + * checks in the flush routines. * - ****************************************************************************/ - -#define H5C__HASH_TABLE_LEN (64 * 1024) /* must be a power of 2 */ - -#define H5C__H5C_T_MAGIC 0x005CAC0E -#define H5C__MAX_NUM_TYPE_IDS 27 -#define H5C__PREFIX_LEN 32 - -struct H5C_t -{ - uint32_t magic; - - hbool_t flush_in_progress; - - FILE * trace_file_ptr; - - void * aux_ptr; - - int32_t max_type_id; - const char * (* type_name_table_ptr); - - size_t max_cache_size; - size_t min_clean_size; - - H5C_write_permitted_func_t check_write_permitted; - hbool_t write_permitted; - - H5C_log_flush_func_t log_flush; - - hbool_t evictions_enabled; - - int32_t index_len; - size_t index_size; - size_t clean_index_size; - size_t dirty_index_size; - H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]); - - hbool_t ignore_tags; + * All this is needed as the fractal heap needs to be + * able to dirty, resize and/or move entries during the + * flush. + * + *------------------------------------------------------------------------- + */ - int32_t slist_len; - size_t slist_size; - H5SL_t * slist_ptr; - int32_t num_last_entries; #if H5C_DO_SANITY_CHECKS - int64_t slist_len_increase; - int64_t slist_size_increase; -#endif /* H5C_DO_SANITY_CHECKS */ - - int32_t pl_len; - size_t pl_size; - H5C_cache_entry_t * pl_head_ptr; - H5C_cache_entry_t * pl_tail_ptr; - - int32_t pel_len; - size_t pel_size; - H5C_cache_entry_t * pel_head_ptr; - H5C_cache_entry_t * pel_tail_ptr; - - int32_t LRU_list_len; - size_t LRU_list_size; - H5C_cache_entry_t * LRU_head_ptr; - H5C_cache_entry_t * LRU_tail_ptr; - - int32_t cLRU_list_len; - size_t cLRU_list_size; - H5C_cache_entry_t * cLRU_head_ptr; - H5C_cache_entry_t * cLRU_tail_ptr; - - int32_t dLRU_list_len; - size_t dLRU_list_size; - H5C_cache_entry_t * dLRU_head_ptr; - H5C_cache_entry_t * dLRU_tail_ptr; - - hbool_t size_increase_possible; - hbool_t flash_size_increase_possible; - size_t flash_size_increase_threshold; - hbool_t size_decrease_possible; - hbool_t resize_enabled; - hbool_t cache_full; - hbool_t size_decreased; - H5C_auto_size_ctl_t resize_ctl; - - int32_t epoch_markers_active; - hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS]; - int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1]; - int32_t epoch_marker_ringbuf_first; - int32_t epoch_marker_ringbuf_last; - int32_t epoch_marker_ringbuf_size; - H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS]; - - int64_t cache_hits; - int64_t cache_accesses; - -#if H5C_COLLECT_CACHE_STATS - - /* stats fields */ - int64_t hits[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t misses[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t write_protects[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t read_protects[H5C__MAX_NUM_TYPE_IDS + 1]; - int32_t max_read_protects[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t insertions[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t pinned_insertions[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t clears[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t flushes[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t evictions[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t moves[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t entry_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t cache_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t pins[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t unpins[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t dirty_pins[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t pinned_flushes[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t pinned_clears[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t size_increases[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t size_decreases[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t entry_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t cache_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1]; - - int64_t total_ht_insertions; - int64_t total_ht_deletions; - int64_t successful_ht_searches; - int64_t total_successful_ht_search_depth; - int64_t failed_ht_searches; - int64_t total_failed_ht_search_depth; - - int32_t max_index_len; - size_t max_index_size; - size_t max_clean_index_size; - size_t max_dirty_index_size; - - int32_t max_slist_len; - size_t max_slist_size; - - int32_t max_pl_len; - size_t max_pl_size; - - int32_t max_pel_len; - size_t max_pel_size; - - int64_t calls_to_msic; - int64_t total_entries_skipped_in_msic; - int64_t total_entries_scanned_in_msic; - int32_t max_entries_skipped_in_msic; - int32_t max_entries_scanned_in_msic; - int64_t entries_scanned_to_make_space; - -#if H5C_COLLECT_CACHE_ENTRY_STATS - - int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; - int32_t min_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; - int32_t max_clears[H5C__MAX_NUM_TYPE_IDS + 1]; - int32_t max_flushes[H5C__MAX_NUM_TYPE_IDS + 1]; - size_t max_size[H5C__MAX_NUM_TYPE_IDS + 1]; - int32_t max_pins[H5C__MAX_NUM_TYPE_IDS + 1]; - -#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ - -#endif /* H5C_COLLECT_CACHE_STATS */ - char prefix[H5C__PREFIX_LEN]; +#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ + HDassert( !((entry_ptr)->in_slist) ); \ + \ + if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "Can't insert entry in skip list") \ + \ + (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_len++; \ + (cache_ptr)->slist_size += (entry_ptr)->size; \ + (cache_ptr)->slist_len_increase++; \ + (cache_ptr)->slist_size_increase += (int64_t)((entry_ptr)->size); \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( (cache_ptr)->slist_size > 0 ); \ + \ +} /* H5C__INSERT_ENTRY_IN_SLIST */ -#ifndef NDEBUG +#else /* H5C_DO_SANITY_CHECKS */ - int64_t get_entry_ptr_from_addr_counter; +#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ + HDassert( !((entry_ptr)->in_slist) ); \ + \ + if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "Can't insert entry in skip list") \ + \ + (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_len++; \ + (cache_ptr)->slist_size += (entry_ptr)->size; \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( (cache_ptr)->slist_size > 0 ); \ + \ +} /* H5C__INSERT_ENTRY_IN_SLIST */ -#endif /* NDEBUG */ -}; +#endif /* H5C_DO_SANITY_CHECKS */ -/****************************************************************************/ -/***************************** Macro Definitions ****************************/ -/****************************************************************************/ - -/**************************************************************************** - * - * We maintain doubly linked lists of instances of H5C_cache_entry_t for a - * variety of reasons -- protected list, LRU list, and the clean and dirty - * LRU lists at present. The following macros support linking and unlinking - * of instances of H5C_cache_entry_t by both their regular and auxilary next - * and previous pointers. - * - * The size and length fields are also maintained. - * - * Note that the relevant pair of prev and next pointers are presumed to be - * NULL on entry in the insertion macros. - * - * Finally, observe that the sanity checking macros evaluate to the empty - * string when H5C_DO_SANITY_CHECKS is FALSE. They also contain calls - * to the HGOTO_ERROR macro, which may not be appropriate in all cases. - * If so, we will need versions of the insertion and deletion macros which - * do not reference the sanity checking macros. - * JRM - 5/5/04 - * - * Changes: - * - * - Removed the line: +/*------------------------------------------------------------------------- * - * ( ( (Size) == (entry_ptr)->size ) && ( (len) != 1 ) ) || + * Function: H5C__REMOVE_ENTRY_FROM_SLIST * - * from the H5C__DLL_PRE_REMOVE_SC macro. With the addition of the - * epoch markers used in the age out based cache size reduction algorithm, - * this invarient need not hold, as the epoch markers are of size 0. + * Purpose: Remove the specified instance of H5C_cache_entry_t from the + * index skip list in the specified instance of H5C_t. Update + * the associated length and size fields. * - * One could argue that I should have given the epoch markers a positive - * size, but this would break the index_size = LRU_list_size + pl_size - * + pel_size invarient. + * Return: N/A * - * Alternatively, I could pass the current decr_mode in to the macro, - * and just skip the check whenever epoch markers may be in use. + * Programmer: John Mainzer, 5/10/04 * - * However, any size errors should be caught when the cache is flushed - * and destroyed. Until we are tracking such an error, this should be - * good enough. - * JRM - 12/9/04 + * Modifications: * + * JRM -- 7/21/04 + * Updated function for the addition of the hash table. * - * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: + * JRM - 7/27/04 + * Converted from the function H5C_remove_entry_from_tree() + * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of + * wringing a little more performance out of the cache. * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + * QAK -- 11/27/04 + * Switched over to using skip list routines. * - * with: + * JRM -- 3/28/07 + * Updated sanity checks for the new is_read_only and + * ro_ref_count fields in H5C_cache_entry_t. * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + *------------------------------------------------------------------------- + */ + +#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( (entry_ptr)->in_slist ); \ + HDassert( (cache_ptr)->slist_ptr ); \ + \ + if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ + != (entry_ptr) ) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ + "Can't delete entry from skip list.") \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + (cache_ptr)->slist_len--; \ + HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ + (cache_ptr)->slist_size -= (entry_ptr)->size; \ + (entry_ptr)->in_slist = FALSE; \ +} /* H5C__REMOVE_ENTRY_FROM_SLIST */ + + +/*------------------------------------------------------------------------- * - * Epoch markers have size 0, so we can now have a non-empty list with - * zero size. Hence the "( (Size) <= 0 )" clause cause false failures - * in the sanity check. Since "Size" is typically a size_t, it can't - * take on negative values, and thus the revised clause "( (Size) < 0 )" - * caused compiler warnings. - * JRM - 12/22/04 + * Function: H5C__UPDATE_SLIST_FOR_SIZE_CHANGE * - * - In the H5C__DLL_SC macro, replaced the lines: + * Purpose: Update cache_ptr->slist_size for a change in the size of + * and entry in the slist. * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || ( (cache_ptr)->size <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + * Return: N/A * - * with + * Programmer: John Mainzer, 9/07/05 * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || + * Modifications: * - * Epoch markers have size 0, so we can now have a non-empty list with - * zero size. Hence the "( (Size) <= 0 )" clause cause false failures - * in the sanity check. Since "Size" is typically a size_t, it can't - * take on negative values, and thus the revised clause "( (Size) < 0 )" - * caused compiler warnings. - * JRM - 1/10/05 + * JRM -- 8/27/06 + * Added the H5C_DO_SANITY_CHECKS version of the macro. * - * - Added the H5C__DLL_UPDATE_FOR_SIZE_CHANGE macro and the associated - * sanity checking macros. These macro are used to update the size of - * a DLL when one of its entries changes size. + * This version maintains the slist_size_increase field + * that are used in sanity checks in the flush routines. * - * JRM - 9/8/05 + * All this is needed as the fractal heap needs to be + * able to dirty, resize and/or move entries during the + * flush. * - ****************************************************************************/ + *------------------------------------------------------------------------- + */ #if H5C_DO_SANITY_CHECKS -#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ -if ( ( (head_ptr) == NULL ) || \ - ( (tail_ptr) == NULL ) || \ - ( (entry_ptr) == NULL ) || \ - ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ - ( ( (entry_ptr)->prev == NULL ) && ( (head_ptr) != (entry_ptr) ) ) || \ - ( ( (entry_ptr)->next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ - ( ( (len) == 1 ) && \ - ( ! ( ( (head_ptr) == (entry_ptr) ) && \ - ( (tail_ptr) == (entry_ptr) ) && \ - ( (entry_ptr)->next == NULL ) && \ - ( (entry_ptr)->prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ - ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre remove SC failed") \ -} - -#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ -if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (head_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( (Size) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL sanity check failed") \ -} - -#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ -if ( ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->next != NULL ) || \ - ( (entry_ptr)->prev != NULL ) || \ - ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (head_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre insert SC failed") \ -} +#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ + (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ + \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ +} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ -#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ -if ( ( (dll_len) <= 0 ) || \ - ( (dll_size) <= 0 ) || \ - ( (old_size) <= 0 ) || \ - ( (old_size) > (dll_size) ) || \ - ( (new_size) <= 0 ) || \ - ( ( (dll_len) == 1 ) && ( (old_size) != (dll_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL pre size update SC failed") \ -} +#else /* H5C_DO_SANITY_CHECKS */ -#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ -if ( ( (new_size) > (dll_size) ) || \ - ( ( (dll_len) == 1 ) && ( (new_size) != (dll_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL post size update SC failed") \ -} +#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ +} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ -#else /* H5C_DO_SANITY_CHECKS */ +#endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) -#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) + +/************************************************************************** + * + * Replacement policy update macros: + * + * These used to be functions, but I converted them to macros to avoid some + * function call overhead. + * + **************************************************************************/ -#endif /* H5C_DO_SANITY_CHECKS */ +/*------------------------------------------------------------------------- + * + * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS + * + * Purpose: For efficiency, we sometimes change the order of flushes -- + * but doing so can confuse the replacement policy. This + * macro exists to allow us to specify an entry as the + * most recently touched so we can repair any such + * confusion. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the macro + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 10/13/05 + * + * Modifications: + * + * JRM -- 3/20/06 + * Modified macro to ignore pinned entries. Pinned entries + * do not appear in the data structures maintained by the + * replacement policy code, and thus this macro has nothing + * to do if called for such an entry. + * + * JRM -- 3/28/07 + * Added sanity checks using the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ { \ - H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (tail_ptr)->next = (entry_ptr); \ - (entry_ptr)->prev = (tail_ptr); \ - (tail_ptr) = (entry_ptr); \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head.\ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Use the dirty flag to infer whether the entry is on the clean or \ + * dirty LRU list, and remove it. Then insert it at the head of \ + * the same LRU list. \ + * \ + * At least initially, all entries should be clean. That may \ + * change, so we may as well deal with both cases now. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ } \ - (len)++; \ - (Size) += (entry_ptr)->size; \ -} /* H5C__DLL_APPEND() */ +} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ -#define H5C__DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ -{ \ - H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (head_ptr)->prev = (entry_ptr); \ - (entry_ptr)->next = (head_ptr); \ - (head_ptr) = (entry_ptr); \ - } \ - (len)++; \ - (Size) += entry_ptr->size; \ -} /* H5C__DLL_PREPEND() */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ { \ - H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - { \ - if ( (head_ptr) == (entry_ptr) ) \ - { \ - (head_ptr) = (entry_ptr)->next; \ - if ( (head_ptr) != NULL ) \ - (head_ptr)->prev = NULL; \ - } \ - else \ - (entry_ptr)->prev->next = (entry_ptr)->next; \ - if ( (tail_ptr) == (entry_ptr) ) \ - { \ - (tail_ptr) = (entry_ptr)->prev; \ - if ( (tail_ptr) != NULL ) \ - (tail_ptr)->next = NULL; \ - } \ - else \ - (entry_ptr)->next->prev = (entry_ptr)->prev; \ - entry_ptr->next = NULL; \ - entry_ptr->prev = NULL; \ - (len)--; \ - (Size) -= entry_ptr->size; \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ } \ -} /* H5C__DLL_REMOVE() */ - -#define H5C__DLL_UPDATE_FOR_SIZE_CHANGE(dll_len, dll_size, old_size, new_size) \ -{ \ - H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ - (dll_size) -= (old_size); \ - (dll_size) += (new_size); \ - H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ -} /* H5C__DLL_UPDATE_FOR_SIZE_CHANGE() */ +} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ -#if H5C_DO_SANITY_CHECKS +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ -if ( ( (hd_ptr) == NULL ) || \ - ( (tail_ptr) == NULL ) || \ - ( (entry_ptr) == NULL ) || \ - ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ - ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ - ( ( (entry_ptr)->aux_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ - ( ( (entry_ptr)->aux_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ - ( ( (len) == 1 ) && \ - ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ - ( (entry_ptr)->aux_next == NULL ) && \ - ( (entry_ptr)->aux_prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ - ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "aux DLL pre remove SC failed") \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_EVICTION + * + * Purpose: Update the replacement policy data structures for an + * eviction of the specified cache entry. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: Non-negative on success/Negative on failure. + * + * Programmer: John Mainzer, 5/10/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_eviction() to the + * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze + * a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * the pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/20/06 + * Pinned entries can't be evicted, so this entry should never + * be called on a pinned entry. Added assert to verify this. + * + * JRM -- 3/28/07 + * Added sanity checks for the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ -if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (head_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( (Size) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->aux_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL sanity check failed") \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ -if ( ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->aux_next != NULL ) || \ - ( (entry_ptr)->aux_prev != NULL ) || \ - ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ - ( (hd_ptr) != (tail_ptr) ) \ - ) || \ - ( (len) < 0 ) || \ - ( ( (len) == 1 ) && \ - ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ - ) \ - ) || \ - ( ( (len) >= 1 ) && \ - ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->aux_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->aux_next != NULL ) \ - ) \ - ) \ - ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL pre insert SC failed") \ -} +#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( !((entry_ptr)->is_pinned) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* If the entry is clean when it is evicted, it should be on the \ + * clean LRU list, if it was dirty, it should be on the dirty LRU list. \ + * Remove it from the appropriate list according to the value of the \ + * dirty flag. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_EVICTION */ -#else /* H5C_DO_SANITY_CHECKS */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) -#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) -#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) +#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( !((entry_ptr)->is_pinned) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ +} /* H5C__UPDATE_RP_FOR_EVICTION */ -#endif /* H5C_DO_SANITY_CHECKS */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_FLUSH + * + * Purpose: Update the replacement policy data structures for a flush + * of the specified cache entry. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/6/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_flush() to the + * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze + * a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two versions, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/20/06 + * While pinned entries can be flushed, they don't reside in + * the replacement policy data structures when unprotected. + * Thus I modified this macro to do nothing if the entry is + * pinned. + * + * JRM - 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#define H5C__AUX_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val)\ -{ \ - H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ - fail_val) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (tail_ptr)->aux_next = (entry_ptr); \ - (entry_ptr)->aux_prev = (tail_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - (len)++; \ - (Size) += entry_ptr->size; \ -} /* H5C__AUX_DLL_APPEND() */ +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__AUX_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ -{ \ - H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ - if ( (head_ptr) == NULL ) \ - { \ - (head_ptr) = (entry_ptr); \ - (tail_ptr) = (entry_ptr); \ - } \ - else \ - { \ - (head_ptr)->aux_prev = (entry_ptr); \ - (entry_ptr)->aux_next = (head_ptr); \ - (head_ptr) = (entry_ptr); \ - } \ - (len)++; \ - (Size) += entry_ptr->size; \ -} /* H5C__AUX_DLL_PREPEND() */ +#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the \ + * head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* since the entry is being flushed or cleared, one would think \ + * that it must be dirty -- but that need not be the case. Use the \ + * dirty flag to infer whether the entry is on the clean or dirty \ + * LRU list, and remove it. Then insert it at the head of the \ + * clean LRU list. \ + * \ + * The function presumes that a dirty entry will be either cleared \ + * or flushed shortly, so it is OK if we put a dirty entry on the \ + * clean LRU list. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_FLUSH */ -#define H5C__AUX_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ -{ \ - H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ - { \ - if ( (head_ptr) == (entry_ptr) ) \ - { \ - (head_ptr) = (entry_ptr)->aux_next; \ - if ( (head_ptr) != NULL ) \ - (head_ptr)->aux_prev = NULL; \ - } \ - else \ - (entry_ptr)->aux_prev->aux_next = (entry_ptr)->aux_next; \ - if ( (tail_ptr) == (entry_ptr) ) \ - { \ - (tail_ptr) = (entry_ptr)->aux_prev; \ - if ( (tail_ptr) != NULL ) \ - (tail_ptr)->aux_next = NULL; \ - } \ - else \ - (entry_ptr)->aux_next->aux_prev = (entry_ptr)->aux_prev; \ - entry_ptr->aux_next = NULL; \ - entry_ptr->aux_prev = NULL; \ - (len)--; \ - (Size) -= entry_ptr->size; \ - } \ -} /* H5C__AUX_DLL_REMOVE() */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ((entry_ptr)->is_pinned) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the \ + * head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_FLUSH */ + +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -/*********************************************************************** +/*------------------------------------------------------------------------- * - * Stats collection macros + * Macro: H5C__UPDATE_RP_FOR_INSERTION * - * The following macros must handle stats collection when this collection - * is enabled, and evaluate to the empty string when it is not. + * Purpose: Update the replacement policy data structures for an + * insertion of the specified cache entry. * - * The sole exception to this rule is - * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as - * the cache hit rate stats are always collected and available. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * - * Changes: + * Return: N/A * - * JRM -- 3/21/06 - * Added / updated macros for pinned entry related stats. + * Programmer: John Mainzer, 5/17/04 * - * JRM -- 8/9/06 - * More pinned entry stats related updates. + * Modifications: * - * JRM -- 3/31/07 - * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on - * read and write protects. + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_insertion() to the + * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze + * a bit more performance out of the cache. * - * MAM -- 1/15/09 - * Created H5C__UPDATE_MAX_INDEX_SIZE_STATS to contain - * common code within macros that update the maximum - * index, clean_index, and dirty_index statistics fields. + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. * - ***********************************************************************/ - -#define H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) \ - (cache_ptr->cache_accesses)++; \ - if ( hit ) { \ - (cache_ptr->cache_hits)++; \ - } \ - -#if H5C_COLLECT_CACHE_STATS - -#define H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->index_size > (cache_ptr)->max_index_size ) \ - (cache_ptr)->max_index_size = (cache_ptr)->index_size; \ - if ( (cache_ptr)->clean_index_size > \ - (cache_ptr)->max_clean_index_size ) \ - (cache_ptr)->max_clean_index_size = \ - (cache_ptr)->clean_index_size; \ - if ( (cache_ptr)->dirty_index_size > \ - (cache_ptr)->max_dirty_index_size ) \ - (cache_ptr)->max_dirty_index_size = \ - (cache_ptr)->dirty_index_size; - -#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) \ - (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++; - -#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) \ - if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ - (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; - -#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \ - if ( cache_ptr->flush_in_progress ) { \ - ((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \ - } \ - if ( entry_ptr->flush_in_progress ) { \ - ((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \ - } \ - (((cache_ptr)->moves)[(entry_ptr)->type->id])++; - -#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\ - if ( cache_ptr->flush_in_progress ) { \ - ((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \ - } \ - if ( entry_ptr->flush_in_progress ) { \ - ((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \ - } \ - if ( (entry_ptr)->size < (new_size) ) { \ - ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ - (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ - } else if ( (entry_ptr)->size > (new_size) ) { \ - ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \ - } - -#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ - (cache_ptr)->total_ht_insertions++; - -#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ - (cache_ptr)->total_ht_deletions++; - -#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) \ - if ( success ) { \ - (cache_ptr)->successful_ht_searches++; \ - (cache_ptr)->total_successful_ht_search_depth += depth; \ - } else { \ - (cache_ptr)->failed_ht_searches++; \ - (cache_ptr)->total_failed_ht_search_depth += depth; \ - } - -#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \ - ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; - -#if H5C_COLLECT_CACHE_ENTRY_STATS - -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \ -{ \ - (entry_ptr)->accesses = 0; \ - (entry_ptr)->clears = 0; \ - (entry_ptr)->flushes = 0; \ - (entry_ptr)->pins = 0; \ -} - -#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ -{ \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) \ - (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ - ((entry_ptr)->clears)++; \ -} - -#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ -{ \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) \ - (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ - ((entry_ptr)->flushes)++; \ -} - -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ -{ \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->accesses > \ - ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] = \ - (entry_ptr)->accesses; \ - if ( (entry_ptr)->accesses < \ - ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] = \ - (entry_ptr)->accesses; \ - if ( (entry_ptr)->clears > \ - ((cache_ptr)->max_clears)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_clears)[(entry_ptr)->type->id] \ - = (entry_ptr)->clears; \ - if ( (entry_ptr)->flushes > \ - ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] \ - = (entry_ptr)->flushes; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ - = (entry_ptr)->size; \ - if ( (entry_ptr)->pins > \ - ((cache_ptr)->max_pins)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_pins)[(entry_ptr)->type->id] \ - = (entry_ptr)->pins; \ -} + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/10/06 + * This macro should never be called on a pinned entry. + * Inserted an assert to verify this. + * + * JRM - 8/9/06 + * Not any more. We must now allow insertion of pinned + * entries. Updated macro to support this. + * + * JRM - 3/28/07 + * Added sanity checks using the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ -{ \ - (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - (entry_ptr)->pins++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ - (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ - = (entry_ptr)->size; \ - } \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ -{ \ - if ( hit ) \ - ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ - else \ - ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ - if ( ! ((entry_ptr)->is_read_only) ) { \ - ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ - } else { \ - ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ - if ( ((entry_ptr)->ro_ref_count) > \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ - ((entry_ptr)->ro_ref_count); \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ - (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ - (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] = (entry_ptr)->size; \ - ((entry_ptr)->accesses)++; \ +#define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* insert the entry at the head of the clean or dirty LRU list as \ + * appropriate. \ + */ \ + \ + if ( entry_ptr->is_dirty ) { \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ } -#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ -{ \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - (entry_ptr)->pins++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +#define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ } -#else /* H5C_COLLECT_CACHE_ENTRY_STATS */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_PROTECT + * + * Purpose: Update the replacement policy data structures for a + * protect of the specified cache entry. + * + * To do this, unlink the specified entry from any data + * structures used by the replacement policy, and add the + * entry to the protected list. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/17/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_protect() to the + * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze + * a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/17/06 + * Modified macro to attempt to remove pinned entriese from + * the pinned entry list instead of from the data structures + * maintained by the replacement policy. + * + * JRM - 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ -{ \ - if ( (entry_ptr)->is_pinned ) \ - (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + +#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Similarly, remove the entry from the clean or dirty LRU list \ + * as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ + \ + /* Regardless of the replacement policy, or whether the entry is \ + * pinned, now add the entry to the protected list. \ + */ \ + \ + H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, \ + (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ +} /* H5C__UPDATE_RP_FOR_PROTECT */ -#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ -{ \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) \ - (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ -} +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; +#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list. */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ + \ + /* Regardless of the replacement policy, or whether the entry is \ + * pinned, now add the entry to the protected list. \ + */ \ + \ + H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, \ + (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ +} /* H5C__UPDATE_RP_FOR_PROTECT */ -#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ -{ \ - (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ - (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ -} +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ -{ \ - if ( hit ) \ - ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ - else \ - ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ - if ( ! ((entry_ptr)->is_read_only) ) \ - ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ - else { \ - ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ - if ( ((entry_ptr)->ro_ref_count) > \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ - ((entry_ptr)->ro_ref_count); \ - } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ - (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ - (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ - (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_MOVE + * + * Purpose: Update the replacement policy data structures for a + * move of the specified cache entry. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/17/04 + * + *------------------------------------------------------------------------- + */ -#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ -{ \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ +#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ( (entry_ptr)->is_pinned ) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* remove the entry from either the clean or dirty LUR list as \ + * indicated by the was_dirty parameter \ + */ \ + if ( was_dirty ) { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_REMOVE((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ + \ + /* insert the entry at the head of either the clean or dirty \ + * LRU list as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_MOVE */ -#else /* H5C_COLLECT_CACHE_STATS */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) -#define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) -#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) -#define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) -#define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) -#define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) -#define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) -#define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) +#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( ! ( (entry_ptr)->is_pinned ) ) { \ + \ + /* modified LRU specific code */ \ + \ + /* remove the entry from the LRU list, and re-insert it at the head. \ + */ \ + \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_MOVE */ -#endif /* H5C_COLLECT_CACHE_STATS */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -/*********************************************************************** +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE + * + * Purpose: Update the replacement policy data structures for a + * size change of the specified cache entry. * - * Hash table access and manipulation macros: + * To do this, determine if the entry is pinned. If it is, + * update the size of the pinned entry list. * - * The following macros handle searches, insertions, and deletion in - * the hash table. + * If it isn't pinned, the entry must handled by the + * replacement policy. Update the appropriate replacement + * policy data structures. * - * When modifying these macros, remember to modify the similar macros - * in tst/cache.c + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * - * Changes: + * Return: N/A * - * - Updated existing index macros and sanity check macros to maintain - * the clean_index_size and dirty_index_size fields of H5C_t. Also - * added macros to allow us to track entry cleans and dirties. + * Programmer: John Mainzer, 8/23/06 * - * JRM -- 11/5/08 + * Modifications: * - ***********************************************************************/ - -/* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */ - -#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3) - -#define H5C__HASH_FCN(x) (int)(((x) & H5C__HASH_MASK) >> 3) - -#if H5C_DO_SANITY_CHECKS - -#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (entry_ptr) == NULL ) || \ - ( ! H5F_addr_defined((entry_ptr)->addr) ) || \ - ( (entry_ptr)->ht_next != NULL ) || \ - ( (entry_ptr)->ht_prev != NULL ) || \ - ( (entry_ptr)->size <= 0 ) || \ - ( (k = H5C__HASH_FCN((entry_ptr)->addr)) < 0 ) || \ - ( k >= H5C__HASH_TABLE_LEN ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Pre HT insert SC failed") \ -} - -#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len < 1 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( ! H5F_addr_defined((entry_ptr)->addr) ) || \ - ( (entry_ptr)->size <= 0 ) || \ - ( H5C__HASH_FCN((entry_ptr)->addr) < 0 ) || \ - ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \ - ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ - == NULL ) || \ - ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] \ - != (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev == NULL ) ) || \ - ( ( ((cache_ptr)->index)[(H5C__HASH_FCN((entry_ptr)->addr))] == \ - (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev != NULL ) ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ -} - -/* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ -#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ - ( ! H5F_addr_defined(Addr) ) || \ - ( H5C__HASH_FCN(Addr) < 0 ) || \ - ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "Pre HT search SC failed") \ -} - -/* (Keep in sync w/H5C_TEST__POST_SUC_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ -#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len < 1 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ - ( H5F_addr_ne((entry_ptr)->addr, (Addr)) ) || \ - ( (entry_ptr)->size <= 0 ) || \ - ( ((cache_ptr)->index)[k] == NULL ) || \ - ( ( ((cache_ptr)->index)[k] != (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev == NULL ) ) || \ - ( ( ((cache_ptr)->index)[k] == (entry_ptr) ) && \ - ( (entry_ptr)->ht_prev != NULL ) ) || \ - ( ( (entry_ptr)->ht_prev != NULL ) && \ - ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \ - ( ( (entry_ptr)->ht_next != NULL ) && \ - ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Post successful HT search SC failed") \ -} - -/* (Keep in sync w/H5C_TEST__POST_HT_SHIFT_TO_FRONT macro in test/cache_common.h -QAK) */ -#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ -if ( ( (cache_ptr) == NULL ) || \ - ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ - ( (entry_ptr)->ht_prev != NULL ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Post HT shift to front SC failed") \ -} + * JRM -- 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (cache_ptr)->index_size <= 0 ) || \ - ( (new_size) <= 0 ) || \ - ( (old_size) > (cache_ptr)->index_size ) || \ - ( (new_size) <= 0 ) || \ - ( ( (cache_ptr)->index_len == 1 ) && \ - ( (cache_ptr)->index_size != (old_size) ) ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) || \ - ( (entry_ptr == NULL) ) || \ - ( ( !( was_clean ) || \ - ( (cache_ptr)->clean_index_size < (old_size) ) ) && \ - ( ( (was_clean) ) || \ - ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \ - ( (entry_ptr) == NULL ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT entry size change SC failed") \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (cache_ptr)->index_size <= 0 ) || \ - ( (new_size) > (cache_ptr)->index_size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) || \ - ( ( !((entry_ptr)->is_dirty ) || \ - ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \ - ( ( ((entry_ptr)->is_dirty) ) || \ - ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \ - ( ( (cache_ptr)->index_len == 1 ) && \ - ( (cache_ptr)->index_size != (new_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT entry size change SC failed") \ -} +#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( new_size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* Update the size of the LRU list */ \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + /* Similarly, update the size of the clean or dirty LRU list as \ + * appropriate. At present, the entry must be clean, but that \ + * could change. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + } else { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ -if ( \ - ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->is_dirty != FALSE ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->dirty_index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT update for entry clean SC failed") \ -} +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ -if ( \ - ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_len <= 0 ) || \ - ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->is_dirty != TRUE ) || \ - ( (cache_ptr)->index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->clean_index_size < (entry_ptr)->size ) || \ - ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT update for entry dirty SC failed") \ -} +#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( new_size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* Update the size of the LRU list */ \ + \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ + /* End modified LRU specific code. */ \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ -#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ -if ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT update for entry clean SC failed") \ -} +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ -if ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT update for entry dirty SC failed") \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_UNPIN + * + * Purpose: Update the replacement policy data structures for an + * unpin of the specified cache entry. + * + * To do this, unlink the specified entry from the protected + * entry list, and re-insert it in the data structures used + * by the current replacement policy. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the macro + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 3/22/06 + * + * Modifications: + * + * JRM -- 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. + * + *------------------------------------------------------------------------- + */ -#else /* H5C_DO_SANITY_CHECKS */ +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) -#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) -#define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) -#define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) -#define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) -#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) -#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) +#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->is_pinned); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * pinned entry list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Similarly, insert the entry at the head of either the clean \ + * or dirty LRU list as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + \ +} /* H5C__UPDATE_RP_FOR_UNPIN */ -#endif /* H5C_DO_SANITY_CHECKS */ +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->is_pinned); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * pinned entry list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + \ +} /* H5C__UPDATE_RP_FOR_UNPIN */ +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, fail_val) \ -{ \ - int k; \ - H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ - k = H5C__HASH_FCN((entry_ptr)->addr); \ - if ( ((cache_ptr)->index)[k] == NULL ) \ - { \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - } \ - else \ - { \ - (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ - (entry_ptr)->ht_next->ht_prev = (entry_ptr); \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - } \ - (cache_ptr)->index_len++; \ - (cache_ptr)->index_size += (entry_ptr)->size; \ - if ( (entry_ptr)->is_dirty ) { \ - (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ - } else { \ - (cache_ptr)->clean_index_size += (entry_ptr)->size; \ - } \ - if ((entry_ptr)->flush_me_last) { \ - (cache_ptr)->num_last_entries++; \ - HDassert((cache_ptr)->num_last_entries == 1); \ - } \ - H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ -} + +/*------------------------------------------------------------------------- + * + * Macro: H5C__UPDATE_RP_FOR_UNPROTECT + * + * Purpose: Update the replacement policy data structures for an + * unprotect of the specified cache entry. + * + * To do this, unlink the specified entry from the protected + * list, and re-insert it in the data structures used by the + * current replacement policy. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 5/19/04 + * + * Modifications: + * + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_unprotect() to + * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to + * squeeze a bit more performance out of the cache. + * + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause dificulties with + * pre-processor, I'll have to remove them. + * + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. + * + * JRM - 3/17/06 + * Modified macro to put pinned entries on the pinned entry + * list instead of inserting them in the data structures + * maintained by the replacement policy. + * + *------------------------------------------------------------------------- + */ -#define H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) \ -{ \ - int k; \ - H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ - k = H5C__HASH_FCN((entry_ptr)->addr); \ - if ( (entry_ptr)->ht_next ) \ - { \ - (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ - } \ - if ( (entry_ptr)->ht_prev ) \ - { \ - (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ - } \ - if ( ((cache_ptr)->index)[k] == (entry_ptr) ) \ - { \ - ((cache_ptr)->index)[k] = (entry_ptr)->ht_next; \ - } \ - (entry_ptr)->ht_next = NULL; \ - (entry_ptr)->ht_prev = NULL; \ - (cache_ptr)->index_len--; \ - (cache_ptr)->index_size -= (entry_ptr)->size; \ - if ( (entry_ptr)->is_dirty ) { \ - (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ - } else { \ - (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ - } \ - if ((entry_ptr)->flush_me_last) { \ - (cache_ptr)->num_last_entries--; \ - HDassert((cache_ptr)->num_last_entries == 0); \ - } \ - H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ -} +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + +#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->is_protected); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * protected list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* Similarly, insert the entry at the head of either the clean or \ + * dirty LRU list as appropriate. \ + */ \ + \ + if ( (entry_ptr)->is_dirty ) { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + \ + } else { \ + \ + H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ + \ +} /* H5C__UPDATE_RP_FOR_UNPROTECT */ -#define H5C__SEARCH_INDEX(cache_ptr, Addr, entry_ptr, fail_val) \ -{ \ - int k; \ - int depth = 0; \ - H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ - k = H5C__HASH_FCN(Addr); \ - entry_ptr = ((cache_ptr)->index)[k]; \ - while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \ - { \ - (entry_ptr) = (entry_ptr)->ht_next; \ - (depth)++; \ - } \ - if ( entry_ptr ) \ - { \ - H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ - if ( entry_ptr != ((cache_ptr)->index)[k] ) \ - { \ - if ( (entry_ptr)->ht_next ) \ - { \ - (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ - } \ - HDassert( (entry_ptr)->ht_prev != NULL ); \ - (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ - ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \ - (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ - (entry_ptr)->ht_prev = NULL; \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ - } \ - } \ - H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ -} +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__SEARCH_INDEX_NO_STATS(cache_ptr, Addr, entry_ptr, fail_val) \ -{ \ - int k; \ - int depth = 0; \ - H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ - k = H5C__HASH_FCN(Addr); \ - entry_ptr = ((cache_ptr)->index)[k]; \ - while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \ - { \ - (entry_ptr) = (entry_ptr)->ht_next; \ - (depth)++; \ - } \ - if ( entry_ptr ) \ - { \ - H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k, fail_val) \ - if ( entry_ptr != ((cache_ptr)->index)[k] ) \ - { \ - if ( (entry_ptr)->ht_next ) \ - { \ - (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ - } \ - HDassert( (entry_ptr)->ht_prev != NULL ); \ - (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ - ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \ - (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ - (entry_ptr)->ht_prev = NULL; \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ - } \ - } \ -} +#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->is_protected); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + /* Regardless of the replacement policy, remove the entry from the \ + * protected list. \ + */ \ + H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ + (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ + (cache_ptr)->pl_size, (fail_val)) \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the head of the LRU list. */ \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} /* H5C__UPDATE_RP_FOR_UNPROTECT */ -#define H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr) \ -{ \ - H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ - (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ - (cache_ptr)->clean_index_size += (entry_ptr)->size; \ - H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ -} +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) \ -{ \ - H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ - (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ - (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ - H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ -} -#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ -{ \ - H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ - (cache_ptr)->index_size -= (old_size); \ - (cache_ptr)->index_size += (new_size); \ - if ( was_clean ) { \ - (cache_ptr)->clean_index_size -= (old_size); \ - } else { \ - (cache_ptr)->dirty_index_size -= (old_size); \ - } \ - if ( (entry_ptr)->is_dirty ) { \ - (cache_ptr)->dirty_index_size += (new_size); \ - } else { \ - (cache_ptr)->clean_index_size += (new_size); \ - } \ - H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ -} +/****************************/ +/* Package Private Typedefs */ +/****************************/ - -/************************************************************************** +/**************************************************************************** + * + * structure H5C_t + * + * Catchall structure for all variables specific to an instance of the cache. + * + * While the individual fields of the structure are discussed below, the + * following overview may be helpful. + * + * Entries in the cache are stored in an instance of H5TB_TREE, indexed on + * the entry's disk address. While the H5TB_TREE is less efficient than + * hash table, it keeps the entries in address sorted order. As flushes + * in parallel mode are more efficient if they are issued in increasing + * address order, this is a significant benefit. Also the H5TB_TREE code + * was readily available, which reduced development time. + * + * While the cache was designed with multiple replacement policies in mind, + * at present only a modified form of LRU is supported. + * + * JRM - 4/26/04 + * + * Profiling has indicated that searches in the instance of H5TB_TREE are + * too expensive. To deal with this issue, I have augmented the cache + * with a hash table in which all entries will be stored. Given the + * advantages of flushing entries in increasing address order, the TBBT + * is retained, but only dirty entries are stored in it. At least for + * now, we will leave entries in the TBBT after they are flushed. + * + * Note that index_size and index_len now refer to the total size of + * and number of entries in the hash table. + * + * JRM - 7/19/04 + * + * The TBBT has since been replaced with a skip list. This change + * greatly predates this note. + * + * JRM - 9/26/05 + * + * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. + * This field is used to validate pointers to instances of + * H5C_t. + * + * flush_in_progress: Boolean flag indicating whether a flush is in + * progress. + * + * trace_file_ptr: File pointer pointing to the trace file, which is used + * to record cache operations for use in simulations and design + * studies. This field will usually be NULL, indicating that + * no trace file should be recorded. + * + * Since much of the code supporting the parallel metadata + * cache is in H5AC, we don't write the trace file from + * H5C. Instead, H5AC reads the trace_file_ptr as needed. + * + * When we get to using H5C in other places, we may add + * code to write trace file data at the H5C level as well. + * + * aux_ptr: Pointer to void used to allow wrapper code to associate + * its data with an instance of H5C_t. The H5C cache code + * sets this field to NULL, and otherwise leaves it alone. + * + * max_type_id: Integer field containing the maximum type id number assigned + * to a type of entry in the cache. All type ids from 0 to + * max_type_id inclusive must be defined. The names of the + * types are stored in the type_name_table discussed below, and + * indexed by the ids. + * + * type_name_table_ptr: Pointer to an array of pointer to char of length + * max_type_id + 1. The strings pointed to by the entries + * in the array are the names of the entry types associated + * with the indexing type IDs. + * + * max_cache_size: Nominal maximum number of bytes that may be stored in the + * cache. This value should be viewed as a soft limit, as the + * cache can exceed this value under the following circumstances: + * + * a) All entries in the cache are protected, and the cache is + * asked to insert a new entry. In this case the new entry + * will be created. If this causes the cache to exceed + * max_cache_size, it will do so. The cache will attempt + * to reduce its size as entries are unprotected. + * + * b) When running in parallel mode, the cache may not be + * permitted to flush a dirty entry in response to a read. + * If there are no clean entries available to evict, the + * cache will exceed its maximum size. Again the cache + * will attempt to reduce its size to the max_cache_size + * limit on the next cache write. * - * Skip list insertion and deletion macros: + * c) When an entry increases in size, the cache may exceed + * the max_cache_size limit until the next time the cache + * attempts to load or insert an entry. * - * These used to be functions, but I converted them to macros to avoid some - * function call overhead. + * min_clean_size: Nominal minimum number of clean bytes in the cache. + * The cache attempts to maintain this number of bytes of + * clean data so as to avoid case b) above. Again, this is + * a soft limit. * - **************************************************************************/ - -/*------------------------------------------------------------------------- * - * Macro: H5C__INSERT_ENTRY_IN_SLIST + * In addition to the call back functions required for each entry, the + * cache requires the following call back functions for this instance of + * the cache as a whole: * - * Purpose: Insert the specified instance of H5C_cache_entry_t into - * the skip list in the specified instance of H5C_t. Update - * the associated length and size fields. + * check_write_permitted: In certain applications, the cache may not + * be allowed to write to disk at certain time. If specified, + * the check_write_permitted function is used to determine if + * a write is permissible at any given point in time. * - * Return: N/A + * If no such function is specified (i.e. this field is NULL), + * the cache uses the following write_permitted field to + * determine whether writes are permitted. * - * Programmer: John Mainzer, 5/10/04 + * write_permitted: If check_write_permitted is NULL, this boolean flag + * indicates whether writes are permitted. * - * Modifications: + * log_flush: If provided, this function is called whenever a dirty + * entry is flushed to disk. * - * JRM -- 7/21/04 - * Updated function to set the in_tree flag when inserting - * an entry into the tree. Also modified the function to - * update the tree size and len fields instead of the similar - * index fields. * - * All of this is part of the modifications to support the - * hash table. + * In cases where memory is plentiful, and performance is an issue, it may + * be useful to disable all cache evictions, and thereby postpone metadata + * writes. The following field is used to implement this. * - * JRM -- 7/27/04 - * Converted the function H5C_insert_entry_in_tree() into - * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of - * wringing a little more speed out of the cache. + * evictions_enabled: Boolean flag that is initialized to TRUE. When + * this flag is set to FALSE, the metadata cache will not + * attempt to evict entries to make space for newly protected + * entries, and instead the will grow without limit. + * + * Needless to say, this feature must be used with care. * - * Note that we don't bother to check if the entry is already - * in the tree -- if it is, H5SL_insert() will fail. * - * QAK -- 11/27/04 - * Switched over to using skip list routines. + * The cache requires an index to facilitate searching for entries. The + * following fields support that index. * - * JRM -- 6/27/06 - * Added fail_val parameter. + * index_len: Number of entries currently in the hash table used to index + * the cache. * - * JRM -- 8/25/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. + * index_size: Number of bytes of cache entries currently stored in the + * hash table used to index the cache. * - * This version maintains the slist_len_increase and - * slist_size_increase fields that are used in sanity - * checks in the flush routines. + * This value should not be mistaken for footprint of the + * cache in memory. The average cache entry is small, and + * the cache has a considerable overhead. Multiplying the + * index_size by two should yield a conservative estimate + * of the cache's memory footprint. * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. + * clean_index_size: Number of bytes of clean entries currently stored in + * the hash table. Note that the index_size field (above) + * is also the sum of the sizes of all entries in the cache. + * Thus we should have the invariant that clean_index_size + + * dirty_index_size == index_size. * - *------------------------------------------------------------------------- - */ - -#if H5C_DO_SANITY_CHECKS - -#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ - HDassert( !((entry_ptr)->in_slist) ); \ - \ - if ( H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) \ - < 0 ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ - "Can't insert entry in skip list") \ - \ - (entry_ptr)->in_slist = TRUE; \ - (cache_ptr)->slist_len++; \ - (cache_ptr)->slist_size += (entry_ptr)->size; \ - (cache_ptr)->slist_len_increase++; \ - (cache_ptr)->slist_size_increase += (int64_t)((entry_ptr)->size); \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( (cache_ptr)->slist_size > 0 ); \ - \ -} /* H5C__INSERT_ENTRY_IN_SLIST */ - -#else /* H5C_DO_SANITY_CHECKS */ - -#define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ - HDassert( !((entry_ptr)->in_slist) ); \ - \ - if ( H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) \ - < 0 ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ - "Can't insert entry in skip list") \ - \ - (entry_ptr)->in_slist = TRUE; \ - (cache_ptr)->slist_len++; \ - (cache_ptr)->slist_size += (entry_ptr)->size; \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( (cache_ptr)->slist_size > 0 ); \ - \ -} /* H5C__INSERT_ENTRY_IN_SLIST */ - -#endif /* H5C_DO_SANITY_CHECKS */ - - -/*------------------------------------------------------------------------- + * WARNING: * - * Function: H5C__REMOVE_ENTRY_FROM_SLIST + * 1) The clean_index_size field is not maintained by the + * index macros, as the hash table doesn't care whether + * the entry is clean or dirty. Instead the field is + * maintained in the H5C__UPDATE_RP macros. * - * Purpose: Remove the specified instance of H5C_cache_entry_t from the - * index skip list in the specified instance of H5C_t. Update - * the associated length and size fields. + * 2) The value of the clean_index_size must not be mistaken + * for the current clean size of the cache. Rather, the + * clean size of the cache is the current value of + * clean_index_size plus the amount of empty space (if any) + * in the cache. * - * Return: N/A + * dirty_index_size: Number of bytes of dirty entries currently stored in + * the hash table. Note that the index_size field (above) + * is also the sum of the sizes of all entries in the cache. + * Thus we should have the invariant that clean_index_size + + * dirty_index_size == index_size. * - * Programmer: John Mainzer, 5/10/04 + * WARNING: * - * Modifications: + * 1) The dirty_index_size field is not maintained by the + * index macros, as the hash table doesn't care whether + * the entry is clean or dirty. Instead the field is + * maintained in the H5C__UPDATE_RP macros. * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. + * index: Array of pointer to H5C_cache_entry_t of size + * H5C__HASH_TABLE_LEN. At present, this value is a power + * of two, not the usual prime number. * - * JRM - 7/27/04 - * Converted from the function H5C_remove_entry_from_tree() - * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of - * wringing a little more performance out of the cache. + * I hope that the variable size of cache elements, the large + * hash table size, and the way in which HDF5 allocates space + * will combine to avoid problems with periodicity. If so, we + * can use a trivial hash function (a bit-and and a 3 bit left + * shift) with some small savings. * - * QAK -- 11/27/04 - * Switched over to using skip list routines. + * If not, it will become evident in the statistics. Changing + * to the usual prime number length hash table will require + * changing the H5C__HASH_FCN macro and the deletion of the + * H5C__HASH_MASK #define. No other changes should be required. * - * JRM -- 3/28/07 - * Updated sanity checks for the new is_read_only and - * ro_ref_count fields in H5C_cache_entry_t. * - *------------------------------------------------------------------------- - */ - -#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( (entry_ptr)->in_slist ); \ - HDassert( (cache_ptr)->slist_ptr ); \ - \ - if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ - != (entry_ptr) ) \ - \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ - "Can't delete entry from skip list.") \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - (cache_ptr)->slist_len--; \ - HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ - (cache_ptr)->slist_size -= (entry_ptr)->size; \ - (entry_ptr)->in_slist = FALSE; \ -} /* H5C__REMOVE_ENTRY_FROM_SLIST */ - - -/*------------------------------------------------------------------------- + * With the addition of cache entry tagging, it is possible that + * an entry may be inserted into the cache without a tag during testing + * and the tag's validity shouldn't be checked. * - * Function: H5C__UPDATE_SLIST_FOR_SIZE_CHANGE + * The following field is maintained to facilitate this. * - * Purpose: Update cache_ptr->slist_size for a change in the size of - * and entry in the slist. + * ignore_tags: Boolean flag to disable tag validation during entry insertion. * - * Return: N/A + * When we flush the cache, we need to write entries out in increasing + * address order. An instance of a skip list is used to store dirty entries in + * sorted order. Whether it is cheaper to sort the dirty entries as needed, + * or to maintain the list is an open question. At a guess, it depends + * on how frequently the cache is flushed. We will see how it goes. * - * Programmer: John Mainzer, 9/07/05 + * For now at least, I will not remove dirty entries from the list as they + * are flushed. (this has been changed -- dirty entries are now removed from + * the skip list as they are flushed. JRM - 10/25/05) * - * Modifications: + * slist_len: Number of entries currently in the skip list + * used to maintain a sorted list of dirty entries in the + * cache. + * + * slist_size: Number of bytes of cache entries currently stored in the + * skip list used to maintain a sorted list of + * dirty entries in the cache. + * + * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted + * list of dirty entries in the cache. This sorted list has + * two uses: + * + * a) It allows us to flush dirty entries in increasing address + * order, which results in significant savings. + * + * b) It facilitates checking for adjacent dirty entries when + * attempting to evict entries from the cache. While we + * don't use this at present, I hope that this will allow + * some optimizations when I get to it. + * + * num_last_entries: The number of entries in the cache that can only be + * flushed after all other entries in the cache have + * been flushed. At this time, this will only ever be + * one entry (the superblock), and the code has been + * protected with HDasserts to enforce this. This restraint + * can certainly be relaxed in the future if the need for + * multiple entries being flushed last arises, though + * explicit tests for that case should be added when said + * HDasserts are removed. * - * JRM -- 8/27/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. + * With the addition of the fractal heap, the cache must now deal with + * the case in which entries may be dirtied, moved, or have their sizes + * changed during a flush. To allow sanity checks in this situation, the + * following two fields have been added. They are only compiled in when + * H5C_DO_SANITY_CHECKS is TRUE. * - * This version maintains the slist_size_increase field - * that are used in sanity checks in the flush routines. + * slist_len_increase: Number of entries that have been added to the + * slist since the last time this field was set to zero. * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. + * slist_size_increase: Total size of all entries that have been added + * to the slist since the last time this field was set to + * zero. * - *------------------------------------------------------------------------- - */ - -#if H5C_DO_SANITY_CHECKS - -#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ - \ - (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ - (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ - \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ -} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ - -#else /* H5C_DO_SANITY_CHECKS */ - -#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ - \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ -} /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ - -#endif /* H5C_DO_SANITY_CHECKS */ - - -/************************************************************************** * - * Replacement policy update macros: + * When a cache entry is protected, it must be removed from the LRU + * list(s) as it cannot be either flushed or evicted until it is unprotected. + * The following fields are used to implement the protected list (pl). * - * These used to be functions, but I converted them to macros to avoid some - * function call overhead. + * pl_len: Number of entries currently residing on the protected list. * - **************************************************************************/ - -/*------------------------------------------------------------------------- + * pl_size: Number of bytes of cache entries currently residing on the + * protected list. * - * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS + * pl_head_ptr: Pointer to the head of the doubly linked list of protected + * entries. Note that cache entries on this list are linked + * by their next and prev fields. * - * Purpose: For efficiency, we sometimes change the order of flushes -- - * but doing so can confuse the replacement policy. This - * macro exists to allow us to specify an entry as the - * most recently touched so we can repair any such - * confusion. + * This field is NULL if the list is empty. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the macro - * should switch on the current policy and act accordingly. + * pl_tail_ptr: Pointer to the tail of the doubly linked list of protected + * entries. Note that cache entries on this list are linked + * by their next and prev fields. * - * Return: N/A + * This field is NULL if the list is empty. * - * Programmer: John Mainzer, 10/13/05 * - * Modifications: + * For very frequently used entries, the protect/unprotect overhead can + * become burdensome. To avoid this overhead, I have modified the cache + * to allow entries to be "pinned". A pinned entry is similar to a + * protected entry, in the sense that it cannot be evicted, and that + * the entry can be modified at any time. * - * JRM -- 3/20/06 - * Modified macro to ignore pinned entries. Pinned entries - * do not appear in the data structures maintained by the - * replacement policy code, and thus this macro has nothing - * to do if called for such an entry. + * Pinning an entry has the following implications: * - * JRM -- 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * 1) A pinned entry cannot be evicted. Thus unprotected + * pinned entries reside in the pinned entry list, instead + * of the LRU list(s) (or other lists maintained by the current + * replacement policy code). * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head.\ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Use the dirty flag to infer whether the entry is on the clean or \ - * dirty LRU list, and remove it. Then insert it at the head of \ - * the same LRU list. \ - * \ - * At least initially, all entries should be clean. That may \ - * change, so we may as well deal with both cases now. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * 2) A pinned entry can be accessed or modified at any time. + * Therefore, the cache must check with the entry owner + * before flushing it. If permission is denied, the + * cache just skips the entry in the flush. * - * Macro: H5C__UPDATE_RP_FOR_EVICTION + * 3) A pinned entry can be marked as dirty (and possibly + * change size) while it is unprotected. * - * Purpose: Update the replacement policy data structures for an - * eviction of the specified cache entry. + * 4) The flush-destroy code must allow pinned entries to + * be unpinned (and possibly unprotected) during the + * flush. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * Since pinned entries cannot be evicted, they must be kept on a pinned + * entry list (pel), instead of being entrusted to the replacement policy + * code. * - * Return: Non-negative on success/Negative on failure. + * Maintaining the pinned entry list requires the following fields: * - * Programmer: John Mainzer, 5/10/04 + * pel_len: Number of entries currently residing on the pinned + * entry list. * - * Modifications: + * pel_size: Number of bytes of cache entries currently residing on + * the pinned entry list. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_eviction() to the - * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze - * a bit more performance out of the cache. + * pel_head_ptr: Pointer to the head of the doubly linked list of pinned + * but not protected entries. Note that cache entries on + * this list are linked by their next and prev fields. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * the pre-processor, I'll have to remove them. + * This field is NULL if the list is empty. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * pel_tail_ptr: Pointer to the tail of the doubly linked list of pinned + * but not protected entries. Note that cache entries on + * this list are linked by their next and prev fields. * - * JRM - 3/20/06 - * Pinned entries can't be evicted, so this entry should never - * be called on a pinned entry. Added assert to verify this. + * This field is NULL if the list is empty. * - * JRM -- 3/28/07 - * Added sanity checks for the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( !((entry_ptr)->is_pinned) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* If the entry is clean when it is evicted, it should be on the \ - * clean LRU list, if it was dirty, it should be on the dirty LRU list. \ - * Remove it from the appropriate list according to the value of the \ - * dirty flag. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_EVICTION */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( !((entry_ptr)->is_pinned) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ -} /* H5C__UPDATE_RP_FOR_EVICTION */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * The cache must have a replacement policy, and the fields supporting this + * policy must be accessible from this structure. * - * Macro: H5C__UPDATE_RP_FOR_FLUSH + * While there has been interest in several replacement policies for + * this cache, the initial development schedule is tight. Thus I have + * elected to support only a modified LRU (least recently used) policy + * for the first cut. * - * Purpose: Update the replacement policy data structures for a flush - * of the specified cache entry. + * To further simplify matters, I have simply included the fields needed + * by the modified LRU in this structure. When and if we add support for + * other policies, it will probably be easiest to just add the necessary + * fields to this structure as well -- we only create one instance of this + * structure per file, so the overhead is not excessive. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. * - * Return: N/A + * Fields supporting the modified LRU policy: * - * Programmer: John Mainzer, 5/6/04 + * See most any OS text for a discussion of the LRU replacement policy. * - * Modifications: + * When operating in parallel mode, we must ensure that a read does not + * cause a write. If it does, the process will hang, as the write will + * be collective and the other processes will not know to participate. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_flush() to the - * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze - * a bit more performance out of the cache. + * To deal with this issue, I have modified the usual LRU policy by adding + * clean and dirty LRU lists to the usual LRU list. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. + * The clean LRU list is simply the regular LRU list with all dirty cache + * entries removed. * - * JRM - 7/28/04 - * Split macro into two versions, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * Similarly, the dirty LRU list is the regular LRU list with all the clean + * cache entries removed. * - * JRM - 3/20/06 - * While pinned entries can be flushed, they don't reside in - * the replacement policy data structures when unprotected. - * Thus I modified this macro to do nothing if the entry is - * pinned. + * When reading in parallel mode, we evict from the clean LRU list only. + * This implies that we must try to ensure that the clean LRU list is + * reasonably well stocked at all times. * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * We attempt to do this by trying to flush enough entries on each write + * to keep the cLRU_list_size >= min_clean_size. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the \ - * head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* since the entry is being flushed or cleared, one would think \ - * that it must be dirty -- but that need not be the case. Use the \ - * dirty flag to infer whether the entry is on the clean or dirty \ - * LRU list, and remove it. Then insert it at the head of the \ - * clean LRU list. \ - * \ - * The function presumes that a dirty entry will be either cleared \ - * or flushed shortly, so it is OK if we put a dirty entry on the \ - * clean LRU list. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_FLUSH */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the \ - * head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_FLUSH */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * Even if we start with a completely clean cache, a sequence of protects + * without unprotects can empty the clean LRU list. In this case, the + * cache must grow temporarily. At the next write, we will attempt to + * evict enough entries to reduce index_size to less than max_cache_size. + * While this will usually be possible, all bets are off if enough entries + * are protected. * - * Macro: H5C__UPDATE_RP_FOR_INSERTION + * Discussions of the individual fields used by the modified LRU replacement + * policy follow: * - * Purpose: Update the replacement policy data structures for an - * insertion of the specified cache entry. + * LRU_list_len: Number of cache entries currently on the LRU list. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * Observe that LRU_list_len + pl_len must always equal + * index_len. * - * Return: N/A + * LRU_list_size: Number of bytes of cache entries currently residing on the + * LRU list. * - * Programmer: John Mainzer, 5/17/04 + * Observe that LRU_list_size + pl_size must always equal + * index_size. * - * Modifications: + * LRU_head_ptr: Pointer to the head of the doubly linked LRU list. Cache + * entries on this list are linked by their next and prev fields. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_insertion() to the - * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze - * a bit more performance out of the cache. + * This field is NULL if the list is empty. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. + * LRU_tail_ptr: Pointer to the tail of the doubly linked LRU list. Cache + * entries on this list are linked by their next and prev fields. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * This field is NULL if the list is empty. * - * JRM - 3/10/06 - * This macro should never be called on a pinned entry. - * Inserted an assert to verify this. + * cLRU_list_len: Number of cache entries currently on the clean LRU list. * - * JRM - 8/9/06 - * Not any more. We must now allow insertion of pinned - * entries. Updated macro to support this. + * Observe that cLRU_list_len + dLRU_list_len must always + * equal LRU_list_len. * - * JRM - 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * cLRU_list_size: Number of bytes of cache entries currently residing on + * the clean LRU list. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* insert the entry at the head of the clean or dirty LRU list as \ - * appropriate. \ - */ \ - \ - if ( entry_ptr->is_dirty ) { \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- + * Observe that cLRU_list_size + dLRU_list_size must always + * equal LRU_list_size. + * + * cLRU_head_ptr: Pointer to the head of the doubly linked clean LRU list. + * Cache entries on this list are linked by their aux_next and + * aux_prev fields. + * + * This field is NULL if the list is empty. + * + * cLRU_tail_ptr: Pointer to the tail of the doubly linked clean LRU list. + * Cache entries on this list are linked by their aux_next and + * aux_prev fields. + * + * This field is NULL if the list is empty. + * + * dLRU_list_len: Number of cache entries currently on the dirty LRU list. + * + * Observe that cLRU_list_len + dLRU_list_len must always + * equal LRU_list_len. + * + * dLRU_list_size: Number of cache entries currently on the dirty LRU list. + * + * Observe that cLRU_list_len + dLRU_list_len must always + * equal LRU_list_len. + * + * dLRU_head_ptr: Pointer to the head of the doubly linked dirty LRU list. + * Cache entries on this list are linked by their aux_next and + * aux_prev fields. + * + * This field is NULL if the list is empty. + * + * dLRU_tail_ptr: Pointer to the tail of the doubly linked dirty LRU list. + * Cache entries on this list are linked by their aux_next and + * aux_prev fields. + * + * This field is NULL if the list is empty. + * + * + * Automatic cache size adjustment: + * + * While the default cache size is adequate for most cases, we can run into + * cases where the default is too small. Ideally, we will let the user + * adjust the cache size as required. However, this is not possible in all + * cases. Thus I have added automatic cache size adjustment code. + * + * The configuration for the automatic cache size adjustment is stored in + * the structure described below: + * + * size_increase_possible: Depending on the configuration data given + * in the resize_ctl field, it may or may not be possible + * to increase the size of the cache. Rather than test for + * all the ways this can happen, we simply set this flag when + * we receive a new configuration. + * + * flash_size_increase_possible: Depending on the configuration data given + * in the resize_ctl field, it may or may not be possible + * for a flash size increase to occur. We set this flag + * whenever we receive a new configuration so as to avoid + * repeated calculations. + * + * flash_size_increase_threshold: If a flash cache size increase is possible, + * this field is used to store the minimum size of a new entry + * or size increase needed to trigger a flash cache size + * increase. Note that this field must be updated whenever + * the size of the cache is changed. + * + * size_decrease_possible: Depending on the configuration data given + * in the resize_ctl field, it may or may not be possible + * to decrease the size of the cache. Rather than test for + * all the ways this can happen, we simply set this flag when + * we receive a new configuration. + * + * cache_full: Boolean flag used to keep track of whether the cache is + * full, so we can refrain from increasing the size of a + * cache which hasn't used up the space allotted to it. + * + * The field is initialized to FALSE, and then set to TRUE + * whenever we attempt to make space in the cache. + * + * resize_enabled: This is another convenience flag which is set whenever + * a new set of values for resize_ctl are provided. Very + * simply, + * + * resize_enabled = size_increase_possible || + * size_decrease_possible; + * + * size_decreased: Boolean flag set to TRUE whenever the maximum cache + * size is decreased. The flag triggers a call to + * H5C_make_space_in_cache() on the next call to H5C_protect(). + * + * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration + * data for automatic cache resizing. + * + * epoch_markers_active: Integer field containing the number of epoch + * markers currently in use in the LRU list. This value + * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1]. + * + * epoch_marker_active: Array of boolean of length H5C__MAX_EPOCH_MARKERS. + * This array is used to track which epoch markers are currently + * in use. + * + * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1. + * + * To manage the epoch marker cache entries, it is necessary + * to track their order in the LRU list. This is done with + * epoch_marker_ringbuf. When markers are inserted at the + * head of the LRU list, the index of the marker in the + * epoch_markers array is inserted at the tail of the ring + * buffer. When it becomes the epoch_marker_active'th marker + * in the LRU list, it will have worked its way to the head + * of the ring buffer as well. This allows us to remove it + * without scanning the LRU list if such is required. * - * Macro: H5C__UPDATE_RP_FOR_PROTECT + * epoch_marker_ringbuf_first: Integer field containing the index of the + * first entry in the ring buffer. * - * Purpose: Update the replacement policy data structures for a - * protect of the specified cache entry. + * epoch_marker_ringbuf_last: Integer field containing the index of the + * last entry in the ring buffer. * - * To do this, unlink the specified entry from any data - * structures used by the replacement policy, and add the - * entry to the protected list. + * epoch_marker_ringbuf_size: Integer field containing the number of entries + * in the ring buffer. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * epoch_markers: Array of instances of H5C_cache_entry_t of length + * H5C__MAX_EPOCH_MARKERS. The entries are used as markers + * in the LRU list to identify cache entries that haven't + * been accessed for some (small) specified number of + * epochs. These entries (if any) can then be evicted and + * the cache size reduced -- ideally without evicting any + * of the current working set. Needless to say, the epoch + * length and the number of epochs before an unused entry + * must be chosen so that all, or almost all, the working + * set will be accessed before the limit. * - * Return: N/A + * Epoch markers only appear in the LRU list, never in + * the index or slist. While they are of type + * H5C__EPOCH_MARKER_TYPE, and have associated class + * functions, these functions should never be called. * - * Programmer: John Mainzer, 5/17/04 + * The addr fields of these instances of H5C_cache_entry_t + * are set to the index of the instance in the epoch_markers + * array, the size is set to 0, and the type field points + * to the constant structure epoch_marker_class defined + * in H5C.c. The next and prev fields are used as usual + * to link the entry into the LRU list. * - * Modifications: + * All other fields are unused. * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_protect() to the - * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze - * a bit more performance out of the cache. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. + * Cache hit rate collection fields: * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * We supply the current cache hit rate on request, so we must keep a + * simple cache hit rate computation regardless of whether statistics + * collection is enabled. The following fields support this capability. * - * JRM - 3/17/06 - * Modified macro to attempt to remove pinned entriese from - * the pinned entry list instead of from the data structures - * maintained by the replacement policy. + * cache_hits: Number of cache hits since the last time the cache hit + * rate statistics were reset. Note that when automatic cache + * re-sizing is enabled, this field will be reset every automatic + * resize epoch. * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * cache_accesses: Number of times the cache has been accessed while + * since the last since the last time the cache hit rate statistics + * were reset. Note that when automatic cache re-sizing is enabled, + * this field will be reset every automatic resize epoch. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Similarly, remove the entry from the clean or dirty LRU list \ - * as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ - \ - /* Regardless of the replacement policy, or whether the entry is \ - * pinned, now add the entry to the protected list. \ - */ \ - \ - H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, \ - (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ -} /* H5C__UPDATE_RP_FOR_PROTECT */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list. */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ - \ - /* Regardless of the replacement policy, or whether the entry is \ - * pinned, now add the entry to the protected list. \ - */ \ - \ - H5C__DLL_APPEND((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, \ - (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ -} /* H5C__UPDATE_RP_FOR_PROTECT */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_MOVE + * Statistics collection fields: + * + * When enabled, these fields are used to collect statistics as described + * below. The first set are collected only when H5C_COLLECT_CACHE_STATS + * is true. + * + * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been in cache when requested in + * the current epoch. + * + * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has not been in cache when + * requested in the current epoch. + * + * write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry with + * type id equal to the array index has been write protected + * in the current epoch. + * + * Observe that (hits + misses) = (write_protects + read_protects). + * + * read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry with + * type id equal to the array index has been read protected in + * the current epoch. + * + * Observe that (hits + misses) = (write_protects + read_protects). + * + * max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to maximum number of simultaneous read + * protects on any entry with type id equal to the array index + * in the current epoch. + * + * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been inserted into the + * cache in the current epoch. + * + * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry + * with type id equal to the array index has been inserted + * pinned into the cache in the current epoch. + * + * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times a dirty entry with type + * id equal to the array index has been cleared in the current + * epoch. + * + * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been written to disk in the + * current epoch. + * + * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been evicted from the cache in + * the current epoch. + * + * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been moved in the current + * epoch. + * + * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry + * with type id equal to the array index has been moved + * during its flush callback in the current epoch. + * + * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry + * with type id equal to the array index has been moved + * during a cache flush in the current epoch. * - * Purpose: Update the replacement policy data structures for a - * move of the specified cache entry. + * pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been pinned in the current + * epoch. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * unpins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been unpinned in the current + * epoch. * - * Return: N/A + * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been marked dirty while pinned + * in the current epoch. * - * Programmer: John Mainzer, 5/17/04 + * pinned_flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry + * with type id equal to the array index has been flushed while + * pinned in the current epoch. * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ( (entry_ptr)->is_pinned ) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* remove the entry from either the clean or dirty LUR list as \ - * indicated by the was_dirty parameter \ - */ \ - if ( was_dirty ) { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_REMOVE((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ - \ - /* insert the entry at the head of either the clean or dirty \ - * LRU list as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_MOVE */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ( (entry_ptr)->is_pinned ) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head. \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_MOVE */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + * pinned_clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry + * with type id equal to the array index has been cleared while + * pinned in the current epoch. + * + * size_increases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry + * with type id equal to the array index has increased in + * size in the current epoch. + * + * size_decreases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry + * with type id equal to the array index has decreased in + * size in the current epoch. + * + * entry_flush_size_changes: Array of int64 of length + * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record + * the number of times an entry with type id equal to the + * array index has changed size while in its flush callback. + * + * cache_flush_size_changes: Array of int64 of length + * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record + * the number of times an entry with type id equal to the + * array index has changed size during a cache flush + * + * total_ht_insertions: Number of times entries have been inserted into the + * hash table in the current epoch. + * + * total_ht_deletions: Number of times entries have been deleted from the + * hash table in the current epoch. + * + * successful_ht_searches: int64 containing the total number of successful + * searches of the hash table in the current epoch. + * + * total_successful_ht_search_depth: int64 containing the total number of + * entries other than the targets examined in successful + * searches of the hash table in the current epoch. + * + * failed_ht_searches: int64 containing the total number of unsuccessful + * searches of the hash table in the current epoch. + * + * total_failed_ht_search_depth: int64 containing the total number of + * entries examined in unsuccessful searches of the hash + * table in the current epoch. + * + * max_index_len: Largest value attained by the index_len field in the + * current epoch. + * + * max_index_size: Largest value attained by the index_size field in the + * current epoch. + * + * max_clean_index_size: Largest value attained by the clean_index_size field + * in the current epoch. + * + * max_dirty_index_size: Largest value attained by the dirty_index_size field + * in the current epoch. + * + * max_slist_len: Largest value attained by the slist_len field in the + * current epoch. + * + * max_slist_size: Largest value attained by the slist_size field in the + * current epoch. + * + * max_pl_len: Largest value attained by the pl_len field in the + * current epoch. + * + * max_pl_size: Largest value attained by the pl_size field in the + * current epoch. + * + * max_pel_len: Largest value attained by the pel_len field in the + * current epoch. + * + * max_pel_size: Largest value attained by the pel_size field in the + * current epoch. + * + * calls_to_msic: Total number of calls to H5C_make_space_in_cache + * + * total_entries_skipped_in_msic: Number of clean entries skipped while + * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * + * total_entries_scanned_in_msic: Number of clean entries skipped while + * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * + * max_entries_skipped_in_msic: Maximum number of clean entries skipped + * in any one call to H5C_make_space_in_cache(). + * + * max_entries_scanned_in_msic: Maximum number of entries scanned over + * in any one call to H5C_make_space_in_cache(). + * + * entries_scanned_to_make_space: Number of entries scanned only when looking + * for entries to evict in order to make space in cache. - -/*------------------------------------------------------------------------- + * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS + * and H5C_COLLECT_CACHE_ENTRY_STATS are true. * - * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE + * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been + * accessed in the current epoch. * - * Purpose: Update the replacement policy data structures for a - * size change of the specified cache entry. + * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the minimum number of times any single + * entry with type id equal to the array index has been + * accessed in the current epoch. + * + * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been cleared + * in the current epoch. * - * To do this, determine if the entry is pinned. If it is, - * update the size of the pinned entry list. + * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been + * flushed in the current epoch. * - * If it isn't pinned, the entry must handled by the - * replacement policy. Update the appropriate replacement - * policy data structures. + * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum size of any single entry + * with type id equal to the array index that has resided in + * the cache in the current epoch. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times that any single + * entry with type id equal to the array index that has been + * marked as pinned in the cache in the current epoch. * - * Return: N/A * - * Programmer: John Mainzer, 8/23/06 + * Fields supporting testing: * - * Modifications: + * prefix Array of char used to prefix debugging output. The + * field is intended to allow marking of output of with + * the processes mpi rank. * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * get_entry_ptr_from_addr_counter: Counter used to track the number of + * times the H5C_get_entry_ptr_from_addr() function has been + * called successfully. This field is only defined when + * NDEBUG is not #defined. * - *------------------------------------------------------------------------- - */ + ****************************************************************************/ +struct H5C_t { + uint32_t magic; + hbool_t flush_in_progress; + FILE * trace_file_ptr; + void * aux_ptr; + int32_t max_type_id; + const char * (* type_name_table_ptr); + size_t max_cache_size; + size_t min_clean_size; + H5C_write_permitted_func_t check_write_permitted; + hbool_t write_permitted; + H5C_log_flush_func_t log_flush; + hbool_t evictions_enabled; -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + /* Fields for maintaining [hash table] index of entries */ + int32_t index_len; + size_t index_size; + size_t clean_index_size; + size_t dirty_index_size; + H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]); -#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( new_size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* Update the size of the LRU list */ \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - /* Similarly, update the size of the clean or dirty LRU list as \ - * appropriate. At present, the entry must be clean, but that \ - * could change. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - } else { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ + /* Field to disable tag validation */ + hbool_t ignore_tags; -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + int32_t slist_len; + size_t slist_size; + H5SL_t * slist_ptr; + int32_t num_last_entries; +#if H5C_DO_SANITY_CHECKS + int64_t slist_len_increase; + int64_t slist_size_increase; +#endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( new_size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* Update the size of the LRU list */ \ - \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ - /* End modified LRU specific code. */ \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_SIZE_CHANGE */ + /* Fields for tracking protected entries */ + int32_t pl_len; + size_t pl_size; + H5C_cache_entry_t * pl_head_ptr; + H5C_cache_entry_t * pl_tail_ptr; -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + /* Fields for tracking pinned entries */ + int32_t pel_len; + size_t pel_size; + H5C_cache_entry_t * pel_head_ptr; + H5C_cache_entry_t * pel_tail_ptr; - -/*------------------------------------------------------------------------- - * - * Macro: H5C__UPDATE_RP_FOR_UNPIN - * - * Purpose: Update the replacement policy data structures for an - * unpin of the specified cache entry. - * - * To do this, unlink the specified entry from the protected - * entry list, and re-insert it in the data structures used - * by the current replacement policy. - * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the macro - * should switch on the current policy and act accordingly. - * - * Return: N/A - * - * Programmer: John Mainzer, 3/22/06 - * - * Modifications: - * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * - *------------------------------------------------------------------------- - */ + /* Fields for complete LRU list of entries */ + int32_t LRU_list_len; + size_t LRU_list_size; + H5C_cache_entry_t * LRU_head_ptr; + H5C_cache_entry_t * LRU_tail_ptr; -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + /* Fields for clean LRU list of entries */ + int32_t cLRU_list_len; + size_t cLRU_list_size; + H5C_cache_entry_t * cLRU_head_ptr; + H5C_cache_entry_t * cLRU_tail_ptr; + + /* Fields for dirty LRU list of entries */ + int32_t dLRU_list_len; + size_t dLRU_list_size; + H5C_cache_entry_t * dLRU_head_ptr; + H5C_cache_entry_t * dLRU_tail_ptr; + + /* Fields for automatic cache size adjustment */ + hbool_t size_increase_possible; + hbool_t flash_size_increase_possible; + size_t flash_size_increase_threshold; + hbool_t size_decrease_possible; + hbool_t resize_enabled; + hbool_t cache_full; + hbool_t size_decreased; + H5C_auto_size_ctl_t resize_ctl; + + /* Fields for epoch markers used in automatic cache size adjustment */ + int32_t epoch_markers_active; + hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS]; + int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1]; + int32_t epoch_marker_ringbuf_first; + int32_t epoch_marker_ringbuf_last; + int32_t epoch_marker_ringbuf_size; + H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS]; + + /* Fields for cache hit rate collection */ + int64_t cache_hits; + int64_t cache_accesses; + +#if H5C_COLLECT_CACHE_STATS + /* stats fields */ + int64_t hits[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t misses[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t write_protects[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t read_protects[H5C__MAX_NUM_TYPE_IDS + 1]; + int32_t max_read_protects[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t insertions[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t pinned_insertions[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t clears[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t flushes[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t evictions[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t moves[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t entry_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t cache_flush_moves[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t pins[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t unpins[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t dirty_pins[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t pinned_flushes[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t pinned_clears[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t size_increases[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t size_decreases[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t entry_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t cache_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1]; + + /* Fields for hash table operations */ + int64_t total_ht_insertions; + int64_t total_ht_deletions; + int64_t successful_ht_searches; + int64_t total_successful_ht_search_depth; + int64_t failed_ht_searches; + int64_t total_failed_ht_search_depth; + int32_t max_index_len; + size_t max_index_size; + size_t max_clean_index_size; + size_t max_dirty_index_size; -#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->is_pinned); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * pinned entry list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Similarly, insert the entry at the head of either the clean \ - * or dirty LRU list as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - \ -} /* H5C__UPDATE_RP_FOR_UNPIN */ + /* Fields for in-order skip list */ + int32_t max_slist_len; + size_t max_slist_size; -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + /* Fields for protected entry list */ + int32_t max_pl_len; + size_t max_pl_size; -#define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->is_pinned); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * pinned entry list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - \ -} /* H5C__UPDATE_RP_FOR_UNPIN */ + /* Fields for pinned entry list */ + int32_t max_pel_len; + size_t max_pel_size; -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + /* Fields for tacking 'make space in cache' (msic) operations */ + int64_t calls_to_msic; + int64_t total_entries_skipped_in_msic; + int64_t total_entries_scanned_in_msic; + int32_t max_entries_skipped_in_msic; + int32_t max_entries_scanned_in_msic; + int64_t entries_scanned_to_make_space; - -/*------------------------------------------------------------------------- - * - * Macro: H5C__UPDATE_RP_FOR_UNPROTECT - * - * Purpose: Update the replacement policy data structures for an - * unprotect of the specified cache entry. - * - * To do this, unlink the specified entry from the protected - * list, and re-insert it in the data structures used by the - * current replacement policy. - * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. - * - * Return: N/A - * - * Programmer: John Mainzer, 5/19/04 - * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_unprotect() to - * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to - * squeeze a bit more performance out of the cache. - * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause dificulties with - * pre-processor, I'll have to remove them. - * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. - * - * JRM - 3/17/06 - * Modified macro to put pinned entries on the pinned entry - * list instead of inserting them in the data structures - * maintained by the replacement policy. - * - *------------------------------------------------------------------------- - */ +#if H5C_COLLECT_CACHE_ENTRY_STATS + int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; + int32_t min_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; + int32_t max_clears[H5C__MAX_NUM_TYPE_IDS + 1]; + int32_t max_flushes[H5C__MAX_NUM_TYPE_IDS + 1]; + size_t max_size[H5C__MAX_NUM_TYPE_IDS + 1]; + int32_t max_pins[H5C__MAX_NUM_TYPE_IDS + 1]; +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ +#endif /* H5C_COLLECT_CACHE_STATS */ -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + char prefix[H5C__PREFIX_LEN]; -#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->is_protected); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * protected list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Similarly, insert the entry at the head of either the clean or \ - * dirty LRU list as appropriate. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - \ - } else { \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ - \ -} /* H5C__UPDATE_RP_FOR_UNPROTECT */ +#ifndef NDEBUG + int64_t get_entry_ptr_from_addr_counter; +#endif /* NDEBUG */ +}; -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ +/*****************************/ +/* Package Private Variables */ +/*****************************/ -#define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->is_protected); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - /* Regardless of the replacement policy, remove the entry from the \ - * protected list. \ - */ \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pl_head_ptr, \ - (cache_ptr)->pl_tail_ptr, (cache_ptr)->pl_len, \ - (cache_ptr)->pl_size, (fail_val)) \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the head of the LRU list. */ \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__UPDATE_RP_FOR_UNPROTECT */ -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ +/******************************/ +/* Package Private Prototypes */ +/******************************/ #endif /* _H5Cpkg_H */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 301dd19..3413381 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -36,6 +36,9 @@ #include "H5private.h" /* Generic Functions */ #include "H5Fprivate.h" /* File access */ +/**************************/ +/* Library Private Macros */ +/**************************/ #define H5C_DO_SANITY_CHECKS 0 #define H5C_DO_TAGGING_SANITY_CHECKS 1 @@ -61,36 +64,162 @@ * H5C_COLLECT_CACHE_STATS is also defined to true. */ #if H5C_COLLECT_CACHE_STATS - #define H5C_COLLECT_CACHE_ENTRY_STATS 1 - #else - #define H5C_COLLECT_CACHE_ENTRY_STATS 0 - #endif /* H5C_COLLECT_CACHE_STATS */ - #ifdef H5_HAVE_PARALLEL - /* we must maintain the clean and dirty LRU lists when we are compiled * with parallel support. */ #define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 1 - #else /* H5_HAVE_PARALLEL */ - /* The clean and dirty LRU lists don't buy us anything here -- we may * want them on for testing on occasion, but in general they should be * off. */ #define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 0 - #endif /* H5_HAVE_PARALLEL */ +/* Flags returned from the 'flush' callback */ +#define H5C_CALLBACK__NO_FLAGS_SET 0x0 +#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1 +#define H5C_CALLBACK__MOVED_FLAG 0x2 -/* Typedef for the main structure for the cache (defined in H5Cpkg.h) */ +/* Upper and lower limits on cache size. These limits are picked + * out of a hat -- you should be able to change them as necessary. + * + * However, if you need a very big cache, you should also increase the + * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current + * upper bound on cache size is rather large for the current hash table + * size. + */ +#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024)) +#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024)) + +/* Default max cache size and min clean size are give here to make + * them generally accessable. + */ +#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024)) +#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024)) + +/* Maximum height of flush dependency relationships between entries. This is + * currently tuned to the extensible array (H5EA) data structure, which only + * requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible + * array needs 4 levels, plus another 2 levels are needed: one for the layer + * under the extensible array and one for the layer above it). + */ +#define H5C__NUM_FLUSH_DEP_HEIGHTS 6 + +#ifndef NDEBUG +/* Values for cache entry magic field */ +#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A +#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef +#endif /* NDEBUG */ + +/* Cache configuration validation definitions */ +#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1 +#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2 +#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4 +#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8 +#define H5C_RESIZE_CFG__VALIDATE_ALL \ +( \ + H5C_RESIZE_CFG__VALIDATE_GENERAL | \ + H5C_RESIZE_CFG__VALIDATE_INCREMENT | \ + H5C_RESIZE_CFG__VALIDATE_DECREMENT | \ + H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \ +) + +/* Cache configuration versions */ +#define H5C__CURR_AUTO_SIZE_CTL_VER 1 +#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1 + +/* Number of epoch markers active */ +#define H5C__MAX_EPOCH_MARKERS 10 + +/* Default configuration settings */ +#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f +#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f +#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024)) +#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024)) +#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024)) +#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f +#define H5C__DEF_AR_INCREMENT 2.0f +#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024)) +#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f +#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f +#define H5C__DEF_AR_DECREMENT 0.9f +#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024)) +#define H5C__DEF_AR_EPCHS_B4_EVICT 3 +#define H5C__DEF_AR_EMPTY_RESERVE 0.05f +#define H5C__MIN_AR_EPOCH_LENGTH 100 +#define H5C__DEF_AR_EPOCH_LENGTH 50000 +#define H5C__MAX_AR_EPOCH_LENGTH 1000000 + +/* #defines of flags used in the flags parameters in some of the + * cache calls. Note that not all flags are applicable + * to all function calls. Flags that don't apply to a particular + * function are ignored in that function. + * + * These flags apply to all function calls: + * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls) + * + * + * These flags apply to H5C_insert_entry(): + * H5C__SET_FLUSH_MARKER_FLAG + * H5C__PIN_ENTRY_FLAG + * + * These flags apply to H5C_protect() + * H5C__READ_ONLY_FLAG + * + * These flags apply to H5C_unprotect(): + * H5C__SET_FLUSH_MARKER_FLAG + * H5C__DELETED_FLAG + * H5C__DIRTIED_FLAG + * H5C__PIN_ENTRY_FLAG + * H5C__UNPIN_ENTRY_FLAG + * H5C__FREE_FILE_SPACE_FLAG + * H5C__TAKE_OWNERSHIP_FLAG + * + * These flags apply to H5C_expunge_entry(): + * H5C__FREE_FILE_SPACE_FLAG + * + * These flags apply to H5C_flush_cache(): + * H5C__FLUSH_INVALIDATE_FLAG + * H5C__FLUSH_CLEAR_ONLY_FLAG + * H5C__FLUSH_MARKED_ENTRIES_FLAG + * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination + * with H5C__FLUSH_INVALIDATE_FLAG) + * + * These flags apply to H5C_flush_single_entry(): + * H5C__FLUSH_INVALIDATE_FLAG + * H5C__FLUSH_CLEAR_ONLY_FLAG + * H5C__FLUSH_MARKED_ENTRIES_FLAG + * H5C__TAKE_OWNERSHIP_FLAG + */ +#define H5C__NO_FLAGS_SET 0x0000 +#define H5C__SET_FLUSH_MARKER_FLAG 0x0001 +#define H5C__DELETED_FLAG 0x0002 +#define H5C__DIRTIED_FLAG 0x0004 +#define H5C__PIN_ENTRY_FLAG 0x0008 +#define H5C__UNPIN_ENTRY_FLAG 0x0010 +#define H5C__FLUSH_INVALIDATE_FLAG 0x0020 +#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040 +#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080 +#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100 +#define H5C__READ_ONLY_FLAG 0x0200 +#define H5C__FREE_FILE_SPACE_FLAG 0x0800 +#define H5C__TAKE_OWNERSHIP_FLAG 0x1000 +#define H5C__FLUSH_LAST_FLAG 0x2000 +#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000 + + +/****************************/ +/* Library Private Typedefs */ +/****************************/ +/* Typedef for the main structure for the cache (defined in H5Cpkg.h) */ typedef struct H5C_t H5C_t; @@ -121,10 +250,6 @@ typedef struct H5C_t H5C_t; * Note that the space allocated on disk may not be contiguous. */ -#define H5C_CALLBACK__NO_FLAGS_SET 0x0 -#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1 -#define H5C_CALLBACK__MOVED_FLAG 0x2 - /* Actions that can be reported to 'notify' client callback */ typedef enum H5C_notify_action_t { H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache */ @@ -135,27 +260,18 @@ typedef enum H5C_notify_action_t { H5C_NOTIFY_ACTION_BEFORE_EVICT /* Entry is about to be evicted from cache */ } H5C_notify_action_t; -typedef void *(*H5C_load_func_t)(H5F_t *f, - hid_t dxpl_id, - haddr_t addr, - void *udata); -typedef herr_t (*H5C_flush_func_t)(H5F_t *f, - hid_t dxpl_id, - hbool_t dest, - haddr_t addr, - void *thing, - unsigned * flags_ptr); -typedef herr_t (*H5C_dest_func_t)(H5F_t *f, - void *thing); -typedef herr_t (*H5C_clear_func_t)(H5F_t *f, - void *thing, - hbool_t dest); -typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, - void *thing); -typedef herr_t (*H5C_size_func_t)(const H5F_t *f, - const void *thing, - size_t *size_ptr); - +/* Cache client callback function pointers */ +typedef void *(*H5C_load_func_t)(H5F_t *f, hid_t dxpl_id, haddr_t addr, + void *udata); +typedef herr_t (*H5C_flush_func_t)(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned *flags_ptr); +typedef herr_t (*H5C_dest_func_t)(H5F_t *f, void *thing); +typedef herr_t (*H5C_clear_func_t)(H5F_t *f, void *thing, hbool_t dest); +typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, void *thing); +typedef herr_t (*H5C_size_func_t)(const H5F_t *f, const void *thing, + size_t *size_ptr); + +/* Metadata cache client class definition */ typedef struct H5C_class_t { int id; H5C_load_func_t load; @@ -166,47 +282,11 @@ typedef struct H5C_class_t { H5C_size_func_t size; } H5C_class_t; - -/* Type defintions of call back functions used by the cache as a whole */ - +/* Type defintions of callback functions used by the cache as a whole */ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, - hbool_t * write_permitted_ptr); - -typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, - haddr_t addr, - hbool_t was_dirty, - unsigned flags); - -/* Upper and lower limits on cache size. These limits are picked - * out of a hat -- you should be able to change them as necessary. - * - * However, if you need a very big cache, you should also increase the - * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current - * upper bound on cache size is rather large for the current hash table - * size. - */ - -#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024)) -#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024)) - - -/* Default max cache size and min clean size are give here to make - * them generally accessable. - */ - -#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024)) -#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024)) - -/* Maximum height of flush dependency relationships between entries. This is - * currently tuned to the extensible array (H5EA) data structure, which only - * requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible - * array needs 4 levels, plus another 2 levels are needed: one for the layer - * under the extensible array and one for the layer above it). - */ - -#define H5C__NUM_FLUSH_DEP_HEIGHTS 6 - - + hbool_t *write_permitted_ptr); +typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, + hbool_t was_dirty, unsigned flags); /**************************************************************************** * @@ -578,21 +658,14 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * been pinned in cache in its life time. * ****************************************************************************/ - -#ifndef NDEBUG -#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A -#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef -#endif /* NDEBUG */ - -typedef struct H5C_cache_entry_t -{ +typedef struct H5C_cache_entry_t { #ifndef NDEBUG uint32_t magic; #endif /* NDEBUG */ - H5C_t * cache_ptr; + H5C_t * cache_ptr; haddr_t addr; size_t size; - const H5C_class_t * type; + const H5C_class_t * type; haddr_t tag; hbool_t is_dirty; hbool_t dirtied; @@ -613,39 +686,31 @@ typedef struct H5C_cache_entry_t hbool_t free_file_space_on_destroy; /* fields supporting the 'flush dependency' feature: */ - - struct H5C_cache_entry_t * flush_dep_parent; + struct H5C_cache_entry_t * flush_dep_parent; uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS]; unsigned flush_dep_height; hbool_t pinned_from_client; hbool_t pinned_from_cache; /* fields supporting the hash table: */ - - struct H5C_cache_entry_t * ht_next; - struct H5C_cache_entry_t * ht_prev; + struct H5C_cache_entry_t * ht_next; + struct H5C_cache_entry_t * ht_prev; /* fields supporting replacement policies: */ - - struct H5C_cache_entry_t * next; - struct H5C_cache_entry_t * prev; - struct H5C_cache_entry_t * aux_next; - struct H5C_cache_entry_t * aux_prev; + struct H5C_cache_entry_t * next; + struct H5C_cache_entry_t * prev; + struct H5C_cache_entry_t * aux_next; + struct H5C_cache_entry_t * aux_prev; #if H5C_COLLECT_CACHE_ENTRY_STATS - /* cache entry stats fields */ - int32_t accesses; int32_t clears; int32_t flushes; int32_t pins; - #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ - } H5C_cache_entry_t; - /**************************************************************************** * * structure H5C_auto_size_ctl_t @@ -886,41 +951,6 @@ typedef struct H5C_cache_entry_t * ****************************************************************************/ -#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1 -#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2 -#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4 -#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8 -#define H5C_RESIZE_CFG__VALIDATE_ALL \ -( \ - H5C_RESIZE_CFG__VALIDATE_GENERAL | \ - H5C_RESIZE_CFG__VALIDATE_INCREMENT | \ - H5C_RESIZE_CFG__VALIDATE_DECREMENT | \ - H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \ -) - -#define H5C__CURR_AUTO_SIZE_CTL_VER 1 -#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1 - -#define H5C__MAX_EPOCH_MARKERS 10 - -#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f -#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f -#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024)) -#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024)) -#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024)) -#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f -#define H5C__DEF_AR_INCREMENT 2.0f -#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024)) -#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f -#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f -#define H5C__DEF_AR_DECREMENT 0.9f -#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024)) -#define H5C__DEF_AR_EPCHS_B4_EVICT 3 -#define H5C__DEF_AR_EMPTY_RESERVE 0.05f -#define H5C__MIN_AR_EPOCH_LENGTH 100 -#define H5C__DEF_AR_EPOCH_LENGTH 50000 -#define H5C__MAX_AR_EPOCH_LENGTH 1000000 - enum H5C_resize_status { in_spec, @@ -934,301 +964,118 @@ enum H5C_resize_status not_full }; /* enum H5C_resize_conditions */ -typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr, - int32_t version, - double hit_rate, - enum H5C_resize_status status, - size_t old_max_cache_size, - size_t new_max_cache_size, - size_t old_min_clean_size, - size_t new_min_clean_size); +typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr, int32_t version, + double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, + size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size); -typedef struct H5C_auto_size_ctl_t -{ +typedef struct H5C_auto_size_ctl_t { /* general configuration fields: */ int32_t version; H5C_auto_resize_rpt_fcn rpt_fcn; - hbool_t set_initial_size; size_t initial_size; - double min_clean_fraction; - size_t max_size; size_t min_size; - int64_t epoch_length; - /* size increase control fields: */ enum H5C_cache_incr_mode incr_mode; - double lower_hr_threshold; - double increment; - hbool_t apply_max_increment; size_t max_increment; - enum H5C_cache_flash_incr_mode flash_incr_mode; double flash_multiple; double flash_threshold; - /* size decrease control fields: */ enum H5C_cache_decr_mode decr_mode; - double upper_hr_threshold; - double decrement; - hbool_t apply_max_decrement; size_t max_decrement; - int32_t epochs_before_eviction; - hbool_t apply_empty_reserve; double empty_reserve; - } H5C_auto_size_ctl_t; - -/* - * Library prototypes. - */ - -/* #defines of flags used in the flags parameters in some of the - * following function calls. Note that not all flags are applicable - * to all function calls. Flags that don't apply to a particular - * function are ignored in that function. - * - * These flags apply to all function calls: - * - * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls) - * - * - * These flags apply to H5C_insert_entry(): - * - * H5C__SET_FLUSH_MARKER_FLAG - * H5C__PIN_ENTRY_FLAG - * - * These flags apply to H5C_protect() - * - * H5C__READ_ONLY_FLAG - * - * These flags apply to H5C_unprotect(): - * - * H5C__SET_FLUSH_MARKER_FLAG - * H5C__DELETED_FLAG - * H5C__DIRTIED_FLAG - * H5C__PIN_ENTRY_FLAG - * H5C__UNPIN_ENTRY_FLAG - * H5C__FREE_FILE_SPACE_FLAG - * H5C__TAKE_OWNERSHIP_FLAG - * - * These flags apply to H5C_expunge_entry(): - * - * H5C__FREE_FILE_SPACE_FLAG - * - * These flags apply to H5C_flush_cache(): - * - * H5C__FLUSH_INVALIDATE_FLAG - * H5C__FLUSH_CLEAR_ONLY_FLAG - * H5C__FLUSH_MARKED_ENTRIES_FLAG - * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination - * with H5C__FLUSH_INVALIDATE_FLAG) - * - * These flags apply to H5C_flush_single_entry(): - * - * H5C__FLUSH_INVALIDATE_FLAG - * H5C__FLUSH_CLEAR_ONLY_FLAG - * H5C__FLUSH_MARKED_ENTRIES_FLAG - * H5C__TAKE_OWNERSHIP_FLAG - */ - -#define H5C__NO_FLAGS_SET 0x0000 -#define H5C__SET_FLUSH_MARKER_FLAG 0x0001 -#define H5C__DELETED_FLAG 0x0002 -#define H5C__DIRTIED_FLAG 0x0004 -#define H5C__PIN_ENTRY_FLAG 0x0008 -#define H5C__UNPIN_ENTRY_FLAG 0x0010 -#define H5C__FLUSH_INVALIDATE_FLAG 0x0020 -#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040 -#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080 -#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100 -#define H5C__READ_ONLY_FLAG 0x0200 -#define H5C__FREE_FILE_SPACE_FLAG 0x0800 -#define H5C__TAKE_OWNERSHIP_FLAG 0x1000 -#define H5C__FLUSH_LAST_FLAG 0x2000 -#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000 - -#ifdef H5_HAVE_PARALLEL -H5_DLL herr_t H5C_apply_candidate_list(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - H5C_t * cache_ptr, - int num_candidates, - haddr_t * candidates_list_ptr, - int mpi_rank, - int mpi_size); - -H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr); - -H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr); -#endif /* H5_HAVE_PARALLEL */ - -H5_DLL H5C_t * H5C_create(size_t max_cache_size, - size_t min_clean_size, - int max_type_id, - const char * (* type_name_table_ptr), - H5C_write_permitted_func_t check_write_permitted, - hbool_t write_permitted, - H5C_log_flush_func_t log_flush, - void * aux_ptr); - -H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, - int32_t version, - double hit_rate, - enum H5C_resize_status status, - size_t old_max_cache_size, - size_t new_max_cache_size, - size_t old_min_clean_size, - size_t new_min_clean_size); - -H5_DLL herr_t H5C_dest(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id); - -H5_DLL herr_t H5C_expunge_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - const H5C_class_t * type, - haddr_t addr, - unsigned flags); - -H5_DLL herr_t H5C_flush_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - unsigned flags); - -H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id); - -H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr, - H5C_auto_size_ctl_t *config_ptr); - -H5_DLL herr_t H5C_get_cache_size(H5C_t * cache_ptr, - size_t * max_size_ptr, - size_t * min_clean_size_ptr, - size_t * cur_size_ptr, - int32_t * cur_num_entries_ptr); - -H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t * cache_ptr, - double * hit_rate_ptr); - -H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, - haddr_t addr, - size_t * size_ptr, - hbool_t * in_cache_ptr, - hbool_t * is_dirty_ptr, - hbool_t * is_protected_ptr, - hbool_t * is_pinned_ptr, - hbool_t * is_flush_dep_parent_ptr, - hbool_t * is_flush_dep_child_ptr); - -H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr, - hbool_t * evictions_enabled_ptr); - +/***************************************/ +/* Library-private Function Prototypes */ +/***************************************/ + +H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size, + int max_type_id, const char *(*type_name_table_ptr), + H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted, + H5C_log_flush_func_t log_flush, void *aux_ptr); +H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version, + double hit_rate, enum H5C_resize_status status, + size_t old_max_cache_size, size_t new_max_cache_size, + size_t old_min_clean_size, size_t new_min_clean_size); +H5_DLL herr_t H5C_dest(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id); +H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, + const H5C_class_t *type, haddr_t addr, unsigned flags); +H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, + unsigned flags); +H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id); +H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, + H5C_auto_size_ctl_t *config_ptr); +H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr, + size_t *min_clean_size_ptr, size_t *cur_size_ptr, + int32_t *cur_num_entries_ptr); +H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr); +H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, + size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr, + hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr, + hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr); +H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr); H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr); - -H5_DLL herr_t H5C_insert_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - const H5C_class_t * type, - haddr_t addr, - void * thing, - unsigned int flags); - -H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - int32_t ce_array_len, - haddr_t *ce_array_ptr); - +H5_DLL herr_t H5C_insert_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, + const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags); +H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, int32_t ce_array_len, haddr_t *ce_array_ptr); H5_DLL herr_t H5C_mark_entry_dirty(void *thing); - -H5_DLL herr_t H5C_move_entry(H5C_t * cache_ptr, - const H5C_class_t * type, - haddr_t old_addr, - haddr_t new_addr); - +H5_DLL herr_t H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, + haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5C_pin_protected_entry(void *thing); - H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing); - -H5_DLL void * H5C_protect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - const H5C_class_t * type, - haddr_t addr, - void * udata, - unsigned flags); - -H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr); - +H5_DLL void * H5C_protect(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, + const H5C_class_t *type, haddr_t addr, void *udata, unsigned flags); +H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr); H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size); - H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, - H5C_auto_size_ctl_t *config_ptr); - -H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, - hbool_t evictions_enabled); - -H5_DLL herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix); - -H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t * cache_ptr, - FILE * trace_file_ptr); - -H5_DLL herr_t H5C_stats(H5C_t * cache_ptr, - const char * cache_name, - hbool_t display_detailed_stats); - -H5_DLL void H5C_stats__reset(H5C_t * cache_ptr); - -H5_DLL herr_t H5C_dump_cache(H5C_t * cache_ptr, - const char * cache_name); - + H5C_auto_size_ctl_t *config_ptr); +H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled); +H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix); +H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t *cache_ptr, FILE *trace_file_ptr); +H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, + hbool_t display_detailed_stats); +H5_DLL void H5C_stats__reset(H5C_t *cache_ptr); +H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name); H5_DLL herr_t H5C_unpin_entry(void *thing); - H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing); +H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, + const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags); +H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, + unsigned int tests); +H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr); +H5_DLL void H5C_retag_copied_metadata(H5C_t *cache_ptr, haddr_t metadata_tag); -H5_DLL herr_t H5C_unprotect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - const H5C_class_t * type, - haddr_t addr, - void * thing, - unsigned int flags); - -H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, - unsigned int tests); - -H5_DLL herr_t H5C_ignore_tags(H5C_t * cache_ptr); - -H5_DLL void H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag); +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t *cache_ptr, int num_candidates, + haddr_t *candidates_list_ptr, int mpi_rank, int mpi_size); +H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr); +H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr); +#endif /* H5_HAVE_PARALLEL */ #ifndef NDEBUG /* debugging functions */ - H5_DLL herr_t H5C_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, - void ** entry_ptr_ptr); - -H5_DLL herr_t H5C_verify_entry_type(const H5F_t * f, haddr_t addr, - const H5C_class_t * expected_type, - hbool_t * in_cache_ptr, - hbool_t * type_ok_ptr); - + void **entry_ptr_ptr); +H5_DLL herr_t H5C_verify_entry_type(const H5F_t *f, haddr_t addr, + const H5C_class_t *expected_type, hbool_t *in_cache_ptr, + hbool_t *type_ok_ptr); #endif /* NDEBUG */ #endif /* !_H5Cprivate_H */ diff --git a/test/cache.c b/test/cache.c index 9bf225e..85fbadb 100644 --- a/test/cache.c +++ b/test/cache.c @@ -235,7 +235,6 @@ static unsigned check_notify_cb(void); static unsigned smoke_check_1(void) { - const char * fcn_name = "smoke_check_1"; hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; int dirty_destroys = FALSE; @@ -256,20 +255,20 @@ smoke_check_1(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -287,7 +286,7 @@ smoke_check_1(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -305,7 +304,7 @@ smoke_check_1(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -323,7 +322,7 @@ smoke_check_1(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -334,7 +333,7 @@ smoke_check_1(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -347,7 +346,7 @@ smoke_check_1(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -358,7 +357,7 @@ smoke_check_1(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -371,13 +370,13 @@ smoke_check_1(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -387,7 +386,7 @@ smoke_check_1(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -420,7 +419,6 @@ smoke_check_1(void) static unsigned smoke_check_2(void) { - const char * fcn_name = "smoke_check_2"; hbool_t show_progress = FALSE; int dirty_unprotects = TRUE; int dirty_destroys = TRUE; @@ -441,20 +439,20 @@ smoke_check_2(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -472,7 +470,7 @@ smoke_check_2(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -490,7 +488,7 @@ smoke_check_2(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -508,7 +506,7 @@ smoke_check_2(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -519,7 +517,7 @@ smoke_check_2(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -532,7 +530,7 @@ smoke_check_2(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -543,7 +541,7 @@ smoke_check_2(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -556,13 +554,13 @@ smoke_check_2(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -572,7 +570,7 @@ smoke_check_2(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -604,7 +602,6 @@ smoke_check_2(void) static unsigned smoke_check_3(void) { - const char * fcn_name = "smoke_check_3"; hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; int dirty_destroys = FALSE; @@ -625,20 +622,20 @@ smoke_check_3(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -656,7 +653,7 @@ smoke_check_3(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -674,7 +671,7 @@ smoke_check_3(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -692,7 +689,7 @@ smoke_check_3(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -703,7 +700,7 @@ smoke_check_3(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -716,7 +713,7 @@ smoke_check_3(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -727,7 +724,7 @@ smoke_check_3(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -740,13 +737,13 @@ smoke_check_3(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -756,7 +753,7 @@ smoke_check_3(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -789,7 +786,6 @@ smoke_check_3(void) static unsigned smoke_check_4(void) { - const char * fcn_name = "smoke_check_4"; hbool_t show_progress = FALSE; int dirty_unprotects = TRUE; int dirty_destroys = TRUE; @@ -810,20 +806,20 @@ smoke_check_4(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -841,7 +837,7 @@ smoke_check_4(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -859,7 +855,7 @@ smoke_check_4(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -877,7 +873,7 @@ smoke_check_4(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -888,7 +884,7 @@ smoke_check_4(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -901,7 +897,7 @@ smoke_check_4(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -912,7 +908,7 @@ smoke_check_4(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -925,13 +921,13 @@ smoke_check_4(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -941,7 +937,7 @@ smoke_check_4(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -974,7 +970,6 @@ smoke_check_4(void) static unsigned smoke_check_5(void) { - const char * fcn_name = "smoke_check_5"; herr_t result; hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; @@ -1052,13 +1047,13 @@ smoke_check_5(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); @@ -1077,7 +1072,7 @@ smoke_check_5(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1089,7 +1084,7 @@ smoke_check_5(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1101,7 +1096,7 @@ smoke_check_5(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1113,7 +1108,7 @@ smoke_check_5(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1124,7 +1119,7 @@ smoke_check_5(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1137,7 +1132,7 @@ smoke_check_5(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1148,7 +1143,7 @@ smoke_check_5(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1161,13 +1156,13 @@ smoke_check_5(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1177,7 +1172,7 @@ smoke_check_5(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -1210,7 +1205,6 @@ smoke_check_5(void) static unsigned smoke_check_6(void) { - const char * fcn_name = "smoke_check_6"; herr_t result; hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; @@ -1285,13 +1279,13 @@ smoke_check_6(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); @@ -1310,7 +1304,7 @@ smoke_check_6(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1322,7 +1316,7 @@ smoke_check_6(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1334,7 +1328,7 @@ smoke_check_6(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1346,7 +1340,7 @@ smoke_check_6(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1357,7 +1351,7 @@ smoke_check_6(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1370,7 +1364,7 @@ smoke_check_6(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1381,7 +1375,7 @@ smoke_check_6(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1394,13 +1388,13 @@ smoke_check_6(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1410,7 +1404,7 @@ smoke_check_6(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -1443,7 +1437,6 @@ smoke_check_6(void) static unsigned smoke_check_7(void) { - const char * fcn_name = "smoke_check_7"; herr_t result; hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; @@ -1519,13 +1512,13 @@ smoke_check_7(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); @@ -1544,7 +1537,7 @@ smoke_check_7(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1556,7 +1549,7 @@ smoke_check_7(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1568,7 +1561,7 @@ smoke_check_7(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1580,7 +1573,7 @@ smoke_check_7(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1591,7 +1584,7 @@ smoke_check_7(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1604,7 +1597,7 @@ smoke_check_7(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1615,7 +1608,7 @@ smoke_check_7(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1628,13 +1621,13 @@ smoke_check_7(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1644,7 +1637,7 @@ smoke_check_7(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -1677,7 +1670,6 @@ smoke_check_7(void) static unsigned smoke_check_8(void) { - const char * fcn_name = "smoke_check_8"; herr_t result; hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; @@ -1753,13 +1745,13 @@ smoke_check_8(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); cache_ptr = file_ptr->shared->cache; @@ -1777,7 +1769,7 @@ smoke_check_8(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1789,7 +1781,7 @@ smoke_check_8(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1801,7 +1793,7 @@ smoke_check_8(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1813,7 +1805,7 @@ smoke_check_8(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1824,7 +1816,7 @@ smoke_check_8(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1837,7 +1829,7 @@ smoke_check_8(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1848,7 +1840,7 @@ smoke_check_8(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1861,13 +1853,13 @@ smoke_check_8(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1877,7 +1869,7 @@ smoke_check_8(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -1911,7 +1903,6 @@ smoke_check_8(void) static unsigned smoke_check_9(void) { - const char * fcn_name = "smoke_check_9"; herr_t result; hbool_t show_progress = FALSE; int dirty_unprotects = FALSE; @@ -1935,13 +1926,13 @@ smoke_check_9(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); @@ -1951,7 +1942,7 @@ smoke_check_9(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -1966,7 +1957,7 @@ smoke_check_9(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -1986,7 +1977,7 @@ smoke_check_9(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2001,7 +1992,7 @@ smoke_check_9(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2019,7 +2010,7 @@ smoke_check_9(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2034,7 +2025,7 @@ smoke_check_9(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2052,7 +2043,7 @@ smoke_check_9(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2067,7 +2058,7 @@ smoke_check_9(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -2078,7 +2069,7 @@ smoke_check_9(void) if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2093,7 +2084,7 @@ smoke_check_9(void) if ( show_progress ) /* 12 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2106,7 +2097,7 @@ smoke_check_9(void) if ( show_progress ) /* 13 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -2117,7 +2108,7 @@ smoke_check_9(void) if ( show_progress ) /* 14 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2132,7 +2123,7 @@ smoke_check_9(void) if ( show_progress ) /* 15 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2145,7 +2136,7 @@ smoke_check_9(void) if ( show_progress ) /* 16 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2161,13 +2152,13 @@ smoke_check_9(void) if ( show_progress ) /* 17 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 18 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2177,7 +2168,7 @@ smoke_check_9(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -2211,7 +2202,6 @@ smoke_check_9(void) static unsigned smoke_check_10(void) { - const char * fcn_name = "smoke_check_10"; herr_t result; hbool_t show_progress = FALSE; int dirty_unprotects = TRUE; @@ -2235,13 +2225,13 @@ smoke_check_10(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); @@ -2249,7 +2239,7 @@ smoke_check_10(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2267,7 +2257,7 @@ smoke_check_10(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2282,7 +2272,7 @@ smoke_check_10(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2300,7 +2290,7 @@ smoke_check_10(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2315,7 +2305,7 @@ smoke_check_10(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2333,7 +2323,7 @@ smoke_check_10(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2348,7 +2338,7 @@ smoke_check_10(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -2359,7 +2349,7 @@ smoke_check_10(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2374,7 +2364,7 @@ smoke_check_10(void) if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2387,7 +2377,7 @@ smoke_check_10(void) if ( show_progress ) /* 12 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2402,7 +2392,7 @@ smoke_check_10(void) if ( show_progress ) /* 13 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -2413,7 +2403,7 @@ smoke_check_10(void) if ( show_progress ) /* 14 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2428,7 +2418,7 @@ smoke_check_10(void) if ( show_progress ) /* 15 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2441,7 +2431,7 @@ smoke_check_10(void) if ( show_progress ) /* 16 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2456,13 +2446,13 @@ smoke_check_10(void) if ( show_progress ) /* 17 */ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 18 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2472,7 +2462,7 @@ smoke_check_10(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -2498,14 +2488,12 @@ smoke_check_10(void) * *------------------------------------------------------------------------- */ - static unsigned write_permitted_check(void) { #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - const char * fcn_name = "write_permitted_check"; hbool_t show_progress = FALSE; hbool_t display_stats = FALSE; int32_t lag = 10; @@ -2522,20 +2510,20 @@ write_permitted_check(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(1 * 1024 * 1024), (size_t)(0)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2553,7 +2541,7 @@ write_permitted_check(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); write_permitted = FALSE; @@ -2573,7 +2561,7 @@ write_permitted_check(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); write_permitted = TRUE; @@ -2593,7 +2581,7 @@ write_permitted_check(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -2604,7 +2592,7 @@ write_permitted_check(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* lag */ lag, @@ -2617,7 +2605,7 @@ write_permitted_check(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); write_permitted = FALSE; @@ -2634,13 +2622,13 @@ write_permitted_check(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2650,7 +2638,7 @@ write_permitted_check(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } #else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -2690,7 +2678,6 @@ write_permitted_check(void) static unsigned check_insert_entry(void) { - const char * fcn_name = "check_insert_entry"; int entry_type = PICO_ENTRY_TYPE; int i; herr_t result; @@ -2956,7 +2943,7 @@ check_insert_entry(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -2983,7 +2970,6 @@ check_insert_entry(void) static unsigned check_flush_cache(void) { - const char * fcn_name = "check_flush_cache"; H5F_t * file_ptr = NULL; TESTING("H5C_flush_cache() functionality"); @@ -3041,7 +3027,7 @@ check_flush_cache(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -3068,7 +3054,6 @@ check_flush_cache(void) static void check_flush_cache__empty_cache(H5F_t * file_ptr) { - /* const char * fcn_name = "check_flush_cache__empty_cache"; */ H5C_t * cache_ptr = file_ptr->shared->cache; herr_t result; @@ -3163,7 +3148,6 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) static void check_flush_cache__multi_entry(H5F_t * file_ptr) { - /* const char * fcn_name = "check_flush_cache__multi_entry"; */ H5C_t *cache_ptr = file_ptr->shared->cache; if ( cache_ptr == NULL ) { @@ -4830,7 +4814,6 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, int spec_size, struct flush_cache_test_spec spec[]) { - /* const char * fcn_name = "check_flush_cache__multi_entry_test"; */ H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; herr_t result; @@ -5055,7 +5038,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, int spec_size, struct pe_flush_cache_test_spec spec[]) { - /* const char * fcn_name = "check_flush_cache__pe_multi_entry_test"; */ H5C_t *cache_ptr = file_ptr->shared->cache; static char msg[128]; herr_t result; @@ -5295,7 +5277,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, static void check_flush_cache__flush_ops(H5F_t * file_ptr) { - /* const char * fcn_name = "check_flush_cache__flush_ops"; */ H5C_t *cache_ptr = file_ptr->shared->cache; if ( cache_ptr == NULL ) { @@ -9611,7 +9592,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, static void check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) { - /* const char * fcn_name = "check_flush_cache__flush_op_eviction_test"; */ H5C_t * cache_ptr = file_ptr->shared->cache; int i; int num_variable_entries = 8; @@ -12346,12 +12326,11 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, hbool_t expected_flushed, hbool_t expected_destroyed) { - /* const char * fcn_name = "check_flush_cache__single_entry_test"; */ H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; herr_t result; test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t * entry_ptr = NULL; if ( cache_ptr == NULL ) { @@ -12534,13 +12513,12 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, hbool_t expected_flushed, hbool_t expected_destroyed) { - /* const char *fcn_name = "check_flush_cache__pinned_single_entry_test"; */ H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; hbool_t expected_loaded = TRUE; herr_t result; test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t * entry_ptr = NULL; if ( cache_ptr == NULL ) { @@ -12726,7 +12704,6 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, static unsigned check_get_entry_status(void) { - const char * fcn_name = "check_get_entry_status"; static char msg[128]; herr_t result; hbool_t in_cache; @@ -12929,7 +12906,7 @@ check_get_entry_status(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -12956,7 +12933,6 @@ check_get_entry_status(void) static unsigned check_expunge_entry(void) { - const char * fcn_name = "check_expunge_entry"; static char msg[128]; herr_t result; hbool_t in_cache; @@ -13244,7 +13220,7 @@ check_expunge_entry(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -13272,7 +13248,6 @@ check_expunge_entry(void) static unsigned check_multiple_read_protect(void) { - const char * fcn_name = "check_multiple_read_protect()"; H5F_t * file_ptr = NULL; #if H5C_COLLECT_CACHE_STATS H5C_t * cache_ptr = NULL; @@ -13669,7 +13644,7 @@ check_multiple_read_protect(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -13697,7 +13672,6 @@ check_multiple_read_protect(void) static unsigned check_move_entry(void) { - const char * fcn_name = "check_move_entry"; int i; H5F_t * file_ptr = NULL; struct move_entry_test_spec test_specs[4] = @@ -13782,7 +13756,7 @@ check_move_entry(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -13814,7 +13788,6 @@ check_move_entry__run_test(H5F_t * file_ptr, int test_num, struct move_entry_test_spec * spec_ptr) { - /* const char * fcn_name = "check_move_entry__run_test"; */ H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; unsigned int flags = H5C__NO_FLAGS_SET; @@ -13950,7 +13923,6 @@ check_move_entry__run_test(H5F_t * file_ptr, static unsigned check_pin_protected_entry(void) { - const char * fcn_name = "check_pin_protected_entry"; static char msg[128]; herr_t result; H5F_t * file_ptr = NULL; @@ -14025,7 +13997,7 @@ check_pin_protected_entry(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -14050,7 +14022,6 @@ check_pin_protected_entry(void) static unsigned check_resize_entry(void) { - const char * fcn_name = "check_resize_entry"; static char msg[128]; herr_t result; hbool_t in_cache; @@ -14062,7 +14033,7 @@ check_resize_entry(void) H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t * entry_ptr = NULL; TESTING("entry resize functionality"); @@ -15034,7 +15005,7 @@ check_resize_entry(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -15062,7 +15033,6 @@ check_resize_entry(void) static unsigned check_evictions_enabled(void) { - const char * fcn_name = "check_evictions_enabled"; static char msg[128]; herr_t result; hbool_t show_progress = FALSE; @@ -15116,7 +15086,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* create the cache */ if ( pass ) { @@ -15141,7 +15111,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that it is empty */ if ( pass ) { @@ -15161,7 +15131,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that H5C_get_evictions_enabled() returns the expected value */ if ( pass ) { @@ -15178,7 +15148,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15193,7 +15163,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that the cache is full */ if ( pass ) { @@ -15214,7 +15184,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15226,7 +15196,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that an entry has been evicted */ if ( pass ) { @@ -15246,7 +15216,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15283,7 +15253,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15294,7 +15264,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that another entry has been evicted */ if ( pass ) { @@ -15314,7 +15284,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15350,7 +15320,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 12 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* disable evictions */ if ( pass ) { @@ -15367,7 +15337,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 13 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that evictions are disabled */ if ( pass ) { @@ -15387,7 +15357,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 14 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15399,7 +15369,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 15 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that no entry has been evicted */ if ( pass ) { @@ -15419,7 +15389,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 16 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15430,7 +15400,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 17 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that no entry has been evicted */ if ( pass ) { @@ -15450,7 +15420,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 18 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* re-enable evictions */ if ( pass ) { @@ -15467,7 +15437,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 19 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15479,7 +15449,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 20 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that no entries have been evicted */ if ( pass ) { @@ -15499,7 +15469,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 21 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15511,7 +15481,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 22 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that the entries have been evicted to bring the * cache back down to its normal size. @@ -15534,7 +15504,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 23 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15570,7 +15540,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 24 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15606,7 +15576,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 25 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* disable evictions again */ if ( pass ) { @@ -15623,7 +15593,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 26 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15637,7 +15607,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 27 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that the cache has grown */ if ( pass ) { @@ -15657,7 +15627,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 28 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* re-enable evictions again */ if ( pass ) { @@ -15674,7 +15644,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 29 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15685,7 +15655,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 30 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* verify that the cache has returned to its maximum size */ if ( pass ) { @@ -15705,7 +15675,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 31 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15741,7 +15711,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 32 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* disable evictions one last time before we shut down */ if ( pass ) { @@ -15758,7 +15728,7 @@ check_evictions_enabled(void) if ( show_progress ) /* 33 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -15767,14 +15737,14 @@ check_evictions_enabled(void) if ( show_progress ) /* 34 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -15801,7 +15771,6 @@ check_evictions_enabled(void) static unsigned check_flush_protected_err(void) { - const char * fcn_name = "check_flush_protected_err"; H5F_t * file_ptr = NULL; TESTING("flush cache with protected entry error"); @@ -15850,7 +15819,7 @@ check_flush_protected_err(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -15881,7 +15850,6 @@ extern H5C_t * saved_cache; static unsigned check_destroy_pinned_err(void) { - const char * fcn_name = "check_destroy_pinned_err()"; H5F_t * file_ptr = NULL; TESTING("destroy cache with permanently pinned entry error"); @@ -15942,7 +15910,7 @@ check_destroy_pinned_err(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -15969,7 +15937,6 @@ check_destroy_pinned_err(void) static unsigned check_destroy_protected_err(void) { - const char * fcn_name = "check_destroy_protected_err"; H5F_t * file_ptr = NULL; TESTING("destroy cache with protected entry error"); @@ -16028,7 +15995,7 @@ check_destroy_protected_err(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16055,7 +16022,6 @@ check_destroy_protected_err(void) static unsigned check_duplicate_insert_err(void) { - const char * fcn_name = "check_duplicate_insert_err"; herr_t result = -1; H5F_t * file_ptr = NULL; test_entry_t * base_addr; @@ -16106,7 +16072,7 @@ check_duplicate_insert_err(void) if ( ! pass ) { HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16133,7 +16099,6 @@ check_duplicate_insert_err(void) static unsigned check_move_err(void) { - const char * fcn_name = "check_move_err()"; herr_t result; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; @@ -16201,7 +16166,7 @@ check_move_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16230,7 +16195,6 @@ check_move_err(void) static unsigned check_double_pin_err(void) { - const char * fcn_name = "check_double_pin_err()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -16289,7 +16253,7 @@ check_double_pin_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16318,7 +16282,6 @@ check_double_pin_err(void) static unsigned check_double_unpin_err(void) { - const char * fcn_name = "check_double_unpin_err()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -16388,7 +16351,7 @@ check_double_unpin_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16417,7 +16380,6 @@ check_double_unpin_err(void) static unsigned check_pin_entry_errs(void) { - const char * fcn_name = "check_pin_entry_errs()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -16499,7 +16461,7 @@ check_pin_entry_errs(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16524,7 +16486,6 @@ check_pin_entry_errs(void) static unsigned check_double_protect_err(void) { - const char * fcn_name = "check_double_protect_err()"; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; H5C_cache_entry_t * cache_entry_ptr; @@ -16577,7 +16538,7 @@ check_double_protect_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16602,7 +16563,6 @@ check_double_protect_err(void) static unsigned check_double_unprotect_err(void) { - const char * fcn_name = "check_double_unprotect_err()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -16654,7 +16614,7 @@ check_double_unprotect_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16682,7 +16642,6 @@ check_double_unprotect_err(void) static unsigned check_mark_entry_dirty_errs(void) { - const char * fcn_name = "check_mark_entry_dirty_errs()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -16734,7 +16693,7 @@ check_mark_entry_dirty_errs(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16763,7 +16722,6 @@ check_mark_entry_dirty_errs(void) static unsigned check_expunge_entry_errs(void) { - const char * fcn_name = "check_expunge_entry_errs()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -16858,7 +16816,7 @@ check_expunge_entry_errs(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16883,7 +16841,6 @@ check_expunge_entry_errs(void) static unsigned check_resize_entry_errs(void) { - const char * fcn_name = "check_resize_entry_errs()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -16960,7 +16917,7 @@ check_resize_entry_errs(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -16985,7 +16942,6 @@ check_resize_entry_errs(void) static unsigned check_unprotect_ro_dirty_err(void) { - const char * fcn_name = "check_unprotect_ro_dirty_err()"; herr_t result; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; @@ -17086,7 +17042,7 @@ check_unprotect_ro_dirty_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -17115,7 +17071,6 @@ check_unprotect_ro_dirty_err(void) static unsigned check_protect_ro_rw_err(void) { - const char * fcn_name = "check_protect_ro_rw_err()"; H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; void * thing_ptr = NULL; @@ -17169,7 +17124,7 @@ check_protect_ro_rw_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -17198,7 +17153,6 @@ check_protect_ro_rw_err(void) static unsigned check_check_evictions_enabled_err(void) { - const char * fcn_name = "check_evictions_enabled_err()"; herr_t result; hbool_t evictions_enabled; H5F_t * file_ptr = NULL; @@ -17308,7 +17262,7 @@ check_check_evictions_enabled_err(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -17357,7 +17311,6 @@ static void test_rpt_fcn(H5_ATTR_UNUSED H5C_t * cache_ptr, static unsigned check_auto_cache_resize(void) { - const char * fcn_name = "check_auto_cache_resize()"; hbool_t show_progress = FALSE; herr_t result; int32_t i; @@ -21534,7 +21487,7 @@ check_auto_cache_resize(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -21565,7 +21518,6 @@ check_auto_cache_resize(void) static unsigned check_auto_cache_resize_disable(void) { - const char * fcn_name = "check_auto_cache_resize_disable()"; hbool_t show_progress = FALSE; herr_t result; int32_t i; @@ -24264,7 +24216,7 @@ check_auto_cache_resize_disable(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -24291,7 +24243,6 @@ check_auto_cache_resize_disable(void) static unsigned check_auto_cache_resize_epoch_markers(void) { - const char * fcn_name = "check_auto_cache_resize_epoch_markers()"; hbool_t show_progress = FALSE; herr_t result; int32_t i; @@ -24969,7 +24920,7 @@ check_auto_cache_resize_epoch_markers(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -25001,7 +24952,6 @@ check_auto_cache_resize_epoch_markers(void) static unsigned check_auto_cache_resize_input_errs(void) { - const char * fcn_name = "check_auto_cache_resize_input_errs()"; herr_t result; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; @@ -27377,7 +27327,7 @@ check_auto_cache_resize_input_errs(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -27409,7 +27359,6 @@ check_auto_cache_resize_input_errs(void) static unsigned check_auto_cache_resize_aux_fcns(void) { - const char * fcn_name = "check_auto_cache_resize_aux_fcns()"; herr_t result; int32_t i; H5F_t * file_ptr = NULL; @@ -27529,7 +27478,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */ + } else if ( !H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f) ) { /* i.e. hit_rate != 0.0 */ pass = FALSE; failure_mssg = @@ -27562,7 +27511,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */ + } else if ( !H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f) ) { /* i.e. hit_rate != 0.0 */ pass = FALSE; failure_mssg = @@ -27607,7 +27556,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5f, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ + } else if ( ! H5_DBL_ABS_EQUAL(hit_rate, (double)0.5f) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = @@ -27690,7 +27639,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5F, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ + } else if ( ! H5_DBL_ABS_EQUAL(hit_rate, (double)0.5F) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = @@ -27916,7 +27865,7 @@ check_auto_cache_resize_aux_fcns(void) if ( ! pass ) { HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); } return (unsigned)!pass; @@ -27955,7 +27904,6 @@ check_auto_cache_resize_aux_fcns(void) static unsigned check_metadata_blizzard_absence(hbool_t fill_via_insertion) { - const char * fcn_name = "check_metadata_blizzard_absence"; int entry_type = HUGE_ENTRY_TYPE; size_t entry_size = HUGE_ENTRY_SIZE; /* 16 KB */ H5F_t * file_ptr = NULL; @@ -28142,7 +28090,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 0 */ HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28166,7 +28114,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 1 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -28230,7 +28178,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 2 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -28300,7 +28248,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 3 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28354,7 +28302,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 4 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28407,7 +28355,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 5 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -28482,7 +28430,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 6 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28554,7 +28502,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 7 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -28614,7 +28562,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 8 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28663,7 +28611,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 9 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28714,7 +28662,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 10 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28762,7 +28710,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 11 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { @@ -28773,7 +28721,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) if ( show_progress) /* 12 */ HDfprintf(stdout, "%s: check point %d -- pass %d\n", - fcn_name, checkpoint++, pass); + FUNC, checkpoint++, pass); if ( pass ) { PASSED(); } else { H5_FAILED(); } diff --git a/test/cache_api.c b/test/cache_api.c index 3c0871f..6953d17 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -70,7 +70,6 @@ static unsigned check_file_mdc_api_errs(void); static unsigned check_fapl_mdc_api_calls(void) { - const char * fcn_name = "check_fapl_mdc_api_calls()"; char filename[512]; herr_t result; hid_t fapl_id = -1; @@ -487,7 +486,7 @@ check_fapl_mdc_api_calls(void) if ( ! pass ) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); return !pass; @@ -521,7 +520,6 @@ check_fapl_mdc_api_calls(void) static unsigned check_file_mdc_api_calls(void) { - const char * fcn_name = "check_file_mdc_api_calls()"; char filename[512]; hid_t file_id = -1; size_t max_size; @@ -775,7 +773,7 @@ check_file_mdc_api_calls(void) pass = FALSE; failure_mssg = "H5Fget_mdc_hit_rate() failed 1.\n"; - } else if ( hit_rate != 0.0f ) { + } else if ( !H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f) ) { pass = FALSE; failure_mssg = @@ -839,7 +837,7 @@ check_file_mdc_api_calls(void) if ( ! pass ) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); return !pass; @@ -872,7 +870,6 @@ check_file_mdc_api_calls(void) static unsigned mdc_api_call_smoke_check(int express_test) { - const char * fcn_name = "mdc_api_call_smoke_check()"; char filename[512]; hbool_t valid_chunk; hbool_t dump_hit_rate = FALSE; @@ -884,7 +881,7 @@ mdc_api_call_smoke_check(int express_test) hid_t filespace_ids[NUM_DSETS]; hid_t memspace_id = -1; hid_t dataset_ids[NUM_DSETS]; - hid_t properties; + hid_t properties = -1; char dset_name[64]; int i, j, k, l, m, n; herr_t status; @@ -1187,8 +1184,8 @@ mdc_api_call_smoke_check(int express_test) } /* select on disk hyperslab */ - offset[0] = i; /*offset of hyperslab in file*/ - offset[1] = j; + offset[0] = (hsize_t)i; /*offset of hyperslab in file*/ + offset[1] = (hsize_t)j; a_size[0] = CHUNK_SIZE; /*size of hyperslab*/ a_size[1] = CHUNK_SIZE; status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET, @@ -1258,8 +1255,8 @@ mdc_api_call_smoke_check(int express_test) j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; /* select on disk hyperslab */ - offset[0] = i; /*offset of hyperslab in file*/ - offset[1] = j; + offset[0] = (hsize_t)i; /*offset of hyperslab in file*/ + offset[1] = (hsize_t)j; a_size[0] = CHUNK_SIZE; /*size of hyperslab*/ a_size[1] = CHUNK_SIZE; status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET, @@ -1383,8 +1380,8 @@ mdc_api_call_smoke_check(int express_test) j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; /* select on disk hyperslab */ - offset[0] = i; /*offset of hyperslab in file*/ - offset[1] = j; + offset[0] = (hsize_t)i; /*offset of hyperslab in file*/ + offset[1] = (hsize_t)j; a_size[0] = CHUNK_SIZE; /*size of hyperslab*/ a_size[1] = CHUNK_SIZE; status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET, @@ -1516,7 +1513,7 @@ mdc_api_call_smoke_check(int express_test) if ( ! pass ) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); return !pass; @@ -2885,7 +2882,6 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = static unsigned check_fapl_mdc_api_errs(void) { - const char * fcn_name = "check_fapl_mdc_api_errs()"; static char msg[128]; int i; herr_t result; @@ -3032,7 +3028,7 @@ check_fapl_mdc_api_errs(void) if ( ! pass ) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); return !pass; @@ -3058,7 +3054,6 @@ check_fapl_mdc_api_errs(void) static unsigned check_file_mdc_api_errs(void) { - const char * fcn_name = "check_file_mdc_api_errs()"; char filename[512]; static char msg[128]; hbool_t show_progress = FALSE; @@ -3086,7 +3081,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name); + HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC); } if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) @@ -3101,7 +3096,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: calling H5Fcreate().\n", fcn_name); + HDfprintf(stdout, "%s: calling H5Fcreate().\n", FUNC); } file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3123,7 +3118,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", fcn_name); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", FUNC); } H5E_BEGIN_TRY { @@ -3141,7 +3136,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", fcn_name); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", FUNC); } H5E_BEGIN_TRY { @@ -3160,7 +3155,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", fcn_name); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", FUNC); } H5E_BEGIN_TRY { @@ -3182,7 +3177,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", fcn_name); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", FUNC); } H5E_BEGIN_TRY { @@ -3200,7 +3195,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", fcn_name); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", FUNC); } H5E_BEGIN_TRY { @@ -3221,7 +3216,7 @@ check_file_mdc_api_errs(void) HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", - fcn_name, i); + FUNC, i); } H5E_BEGIN_TRY { @@ -3250,7 +3245,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", - fcn_name); + FUNC); } H5E_BEGIN_TRY { @@ -3269,7 +3264,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", - fcn_name); + FUNC); } H5E_BEGIN_TRY { @@ -3290,7 +3285,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", - fcn_name); + FUNC); } H5E_BEGIN_TRY { @@ -3311,7 +3306,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", fcn_name); + HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", FUNC); } H5E_BEGIN_TRY { @@ -3330,7 +3325,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", fcn_name); + HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", FUNC); } if ( ( H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0 ) || @@ -3352,7 +3347,7 @@ check_file_mdc_api_errs(void) if ( show_progress ) { - HDfprintf(stdout, "%s: cleaning up from tests.\n", fcn_name); + HDfprintf(stdout, "%s: cleaning up from tests.\n", FUNC); } if ( H5Fclose(file_id) < 0 ) { @@ -3371,7 +3366,7 @@ check_file_mdc_api_errs(void) if ( ! pass ) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + FUNC, failure_mssg); return !pass; diff --git a/test/cache_common.c b/test/cache_common.c index 4abc0f4..60ab827 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -2391,7 +2391,6 @@ H5F_t * setup_cache(size_t max_cache_size, size_t min_clean_size) { - const char * fcn_name = "setup_cache()"; char filename[512]; hbool_t show_progress = FALSE; hbool_t verbose = TRUE; @@ -2405,7 +2404,7 @@ setup_cache(size_t max_cache_size, if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); saved_fid = -1; @@ -2422,7 +2421,7 @@ setup_cache(size_t max_cache_size, if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( ( pass ) && ( try_core_file_driver ) ) { @@ -2444,7 +2443,7 @@ setup_cache(size_t max_cache_size, core_file_driver_failed = TRUE; if ( verbose ) { - HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", fcn_name); + HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC); } } else { @@ -2455,7 +2454,7 @@ setup_cache(size_t max_cache_size, if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); /* if we either aren't using the core file driver, or a create * with the core file driver failed, try again with a regular file. @@ -2473,14 +2472,14 @@ setup_cache(size_t max_cache_size, failure_mssg = "H5Fcreate() failed."; if ( verbose ) { - HDfprintf(stdout, "%s: H5Fcreate() failed.\n", fcn_name); + HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); } } } if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2494,7 +2493,7 @@ setup_cache(size_t max_cache_size, failure_mssg = "H5Fflush() failed."; if ( verbose ) { - HDfprintf(stdout, "%s: H5Fflush() failed.\n", fcn_name); + HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC); } } else { @@ -2507,7 +2506,7 @@ setup_cache(size_t max_cache_size, failure_mssg = "Can't get file_ptr."; if ( verbose ) { - HDfprintf(stdout, "%s: H5Fflush() failed.\n", fcn_name); + HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC); } } } @@ -2515,7 +2514,7 @@ setup_cache(size_t max_cache_size, if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2567,7 +2566,7 @@ setup_cache(size_t max_cache_size, if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2577,7 +2576,7 @@ setup_cache(size_t max_cache_size, failure_mssg = "H5C_create() failed."; if ( verbose ) { - HDfprintf(stdout, "%s: H5C_create() failed.\n", fcn_name); + HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC); } } else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) { @@ -2586,14 +2585,14 @@ setup_cache(size_t max_cache_size, failure_mssg = "Bad cache_ptr magic."; if ( verbose ) { - HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", fcn_name); + HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC); } } } if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { /* allocate space for test entries */ @@ -2606,7 +2605,7 @@ setup_cache(size_t max_cache_size, failure_mssg = "H5MF_alloc() failed."; if ( verbose ) { - HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", fcn_name); + HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC); } } else if ( actual_base_addr > BASE_ADDR ) { @@ -2620,7 +2619,7 @@ setup_cache(size_t max_cache_size, if ( verbose ) { HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", - fcn_name); + FUNC); } } @@ -2629,7 +2628,7 @@ setup_cache(size_t max_cache_size, if ( show_progress ) /* 8 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); if ( pass ) { @@ -2642,7 +2641,7 @@ setup_cache(size_t max_cache_size, if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + FUNC, mile_stone++, (int)pass); return(ret_val); } /* setup_cache() */ @@ -2762,7 +2761,6 @@ expunge_entry(H5F_t * file_ptr, int32_t type, int32_t idx) { - /* const char * fcn_name = "expunge_entry()"; */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -2825,7 +2823,6 @@ flush_cache(H5F_t * file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats) { - const char * fcn_name = "flush_cache()"; hbool_t verbose = FALSE; verify_unprotected(); @@ -2861,7 +2858,7 @@ flush_cache(H5F_t * file_ptr, if(verbose) { HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", - fcn_name, + FUNC, (long long)(cache_ptr->index_len), (long long)(cache_ptr->index_size), (long long)(cache_ptr->clean_index_size), @@ -3579,13 +3576,12 @@ row_major_scan_forward(H5F_t * file_ptr, int dirty_destroys, int dirty_unprotects) { - const char * fcn_name = "row_major_scan_forward"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int32_t type = 0; int32_t idx; if ( verbose ) - HDfprintf(stdout, "%s(): entering.\n", fcn_name); + HDfprintf(stdout, "%s(): entering.\n", FUNC); if ( pass ) { @@ -3871,8 +3867,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, hbool_t display_detailed_stats, hbool_t do_inserts) { - const char * fcn_name = "hl_row_major_scan_forward"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int32_t type = 0; int32_t idx; int32_t i; @@ -3880,7 +3875,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, int32_t local_max_index; if ( verbose ) - HDfprintf(stdout, "%s(): entering.\n", fcn_name); + HDfprintf(stdout, "%s(): entering.\n", FUNC); if ( pass ) { @@ -3983,13 +3978,12 @@ row_major_scan_backward(H5F_t * file_ptr, int dirty_destroys, int dirty_unprotects) { - const char * fcn_name = "row_major_scan_backward"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int32_t type = NUMBER_OF_ENTRY_TYPES - 1; int32_t idx; if ( verbose ) - HDfprintf(stdout, "%s(): Entering.\n", fcn_name); + HDfprintf(stdout, "%s(): Entering.\n", FUNC); if ( pass ) { @@ -4269,8 +4263,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, hbool_t display_detailed_stats, hbool_t do_inserts) { - const char * fcn_name = "hl_row_major_scan_backward"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int32_t type = NUMBER_OF_ENTRY_TYPES - 1; int32_t idx; int32_t i; @@ -4278,7 +4271,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, int32_t local_max_index; if ( verbose ) - HDfprintf(stdout, "%s(): entering.\n", fcn_name); + HDfprintf(stdout, "%s(): entering.\n", FUNC); if ( pass ) { @@ -4376,13 +4369,12 @@ col_major_scan_forward(H5F_t * file_ptr, hbool_t do_inserts, int dirty_unprotects) { - const char * fcn_name = "col_major_scan_forward()"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int32_t type = 0; int32_t idx; if ( verbose ) - HDfprintf(stdout, "%s: entering.\n", fcn_name); + HDfprintf(stdout, "%s: entering.\n", FUNC); if ( pass ) { @@ -4477,8 +4469,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, hbool_t do_inserts, int dirty_unprotects) { - const char * fcn_name = "hl_col_major_scan_forward()"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int32_t type = 0; int32_t idx; int32_t lag = 200; @@ -4486,7 +4477,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, int32_t local_max_index; if ( verbose ) - HDfprintf(stdout, "%s: entering.\n", fcn_name); + HDfprintf(stdout, "%s: entering.\n", FUNC); if ( pass ) { @@ -4594,14 +4585,13 @@ col_major_scan_backward(H5F_t * file_ptr, hbool_t do_inserts, int dirty_unprotects) { - const char * fcn_name = "col_major_scan_backward()"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int mile_stone = 1; int32_t type; int32_t idx; if ( verbose ) - HDfprintf(stdout, "%s: entering.\n", fcn_name); + HDfprintf(stdout, "%s: entering.\n", FUNC); if ( pass ) { @@ -4620,7 +4610,7 @@ col_major_scan_backward(H5F_t * file_ptr, idx = MAX_ENTRIES + lag; if ( verbose ) /* 1 */ - HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++); + HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++); while ( ( pass ) && ( (idx + lag) >= 0 ) ) @@ -4668,7 +4658,7 @@ col_major_scan_backward(H5F_t * file_ptr, } if ( verbose ) /* 2 */ - HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++); + HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++); if ( ( pass ) && ( display_stats ) ) { @@ -4676,7 +4666,7 @@ col_major_scan_backward(H5F_t * file_ptr, } if ( verbose ) - HDfprintf(stdout, "%s: exiting.\n", fcn_name); + HDfprintf(stdout, "%s: exiting.\n", FUNC); return; @@ -4708,16 +4698,15 @@ hl_col_major_scan_backward(H5F_t * file_ptr, hbool_t do_inserts, int dirty_unprotects) { - const char * fcn_name = "hl_col_major_scan_backward()"; - H5C_t * cache_ptr; + H5C_t * cache_ptr = NULL; int32_t type = 0; - int32_t idx; + int32_t idx = -1; int32_t lag = 50; int32_t i; - int32_t local_max_index; + int32_t local_max_index = -1; if ( verbose ) - HDfprintf(stdout, "%s: entering.\n", fcn_name); + HDfprintf(stdout, "%s: entering.\n", FUNC); if ( pass ) { @@ -5101,7 +5090,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, pass = FALSE; failure_mssg = "H5Fget_mdc_hit_rate() failed."; - } else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001F) ) { + } else if ( ! H5_DBL_ABS_EQUAL(hit_rate, expected_hit_rate) ) { pass = FALSE; failure_mssg = "unexpected hit rate."; @@ -5294,7 +5283,7 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a, return(FALSE); else if(compare_init && (a->initial_size != b->initial_size)) return(FALSE); - else if(HDfabs(a->min_clean_fraction - b->min_clean_fraction) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->min_clean_fraction, b->min_clean_fraction)) return(FALSE); else if(a->max_size != b->max_size) return(FALSE); @@ -5304,9 +5293,9 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a, return(FALSE); else if(a->incr_mode != b->incr_mode) return(FALSE); - else if(HDfabs(a->lower_hr_threshold - b->lower_hr_threshold) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->lower_hr_threshold, b->lower_hr_threshold)) return(FALSE); - else if(HDfabs(a->increment - b->increment) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->increment, b->increment)) return(FALSE); else if(a->apply_max_increment != b->apply_max_increment) return(FALSE); @@ -5314,15 +5303,15 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a, return(FALSE); else if(a->flash_incr_mode != b->flash_incr_mode) return(FALSE); - else if(HDfabs(a->flash_multiple - b->flash_multiple) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->flash_multiple, b->flash_multiple)) return(FALSE); - else if(HDfabs(a->flash_threshold - b->flash_threshold) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->flash_threshold, b->flash_threshold)) return(FALSE); else if(a->decr_mode != b->decr_mode) return(FALSE); - else if(HDfabs(a->upper_hr_threshold - b->upper_hr_threshold) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->upper_hr_threshold, b->upper_hr_threshold)) return(FALSE); - else if(HDfabs(a->decrement - b->decrement) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->decrement, b->decrement)) return(FALSE); else if(a->apply_max_decrement != b->apply_max_decrement) return(FALSE); @@ -5332,7 +5321,7 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a, return(FALSE); else if(a->apply_empty_reserve != b->apply_empty_reserve) return(FALSE); - else if(HDfabs(a->empty_reserve - b->empty_reserve) > FP_EPSILON) + else if(!H5_DBL_ABS_EQUAL(a->empty_reserve, b->empty_reserve)) return(FALSE); return(TRUE); } diff --git a/test/cache_common.h b/test/cache_common.h index be3195b..48b95d8 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -425,26 +425,26 @@ if ( ( (cache_ptr) == NULL ) || \ ( (a).set_initial_size == (b).set_initial_size ) ) && \ ( ( ! cmp_init_size ) || \ ( (a).initial_size == (b).initial_size ) ) && \ - ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \ + ( H5_DBL_ABS_EQUAL((a).min_clean_fraction, (b).min_clean_fraction) ) && \ ( (a).max_size == (b).max_size ) && \ ( (a).min_size == (b).min_size ) && \ ( (a).epoch_length == (b).epoch_length ) && \ ( (a).incr_mode == (b).incr_mode ) && \ - ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \ - ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \ + ( H5_DBL_ABS_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold) ) && \ + ( H5_DBL_ABS_EQUAL((a).increment, (b).increment) ) && \ ( (a).apply_max_increment == (b).apply_max_increment ) && \ ( (a).max_increment == (b).max_increment ) && \ ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ - ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \ - ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \ + ( H5_DBL_ABS_EQUAL((a).flash_multiple, (b).flash_multiple) ) && \ + ( H5_DBL_ABS_EQUAL((a).flash_threshold, (b).flash_threshold) ) && \ ( (a).decr_mode == (b).decr_mode ) && \ - ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \ - ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \ + ( H5_DBL_ABS_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold) ) && \ + ( H5_DBL_ABS_EQUAL((a).decrement, (b).decrement) ) && \ ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ ( (a).max_decrement == (b).max_decrement ) && \ ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ - ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) && \ + ( H5_DBL_ABS_EQUAL((a).empty_reserve, (b).empty_reserve) ) && \ ( (a).dirty_bytes_threshold == (b).dirty_bytes_threshold ) && \ ( (a).metadata_write_strategy == (b).metadata_write_strategy ) ) @@ -482,9 +482,6 @@ if ( ( (cache_ptr) == NULL ) || \ (i).empty_reserve = (e).empty_reserve; \ } -/* Epsilon for floating-point comparisons */ -#define FP_EPSILON 0.000001f - /* misc type definitions */ diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index d81b7fc..5c591f8 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -1285,16 +1285,16 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset) s_ptr->c[3] != d_ptr->c[3] || s_ptr->d != d_ptr->d || s_ptr->e != d_ptr->e || - !FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) || - !FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) || - !FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) || - !FLT_ABS_EQUAL(s_ptr->h[1], d_ptr->h[1]) || - !FLT_ABS_EQUAL(s_ptr->i, d_ptr->i) || - !FLT_ABS_EQUAL(s_ptr->j, d_ptr->j) || - !DBL_ABS_EQUAL(s_ptr->k, d_ptr->k) || - !DBL_ABS_EQUAL(s_ptr->l, d_ptr->l) || - !DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) || - !DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) { + !H5_FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) || + !H5_FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) || + !H5_FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) || + !H5_FLT_ABS_EQUAL(s_ptr->h[1], d_ptr->h[1]) || + !H5_FLT_ABS_EQUAL(s_ptr->i, d_ptr->i) || + !H5_FLT_ABS_EQUAL(s_ptr->j, d_ptr->j) || + !H5_DBL_ABS_EQUAL(s_ptr->k, d_ptr->k) || + !H5_DBL_ABS_EQUAL(s_ptr->l, d_ptr->l) || + !H5_DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) || + !H5_DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) { H5_FAILED(); printf(" i=%d\n", i); diff --git a/test/cross_read.c b/test/cross_read.c index 35dd2ce..b2fae89 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -126,7 +126,7 @@ static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number) /* Check results */ for (j=0; j<(NX+1); j++) { for (i=0; imagic != MSSG_MAGIC ) { @@ -1048,7 +1041,7 @@ recv_mssg(struct mssg_t *mssg_ptr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: invalid magic.\n", world_mpi_rank, - fcn_name); + FUNC); } } else if ( mssg_ptr->src != status.MPI_SOURCE ) { @@ -1057,7 +1050,7 @@ recv_mssg(struct mssg_t *mssg_ptr, if ( verbose ) { HDfprintf(stdout, "%d:%s: mssg_ptr->src != status.MPI_SOURCE.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -1092,7 +1085,6 @@ static hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag) { - const char * fcn_name = "send_mssg()"; hbool_t success = TRUE; int mssg_tag = CACHE_TEST_TAG; int result; @@ -1111,7 +1103,7 @@ send_mssg(struct mssg_t *mssg_ptr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Invalid mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -1133,7 +1125,7 @@ send_mssg(struct mssg_t *mssg_ptr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: MPI_Send() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -1160,7 +1152,6 @@ send_mssg(struct mssg_t *mssg_ptr, static hbool_t setup_derived_types(void) { - const char * fcn_name = "setup_derived_types()"; hbool_t success = TRUE; int i; int result; @@ -1186,7 +1177,7 @@ setup_derived_types(void) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: MPI_Address() call failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -1208,7 +1199,7 @@ setup_derived_types(void) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: MPI_Type_struct() call failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -1223,7 +1214,7 @@ setup_derived_types(void) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: MPI_Type_commit() call failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -1250,7 +1241,6 @@ setup_derived_types(void) static hbool_t takedown_derived_types(void) { - const char * fcn_name = "takedown_derived_types()"; hbool_t success = TRUE; int result; @@ -1262,7 +1252,7 @@ takedown_derived_types(void) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: MPI_Type_free() call failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -1292,7 +1282,6 @@ takedown_derived_types(void) static hbool_t reset_server_counters(void) { - const char * fcn_name = "reset_server_counters()"; hbool_t success = TRUE; int i; long actual_total_reads = 0; @@ -1319,7 +1308,7 @@ reset_server_counters(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%ld).\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, actual_total_reads, total_reads); } } @@ -1330,7 +1319,7 @@ reset_server_counters(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%ld).\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, actual_total_writes, total_writes); } } @@ -1369,7 +1358,6 @@ reset_server_counters(void) static hbool_t server_main(void) { - const char * fcn_name = "server_main()"; hbool_t done = FALSE; hbool_t success = TRUE; int done_count = 0; @@ -1381,7 +1369,7 @@ server_main(void) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: This isn't the server process?!?!?\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -1401,7 +1389,7 @@ server_main(void) case WRITE_REQ_ACK_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received write ack?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received write ack?!?.\n", FUNC); break; case READ_REQ_CODE: @@ -1411,7 +1399,7 @@ server_main(void) case READ_REQ_REPLY_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received read req reply?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received read req reply?!?.\n", FUNC); break; case SYNC_REQ_CODE: @@ -1421,7 +1409,7 @@ server_main(void) case SYNC_ACK_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received sync ack?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received sync ack?!?.\n", FUNC); break; case REQ_TTL_WRITES_CODE: @@ -1431,7 +1419,7 @@ server_main(void) case REQ_TTL_WRITES_RPLY_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received total writes reply?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received total writes reply?!?.\n", FUNC); break; case REQ_TTL_READS_CODE: @@ -1441,7 +1429,7 @@ server_main(void) case REQ_TTL_READS_RPLY_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received total reads reply?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received total reads reply?!?.\n", FUNC); break; case REQ_ENTRY_WRITES_CODE: @@ -1451,7 +1439,7 @@ server_main(void) case REQ_ENTRY_WRITES_RPLY_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", FUNC); break; case REQ_ENTRY_READS_CODE: @@ -1461,7 +1449,7 @@ server_main(void) case REQ_ENTRY_READS_RPLY_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", FUNC); break; case REQ_RW_COUNT_RESET_CODE: @@ -1471,7 +1459,7 @@ server_main(void) case REQ_RW_COUNT_RESET_RPLY_CODE: success = FALSE; if(verbose) - HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", fcn_name); + HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", FUNC); break; case DONE_REQ_CODE: @@ -1484,7 +1472,7 @@ server_main(void) nerrors++; success = FALSE; if(verbose) - HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, fcn_name); + HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC); break; } } @@ -1516,7 +1504,6 @@ server_main(void) static hbool_t serve_read_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_read_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; int target_index; @@ -1531,7 +1518,7 @@ serve_read_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -1546,7 +1533,7 @@ serve_read_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", - world_mpi_rank, fcn_name, target_addr); + world_mpi_rank, FUNC, target_addr); } } else if ( data[target_index].len != mssg_ptr->len ) { @@ -1555,7 +1542,7 @@ serve_read_request(struct mssg_t * mssg_ptr) if ( verbose ) { HDfprintf(stdout, "%d:%s: data[i].len = %Zu != mssg->len = %d.\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, data[target_index].len, mssg_ptr->len); } } else if ( ! (data[target_index].valid) ) { @@ -1565,7 +1552,7 @@ serve_read_request(struct mssg_t * mssg_ptr) if ( verbose ) { HDfprintf(stdout, "%d:%s: proc %d read invalid entry. idx/base_addr = %d/%a.\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, mssg_ptr->src, target_index, data[target_index].base_addr); @@ -1644,7 +1631,6 @@ serve_read_request(struct mssg_t * mssg_ptr) static hbool_t serve_sync_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_sync_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; struct mssg_t reply; @@ -1657,7 +1643,7 @@ serve_sync_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -1719,7 +1705,6 @@ serve_sync_request(struct mssg_t * mssg_ptr) static hbool_t serve_write_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_write_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; int target_index; @@ -1737,7 +1722,7 @@ serve_write_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -1752,7 +1737,7 @@ serve_write_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", - world_mpi_rank, fcn_name, target_addr); + world_mpi_rank, FUNC, target_addr); } } else if ( data[target_index].len != mssg_ptr->len ) { @@ -1761,7 +1746,7 @@ serve_write_request(struct mssg_t * mssg_ptr) if ( verbose ) { HDfprintf(stdout, "%d:%s: data[i].len = %Zu != mssg->len = %d.\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, data[target_index].len, mssg_ptr->len); } } @@ -1778,7 +1763,7 @@ serve_write_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: new ver = %d <= old ver = %d.\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, new_ver_num, data[target_index].ver); } } @@ -1862,7 +1847,6 @@ serve_write_request(struct mssg_t * mssg_ptr) static hbool_t serve_total_writes_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_total_writes_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; struct mssg_t reply; @@ -1875,7 +1859,7 @@ serve_total_writes_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -1942,7 +1926,6 @@ serve_total_writes_request(struct mssg_t * mssg_ptr) static hbool_t serve_total_reads_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_total_reads_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; struct mssg_t reply; @@ -1955,7 +1938,7 @@ serve_total_reads_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -2022,7 +2005,6 @@ serve_total_reads_request(struct mssg_t * mssg_ptr) static hbool_t serve_entry_writes_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_entry_writes_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; int target_index; @@ -2037,7 +2019,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -2052,7 +2034,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", - world_mpi_rank, fcn_name, target_addr); + world_mpi_rank, FUNC, target_addr); } } else { @@ -2120,7 +2102,6 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) static hbool_t serve_entry_reads_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_entry_reads_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; int target_index; @@ -2135,7 +2116,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -2150,7 +2131,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", - world_mpi_rank, fcn_name, target_addr); + world_mpi_rank, FUNC, target_addr); } } else { @@ -2217,7 +2198,6 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) static hbool_t serve_rw_count_reset_request(struct mssg_t * mssg_ptr) { - const char * fcn_name = "serve_rw_count_reset_request()"; hbool_t report_mssg = FALSE; hbool_t success = TRUE; struct mssg_t reply; @@ -2230,7 +2210,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -2417,7 +2397,6 @@ flush_datum(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, void *thing) { - const char * fcn_name = "flush_datum()"; hbool_t was_dirty = FALSE; herr_t ret_value = SUCCEED; int idx; @@ -2464,7 +2443,7 @@ flush_datum(H5F_t *f, ret_value = FAIL; HDfprintf(stdout, "%d:%s: Flushed dirty entry from non-zero file process.", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } if ( ret_value == SUCCEED ) { @@ -2490,7 +2469,7 @@ flush_datum(H5F_t *f, ret_value = FAIL; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else @@ -2512,7 +2491,7 @@ flush_datum(H5F_t *f, ret_value = FAIL; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( ( mssg.req != WRITE_REQ_ACK_CODE ) || ( mssg.src != world_server_mpi_rank ) || @@ -2526,7 +2505,7 @@ flush_datum(H5F_t *f, ret_value = FAIL; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -2575,7 +2554,6 @@ load_datum(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, void H5_ATTR_UNUSED *udata) { - const char * fcn_name = "load_datum()"; hbool_t success = TRUE; int idx; struct datum * entry_ptr = NULL; @@ -2610,7 +2588,7 @@ load_datum(H5F_t H5_ATTR_UNUSED *f, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -2622,7 +2600,7 @@ load_datum(H5F_t H5_ATTR_UNUSED *f, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -2641,42 +2619,42 @@ load_datum(H5F_t H5_ATTR_UNUSED *f, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } #if 0 /* This has been useful debugging code -- keep it for now. */ if ( mssg.req != READ_REQ_REPLY_CODE ) { HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", - world_mpi_rank, fcn_name, (int)(mssg.req)); + world_mpi_rank, FUNC, (int)(mssg.req)); } if ( mssg.src != world_server_mpi_rank ) { HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } if ( mssg.dest != world_mpi_rank ) { HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } if ( mssg.base_addr != entry_ptr->base_addr ) { HDfprintf(stdout, "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", - world_mpi_rank, fcn_name, mssg.base_addr); + world_mpi_rank, FUNC, mssg.base_addr); HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, entry_ptr->base_addr); } @@ -2684,22 +2662,22 @@ load_datum(H5F_t H5_ATTR_UNUSED *f, HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", - world_mpi_rank, fcn_name, mssg.len); + world_mpi_rank, FUNC, mssg.len); } if ( mssg.ver < entry_ptr->ver ) { HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } if ( mssg.magic != MSSG_MAGIC ) { HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } #endif /* JRM */ @@ -2800,7 +2778,6 @@ static void expunge_entry(H5F_t * file_ptr, int32_t idx) { - const char * fcn_name = "expunge_entry()"; hbool_t in_cache; herr_t result; struct datum * entry_ptr; @@ -2825,7 +2802,7 @@ expunge_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -2840,14 +2817,14 @@ expunge_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( in_cache ) { nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -2884,7 +2861,6 @@ insert_entry(H5C_t * cache_ptr, int32_t idx, unsigned int flags) { - const char * fcn_name = "insert_entry()"; hbool_t insert_pinned; herr_t result; struct datum * entry_ptr; @@ -2916,7 +2892,7 @@ insert_entry(H5C_t * cache_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -2939,7 +2915,7 @@ insert_entry(H5C_t * cache_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", - world_mpi_rank, fcn_name, idx, + world_mpi_rank, FUNC, idx, (int)(data[idx].header.is_dirty)); } } @@ -2988,7 +2964,6 @@ local_pin_and_unpin_random_entries(H5F_t * file_ptr, int min_count, int max_count) { - /* const char * fcn_name = "local_pin_and_unpin_random_entries()"; */ if ( nerrors == 0 ) { @@ -3057,7 +3032,6 @@ local_pin_random_entry(H5F_t * file_ptr, int min_idx, int max_idx) { - /* const char * fcn_name = "local_pin_random_entry()"; */ int idx; if ( nerrors == 0 ) { @@ -3101,7 +3075,6 @@ static void local_unpin_all_entries(H5F_t * file_ptr, hbool_t via_unprotect) { - /* const char * fcn_name = "local_unpin_all_entries()"; */ if ( nerrors == 0 ) { @@ -3144,7 +3117,6 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr, int start_idx, hbool_t via_unprotect) { - /* const char * fcn_name = "local_unpin_next_pinned_entry()"; */ int i = 0; int idx = -1; @@ -3204,7 +3176,6 @@ lock_and_unlock_random_entries(H5F_t * file_ptr, int min_count, int max_count) { - /* const char * fcn_name = "lock_and_unlock_random_entries()"; */ int count; int i; @@ -3249,7 +3220,6 @@ lock_and_unlock_random_entry(H5F_t * file_ptr, int min_idx, int max_idx) { - /* const char * fcn_name = "lock_and_unlock_random_entry()"; */ int idx; if ( nerrors == 0 ) { @@ -3297,7 +3267,6 @@ static void lock_entry(H5F_t * file_ptr, int32_t idx) { - const char * fcn_name = "lock_entry()"; struct datum * entry_ptr; H5C_cache_entry_t * cache_entry_ptr; @@ -3323,7 +3292,7 @@ lock_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -3355,7 +3324,6 @@ lock_entry(H5F_t * file_ptr, static void mark_entry_dirty(int32_t idx) { - const char * fcn_name = "mark_entry_dirty()"; herr_t result; struct datum * entry_ptr; @@ -3380,7 +3348,7 @@ mark_entry_dirty(int32_t idx) if ( verbose ) { HDfprintf(stdout, "%d:%s: error in H5AC_mark_entry_dirty().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( ! ( entry_ptr->locked ) ) @@ -3413,7 +3381,6 @@ pin_entry(H5F_t * file_ptr, hbool_t global, hbool_t dirty) { - /* const char * fcn_name = "pin_entry()"; */ unsigned int flags = H5AC__PIN_ENTRY_FLAG; struct datum * entry_ptr; @@ -3480,7 +3447,6 @@ static void pin_protected_entry(int32_t idx, hbool_t global) { - const char * fcn_name = "pin_protected_entry()"; herr_t result; struct datum * entry_ptr; @@ -3506,7 +3472,7 @@ pin_protected_entry(int32_t idx, if ( verbose ) { HDfprintf(stdout, "%d:%s: Error in H5AC_pin_protected entry().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -3554,7 +3520,6 @@ move_entry(H5F_t * file_ptr, int32_t old_idx, int32_t new_idx) { - const char * fcn_name = "move_entry()"; herr_t result; int tmp; size_t tmp_len; @@ -3617,7 +3582,7 @@ move_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -3644,7 +3609,7 @@ move_entry(H5F_t * file_ptr, if ( verbose ) { HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", - world_mpi_rank, fcn_name, new_idx, + world_mpi_rank, FUNC, new_idx, (int)(data[new_idx].header.is_dirty)); } } @@ -3675,7 +3640,6 @@ move_entry(H5F_t * file_ptr, static hbool_t reset_server_counts(void) { - const char * fcn_name = "reset_server_counts()"; hbool_t success = TRUE; /* will set to FALSE if appropriate. */ struct mssg_t mssg; @@ -3698,7 +3662,7 @@ reset_server_counts(void) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -3711,7 +3675,7 @@ reset_server_counts(void) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( ( mssg.req != REQ_RW_COUNT_RESET_RPLY_CODE ) || ( mssg.src != world_server_mpi_rank ) || @@ -3727,7 +3691,7 @@ reset_server_counts(void) if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in req r/w counter reset reply.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -3756,7 +3720,6 @@ static void resize_entry(int32_t idx, size_t new_size) { - const char * fcn_name = "resize_entry()"; herr_t result; struct datum * entry_ptr; @@ -3783,7 +3746,7 @@ resize_entry(int32_t idx, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -3831,7 +3794,6 @@ setup_cache_for_test(hid_t * fid_ptr, H5C_t ** cache_ptr_ptr, int metadata_write_strategy) { - const char * fcn_name = "setup_cache_for_test()"; hbool_t success = FALSE; /* will set to TRUE if appropriate. */ hbool_t enable_rpt_fcn = FALSE; hid_t fid = -1; @@ -3850,13 +3812,13 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE); @@ -3866,7 +3828,7 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { cache_ptr = file_ptr->shared->cache; @@ -3876,13 +3838,13 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n", - world_mpi_rank, fcn_name); + 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", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { cache_ptr->ignore_tags = TRUE; @@ -3902,7 +3864,7 @@ setup_cache_for_test(hid_t * fid_ptr, HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } else { @@ -3914,12 +3876,12 @@ setup_cache_for_test(hid_t * fid_ptr, HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } else if ( enable_rpt_fcn ) { HDfprintf(stdout, "%d:%s: rpt_fcn enabled.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -3936,7 +3898,7 @@ setup_cache_for_test(hid_t * fid_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC ) { @@ -3945,7 +3907,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( verbose ) { HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy != metadata_write_strategy ) { @@ -3954,7 +3916,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( verbose ) { HDfprintf(stdout, "%d:%s: bad cache_ptr->aux_ptr->metadata_write_strategy\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -3972,7 +3934,7 @@ setup_cache_for_test(hid_t * fid_ptr, HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } else if ( test_config.metadata_write_strategy != metadata_write_strategy ) { @@ -3983,7 +3945,7 @@ setup_cache_for_test(hid_t * fid_ptr, HDfprintf(stdout, "%d:%s: unexpected metadata_write_strategy.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -3999,7 +3961,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( verbose ) { HDfprintf(stdout, "%d:%s: H5C_set_write_done_callback failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4014,7 +3976,7 @@ setup_cache_for_test(hid_t * fid_ptr, if ( verbose ) { HDfprintf(stdout, "%d:%s: H5AC_set_sync_point_done_callback failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4055,7 +4017,6 @@ static void verify_writes(int num_writes, haddr_t * written_entries_tbl) { - const char * fcn_name = "verify_writes()"; const hbool_t report = FALSE; hbool_t proceed = TRUE; int i = 0; @@ -4076,7 +4037,7 @@ verify_writes(int num_writes, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 1 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4103,7 +4064,7 @@ verify_writes(int num_writes, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 2 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4119,12 +4080,12 @@ verify_writes(int num_writes, if ( proceed ) { HDfprintf(stdout, "%d:%s: verified %d writes.\n", - world_mpi_rank, fcn_name, num_writes); + world_mpi_rank, FUNC, num_writes); } else { HDfprintf(stdout, "%d:%s: FAILED to verify %d writes.\n", - world_mpi_rank, fcn_name, num_writes); + world_mpi_rank, FUNC, num_writes); } } @@ -4143,7 +4104,7 @@ verify_writes(int num_writes, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 3 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4175,7 +4136,6 @@ verify_writes(int num_writes, static void setup_rand(void) { - const char * fcn_name = "setup_rand()"; hbool_t use_predefined_seeds = FALSE; int num_predefined_seeds = 3; unsigned predefined_seeds[3] = {33402, 33505, 33422}; @@ -4190,7 +4150,7 @@ setup_rand(void) seed = predefined_seeds[world_mpi_rank]; HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", - world_mpi_rank, fcn_name, seed); + world_mpi_rank, FUNC, seed); fflush(stdout); HDsrand(seed); @@ -4201,13 +4161,13 @@ setup_rand(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { seed = (unsigned)tv.tv_usec; if ( verbose ) { HDfprintf(stdout, "%d:%s: seed = %d.\n", - world_mpi_rank, fcn_name, seed); + world_mpi_rank, FUNC, seed); fflush(stdout); } HDsrand(seed); @@ -4238,7 +4198,6 @@ setup_rand(void) static hbool_t take_down_cache(hid_t fid) { - const char * fcn_name = "take_down_cache()"; hbool_t success = FALSE; /* will set to TRUE if appropriate. */ /* close the file and delete it */ @@ -4247,7 +4206,7 @@ take_down_cache(hid_t fid) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Fclose() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( world_mpi_rank == world_server_mpi_rank ) { @@ -4257,7 +4216,7 @@ take_down_cache(hid_t fid) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: HDremove() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -4297,7 +4256,6 @@ static hbool_t verify_entry_reads(haddr_t addr, int expected_entry_reads) { - const char * fcn_name = "verify_entry_reads()"; hbool_t success = TRUE; int reported_entry_reads; struct mssg_t mssg; @@ -4321,7 +4279,7 @@ verify_entry_reads(haddr_t addr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4334,7 +4292,7 @@ verify_entry_reads(haddr_t addr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4353,7 +4311,7 @@ verify_entry_reads(haddr_t addr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in req entry reads reply.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -4370,7 +4328,7 @@ verify_entry_reads(haddr_t addr, if ( verbose ) { HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx reads mismatch (%ld/%ld).\n", - world_mpi_rank, fcn_name, (long long)addr, + world_mpi_rank, FUNC, (long long)addr, reported_entry_reads, expected_entry_reads); } } @@ -4405,7 +4363,6 @@ static hbool_t verify_entry_writes(haddr_t addr, int expected_entry_writes) { - const char * fcn_name = "verify_entry_writes()"; hbool_t success = TRUE; int reported_entry_writes; struct mssg_t mssg; @@ -4429,7 +4386,7 @@ verify_entry_writes(haddr_t addr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4442,7 +4399,7 @@ verify_entry_writes(haddr_t addr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4461,7 +4418,7 @@ verify_entry_writes(haddr_t addr, success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in req entry writes reply.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -4478,7 +4435,7 @@ verify_entry_writes(haddr_t addr, if ( verbose ) { HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx writes mismatch (%ld/%ld).\n", - world_mpi_rank, fcn_name, (long long)addr, + world_mpi_rank, FUNC, (long long)addr, reported_entry_writes, expected_entry_writes); } } @@ -4511,7 +4468,6 @@ verify_entry_writes(haddr_t addr, static hbool_t verify_total_reads(int expected_total_reads) { - const char * fcn_name = "verify_total_reads()"; hbool_t success = TRUE; /* will set to FALSE if appropriate. */ long reported_total_reads; struct mssg_t mssg; @@ -4535,7 +4491,7 @@ verify_total_reads(int expected_total_reads) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4548,7 +4504,7 @@ verify_total_reads(int expected_total_reads) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( ( mssg.req != REQ_TTL_READS_RPLY_CODE ) || ( mssg.src != world_server_mpi_rank ) || @@ -4562,7 +4518,7 @@ verify_total_reads(int expected_total_reads) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -4579,7 +4535,7 @@ verify_total_reads(int expected_total_reads) if ( verbose ) { HDfprintf(stdout, "%d:%s: reported/expected total reads mismatch (%ld/%ld).\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, reported_total_reads, expected_total_reads); } @@ -4613,7 +4569,6 @@ verify_total_reads(int expected_total_reads) static hbool_t verify_total_writes(int expected_total_writes) { - const char * fcn_name = "verify_total_writes()"; hbool_t success = TRUE; /* will set to FALSE if appropriate. */ long reported_total_writes; struct mssg_t mssg; @@ -4637,7 +4592,7 @@ verify_total_writes(int expected_total_writes) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4650,7 +4605,7 @@ verify_total_writes(int expected_total_writes) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else if ( ( mssg.req != REQ_TTL_WRITES_RPLY_CODE ) || ( mssg.src != world_server_mpi_rank ) || @@ -4664,7 +4619,7 @@ verify_total_writes(int expected_total_writes) success = FALSE; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -4681,7 +4636,7 @@ verify_total_writes(int expected_total_writes) if ( verbose ) { HDfprintf(stdout, "%d:%s: reported/expected total writes mismatch (%ld/%ld).\n", - world_mpi_rank, fcn_name, + world_mpi_rank, FUNC, reported_total_writes, expected_total_writes); } } @@ -4715,7 +4670,6 @@ unlock_entry(H5F_t * file_ptr, int32_t idx, unsigned int flags) { - const char * fcn_name = "unlock_entry()"; herr_t dirtied; herr_t result; struct datum * entry_ptr; @@ -4750,7 +4704,7 @@ unlock_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: error in H5C_unprotect().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } else { @@ -4803,7 +4757,6 @@ unpin_entry(H5F_t * file_ptr, hbool_t dirty, hbool_t via_unprotect) { - const char * fcn_name = "unpin_entry()"; herr_t result; unsigned int flags = H5AC__UNPIN_ENTRY_FLAG; struct datum * entry_ptr; @@ -4848,7 +4801,7 @@ unpin_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4892,7 +4845,6 @@ unpin_entry(H5F_t * file_ptr, static hbool_t server_smoke_check(void) { - const char * fcn_name = "server_smoke_check()"; hbool_t success = TRUE; int max_nerrors; struct mssg_t mssg; @@ -4914,7 +4866,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: server_main() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4936,7 +4888,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -4952,7 +4904,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4972,7 +4924,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -4988,7 +4940,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 1 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5021,7 +4973,7 @@ server_smoke_check(void) if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 2 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5045,7 +4997,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5060,7 +5012,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5080,7 +5032,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5092,7 +5044,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 3 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5124,7 +5076,7 @@ server_smoke_check(void) if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 4 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5141,7 +5093,7 @@ server_smoke_check(void) if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 5 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5173,7 +5125,7 @@ server_smoke_check(void) if ( verbose ) { HDfprintf(stdout, "%d:%s: barrier 6 failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5197,7 +5149,7 @@ server_smoke_check(void) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5241,7 +5193,6 @@ server_smoke_check(void) static hbool_t smoke_check_1(int metadata_write_strategy) { - const char * fcn_name = "smoke_check_1()"; hbool_t success = TRUE; int i; int max_nerrors; @@ -5283,7 +5234,7 @@ smoke_check_1(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: server_main() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5297,7 +5248,7 @@ smoke_check_1(int metadata_write_strategy) cache_ptr = NULL; if ( verbose ) { HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5335,7 +5286,7 @@ smoke_check_1(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5370,7 +5321,7 @@ smoke_check_1(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5417,7 +5368,6 @@ smoke_check_1(int metadata_write_strategy) static hbool_t smoke_check_2(int metadata_write_strategy) { - const char * fcn_name = "smoke_check_2()"; hbool_t success = TRUE; int i; int max_nerrors; @@ -5459,7 +5409,7 @@ smoke_check_2(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: server_main() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5473,7 +5423,7 @@ smoke_check_2(int metadata_write_strategy) cache_ptr = NULL; if ( verbose ) { HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5558,7 +5508,7 @@ smoke_check_2(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5593,7 +5543,7 @@ smoke_check_2(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5643,7 +5593,6 @@ smoke_check_2(int metadata_write_strategy) static hbool_t smoke_check_3(int metadata_write_strategy) { - const char * fcn_name = "smoke_check_3()"; hbool_t success = TRUE; int i; int max_nerrors; @@ -5689,7 +5638,7 @@ smoke_check_3(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: server_main() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5703,7 +5652,7 @@ smoke_check_3(int metadata_write_strategy) cache_ptr = NULL; if ( verbose ) { HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5768,7 +5717,7 @@ smoke_check_3(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -5882,7 +5831,7 @@ smoke_check_3(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5918,7 +5867,7 @@ smoke_check_3(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -5968,7 +5917,6 @@ smoke_check_3(int metadata_write_strategy) static hbool_t smoke_check_4(int metadata_write_strategy) { - const char * fcn_name = "smoke_check_4()"; hbool_t success = TRUE; int i; int max_nerrors; @@ -6014,7 +5962,7 @@ smoke_check_4(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: server_main() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6028,7 +5976,7 @@ smoke_check_4(int metadata_write_strategy) cache_ptr = NULL; if ( verbose ) { HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -6104,7 +6052,7 @@ smoke_check_4(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -6200,7 +6148,7 @@ smoke_check_4(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6236,7 +6184,7 @@ smoke_check_4(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6281,7 +6229,6 @@ smoke_check_4(int metadata_write_strategy) static hbool_t smoke_check_5(int metadata_write_strategy) { - const char * fcn_name = "smoke_check_5()"; hbool_t success = TRUE; int i; int max_nerrors; @@ -6324,7 +6271,7 @@ smoke_check_5(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: server_main() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6339,7 +6286,7 @@ smoke_check_5(int metadata_write_strategy) cache_ptr = NULL; if ( verbose ) { HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -6353,7 +6300,7 @@ smoke_check_5(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -6411,7 +6358,7 @@ smoke_check_5(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6446,7 +6393,7 @@ smoke_check_5(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6520,7 +6467,6 @@ trace_file_check(int metadata_write_strategy) #ifdef H5_METADATA_TRACE_FILE - const char * fcn_name = "trace_file_check()"; const char *((* expected_output)[]) = NULL; const char * expected_output_0[] = { @@ -6643,7 +6589,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: server_main() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6658,7 +6604,7 @@ trace_file_check(int metadata_write_strategy) cache_ptr = NULL; if ( verbose ) { HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -6672,7 +6618,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } else { @@ -6685,7 +6631,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6721,7 +6667,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -6735,7 +6681,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } else { @@ -6749,7 +6695,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6761,7 +6707,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6796,7 +6742,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6811,7 +6757,7 @@ trace_file_check(int metadata_write_strategy) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: HDfopen failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } @@ -6848,12 +6794,12 @@ trace_file_check(int metadata_write_strategy) if ( verbose ) { HDfprintf(stdout, "%d:%s: Unexpected data in trace file line %d.\n", - world_mpi_rank, fcn_name, i); + world_mpi_rank, FUNC, i); HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", - world_mpi_rank, fcn_name, (*expected_output)[i], + world_mpi_rank, FUNC, (*expected_output)[i], expected_line_len); HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", - world_mpi_rank, fcn_name, buffer, + world_mpi_rank, FUNC, buffer, actual_line_len); } } else { @@ -6920,7 +6866,6 @@ trace_file_check(int metadata_write_strategy) int main(int argc, char **argv) { - const char * fcn_name = "main()"; int express_test; unsigned u; int mpi_size; @@ -6999,7 +6944,7 @@ main(int argc, char **argv) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -7008,7 +6953,7 @@ main(int argc, char **argv) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 1.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -7021,7 +6966,7 @@ main(int argc, char **argv) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: h5_fixname() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } break; } @@ -7032,7 +6977,7 @@ main(int argc, char **argv) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -7044,7 +6989,7 @@ main(int argc, char **argv) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } @@ -7053,7 +6998,7 @@ main(int argc, char **argv) nerrors++; if ( verbose ) { HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", - world_mpi_rank, fcn_name); + world_mpi_rank, FUNC); } } } -- cgit v0.12 From f34bdad87c4af43bd09a6b9e6f8859cb268ce6ec Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 15 Jun 2015 13:35:00 -0500 Subject: [svn-r27206] fix for HDFFV-9418. - Moving truncate to H5F_flush() where it was done a long time ago. - Add a second H5AC_flush() call after the truncate is done to make sure we write the correct EOA. tested with h5committest --- src/H5Fint.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index e012ba6..94d76cc 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -857,14 +857,6 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close property list") - /* Only truncate the file on an orderly close, with write-access */ - if(f->closing && (H5F_ACC_RDWR & H5F_INTENT(f))) { - /* Truncate the file to the current allocated size */ - if(H5FD_truncate(f->shared->lf, dxpl_id, (unsigned)TRUE) < 0) - /* Push error, but keep going*/ - HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") - } /* end if */ - /* Close the file */ if(H5FD_close(f->shared->lf) < 0) /* Push error, but keep going*/ @@ -1182,6 +1174,15 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") + /* Truncate the file to the current allocated size */ + if(H5FD_truncate(f->shared->lf, dxpl_id, (unsigned)TRUE) < 0) + HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") + + /* Flush the entire metadata cache again since the EOA could have changed in the truncate call. */ + if(H5AC_flush(f, dxpl_id) < 0) + /* Push error, but keep going*/ + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") + /* Set up I/O info for operation */ fio_info.f = f; if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) -- cgit v0.12 From afb85e30e5874454fe890bb06c1a8cc67d2dc245 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 15 Jun 2015 14:29:30 -0500 Subject: [svn-r27207] use "closing" flag instead of always TRUE in the truncate call. --- src/H5Fint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index 94d76cc..df8e886 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1175,7 +1175,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing) HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Truncate the file to the current allocated size */ - if(H5FD_truncate(f->shared->lf, dxpl_id, (unsigned)TRUE) < 0) + if(H5FD_truncate(f->shared->lf, dxpl_id, closing) < 0) HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") /* Flush the entire metadata cache again since the EOA could have changed in the truncate call. */ -- cgit v0.12 From 6e9e9e0dd200979642de8d2a2bce2f66f9728237 Mon Sep 17 00:00:00 2001 From: Barbara Jones Date: Tue, 16 Jun 2015 13:32:04 -0500 Subject: [svn-r27216] The comments in this example were incorrect regarding the resulting dataset. They were updated to match the output of the file. (HDFFV-637) --- examples/h5_extend_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index 74f6c01..56bd025 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -165,9 +165,9 @@ main (void) /* * Resulting dataset * - * 3 3 3 2 2 - * 3 3 3 2 2 - * 3 3 3 0 0 + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 * 2 0 0 0 0 * 2 0 0 0 0 * 2 0 0 0 0 -- cgit v0.12