Skip to content

Commit

Permalink
Now use H5Literate2() instead of H5Literate() when its available
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Aug 5, 2024
1 parent 1aa2c6b commit c3ae3da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1618,13 +1618,13 @@ if test "x$enable_hdf5" = xyes; then
# H5Pset_fapl_mpiposix and H5Pget_fapl_mpiposix have been removed since HDF5 1.8.12.
# Use H5Pset_fapl_mpio and H5Pget_fapl_mpio, instead.

AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5Pset_all_coll_metadata_ops H5Literate])
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5Pset_all_coll_metadata_ops H5Literate H5Literate2])

# Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0)
if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then
AC_DEFINE([HDF5_HAS_COLL_METADATA_OPS], [1], [if true, use collective metadata ops in parallel netCDF-4])
fi

# If parallel is available in hdf5, enable it in the C code. Also add some stuff to netcdf.h.
if test "x$ac_cv_func_H5Pget_fapl_mpio" = xyes -o "x$ac_cv_func_H5Pget_fapl_mpiposix" = xyes; then
hdf5_parallel=yes
Expand Down
6 changes: 6 additions & 0 deletions libhdf5/hdf5open.c
Original file line number Diff line number Diff line change
Expand Up @@ -2857,9 +2857,15 @@ rec_read_metadata(NC_GRP_INFO_T *grp)
* passed as a parameter to the callback function
* read_hdf5_obj(). (I have also tried H5Oiterate(), but it is much
* slower iterating over the same file - Ed.) */
#ifdef HAVE_H5LITERATE2
if (H5Literate2(hdf5_grp->hdf_grpid, iter_index, H5_ITER_INC, &idx,
read_hdf5_obj, (void *)&udata) < 0)
BAIL(NC_EHDFERR);
#else
if (H5Literate(hdf5_grp->hdf_grpid, iter_index, H5_ITER_INC, &idx,
read_hdf5_obj, (void *)&udata) < 0)
BAIL(NC_EHDFERR);
#endif

/* Process the child groups found. (Deferred until now, so that the
* types in the current group get processed and are available for
Expand Down

0 comments on commit c3ae3da

Please sign in to comment.