summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-04-09 23:18:29 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-04-09 23:18:29 (GMT)
commitf56cc4156ec09d434b4f474afe5ed5b3786c5fe5 (patch)
tree04c71800e236564d469cd88256728825e3928baa
parent0b7490e7e4f2121b15fe01daa1cce318dab36ad9 (diff)
downloadhdf5-f56cc4156ec09d434b4f474afe5ed5b3786c5fe5.zip
hdf5-f56cc4156ec09d434b4f474afe5ed5b3786c5fe5.tar.gz
hdf5-f56cc4156ec09d434b4f474afe5ed5b3786c5fe5.tar.bz2
[svn-r23568] Bring revision 22634:22690 from trunk to revise_chunks.
h5committested.
-rw-r--r--MANIFEST1
-rw-r--r--README.txt2
-rw-r--r--c++/src/Makefile.in2
-rw-r--r--config/lt_vers.am2
-rwxr-xr-xconfigure22
-rw-r--r--configure.in2
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--hl/c++/src/Makefile.in2
-rw-r--r--hl/fortran/src/Makefile.in2
-rw-r--r--hl/src/Makefile.in2
-rw-r--r--release_docs/RELEASE.txt6
-rw-r--r--src/H5FD.c142
-rw-r--r--src/H5FDcore.c2
-rw-r--r--src/H5FDdirect.c2
-rw-r--r--src/H5FDfamily.c121
-rw-r--r--src/H5FDlog.c2
-rw-r--r--src/H5FDmpio.c200
-rw-r--r--src/H5FDmpiposix.c2
-rw-r--r--src/H5FDmulti.c407
-rw-r--r--src/H5FDprivate.h2
-rw-r--r--src/H5FDsec2.c2
-rw-r--r--src/H5FDstdio.c2
-rw-r--r--src/H5FSprivate.h2
-rw-r--r--src/H5FSsection.c111
-rw-r--r--src/H5MF.c150
-rw-r--r--src/H5MFaggr.c161
-rw-r--r--src/H5MFpkg.h1
-rw-r--r--src/H5MFprivate.h1
-rw-r--r--src/H5MFsection.c4
-rw-r--r--src/H5Ocopy.c16
-rw-r--r--src/H5Pdcpl.c2
-rw-r--r--src/H5Pdxpl.c471
-rw-r--r--src/H5Pfapl.c309
-rw-r--r--src/H5Pprivate.h2
-rw-r--r--src/H5Zscaleoffset.c6
-rw-r--r--src/H5public.h4
-rw-r--r--src/Makefile.in2
-rw-r--r--test/cache_tagging.c18
-rw-r--r--test/mf.c401
-rw-r--r--test/tfile.c12
-rw-r--r--tools/h5diff/CMakeLists.txt7
-rw-r--r--tools/h5diff/h5diffgentest.c17
-rw-r--r--tools/h5diff/testfiles/h5diff_59.txt11
-rw-r--r--tools/h5diff/testfiles/h5diff_dtypes.h5bin10776 -> 11416 bytes
-rwxr-xr-xtools/h5diff/testh5diff.sh5
-rw-r--r--tools/h5dump/CMakeLists.txt71
-rw-r--r--tools/h5dump/testh5dump.sh.in57
-rw-r--r--tools/lib/h5diff.h5
-rw-r--r--tools/lib/h5diff_attr.c8
-rw-r--r--tools/lib/h5diff_dset.c24
-rw-r--r--tools/lib/h5diff_util.c42
-rw-r--r--vms/src/h5pubconf.h6
52 files changed, 1450 insertions, 1405 deletions
diff --git a/MANIFEST b/MANIFEST
index 9e45949..9fed176 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1845,6 +1845,7 @@
./tools/h5diff/testfiles/h5diff_56.txt
./tools/h5diff/testfiles/h5diff_57.txt
./tools/h5diff/testfiles/h5diff_58.txt
+./tools/h5diff/testfiles/h5diff_59.txt
./tools/h5diff/testfiles/h5diff_600.txt
./tools/h5diff/testfiles/h5diff_601.txt
./tools/h5diff/testfiles/h5diff_603.txt
diff --git a/README.txt b/README.txt
index 6eda55e..5f698cf 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.125-FA_a5 currently under development
+HDF5 version 1.9.126-FA_a5 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 c707e9c..b76a74c 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 115
+LT_VERS_REVISION = 116
LT_VERS_AGE = 0
# Include src directory
diff --git a/config/lt_vers.am b/config/lt_vers.am
index 6540b48..07dad57 100644
--- a/config/lt_vers.am
+++ b/config/lt_vers.am
@@ -17,7 +17,7 @@
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 115
+LT_VERS_REVISION = 116
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and
diff --git a/configure b/configure
index a32a3e2..dc3adf5 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in Id: configure.in 22636 2012-08-06 19:42:49Z koziol .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for HDF5 1.9.125-FA_a5.
+# Generated by GNU Autoconf 2.68 for HDF5 1.9.126-FA_a5.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -571,8 +571,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.9.125-FA_a5'
-PACKAGE_STRING='HDF5 1.9.125-FA_a5'
+PACKAGE_VERSION='1.9.126-FA_a5'
+PACKAGE_STRING='HDF5 1.9.126-FA_a5'
PACKAGE_BUGREPORT='help@hdfgroup.org'
PACKAGE_URL=''
@@ -1463,7 +1463,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.125-FA_a5 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.9.126-FA_a5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1533,7 +1533,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.9.125-FA_a5:";;
+ short | recursive ) echo "Configuration of HDF5 1.9.126-FA_a5:";;
esac
cat <<\_ACEOF
@@ -1726,7 +1726,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.9.125-FA_a5
+HDF5 configure 1.9.126-FA_a5
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2815,7 +2815,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.125-FA_a5, which was
+It was created by HDF5 $as_me 1.9.126-FA_a5, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3636,7 +3636,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.9.125-FA_a5'
+ VERSION='1.9.126-FA_a5'
cat >>confdefs.h <<_ACEOF
@@ -30668,7 +30668,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.125-FA_a5, which was
+This file was extended by HDF5 $as_me 1.9.126-FA_a5, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -30734,7 +30734,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.125-FA_a5
+HDF5 config.status 1.9.126-FA_a5
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
@@ -33533,7 +33533,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-HDF5 config.lt 1.9.125-FA_a5
+HDF5 config.lt 1.9.126-FA_a5
configured by $0, generated by GNU Autoconf 2.68.
Copyright (C) 2010 Free Software Foundation, Inc.
diff --git a/configure.in b/configure.in
index 828561e..445d485 100644
--- a/configure.in
+++ b/configure.in
@@ -26,7 +26,7 @@ dnl
dnl NOTE: Don't forget to change the version number here when we do a
dnl release!!!
dnl
-AC_INIT([HDF5], [1.9.125-FA_a5], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.9.126-FA_a5], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AM_CONFIG_HEADER([src/H5config.h])
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 13a07a4..e61266e 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 115
+LT_VERS_REVISION = 116
LT_VERS_AGE = 0
# Include src directory in both Fortran and C flags (C compiler is used
diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in
index b0492bf..84c0e98 100644
--- a/hl/c++/src/Makefile.in
+++ b/hl/c++/src/Makefile.in
@@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 115
+LT_VERS_REVISION = 116
LT_VERS_AGE = 0
# Include src directory
diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in
index 30d2cac..16db0bc 100644
--- a/hl/fortran/src/Makefile.in
+++ b/hl/fortran/src/Makefile.in
@@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 115
+LT_VERS_REVISION = 116
LT_VERS_AGE = 0
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \
-I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index eaeac2e..f39b0a7 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 115
+LT_VERS_REVISION = 116
LT_VERS_AGE = 0
# This library is our main target.
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index c448d1d..f3e8815 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,5 +1,4 @@
-HDF5 version 1.9.125-FA_a5 currently under development
-================================================================================
+HDF5 version 1.9.126-FA_a5 currently under development
INTRODUCTION
@@ -705,6 +704,9 @@ Bug Fixes since HDF5-1.8.0 release
Tools
-----
+ - h5diff: Fixed the incorrect result when comparing attribute data
+ values and the data type has same class but different size.
+ HDFFV-7942 (JKM 08/15/2012)
- ph5diff: Fixed intermittent hang issue on a certain operation in
parallel mode. It was detected by daily test for comparing
non-comparable objects, but it could have occurred in other
diff --git a/src/H5FD.c b/src/H5FD.c
index 7db584e..b359d78 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -71,7 +71,6 @@ static herr_t H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *),
void *pl);
static herr_t H5FD_free_cls(H5FD_class_t *cls);
static herr_t H5FD_fapl_copy(hid_t driver_id, const void *fapl, void **copied_fapl);
-static herr_t H5FD_dxpl_copy(hid_t driver_id, const void *dxpl, void **copied_dxpl);
static int H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/);
static int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/);
@@ -456,13 +455,9 @@ H5FD_get_class(hid_t id)
if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &driver_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID")
ret_value = H5FD_get_class(driver_id);
- } else if(TRUE == H5P_isa_class(id, H5P_DATASET_XFER)) {
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID")
- ret_value = H5FD_get_class(driver_id);
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a driver id, file access property list or data transfer property list")
- }
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a driver id or file access property list")
} /* end if */
done:
@@ -826,125 +821,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_dxpl_open
- *
- * Purpose: Mark a driver as used by a data transfer property list
- *
- * Return: Success: non-negative
- *
- * Failure: negative
- *
- * Programmer: Quincey Koziol
- * Thursday, October 23, 2003
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info)
-{
- void *copied_driver_info = NULL; /* Temporary VFL driver info */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Increment the reference count on the driver and copy the driver info */
- if(H5I_inc_ref(driver_id, FALSE) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "can't increment VFL driver ID")
- if(H5FD_dxpl_copy(driver_id, driver_info, &copied_driver_info) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "can't copy VFL driver")
-
- /* Set the driver information for the new property list */
- if(H5P_set(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set VFL driver ID")
- if(H5P_set(plist, H5D_XFER_VFL_INFO_NAME, &copied_driver_info) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set VFL driver info")
-
-done:
- if(ret_value < 0)
- if(copied_driver_info && H5FD_dxpl_close(driver_id, copied_driver_info) < 0)
- HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close copy of driver info")
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_dxpl_open() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_dxpl_copy
- *
- * Purpose: Copies the driver-specific part of the data transfer property
- * list.
- *
- * Return: Success: non-negative
- *
- * Failure: negative
- *
- * Programmer: Robb Matzke
- * Tuesday, August 3, 1999
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl)
-{
- H5FD_class_t *driver;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check args */
- if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID")
-
- /* Copy the file access property list */
- if(H5FD_pl_copy(driver->dxpl_copy, driver->dxpl_size, old_dxpl, copied_dxpl) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "can't copy driver data transfer property list")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_dxpl_copy() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_dxpl_close
- *
- * Purpose: Closes a driver for a dataset transfer property list
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Robb Matzke
- * Tuesday, August 3, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5FD_dxpl_close(hid_t driver_id, void *dxpl)
-{
- H5FD_class_t *driver;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Check args */
- if(driver_id > 0) {
- if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID")
-
- /* Close the driver for the property list */
- if(H5FD_pl_close(driver_id, driver->dxpl_free, dxpl) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_dxpl_close() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5FDopen
*
* Purpose: Opens a file named NAME for the type(s) of access described
@@ -1456,9 +1332,9 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
if(size == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "zero-size request")
if(H5P_DEFAULT == dxpl_id)
- dxpl_id= H5P_DATASET_XFER_DEFAULT;
+ dxpl_id = H5P_DATASET_XFER_DEFAULT;
else
- if(TRUE != H5P_isa_class(dxpl_id,H5P_DATASET_XFER))
+ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list")
/* Do the real work */
@@ -1508,9 +1384,9 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz
if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid request type")
if(H5P_DEFAULT == dxpl_id)
- dxpl_id= H5P_DATASET_XFER_DEFAULT;
+ dxpl_id = H5P_DATASET_XFER_DEFAULT;
else
- if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER))
+ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
/* Do the real work */
@@ -1796,7 +1672,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size
/* Get the default dataset transfer property list if the user didn't provide one */
if(H5P_DEFAULT == dxpl_id)
- dxpl_id= H5P_DATASET_XFER_DEFAULT;
+ dxpl_id = H5P_DATASET_XFER_DEFAULT;
else
if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
@@ -1965,7 +1841,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, unsigned closing)
if(H5P_DEFAULT == dxpl_id)
dxpl_id = H5P_DATASET_XFER_DEFAULT;
else
- if(TRUE != H5P_isa_class(dxpl_id,H5P_DATASET_XFER))
+ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
/* Do the real work */
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index bb23d2d..decdbf0 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -187,7 +187,7 @@ static const H5FD_class_t H5FD_core_g = {
H5FD_core_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
};
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 8bb613c..1108e05 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -208,7 +208,7 @@ static const H5FD_class_t H5FD_direct_g = {
H5FD_direct_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
};
/* Declare a free list to manage the H5FD_direct_t struct */
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 6f6d757..f051269 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -82,18 +82,11 @@ typedef struct H5FD_family_fapl_t {
hid_t memb_fapl_id; /*file access property list of each memb*/
} H5FD_family_fapl_t;
-/* Driver specific data transfer properties */
-typedef struct H5FD_family_dxpl_t {
- hid_t memb_dxpl_id; /*data xfer property list of each memb */
-} H5FD_family_dxpl_t;
-
/* Callback prototypes */
static herr_t H5FD_family_term(void);
static void *H5FD_family_fapl_get(H5FD_t *_file);
static void *H5FD_family_fapl_copy(const void *_old_fa);
static herr_t H5FD_family_fapl_free(void *_fa);
-static void *H5FD_family_dxpl_copy(const void *_old_dx);
-static herr_t H5FD_family_dxpl_free(void *_dx);
static hsize_t H5FD_family_sb_size(H5FD_t *_file);
static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/,
unsigned char *buf/*out*/);
@@ -128,9 +121,9 @@ static const H5FD_class_t H5FD_family_g = {
H5FD_family_fapl_get, /*fapl_get */
H5FD_family_fapl_copy, /*fapl_copy */
H5FD_family_fapl_free, /*fapl_free */
- sizeof(H5FD_family_dxpl_t), /*dxpl_size */
- H5FD_family_dxpl_copy, /*dxpl_copy */
- H5FD_family_dxpl_free, /*dxpl_free */
+ 0, /*dxpl_size */
+ NULL, /*dxpl_copy */
+ NULL, /*dxpl_free */
H5FD_family_open, /*open */
H5FD_family_close, /*close */
H5FD_family_cmp, /*cmp */
@@ -148,7 +141,7 @@ static const H5FD_class_t H5FD_family_g = {
H5FD_family_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
};
@@ -482,92 +475,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_family_dxpl_copy
- *
- * Purpose: Copes the family-specific data transfer properties.
- *
- * Return: Success: Ptr to new property list
- *
- * Failure: NULL
- *
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5FD_family_dxpl_copy(const void *_old_dx)
-{
- const H5FD_family_dxpl_t *old_dx = (const H5FD_family_dxpl_t*)_old_dx;
- H5FD_family_dxpl_t *new_dx = NULL;
- H5P_genplist_t *plist; /* Property list pointer */
- void *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- if(NULL == (new_dx = (H5FD_family_dxpl_t *)H5MM_malloc(sizeof(H5FD_family_dxpl_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
-
- HDmemcpy(new_dx, old_dx, sizeof(H5FD_family_dxpl_t));
-
- if(old_dx->memb_dxpl_id == H5P_DATASET_XFER_DEFAULT) {
- if(H5I_inc_ref(new_dx->memb_dxpl_id, FALSE)<0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver")
- } /* end if */
- else {
- if(NULL == (plist = (H5P_genplist_t *)H5I_object(old_dx->memb_dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
- new_dx->memb_dxpl_id = H5P_copy_plist(plist, FALSE);
- } /* end else */
-
- /* Set return value */
- ret_value=new_dx;
-
-done:
- if(ret_value==NULL) {
- if(new_dx!=NULL)
- H5MM_xfree(new_dx);
- } /* end if */
- FUNC_LEAVE_NOAPI(ret_value)
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_family_dxpl_free
- *
- * Purpose: Frees the family-specific data transfer properties.
- *
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_family_dxpl_free(void *_dx)
-{
- H5FD_family_dxpl_t *dx = (H5FD_family_dxpl_t*)_dx;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- if(H5I_dec_ref(dx->memb_dxpl_id) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID")
- H5MM_xfree(dx);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-}
-
-
-/*-------------------------------------------------------------------------
* Function: H5FD_family_sb_size
*
* Purpose: Returns the size of the private information to be stored in
@@ -1239,7 +1146,6 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
{
H5FD_family_t *file = (H5FD_family_t*)_file;
unsigned char *buf = (unsigned char*)_buf;
- hid_t memb_dxpl_id = H5P_DATASET_XFER_DEFAULT;
haddr_t sub;
size_t req;
hsize_t tempreq;
@@ -1255,13 +1161,6 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
*/
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- if(H5P_DATASET_XFER_DEFAULT != dxpl_id && H5FD_FAMILY == H5P_get_driver(plist)) {
- H5FD_family_dxpl_t *dx = (H5FD_family_dxpl_t *)H5P_get_driver_info(plist);
-
- HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER));
- assert(dx);
- memb_dxpl_id = dx->memb_dxpl_id;
- } /* end if */
/* Read from each member */
while(size > 0) {
@@ -1279,7 +1178,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
assert(u<file->nmembs);
- if (H5FDread(file->memb[u], type, memb_dxpl_id, sub, req, buf)<0)
+ if (H5FDread(file->memb[u], type, dxpl_id, sub, req, buf)<0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "member file read failed")
addr += req;
@@ -1316,7 +1215,6 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
{
H5FD_family_t *file = (H5FD_family_t*)_file;
const unsigned char *buf = (const unsigned char*)_buf;
- hid_t memb_dxpl_id = H5P_DATASET_XFER_DEFAULT;
haddr_t sub;
size_t req;
hsize_t tempreq;
@@ -1332,13 +1230,6 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
*/
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- if(H5P_DATASET_XFER_DEFAULT != dxpl_id && H5FD_FAMILY == H5P_get_driver(plist)) {
- H5FD_family_dxpl_t *dx = (H5FD_family_dxpl_t *)H5P_get_driver_info(plist);
-
- HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER));
- HDassert(dx);
- memb_dxpl_id = dx->memb_dxpl_id;
- } /* end if */
/* Write to each member */
while (size>0) {
@@ -1356,7 +1247,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
assert(u<file->nmembs);
- if (H5FDwrite(file->memb[u], type, memb_dxpl_id, sub, req, buf)<0)
+ if (H5FDwrite(file->memb[u], type, dxpl_id, sub, req, buf)<0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "member file write failed")
addr += req;
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 523dc71..1c21666 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -239,7 +239,7 @@ static const H5FD_class_t H5FD_log_g = {
H5FD_log_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
};
/* Declare a free list to manage the H5FD_log_t struct */
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 6dbe831..cac101b 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -127,7 +127,7 @@ static const H5FD_class_mpi_t H5FD_mpio_g = {
H5FD_mpio_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
}, /* End of superclass information */
H5FD_mpio_mpi_rank, /*get_rank */
H5FD_mpio_mpi_size, /*get_size */
@@ -449,27 +449,23 @@ done:
* Use collective I/O access.
*
* Return: Success: Non-negative
- *
* Failure: Negative
*
* Programmer: Albert Cheng
* April 2, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-06
- * Modified to work with the virtual file layer.
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iDt", dxpl_id, xfer_mode);
- if(dxpl_id==H5P_DEFAULT)
+ if(dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list")
/* Check arguments */
@@ -479,15 +475,12 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode")
/* Set the transfer mode */
- if (H5P_set(plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0)
+ if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_dxpl_mpio() */
/*-------------------------------------------------------------------------
@@ -505,63 +498,54 @@ done:
* Programmer: Albert Cheng
* April 2, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-06
- * Modified to work with the virtual file layer.
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode/*out*/)
{
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* Return value */
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", dxpl_id, xfer_mode);
if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
- if(H5FD_MPIO != H5P_get_driver(plist))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
/* Get the transfer mode */
- if (xfer_mode)
- if (H5P_get(plist,H5D_XFER_IO_XFER_MODE_NAME,xfer_mode)<0)
+ if(xfer_mode)
+ if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, xfer_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_dxpl_mpio() */
+
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_collective_opt
-
-Purpose:
- To set a flag to choose linked chunk IO or multi-chunk IO without
- involving decision-making inside HDF5
-
-Description:
- The library will do linked chunk IO or multi-chunk IO without
- involving communications for decision-making process.
- The library won't behave as it asks for only when we find
- that the low-level MPI-IO package doesn't support this.
-
-Parameters:
- hid_t dxpl_id in: Data transfer property list identifier
- H5FD_mpio_chunk_opt_t in: The optimization flag for linked chunk IO
- or multi-chunk IO.
-
-
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-*
+ *
+ * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
+ * without involving decision-making inside HDF5
+ *
+ * Note: The library will do linked chunk I/O or multi-chunk I/O without
+ * involving communications for decision-making process.
+ * The library won't behave as it asks for only when we find
+ * that the low-level MPI-IO package doesn't support this.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mode)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iDc", dxpl_id, opt_mode);
@@ -577,9 +561,6 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo
if(H5P_set(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &opt_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value = H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_dxpl_mpio_collective_opt() */
@@ -587,33 +568,28 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_chunk_opt
-
-Purpose:
- To set a flag to choose linked chunk IO or multi-chunk IO without
- involving decision-making inside HDF5
-
-Description:
- The library will do linked chunk IO or multi-chunk IO without
- involving communications for decision-making process.
- The library won't behave as it asks for only when we find
- that the low-level MPI-IO package doesn't support this.
-
-Parameters:
- hid_t dxpl_id in: Data transfer property list identifier
- H5FD_mpio_chunk_opt_t in: The optimization flag for linked chunk IO
- or multi-chunk IO.
-
-
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-*
+ *
+ * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
+ * without involving decision-making inside HDF5
+ *
+ * Note: The library will do linked chunk I/O or multi-chunk I/O without
+ * involving communications for decision-making process.
+ * The library won't behave as it asks for only when we find
+ * that the low-level MPI-IO package doesn't support this.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iDh", dxpl_id, opt_mode);
@@ -626,41 +602,36 @@ H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
/* Set the transfer mode */
- if (H5P_set(plist,H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME,&opt_mode)<0)
+ if(H5P_set(plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &opt_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_dxpl_mpio_chunk_opt() */
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_chunk_opt_num
-
-Purpose:
- To set a threshold for doing linked chunk IO
-
-Description:
- If the number is greater than the threshold set by the user,
- the library will do linked chunk IO; otherwise, IO will be done for every chunk.
-
-Parameters:
- hid_t dxpl_id in: Data transfer property list identifier
- unsigned num_proc_per_chunk in: the threshold of the average number of chunks selected by each process
-
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-*
+ *
+ * Purpose: To set a threshold for doing linked chunk IO
+ *
+ * Note: If the number is greater than the threshold set by the user,
+ * the library will do linked chunk I/O; otherwise, I/O will be
+ * done for every chunk.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iIu", dxpl_id, num_chunk_per_proc);
@@ -673,41 +644,39 @@ H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
/* Set the transfer mode */
- if (H5P_set(plist,H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME,&num_chunk_per_proc)<0)
+ if(H5P_set(plist, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &num_chunk_per_proc) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_dxpl_mpio_chunk_opt_num() */
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_chunk_opt_ratio
-
-Purpose:
- To set a threshold for doing collective IO for each chunk
-Description:
- The library will calculate the percentage of the number of process holding selections at each chunk. If that percentage of number of process in the individual chunk is greater than the threshold set by the user, the library will do collective chunk IO for this chunk; otherwise, independent IO will be done for this chunk.
-Parameters:
- hid_t dxpl_id
- in: Data transfer property list identifier
- unsigned percent_num_proc_per_chunk
- in: the threshold of the percentage of the number of process holding selections per chunk
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-
-
-*
+ *
+ * Purpose: To set a threshold for doing collective I/O for each chunk
+ *
+ * Note: The library will calculate the percentage of the number of
+ * process holding selections at each chunk. If that percentage
+ * of number of process in the individual chunk is greater than
+ * the threshold set by the user, the library will do collective
+ * chunk I/O for this chunk; otherwise, independent I/O will be
+ * done for this chunk.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_chunk)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iIu", dxpl_id, percent_num_proc_per_chunk);
@@ -720,15 +689,12 @@ H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_ch
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
/* Set the transfer mode */
- if (H5P_set(plist,H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME,&percent_num_proc_per_chunk)<0)
+ if(H5P_set(plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &percent_num_proc_per_chunk) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_dxpl_mpio_chunk_opt_ratio() */
/*-------------------------------------------------------------------------
@@ -745,10 +711,6 @@ done:
* Programmer: Robb Matzke
* Friday, August 13, 1999
*
- * Modifications:
- * Albert Cheng, 2003-04-17
- * Duplicate the communicator and Info object so that the new
- * property list is insulated from the old one.
*-------------------------------------------------------------------------
*/
static void *
@@ -790,8 +752,6 @@ done:
* Programmer: Albert Cheng
* Jan 8, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index ecf6e0f..ed57f54 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -239,7 +239,7 @@ static const H5FD_class_mpi_t H5FD_mpiposix_g = {
H5FD_mpiposix_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
}, /* End of superclass information */
H5FD_mpiposix_mpi_rank, /*get_rank */
H5FD_mpiposix_mpi_size, /*get_size */
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index b1d312f..08529e2 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -74,6 +74,10 @@
#define END_MEMBERS }}
+#define H5FD_MULTI_DXPL_PROP_NAME "H5FD_MULTI_DXPL"
+#define H5FD_MULTI_DXPL_PROP_SIZE sizeof(H5FD_multi_dxpl_t)
+
+
/* The driver identification number, initialized at runtime */
static hid_t H5FD_MULTI_g = 0;
@@ -126,8 +130,6 @@ static herr_t H5FD_multi_sb_decode(H5FD_t *file, const char *name,
static void *H5FD_multi_fapl_get(H5FD_t *file);
static void *H5FD_multi_fapl_copy(const void *_old_fa);
static herr_t H5FD_multi_fapl_free(void *_fa);
-static void *H5FD_multi_dxpl_copy(const void *_old_dx);
-static herr_t H5FD_multi_dxpl_free(void *_dx);
static H5FD_t *H5FD_multi_open(const char *name, unsigned flags,
hid_t fapl_id, haddr_t maxaddr);
static herr_t H5FD_multi_close(H5FD_t *_file);
@@ -161,9 +163,9 @@ static const H5FD_class_t H5FD_multi_g = {
H5FD_multi_fapl_get, /*fapl_get */
H5FD_multi_fapl_copy, /*fapl_copy */
H5FD_multi_fapl_free, /*fapl_free */
- sizeof(H5FD_multi_dxpl_t), /*dxpl_size */
- H5FD_multi_dxpl_copy, /*dxpl_copy */
- H5FD_multi_dxpl_free, /*dxpl_free */
+ 0, /*dxpl_size */
+ NULL, /*dxpl_copy */
+ NULL, /*dxpl_free */
H5FD_multi_open, /*open */
H5FD_multi_close, /*close */
H5FD_multi_cmp, /*cmp */
@@ -590,6 +592,127 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_dxpl_copy_cb
+ *
+ * Purpose: Multi VFD DXPL property 'copy' callback
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, August 15, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_multi_dxpl_copy_cb(const char *name, size_t size, void *_dx)
+{
+ H5FD_multi_dxpl_t *dx = (H5FD_multi_dxpl_t *)_dx;
+ static const char *func = "H5FD_multi_dxpl_copy_cb"; /* Function Name for error reporting */
+
+ /* Shut compiler up */
+ name = name;
+
+ /* Sanity check */
+ assert(size == sizeof(H5FD_multi_dxpl_t));
+
+ ALL_MEMBERS(mt) {
+ if(dx->memb_dxpl[mt] >= 0)
+ if(H5Iinc_ref(dx->memb_dxpl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTINC, "can't increment ref. count for multi VFD property", -1)
+ } END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_dxpl_copy_cb() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_dxpl_cmp_cb
+ *
+ * Purpose: Multi VFD DXPL property 'compare' callback
+ *
+ * Return: Success: same as memcmp()
+ * Failure: <can't fail>
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, August 15, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5FD_multi_dxpl_cmp_cb(const void *_dx1, const void *_dx2, size_t size)
+{
+ const H5FD_multi_dxpl_t *dx1 = (const H5FD_multi_dxpl_t *)_dx1;
+ const H5FD_multi_dxpl_t *dx2 = (const H5FD_multi_dxpl_t *)_dx2;
+ int cmp_status;
+
+ /* Sanity check */
+ assert(size == sizeof(H5FD_multi_dxpl_t));
+
+ ALL_MEMBERS(mt) {
+ if(dx1->memb_dxpl[mt] >= 0) {
+ if(dx2->memb_dxpl[mt] >= 0) {
+ cmp_status = H5Pequal(dx1->memb_dxpl[mt], dx2->memb_dxpl[mt]);
+ if(cmp_status != 0)
+ return(cmp_status);
+ } /* end if */
+ else
+ return(1);
+ } /* end if */
+ else {
+ if(dx2->memb_dxpl[mt] >= 0)
+ return(-1);
+ else
+ if(dx1->memb_dxpl[mt] > dx2->memb_dxpl[mt])
+ return(1);
+ else if(dx1->memb_dxpl[mt] < dx2->memb_dxpl[mt])
+ return(-1);
+ else
+ continue;
+ } /* end else */
+ } END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_dxpl_cmp_cb() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_dxpl_cls_cb
+ *
+ * Purpose: Multi VFD DXPL property 'close' callback
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, August 15, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_multi_dxpl_cls_cb(const char *name, size_t size, void *_dx)
+{
+ H5FD_multi_dxpl_t *dx = (H5FD_multi_dxpl_t *)_dx;
+ static const char *func = "H5FD_multi_dxpl_cls_cb"; /* Function Name for error reporting */
+
+ /* Shut compiler up */
+ name = name;
+
+ /* Sanity check */
+ assert(size == sizeof(H5FD_multi_dxpl_t));
+
+ ALL_MEMBERS(mt) {
+ if(dx->memb_dxpl[mt] >= 0)
+ if(H5Idec_ref(dx->memb_dxpl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTDEC, "can't increment ref. count for multi VFD property", -1)
+ } END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_dxpl_cls_cb() */
+
+
+
+/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_multi
*
* Purpose: Set the data transfer property list DXPL_ID to use the multi
@@ -613,7 +736,8 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
{
H5FD_multi_dxpl_t dx;
H5FD_mem_t mt;
- static const char *func="H5FDset_dxpl_multi"; /* Function Name for error reporting */
+ htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */
+ static const char *func = "H5FDset_dxpl_multi"; /* Function Name for error reporting */
/*NO TRACE*/
@@ -621,26 +745,56 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
H5Eclear2(H5E_DEFAULT);
/* Check arguments */
- if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
+ if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1)
- if (!memb_dxpl)
+ if(!memb_dxpl)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1)
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (memb_dxpl[mt]!=H5P_DEFAULT && TRUE!=H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
+ if(memb_dxpl[mt] != H5P_DEFAULT && TRUE != H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1)
- }
+ } /* end for */
+
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+
+ /* Copy the DXPLs to internal property, converting "generic" default
+ * property lists into default dataset transfer property lists */
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
+ if(memb_dxpl[mt] == H5P_DEFAULT)
+ dx.memb_dxpl[mt] = H5P_DATASET_XFER_DEFAULT;
+ else {
+ if((dx.memb_dxpl[mt] = H5Pcopy(memb_dxpl[mt])) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCOPY, "can't copy dataset transfer property list", -1)
+ } /* end else */
+ } /* end for */
+
+ /* Clear previous property, if it exists */
+ if(prop_exists) {
+ H5FD_multi_dxpl_t old_dx;
+
+ /* Get the old DXPL value */
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &old_dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1)
- /* Initialize the data transfer property list */
- memcpy(dx.memb_dxpl, memb_dxpl, H5FD_MEM_NTYPES*sizeof(hid_t));
+ ALL_MEMBERS(mt) {
+ if(old_dx.memb_dxpl[mt] >= 0)
+ if(H5Pclose(old_dx.memb_dxpl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCLOSEOBJ, "can't close property list", -1)
+ } END_MEMBERS;
- /* Convert "generic" default property lists into default dataset transfer property lists */
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (dx.memb_dxpl[mt]==H5P_DEFAULT)
- dx.memb_dxpl[mt]=H5P_DATASET_XFER_DEFAULT;
- }
+ /* Set the new value */
+ if(H5Pset(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1)
+ } /* end if */
+ else {
+ /* Insert multi VFD DXPL property into property list */
+ if(H5Pinsert2(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, H5FD_MULTI_DXPL_PROP_SIZE, &dx, NULL, NULL, NULL, H5FD_multi_dxpl_copy_cb, H5FD_multi_dxpl_cmp_cb, H5FD_multi_dxpl_cls_cb) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTINSERT, "can't insert multi VFD DXPL property", -1)
+ } /* end else */
- return H5Pset_driver(dxpl_id, H5FD_MULTI, &dx);
-}
+ return 0;
+} /* end H5Pset_dxpl_multi() */
/*-------------------------------------------------------------------------
@@ -663,33 +817,42 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
herr_t
H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/)
{
- H5FD_multi_dxpl_t *dx;
+ H5FD_multi_dxpl_t dx;
H5FD_mem_t mt;
- static const char *func="H5FDget_dxpl_multi"; /* Function Name for error reporting */
+ htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */
+ static const char *func = "H5FDget_dxpl_multi"; /* Function Name for error reporting */
/*NO TRACE*/
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
+ /* Argument checking */
+ if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1)
- if (H5FD_MULTI!=H5Pget_driver(dxpl_id))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1)
- if(NULL == (dx = (H5FD_multi_dxpl_t *)H5Pget_driver_info(dxpl_id)))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1)
- if (memb_dxpl) {
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (dx->memb_dxpl[mt]>=0)
- memb_dxpl[mt] = H5Pcopy(dx->memb_dxpl[mt]);
+ if(memb_dxpl) {
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+ if(!prop_exists)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "multi VFD DXPL property not set", -1)
+
+ /* Get the DXPL value */
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1)
+
+ /* Deep copy the multi VFD DXPL value */
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
+ if(dx.memb_dxpl[mt] >= 0)
+ memb_dxpl[mt] = H5Pcopy(dx.memb_dxpl[mt]);
else
- memb_dxpl[mt] = dx->memb_dxpl[mt]; /*default or bad ID */
- }
- }
+ memb_dxpl[mt] = dx.memb_dxpl[mt]; /*default or bad ID */
+ } /* end for */
+ } /* end if */
return 0;
-}
+} /* end H5Pget_dxpl_multi() */
/*-------------------------------------------------------------------------
@@ -1106,90 +1269,6 @@ H5FD_multi_fapl_free(void *_fa)
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_dxpl_copy
- *
- * Purpose: Copes the multi-specific data transfer properties.
- *
- * Return: Success: Ptr to new property list
- *
- * Failure: NULL
- *
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5FD_multi_dxpl_copy(const void *_old_dx)
-{
- const H5FD_multi_dxpl_t *old_dx = (const H5FD_multi_dxpl_t*)_old_dx;
- H5FD_multi_dxpl_t *new_dx = (H5FD_multi_dxpl_t *)malloc(sizeof(H5FD_multi_dxpl_t));
- int nerrors = 0;
- static const char *func="H5FD_multi_dxpl_copy"; /* Function Name for error reporting */
-
- assert(new_dx);
-
- /* Clear the error stack */
- H5Eclear2(H5E_DEFAULT);
-
- memcpy(new_dx, old_dx, sizeof(H5FD_multi_dxpl_t));
- ALL_MEMBERS(mt) {
- if (old_dx->memb_dxpl[mt]>=0) {
- new_dx->memb_dxpl[mt] = H5Pcopy(old_dx->memb_dxpl[mt]);
- if (new_dx->memb_dxpl[mt]<0) nerrors++;
- }
- } END_MEMBERS;
-
- if (nerrors) {
- ALL_MEMBERS(mt) {
- (void)H5Pclose(new_dx->memb_dxpl[mt]);
- } END_MEMBERS;
- free(new_dx);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL)
- }
- return new_dx;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_multi_dxpl_free
- *
- * Purpose: Frees the multi-specific data transfer properties.
- *
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_multi_dxpl_free(void *_dx)
-{
- H5FD_multi_dxpl_t *dx = (H5FD_multi_dxpl_t*)_dx;
- static const char *func="H5FD_multi_dxpl_free"; /* Function Name for error reporting */
-
- /* Clear the error stack */
- H5Eclear2(H5E_DEFAULT);
-
- ALL_MEMBERS(mt) {
- if (dx->memb_dxpl[mt]>=0)
- if(H5Pclose(dx->memb_dxpl[mt])<0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1)
- } END_MEMBERS;
-
- free(dx);
- return 0;
-}
-
-
-/*-------------------------------------------------------------------------
* Function: H5FD_multi_open
*
* Purpose: Creates and/or opens a multi HDF5 file.
@@ -1823,25 +1902,33 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- void *_buf/*out*/)
+H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, void *_buf/*out*/)
{
H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_multi_dxpl_t *dx=NULL;
- H5FD_mem_t mt, mmt, hi=H5FD_MEM_DEFAULT;
- haddr_t start_addr=0;
+ H5FD_multi_dxpl_t dx;
+ htri_t prop_exists = FALSE; /* Whether the multi VFD DXPL property already exists */
+ H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
+ haddr_t start_addr = 0;
+ static const char *func = "H5FD_multi_read"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* Get the data transfer properties */
- if(H5P_FILE_ACCESS_DEFAULT != dxpl_id && H5FD_MULTI == H5Pget_driver(dxpl_id))
- dx = (H5FD_multi_dxpl_t *)H5Pget_driver_info(dxpl_id);
+ if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) {
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+
+ /* Get the DXPL value, if it exists */
+ if(prop_exists)
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1)
+ } /* end if */
/* Find the file to which this address belongs */
for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
@@ -1850,18 +1937,19 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
mmt = mt;
assert(mmt > 0 && mmt < H5FD_MEM_NTYPES);
- if (file->fa.memb_addr[mmt]>addr) continue;
- if (file->fa.memb_addr[mmt]>=start_addr) {
+ if(file->fa.memb_addr[mmt] > addr)
+ continue;
+ if(file->fa.memb_addr[mmt] >= start_addr) {
start_addr = file->fa.memb_addr[mmt];
hi = mmt;
- }
- }
- assert(hi>0);
+ } /* end if */
+ } /* end for */
+ assert(hi > 0);
/* Read from that member */
- return H5FDread(file->memb[hi], type, dx?dx->memb_dxpl[hi]:H5P_DEFAULT,
- addr-start_addr, size, _buf);
-}
+ return H5FDread(file->memb[hi], type, (prop_exists ? dx.memb_dxpl[hi] : H5P_DEFAULT),
+ addr - start_addr, size, _buf);
+} /* end H5FD_multi_read() */
/*-------------------------------------------------------------------------
@@ -1878,45 +1966,54 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- const void *_buf)
+H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, const void *_buf)
{
H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_multi_dxpl_t *dx=NULL;
- H5FD_mem_t mt, mmt, hi=H5FD_MEM_DEFAULT;
- haddr_t start_addr=0;
+ H5FD_multi_dxpl_t dx;
+ htri_t prop_exists = FALSE; /* Whether the multi VFD DXPL property already exists */
+ H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
+ haddr_t start_addr = 0;
+ static const char *func = "H5FD_multi_read"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* Get the data transfer properties */
- if(H5P_FILE_ACCESS_DEFAULT != dxpl_id && H5FD_MULTI == H5Pget_driver(dxpl_id))
- dx = (H5FD_multi_dxpl_t *)H5Pget_driver_info(dxpl_id);
+ if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) {
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+
+ /* Get the DXPL value, if it exists */
+ if(prop_exists)
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1)
+ } /* end if */
/* Find the file to which this address belongs */
for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
mmt = file->fa.memb_map[mt];
if(H5FD_MEM_DEFAULT == mmt)
mmt = mt;
- assert(mmt>0 && mmt<H5FD_MEM_NTYPES);
+ assert(mmt > 0 && mmt<H5FD_MEM_NTYPES);
- if (file->fa.memb_addr[mmt]>addr) continue;
- if (file->fa.memb_addr[mmt]>=start_addr) {
+ if(file->fa.memb_addr[mmt] > addr)
+ continue;
+ if(file->fa.memb_addr[mmt] >= start_addr) {
start_addr = file->fa.memb_addr[mmt];
hi = mmt;
- }
- }
- assert(hi>0);
+ } /* end if */
+ } /* end for */
+ assert(hi > 0);
/* Write to that member */
- return H5FDwrite(file->memb[hi], type, dx?dx->memb_dxpl[hi]:H5P_DEFAULT,
- addr-start_addr, size, _buf);
-}
+ return H5FDwrite(file->memb[hi], type, (prop_exists ? dx.memb_dxpl[hi] : H5P_DEFAULT),
+ addr - start_addr, size, _buf);
+} /* end H5FD_multi_write() */
/*-------------------------------------------------------------------------
@@ -1931,8 +2028,6 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 9c19562..64b71d4 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -96,8 +96,6 @@ H5_DLL herr_t H5FD_sb_decode(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);
-H5_DLL herr_t H5FD_dxpl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info);
-H5_DLL herr_t H5FD_dxpl_close(hid_t driver_id, void *dxpl);
H5_DLL hid_t H5FD_register(const void *cls, size_t size, hbool_t app_ref);
H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index a0a7c50..afe745b 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -197,7 +197,7 @@ static const H5FD_class_t H5FD_sec2_g = {
H5FD_sec2_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
};
/* Declare a free list to manage the H5FD_sec2_t struct */
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 50a1593..6dbc515 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -229,7 +229,7 @@ static const H5FD_class_t H5FD_stdio_g = {
H5FD_stdio_truncate, /* truncate */
NULL, /* lock */
NULL, /* unlock */
- H5FD_FLMAP_SINGLE /* fl_map */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h
index 9dd7022..48fb6d0 100644
--- a/src/H5FSprivate.h
+++ b/src/H5FSprivate.h
@@ -203,6 +203,8 @@ H5_DLL herr_t H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space,
hsize_t *nsects);
H5_DLL herr_t H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace,
H5FS_section_info_t *sect, unsigned new_class);
+H5_DLL htri_t H5FS_sect_try_shrink_eoa(const H5F_t *f, hid_t dxpl_id, const H5FS_t *fspace, void *op_data);
+H5_DLL herr_t H5FS_sect_query_last_sect(const H5FS_t *fspace, haddr_t *sect_addr, hsize_t *sect_size);
/* Statistics routine */
H5_DLL herr_t H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *stats);
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 5e1c853..faa2b2a 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -2327,3 +2327,114 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H
} /* end H5FS_sect_assert() */
#endif /* H5FS_DEBUG_ASSERT */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FS_sect_try_shrink_eoa
+ *
+ * Purpose: To shrink the last section on the merge list if the section
+ * is at EOF.
+ *
+ * Return: Success: non-negative (TRUE/FALSE)
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5FS_sect_try_shrink_eoa(const H5F_t *f, hid_t dxpl_id, const H5FS_t *fspace, void *op_data)
+{
+ hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */
+ hbool_t section_removed = FALSE; /* Whether a section was removed */
+ htri_t ret_value = FALSE; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments. */
+ HDassert(fspace);
+
+ if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0)
+ HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info")
+ sinfo_valid = TRUE;
+
+ if(fspace->sinfo && fspace->sinfo->merge_list) {
+ H5SL_node_t *last_node; /* Last node in merge list */
+
+ /* Check for last node in the merge list */
+ if(NULL != (last_node = H5SL_last(fspace->sinfo->merge_list))) {
+ H5FS_section_info_t *tmp_sect; /* Temporary free space section */
+ H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */
+
+ /* Get the pointer to the last section, from the last node */
+ tmp_sect = (H5FS_section_info_t *)H5SL_item(last_node);
+ HDassert(tmp_sect);
+ tmp_sect_cls = &fspace->sect_cls[tmp_sect->type];
+ if(tmp_sect_cls->can_shrink) {
+ /* Check if the section can be shrunk away */
+ if((ret_value = (*tmp_sect_cls->can_shrink)(tmp_sect, op_data)) < 0)
+ HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container")
+ if(ret_value > 0) {
+ HDassert(tmp_sect_cls->shrink);
+
+ /* Remove section from free space manager */
+ if(H5FS_sect_remove_real(fspace, tmp_sect) < 0)
+ HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures")
+ section_removed = TRUE;
+
+ /* Shrink away section */
+ if((*tmp_sect_cls->shrink)(&tmp_sect, op_data) < 0)
+ HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't shrink free space container")
+ } /* end if */
+ } /* end if */
+ } /* end if */
+ } /* end if */
+
+done:
+ /* Release the section info */
+ if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, section_removed) < 0)
+ HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info")
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FS_sect_try_shrink_eoa() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FS_sect_query_last_sect
+ *
+ * Purpose: Retrieve info about the last section on the merge list
+ *
+ * Return: Success: non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FS_sect_query_last_sect(const H5FS_t *fspace, haddr_t *sect_addr, hsize_t *sect_size)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ /* Check arguments. */
+ HDassert(fspace);
+
+ if(fspace->sinfo && fspace->sinfo->merge_list) {
+ H5SL_node_t *last_node; /* Last node in merge list */
+
+ /* Check for last node in the merge list */
+ if(NULL != (last_node = H5SL_last(fspace->sinfo->merge_list))) {
+ H5FS_section_info_t *tmp_sect; /* Temporary free space section */
+
+ /* Get the pointer to the last section, from the last node */
+ tmp_sect = (H5FS_section_info_t *)H5SL_item(last_node);
+ HDassert(tmp_sect);
+ if(sect_addr)
+ *sect_addr = tmp_sect->addr;
+ if(sect_size)
+ *sect_size = tmp_sect->size;
+ } /* end if */
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5FS_sect_query_last_sect() */
+
diff --git a/src/H5MF.c b/src/H5MF.c
index e708ab8..4b0668f 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -487,6 +487,7 @@ HDfprintf(stderr, "%s: Check 1.6, freeing node\n", FUNC);
udata.dxpl_id = dxpl_id;
udata.alloc_type = alloc_type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
#ifdef H5MF_ALLOC_DEBUG_MORE
HDfprintf(stderr, "%s: Check 1.7, re-adding node, node->sect_info.size = %Hu\n", FUNC, node->sect_info.size);
@@ -692,6 +693,7 @@ HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", FUNC, a
udata.dxpl_id = dxpl_id;
udata.alloc_type = alloc_type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* If size of section freed is larger than threshold, add it to the free space manager */
if(size >= f->shared->fs_threshold) {
@@ -823,6 +825,11 @@ H5MF_sects_dump(f, dxpl_id, stderr);
* Programmer: Quincey Koziol
* Monday, October 6, 2003
*
+ * Modifications:
+ * Vailin Choi; July 2012
+ * As the default free-list mapping is changed to H5FD_FLMAP_DICHOTOMY,
+ * checks are added to account for the last section of each free-space manager
+ * and the remaining space in the two aggregators are at EOF.
*-------------------------------------------------------------------------
*/
herr_t
@@ -836,6 +843,8 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
hsize_t tot_fs_size = 0; /* Amount of all free space managed */
hsize_t tot_meta_size = 0; /* Amount of metadata for free space managers */
H5FD_mem_t type; /* Memory type for iteration */
+ H5FD_mem_t fs_started[H5FD_MEM_NTYPES]; /* Indicate whether the free-space manager has been started */
+ hbool_t eoa_shrank; /* Whether an EOA shrink occurs */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -859,14 +868,15 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
/* Iterate over all the free space types that have managers and get each free list's space */
for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
- hbool_t fs_started = FALSE;
+
+ fs_started[type] = FALSE;
/* Check if the free space for the file has been initialized */
if(!f->shared->fs_man[type] && H5F_addr_defined(f->shared->fs_addr[type])) {
if(H5MF_alloc_open(f, dxpl_id, type) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space")
HDassert(f->shared->fs_man[type]);
- fs_started = TRUE;
+ fs_started[type] = TRUE;
} /* end if */
/* Check if there's free space of this type */
@@ -884,32 +894,54 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
tot_fs_size += type_fs_size;
tot_meta_size += type_meta_size;
} /* end if */
+ } /* end for */
- /* Close the free space manager, if we opened it here */
- if(fs_started)
+ /* Iterate until no more EOA shrink occurs */
+ do {
+ eoa_shrank = FALSE;
+
+ /* Check the last section of each free-space manager */
+ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
+ haddr_t sect_addr = HADDR_UNDEF;
+ hsize_t sect_size = 0;
+
+ if(f->shared->fs_man[type]) {
+ if(H5FS_sect_query_last_sect(f->shared->fs_man[type], &sect_addr, &sect_size) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query last section on merge list")
+
+ /* Deduct space from previous accumulation if the section is at EOA */
+ if(H5F_addr_eq(sect_addr + sect_size, eoa)) {
+ eoa = sect_addr;
+ eoa_shrank = TRUE;
+ tot_fs_size -= sect_size;
+ } /* end if */
+ } /* end if */
+ } /* end for */
+
+ /* Check the metadata and raw data aggregators */
+ if(ma_size > 0 && H5F_addr_eq(ma_addr + ma_size, eoa)) {
+ eoa = ma_addr;
+ eoa_shrank = TRUE;
+ ma_size = 0;
+ } /* end if */
+ if(sda_size > 0 && H5F_addr_eq(sda_addr + sda_size, eoa)) {
+ eoa = sda_addr;
+ eoa_shrank = TRUE;
+ sda_size = 0;
+ } /* end if */
+ } while(eoa_shrank);
+
+ /* Close the free-space managers if they were opened earlier in this routine */
+ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
+ if(fs_started[type])
if(H5MF_alloc_close(f, dxpl_id, type) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space")
} /* end for */
- /* Check for aggregating metadata allocations */
- if(ma_size > 0) {
- /* Add in the reserved space for metadata to the available free space */
- /* (if it's not at the tail of the file) */
- if(H5F_addr_ne(ma_addr + ma_size, eoa))
- tot_fs_size += ma_size;
- } /* end if */
-
- /* Check for aggregating small data allocations */
- if(sda_size > 0) {
- /* Add in the reserved space for metadata to the available free space */
- /* (if it's not at the tail of the file) */
- if(H5F_addr_ne(sda_addr + sda_size, eoa))
- tot_fs_size += sda_size;
- } /* end if */
-
/* Set the value(s) to return */
+ /* (The metadata & small data aggregators count as free space now, since they aren't at EOA) */
if(tot_space)
- *tot_space = tot_fs_size;
+ *tot_space = tot_fs_size + ma_size + sda_size;
if(meta_size)
*meta_size = tot_meta_size;
@@ -961,6 +993,7 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
udata.dxpl_id = dxpl_id;
udata.alloc_type = alloc_type;
udata.allow_sect_absorb = FALSE; /* Force section to be absorbed into aggregator */
+ udata.allow_eoa_shrink_only = FALSE;
/* Call the "can shrink" callback for the section */
if((ret_value = H5MF_sect_simple_can_shrink((const H5FS_section_info_t *)node, &udata)) < 0)
@@ -984,6 +1017,66 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
/*-------------------------------------------------------------------------
+ * Function: H5MF_close_shrink_eoa
+ *
+ * Purpose: Shrink the EOA while closing
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, July 7, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5MF_close_shrink_eoa(H5F_t *f, hid_t dxpl_id)
+{
+ H5FD_mem_t type; /* Memory type for iteration */
+ hbool_t eoa_shrank; /* Whether an EOA shrink occurs */
+ htri_t status; /* Status value */
+ H5MF_sect_ud_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* check args */
+ HDassert(f);
+ HDassert(f->shared);
+
+ /* Construct user data for callbacks */
+ udata.f = f;
+ udata.dxpl_id = dxpl_id;
+ udata.allow_sect_absorb = FALSE;
+ udata.allow_eoa_shrink_only = TRUE;
+
+ /* Iterate until no more EOA shrinking occurs */
+ do {
+ eoa_shrank = FALSE;
+
+ /* Check the last section of each free-space manager */
+ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
+ if(f->shared->fs_man[type]) {
+ udata.alloc_type = type;
+ if((status = H5FS_sect_try_shrink_eoa(f, dxpl_id, f->shared->fs_man[type], &udata)) < 0)
+ HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
+ else if(status > 0)
+ eoa_shrank = TRUE;
+ } /* end if */
+ } /* end for */
+
+ /* check the two aggregators */
+ if((status = H5MF_aggrs_try_shrink_eoa(f, dxpl_id)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
+ else if(status > 0)
+ eoa_shrank = TRUE;
+ } while(eoa_shrank);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5MF_close_shrink_eoa() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5MF_close
*
* Purpose: Close the free space tracker(s) for a file
@@ -993,6 +1086,12 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
* Programmer: Quincey Koziol
* Tuesday, January 22, 2008
*
+ * Modifications:
+ * Vailin Choi; July 2012
+ * As the default free-list mapping is changed to H5FD_FLMAP_DICHOTOMY,
+ * modifications are needed to shrink EOA if the last section of each free-space manager
+ * and the remaining space in the two aggregators are at EOA.
+
*-------------------------------------------------------------------------
*/
herr_t
@@ -1017,6 +1116,10 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
if(H5MF_free_aggrs(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators")
+ /* Trying shrinking the EOA for the file */
+ if(H5MF_close_shrink_eoa(f, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa")
+
/* Making free-space managers persistent for superblock version >= 2 */
if(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2
&& f->shared->fs_strategy == H5F_FILE_SPACE_ALL_PERSIST) {
@@ -1164,6 +1267,11 @@ HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC);
if(H5MF_free_aggrs(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators")
+ /* Trying shrinking the EOA for the file */
+ /* (in case any free space is now at the EOA) */
+ if(H5MF_close_shrink_eoa(f, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa")
+
done:
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: Leaving\n", FUNC);
diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c
index 6f68fd7..f015b19 100644
--- a/src/H5MFaggr.c
+++ b/src/H5MFaggr.c
@@ -57,6 +57,8 @@
/********************/
/* Local Prototypes */
/********************/
+static herr_t H5MF_aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type,
+ H5F_blk_aggr_t *aggr);
/*********************/
@@ -231,15 +233,14 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
if(H5F_addr_gt((eoa + size), f->shared->tmp_addr))
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space")
+ /* Release "other" aggregator, if it exists, is at the end of the allocated space,
+ * has allocated more than one block and the unallocated space is greater than its
+ * allocation block size.
+ */
if ((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
- ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
-
- if(H5FD_free(f->shared->lf, dxpl_id, other_alloc_type, f, other_aggr->addr, other_aggr->size) < 0)
+ (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
+ if(H5MF_aggr_free(f, dxpl_id, other_alloc_type, other_aggr) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block")
-
- other_aggr->addr = 0;
- other_aggr->tot_size = 0;
- other_aggr->size = 0;
} /* end if */
/* Allocate space from the VFD (i.e. at the end of the file) */
@@ -275,14 +276,14 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
if(H5F_addr_gt((eoa + aggr->alloc_size), f->shared->tmp_addr))
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space")
+ /* Release "other" aggregator, if it exists, is at the end of the allocated space,
+ * has allocated more than one block and the unallocated space is greater than its
+ * allocation block size.
+ */
if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
- ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
-
- if(H5FD_free(f->shared->lf, dxpl_id, other_alloc_type, f, other_aggr->addr, other_aggr->size) < 0)
+ (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
+ if(H5MF_aggr_free(f, dxpl_id, other_alloc_type, other_aggr) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block")
- other_aggr->addr = 0;
- other_aggr->tot_size = 0;
- other_aggr->size = 0;
} /* end if */
/* Allocate space from the VFD (i.e. at the end of the file) */
@@ -633,8 +634,10 @@ H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr,
/* Check if this aggregator is active */
if(f->shared->feature_flags & aggr->feature_flag) {
- *addr = aggr->addr;
- *size = aggr->size;
+ if(addr)
+ *addr = aggr->addr;
+ if(size)
+ *size = aggr->size;
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -766,3 +769,131 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5MF_free_aggrs() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5MF_aggr_can_shrink_eoa
+ *
+ * Purpose: Check if the remaining space in the aggregator is at EOA
+ *
+ * Return: Success: non-negative (TRUE/FALSE)
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi
+ *
+ *-------------------------------------------------------------------------
+ */
+static htri_t
+H5MF_aggr_can_shrink_eoa(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr)
+{
+ haddr_t eoa = HADDR_UNDEF; /* EOA for the file */
+ htri_t ret_value = FALSE; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(f);
+ HDassert(aggr);
+ HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA);
+
+ /* Get the EOA for the file */
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa")
+
+ /* Check if the aggregator is at EOA */
+ if(aggr->size > 0 && H5F_addr_defined(aggr->addr))
+ ret_value = H5F_addr_eq(eoa, aggr->addr + aggr->size);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5MF_aggr_can_shrink_eoa() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5MF_aggr_free
+ *
+ * Purpose: Free the aggregator's space in the file.
+ *
+ * Note: Does _not_ put the space on a free list
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Vailin Choi
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5MF_aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, H5F_blk_aggr_t *aggr)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(f);
+ HDassert(f->shared->lf);
+ HDassert(aggr);
+ HDassert(H5F_addr_defined(aggr->addr));
+ HDassert(aggr->size > 0);
+ HDassert(H5F_INTENT(f) & H5F_ACC_RDWR);
+ HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA);
+ HDassert(f->shared->feature_flags & aggr->feature_flag);
+
+ /* Free the remaining space at EOA in the aggregator */
+ if(H5FD_free(f->shared->lf, dxpl_id, type, f, aggr->addr, aggr->size) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregation block")
+
+ /* Reset the aggregator */
+ aggr->tot_size = 0;
+ aggr->addr = HADDR_UNDEF;
+ aggr->size = 0;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5MF_aggr_free() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5MF_aggrs_try_shrink_eoa
+ *
+ * Purpose: Check the metadata & small block aggregators to see if
+ * EOA shrink is possible; if so, shrink each aggregator
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Vailin Choi
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id)
+{
+ htri_t ma_status; /* Whether the metadata aggregator can shrink the EOA */
+ htri_t sda_status; /* Whether the small data aggregator can shrink the EOA */
+ htri_t ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check args */
+ HDassert(f);
+ HDassert(f->shared);
+
+ if((ma_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr))) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats")
+ if(ma_status > 0)
+ if(H5MF_aggr_free(f, dxpl_id, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
+
+ if((sda_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr))) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats")
+ if(sda_status > 0)
+ if(H5MF_aggr_free(f, dxpl_id, H5FD_MEM_DRAW, &(f->shared->sdata_aggr)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
+
+ ret_value = (ma_status || sda_status);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5MF_aggrs_try_shrink_eoa() */
+
diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h
index 25785ae..2071a0a 100644
--- a/src/H5MFpkg.h
+++ b/src/H5MFpkg.h
@@ -122,6 +122,7 @@ typedef struct H5MF_sect_ud_t {
hid_t dxpl_id; /* DXPL for VFD operations */
H5FD_mem_t alloc_type; /* Type of memory being allocated */
hbool_t allow_sect_absorb; /* Whether sections are allowed to absorb a block aggregator */
+ hbool_t allow_eoa_shrink_only; /* Whether shrinking eoa is allowed only for the section */
/* Up */
H5MF_shrink_type_t shrink; /* Type of shrink operation to perform */
diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h
index b471aa3..ad5e385 100644
--- a/src/H5MFprivate.h
+++ b/src/H5MFprivate.h
@@ -81,6 +81,7 @@ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size);
/* 'block aggregator' routines */
H5_DLL herr_t H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id);
+H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id);
/* Debugging routines */
#ifdef H5MF_DEBUGGING
diff --git a/src/H5MFsection.c b/src/H5MFsection.c
index 89b2219..0572def 100644
--- a/src/H5MFsection.c
+++ b/src/H5MFsection.c
@@ -328,6 +328,10 @@ HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", FUNC, sect-
HGOTO_DONE(TRUE)
} /* end if */
else {
+ /* Shrinking can't occur if the 'eoa_shrink_only' flag is set and we're not shrinking the EOA */
+ if(udata->allow_eoa_shrink_only)
+ HGOTO_DONE(FALSE)
+
/* Check if this section is allowed to merge with metadata aggregation block */
if(udata->f->shared->fs_aggr_merge[udata->alloc_type] & H5F_FS_MERGE_METADATA) {
htri_t status; /* Status from aggregator adjoin */
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 3a08d82..d54f454 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -1574,6 +1574,10 @@ done:
* Programmer: Neil Fortner
* Nov 3 2011
*
+ * Modifications:
+ * Vailin Choi; August 2012
+ * Use H5O_obj_class to get object type instead of
+ * H5O_get_info(...TRUE....) saving time in traversing metadata.
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1583,8 +1587,8 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc,
H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */
haddr_t *addr = NULL; /* Destination address */
hbool_t obj_inserted = FALSE; /* Object inserted into skip list */
- H5O_info_t oinfo; /* Object info */
H5A_attr_iter_op_t attr_op; /* Attribute iteration operator */
+ const H5O_obj_class_t *obj_class = NULL; /* Type of object */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1595,13 +1599,13 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc,
HDassert(udata->dst_dt_list);
HDassert(udata->dst_root_loc);
- /* Get the object's info */
- if(H5O_get_info(obj_oloc, udata->dxpl_id, TRUE, &oinfo) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info")
+ /* Get pointer to object class for this object */
+ if((obj_class = H5O_obj_class(obj_oloc, udata->dxpl_id)) == NULL)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type")
/* Check if the object is a datatype, a dataset using a committed
* datatype, or contains an attribute using a committed datatype */
- if(oinfo.type == H5O_TYPE_NAMED_DATATYPE) {
+ if(obj_class->type == H5O_TYPE_NAMED_DATATYPE) {
/* Allocate key */
if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
@@ -1626,7 +1630,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc,
obj_inserted = TRUE;
} /* end if */
} /* end if */
- else if(oinfo.type == H5O_TYPE_DATASET) {
+ else if(obj_class->type == H5O_TYPE_DATASET) {
/* Allocate key */
if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 49a663d..b75614a 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1648,7 +1648,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/,
+H5P_get_fill_value(H5P_genplist_t *plist, H5T_t *type, void *value/*out*/,
hid_t dxpl_id)
{
H5O_fill_t fill; /* Fill value to retrieve */
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index f1eb640..030669f 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -50,49 +50,43 @@
#define H5D_XFER_MAX_TEMP_BUF_SIZE sizeof(size_t)
#define H5D_XFER_MAX_TEMP_BUF_DEF H5D_TEMP_BUF_SIZE
/* Definitions for type conversion buffer property */
-#define H5D_XFER_TCONV_BUF_SIZE sizeof(void *)
-#define H5D_XFER_TCONV_BUF_DEF NULL
+#define H5D_XFER_TCONV_BUF_SIZE sizeof(void *)
+#define H5D_XFER_TCONV_BUF_DEF NULL
/* Definitions for background buffer property */
-#define H5D_XFER_BKGR_BUF_SIZE sizeof(void *)
-#define H5D_XFER_BKGR_BUF_DEF NULL
+#define H5D_XFER_BKGR_BUF_SIZE sizeof(void *)
+#define H5D_XFER_BKGR_BUF_DEF NULL
/* Definitions for background buffer type property */
-#define H5D_XFER_BKGR_BUF_TYPE_SIZE sizeof(H5T_bkg_t)
+#define H5D_XFER_BKGR_BUF_TYPE_SIZE sizeof(H5T_bkg_t)
#define H5D_XFER_BKGR_BUF_TYPE_DEF H5T_BKG_NO
/* Definitions for B-tree node splitting ratio property */
/* (These default B-tree node splitting ratios are also used for splitting
* group's B-trees as well as chunked dataset's B-trees - QAK)
*/
-#define H5D_XFER_BTREE_SPLIT_RATIO_SIZE sizeof(double[3])
-#define H5D_XFER_BTREE_SPLIT_RATIO_DEF {0.1, 0.5, 0.9}
+#define H5D_XFER_BTREE_SPLIT_RATIO_SIZE sizeof(double[3])
+#define H5D_XFER_BTREE_SPLIT_RATIO_DEF {0.1, 0.5, 0.9}
/* Definitions for vlen allocation function property */
-#define H5D_XFER_VLEN_ALLOC_SIZE sizeof(H5MM_allocate_t)
-#define H5D_XFER_VLEN_ALLOC_DEF H5D_VLEN_ALLOC
+#define H5D_XFER_VLEN_ALLOC_SIZE sizeof(H5MM_allocate_t)
+#define H5D_XFER_VLEN_ALLOC_DEF H5D_VLEN_ALLOC
/* Definitions for vlen allocation info property */
-#define H5D_XFER_VLEN_ALLOC_INFO_SIZE sizeof(void *)
-#define H5D_XFER_VLEN_ALLOC_INFO_DEF H5D_VLEN_ALLOC_INFO
+#define H5D_XFER_VLEN_ALLOC_INFO_SIZE sizeof(void *)
+#define H5D_XFER_VLEN_ALLOC_INFO_DEF H5D_VLEN_ALLOC_INFO
/* Definitions for vlen free function property */
-#define H5D_XFER_VLEN_FREE_SIZE sizeof(H5MM_free_t)
-#define H5D_XFER_VLEN_FREE_DEF H5D_VLEN_FREE
+#define H5D_XFER_VLEN_FREE_SIZE sizeof(H5MM_free_t)
+#define H5D_XFER_VLEN_FREE_DEF H5D_VLEN_FREE
/* Definitions for vlen free info property */
-#define H5D_XFER_VLEN_FREE_INFO_SIZE sizeof(void *)
-#define H5D_XFER_VLEN_FREE_INFO_DEF H5D_VLEN_FREE_INFO
-/* Definitions for file driver ID property */
-#define H5D_XFER_VFL_ID_SIZE sizeof(hid_t)
-#define H5D_XFER_VFL_ID_DEF H5FD_VFD_DEFAULT
-/* Definitions for file driver info property */
-#define H5D_XFER_VFL_INFO_SIZE sizeof(void *)
-#define H5D_XFER_VFL_INFO_DEF NULL
+#define H5D_XFER_VLEN_FREE_INFO_SIZE sizeof(void *)
+#define H5D_XFER_VLEN_FREE_INFO_DEF H5D_VLEN_FREE_INFO
/* Definitions for hyperslab vector size property */
/* (Be cautious about increasing the default size, there are arrays allocated
* on the stack which depend on it - QAK)
*/
-#define H5D_XFER_HYPER_VECTOR_SIZE_SIZE sizeof(size_t)
-#define H5D_XFER_HYPER_VECTOR_SIZE_DEF H5D_IO_VECTOR_SIZE
+#define H5D_XFER_HYPER_VECTOR_SIZE_SIZE sizeof(size_t)
+#define H5D_XFER_HYPER_VECTOR_SIZE_DEF H5D_IO_VECTOR_SIZE
#ifdef H5_HAVE_PARALLEL
/* Definitions for I/O transfer mode property */
-#define H5D_XFER_IO_XFER_MODE_SIZE sizeof(H5FD_mpio_xfer_t)
-#define H5D_XFER_IO_XFER_MODE_DEF H5FD_MPIO_INDEPENDENT
+#define H5D_XFER_IO_XFER_MODE_SIZE sizeof(H5FD_mpio_xfer_t)
+#define H5D_XFER_IO_XFER_MODE_DEF H5FD_MPIO_INDEPENDENT
/* Definitions for optimization of MPI-IO transfer mode property */
#define H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE sizeof(H5FD_mpio_collective_opt_t)
#define H5D_XFER_MPIO_COLLECTIVE_OPT_DEF H5FD_MPIO_COLLECTIVE_IO
@@ -128,9 +122,9 @@
/* Definitions for data transform property */
#define H5D_XFER_XFORM_SIZE sizeof(void *)
#define H5D_XFER_XFORM_DEF NULL
-#define H5D_XFER_XFORM_DEL H5P_dxfr_xform_del
-#define H5D_XFER_XFORM_COPY H5P_dxfr_xform_copy
-#define H5D_XFER_XFORM_CLOSE H5P_dxfr_xform_close
+#define H5D_XFER_XFORM_DEL H5P__dxfr_xform_del
+#define H5D_XFER_XFORM_COPY H5P__dxfr_xform_copy
+#define H5D_XFER_XFORM_CLOSE H5P__dxfr_xform_close
/******************/
/* Local Typedefs */
@@ -147,15 +141,12 @@
/********************/
/* Property class callbacks */
-static herr_t H5P_dxfr_reg_prop(H5P_genclass_t *pclass);
-static herr_t H5P_dxfr_create(hid_t dxpl_id, void *create_data);
-static herr_t H5P_dxfr_copy(hid_t dst_dxpl_id, hid_t src_dxpl_id, void *copy_data);
-static herr_t H5P_dxfr_close(hid_t dxpl_id, void *close_data);
+static herr_t H5P__dxfr_reg_prop(H5P_genclass_t *pclass);
/* Property list callbacks */
-static herr_t H5P_dxfr_xform_del(hid_t prop_id, const char* name, size_t size, void* value);
-static herr_t H5P_dxfr_xform_copy(const char* name, size_t size, void* value);
-static herr_t H5P_dxfr_xform_close(const char* name, size_t size, void* value);
+static herr_t H5P__dxfr_xform_del(hid_t prop_id, const char* name, size_t size, void* value);
+static herr_t H5P__dxfr_xform_copy(const char* name, size_t size, void* value);
+static herr_t H5P__dxfr_xform_close(const char* name, size_t size, void* value);
/*********************/
@@ -169,12 +160,12 @@ const H5P_libclass_t H5P_CLS_DXFR[1] = {{
&H5P_CLS_ROOT_g, /* Parent class ID */
&H5P_CLS_DATASET_XFER_g, /* Pointer to class ID */
&H5P_LST_DATASET_XFER_g, /* Pointer to default property list ID */
- H5P_dxfr_reg_prop, /* Default property registration routine */
- H5P_dxfr_create, /* Class creation callback */
+ H5P__dxfr_reg_prop, /* Default property registration routine */
+ NULL, /* Class creation callback */
NULL, /* Class creation callback info */
- H5P_dxfr_copy, /* Class copy callback */
+ NULL, /* Class copy callback */
NULL, /* Class copy callback info */
- H5P_dxfr_close, /* Class close callback */
+ NULL, /* Class close callback */
NULL /* Class close callback info */
}};
@@ -186,7 +177,7 @@ const H5P_libclass_t H5P_CLS_DXFR[1] = {{
/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_reg_prop
+ * Function: H5P__dxfr_reg_prop
*
* Purpose: Register the data transfer property list class's properties
*
@@ -197,7 +188,7 @@ const H5P_libclass_t H5P_CLS_DXFR[1] = {{
*-------------------------------------------------------------------------
*/
static herr_t
-H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
+H5P__dxfr_reg_prop(H5P_genclass_t *pclass)
{
size_t def_max_temp_buf = H5D_XFER_MAX_TEMP_BUF_DEF; /* Default value for maximum temp buffer size */
void *def_tconv_buf = H5D_XFER_TCONV_BUF_DEF; /* Default value for type conversion buffer */
@@ -208,8 +199,6 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
void *def_vlen_alloc_info = H5D_XFER_VLEN_ALLOC_INFO_DEF; /* Default value for vlen allocation information */
H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; /* Default value for vlen free function */
void *def_vlen_free_info = H5D_XFER_VLEN_FREE_INFO_DEF; /* Default value for vlen free information */
- hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; /* Default value for file driver ID */
- void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; /* Default value for file driver info */
size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; /* Default value for vector size */
H5C_tag_t tag = H5C_TAG_DEF; /* Default value for cache entry tag */
#ifdef H5_HAVE_PARALLEL
@@ -229,7 +218,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
void *def_xfer_xform = H5D_XFER_XFORM_DEF; /* Default value for data transform */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Register the max. temp buffer size property */
if(H5P_register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &def_max_temp_buf, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
@@ -271,14 +260,6 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
if(H5P_register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &def_vlen_free_info, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
- /* Register the file driver ID property */
- if(H5P_register_real(pclass, H5D_XFER_VFL_ID_NAME, H5D_XFER_VFL_ID_SIZE, &def_vfl_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
-
- /* Register the file driver info property */
- if(H5P_register_real(pclass, H5D_XFER_VFL_INFO_NAME, H5D_XFER_VFL_INFO_SIZE, &def_vfl_info, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
-
/* Register the vector size property */
if(H5P_register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &def_hyp_vec_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@@ -300,7 +281,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &def_mpio_actual_chunk_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
- /* Register the actual io mode property. */
+ /* Register the actual I/O mode property. */
if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &def_mpio_actual_io_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@@ -334,157 +315,9 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_reg_prop() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_create
- *
- * Purpose: Callback routine which is called whenever any dataset transfer
- * property list is created. This routine performs any generic
- * initialization needed on the properties the library put into
- * the list.
- * Right now, it's just allocating the driver-specific dataset
- * transfer information.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Thursday, August 2, 2001
- *
- *-------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static herr_t
-H5P_dxfr_create(hid_t dxpl_id, void UNUSED *create_data)
-{
- hid_t driver_id; /* VFL driver ID */
- void *driver_info; /* VFL driver info */
- H5P_genplist_t *plist; /* Property list */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check arguments */
- if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
-
- /* Get the driver information */
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID")
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver info")
-
- /* Check if we have a valid driver ID */
- if(driver_id > 0) {
- /* Set the driver for the property list */
- if(H5FD_dxpl_open(plist, driver_id, driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_create() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_copy
- *
- * Purpose: Callback routine which is called whenever any dataset
- * transfer property list is copied. This routine copies
- * the properties from the old list to the new list.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Raymond Lu
- * Tuesday, October 2, 2001
- *
- *-------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static herr_t
-H5P_dxfr_copy(hid_t dst_dxpl_id, hid_t src_dxpl_id, void UNUSED *copy_data)
-{
- hid_t driver_id;
- void* driver_info;
- H5P_genplist_t *dst_plist; /* Destination property list */
- H5P_genplist_t *src_plist; /* Source property list */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
- if(NULL == (src_plist = (H5P_genplist_t *)H5I_object(src_dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
-
- /* Get values from old property list */
- if(H5P_get(src_plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID")
- if(H5P_get(src_plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info")
-
- if(driver_id > 0) {
- /* Set the driver for the property list */
- if(H5FD_dxpl_open(dst_plist, driver_id, driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_copy() */
+} /* end H5P__dxfr_reg_prop() */
-/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_close
- *
- * Purpose: Callback routine which is called whenever any dataset transfer
- * property list is closed. This routine performs any generic
- * cleanup needed on the properties the library put into the list.
- * Right now, it's just freeing the driver-specific dataset
- * transfer information.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Wednesday, July 11, 2001
- *
- *-------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static herr_t
-H5P_dxfr_close(hid_t dxpl_id, void UNUSED *close_data)
-{
- hid_t driver_id; /* VFL driver ID */
- void *driver_info; /* VFL driver info */
- H5P_genplist_t *plist; /* Property list */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check arguments */
- if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
-
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID")
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info")
- if(driver_id > 0) {
- /* Close the driver for the property list */
- if(H5FD_dxpl_close(driver_id, driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_close() */
/*-------------------------------------------------------------------------
@@ -502,11 +335,11 @@ 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 UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(value);
@@ -515,11 +348,11 @@ H5P_dxfr_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_xform_del() */
+} /* end H5P__dxfr_xform_del() */
/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_xform_copy
+ * Function: H5P__dxfr_xform_copy
*
* Purpose: Creates a copy of the user's data transform string and its
* associated parse tree.
@@ -534,11 +367,11 @@ 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 UNUSED *name, size_t UNUSED size, void *value)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(value);
@@ -547,11 +380,11 @@ H5P_dxfr_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_xform_copy() */
+} /* end H5P__dxfr_xform_copy() */
/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_xform_close
+ * Function: H5P__dxfr_xform_close
*
* Purpose: Frees memory allocated by H5P_dxfr_xform_set
*
@@ -565,11 +398,11 @@ 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 UNUSED *name, size_t UNUSED size, void *value)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(value);
@@ -578,18 +411,15 @@ H5P_dxfr_xform_close(const char UNUSED *name, size_t UNUSED size, void *value)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_xform_close() */
+} /* end H5P__dxfr_xform_close() */
/*-------------------------------------------------------------------------
* Function: H5Pset_data_transform
*
- * Purpose:
- * Sets data transform expression.
- *
- *
- * Return: Returns a non-negative value if successful; otherwise returns a negative value.
+ * Purpose: Sets data transform expression.
*
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Leon Arber
* Monday, March 07, 2004
@@ -611,7 +441,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "expression cannot be NULL")
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* See if a data transform is already set, and free it if it is */
@@ -628,9 +458,8 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
done:
if(ret_value < 0) {
- if(data_xform_prop)
- if(H5Z_xform_destroy(data_xform_prop) < 0)
- HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
+ if(data_xform_prop && H5Z_xform_destroy(data_xform_prop) < 0)
+ HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
} /* end if */
FUNC_LEAVE_API(ret_value)
@@ -640,10 +469,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pget_data_transform
*
- * Purpose:
- * Gets data transform expression.
+ * Purpose: Gets data transform expression.
*
- * Return: Returns a non-negative value if successful; otherwise returns a negative value.
+ * Return: Non-negative on success/Negative on failure
*
* Comments:
* If `expression' is non-NULL then write up to `size' bytes into that
@@ -683,9 +511,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "data transform has not been set")
/* Get the data transform string */
- pexp = H5Z_xform_extract_xform_str(data_xform_prop);
-
- if(!pexp)
+ if(NULL == (pexp = H5Z_xform_extract_xform_str(data_xform_prop)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "failed to retrieve transform expression")
len = HDstrlen(pexp);
@@ -699,9 +525,8 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size)
done:
if(ret_value < 0) {
- if(data_xform_prop)
- if(H5Z_xform_destroy(data_xform_prop) < 0)
- HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
+ if(data_xform_prop && H5Z_xform_destroy(data_xform_prop) < 0)
+ HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
} /* end if */
FUNC_LEAVE_API(ret_value)
@@ -733,7 +558,7 @@ herr_t
H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "iz*x*x", plist_id, size, tconv, bkg);
@@ -784,27 +609,27 @@ H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/)
H5TRACE3("z", "ixx", plist_id, tconv, bkg);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, 0, "can't find object for ID")
/* Return values */
- if (tconv)
- if(H5P_get(plist, H5D_XFER_TCONV_BUF_NAME, tconv)<0)
+ if(tconv)
+ if(H5P_get(plist, H5D_XFER_TCONV_BUF_NAME, tconv) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, 0, "Can't get transfer type conversion buffer")
- if (bkg)
- if(H5P_get(plist, H5D_XFER_BKGR_BUF_NAME, bkg)<0)
+ if(bkg)
+ if(H5P_get(plist, H5D_XFER_BKGR_BUF_NAME, bkg) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, 0, "Can't get background type conversion buffer")
/* Get the size */
- if(H5P_get(plist, H5D_XFER_MAX_TEMP_BUF_NAME, &size)<0)
+ if(H5P_get(plist, H5D_XFER_MAX_TEMP_BUF_NAME, &size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, 0, "Can't set transfer buffer size")
/* Set the return value */
- ret_value=size;
+ ret_value = size;
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_buffer() */
/*-------------------------------------------------------------------------
@@ -821,32 +646,30 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 17, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_preserve(hid_t plist_id, hbool_t status)
{
- H5T_bkg_t need_bkg; /* Value for background buffer type */
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ H5T_bkg_t need_bkg; /* Value for background buffer type */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ib", plist_id, status);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Update property list */
need_bkg = status ? H5T_BKG_YES : H5T_BKG_NO;
- if (H5P_set(plist,H5D_XFER_BKGR_BUF_TYPE_NAME,&need_bkg)<0)
+ if(H5P_set(plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_preserve() */
/*-------------------------------------------------------------------------
@@ -861,8 +684,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 17, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -876,19 +697,19 @@ H5Pget_preserve(hid_t plist_id)
H5TRACE1("Is", "i", plist_id);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get value */
- if (H5P_get(plist,H5D_XFER_BKGR_BUF_TYPE_NAME,&need_bkg)<0)
+ if(H5P_get(plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
/* Set return value */
- ret_value= need_bkg ? TRUE : FALSE;
+ ret_value = need_bkg ? TRUE : FALSE;
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_preserve() */
/*-------------------------------------------------------------------------
@@ -904,21 +725,19 @@ done:
* Programmer: Raymond Lu
* Jan 3, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iZe", plist_id, check);
/* Check argument */
- if (check != H5Z_ENABLE_EDC && check != H5Z_DISABLE_EDC)
+ if(check != H5Z_ENABLE_EDC && check != H5Z_DISABLE_EDC)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid value")
/* Get the plist structure */
@@ -926,12 +745,12 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Update property list */
- if (H5P_set(plist,H5D_XFER_EDC_NAME,&check)<0)
+ if(H5P_set(plist, H5D_XFER_EDC_NAME, &check) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_edc_check() */
/*-------------------------------------------------------------------------
@@ -947,15 +766,13 @@ done:
* Programmer: Raymond Lu
* Jan 3, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5Z_EDC_t
H5Pget_edc_check(hid_t plist_id)
{
H5P_genplist_t *plist; /* Property list pointer */
- H5Z_EDC_t ret_value; /* return value */
+ H5Z_EDC_t ret_value; /* Return value */
FUNC_ENTER_API(H5Z_ERROR_EDC)
H5TRACE1("Ze", "i", plist_id);
@@ -965,16 +782,12 @@ H5Pget_edc_check(hid_t plist_id)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5Z_ERROR_EDC, "can't find object for ID")
/* Update property list */
- if (H5P_get(plist,H5D_XFER_EDC_NAME,&ret_value)<0)
+ if(H5P_get(plist, H5D_XFER_EDC_NAME, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5Z_ERROR_EDC, "unable to set value")
- /* check valid value */
- if (ret_value != H5Z_ENABLE_EDC && ret_value != H5Z_DISABLE_EDC)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5Z_ERROR_EDC, "not a valid value")
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_edc_check() */
/*-------------------------------------------------------------------------
@@ -1117,40 +930,38 @@ done:
* Programmer: Robb Matzke
* Monday, September 28, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/,
- double *right/*out*/)
+ double *right/*out*/)
{
+ H5P_genplist_t *plist; /* Property list pointer */
double btree_split_ratio[3]; /* B-tree node split ratios */
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "ixxx", plist_id, left, middle, right);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get the split ratios */
- if (H5P_get(plist,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&btree_split_ratio)<0)
+ if(H5P_get(plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &btree_split_ratio) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
/* Get values */
- if (left)
+ if(left)
*left = btree_split_ratio[0];
- if (middle)
+ if(middle)
*middle = btree_split_ratio[1];
- if (right)
+ if(right)
*right = btree_split_ratio[2];
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_btree_ratios() */
/*-------------------------------------------------------------------------
@@ -1171,28 +982,26 @@ done:
* Programmer: Robb Matzke
* Monday, September 28, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
- double right)
+ double right)
{
- double split_ratio[3]; /* B-tree node split ratios */
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ double split_ratio[3]; /* B-tree node split ratios */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "iddd", plist_id, left, middle, right);
/* Check arguments */
- if (left<0.0 || left>1.0 || middle<0.0 || middle>1.0 ||
- right<0.0 || right>1.0)
+ if(left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 ||
+ right < 0.0 || right > 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0")
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
@@ -1201,12 +1010,12 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
split_ratio[2] = right;
/* Set the split ratios */
- if (H5P_set(plist,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&split_ratio)<0)
+ if(H5P_set(plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &split_ratio) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_btree_ratios() */
/*-------------------------------------------------------------------------
@@ -1226,28 +1035,26 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 1, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5P_set_vlen_mem_manager(H5P_genplist_t *plist, H5MM_allocate_t alloc_func,
- void *alloc_info, H5MM_free_t free_func, void *free_info)
+ void *alloc_info, H5MM_free_t free_func, void *free_info)
{
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- assert(plist);
+ HDassert(plist);
/* Update property list */
- if (H5P_set(plist,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_ALLOC_NAME, &alloc_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- if (H5P_set(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_ALLOC_INFO_NAME, &alloc_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- if (H5P_set(plist,H5D_XFER_VLEN_FREE_NAME,&free_func)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_FREE_NAME, &free_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- if (H5P_set(plist,H5D_XFER_VLEN_FREE_INFO_NAME,&free_info)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_FREE_INFO_NAME, &free_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
@@ -1272,27 +1079,25 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 1, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func,
- void *alloc_info, H5MM_free_t free_func, void *free_info)
+ void *alloc_info, H5MM_free_t free_func, void *free_info)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "ix*xx*x", plist_id, alloc_func, alloc_info, free_func,
free_info);
/* Check arguments */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
/* Update property list */
- if (H5P_set_vlen_mem_manager(plist,alloc_func,alloc_info,free_func,free_info)<0)
+ if(H5P_set_vlen_mem_manager(plist, alloc_func, alloc_info, free_func, free_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set values")
done:
@@ -1310,42 +1115,38 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 1, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/,
- void **alloc_info/*out*/,
- H5MM_free_t *free_func/*out*/,
- void **free_info/*out*/)
+ void **alloc_info/*out*/, H5MM_free_t *free_func/*out*/, void **free_info/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "ixxxx", plist_id, alloc_func, alloc_info, free_func, free_info);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- if(alloc_func!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,alloc_func)<0)
+ if(alloc_func)
+ if(H5P_get(plist, H5D_XFER_VLEN_ALLOC_NAME, alloc_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
- if(alloc_info!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,alloc_info)<0)
+ if(alloc_info)
+ if(H5P_get(plist, H5D_XFER_VLEN_ALLOC_INFO_NAME, alloc_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
- if(free_func!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_FREE_NAME,free_func)<0)
+ if(free_func)
+ if(H5P_get(plist, H5D_XFER_VLEN_FREE_NAME, free_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
- if(free_info!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_FREE_INFO_NAME,free_info)<0)
+ if(free_info)
+ if(H5P_get(plist, H5D_XFER_VLEN_FREE_INFO_NAME, free_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_vlen_mem_manager() */
/*-------------------------------------------------------------------------
@@ -1367,29 +1168,27 @@ done:
* Programmer: Quincey Koziol
* Monday, July 9, 2001
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_hyper_vector_size(hid_t plist_id, size_t vector_size)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iz", plist_id, vector_size);
/* Check arguments */
- if (vector_size<1)
+ if(vector_size < 1)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "vector size too small")
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Update property list */
- if (H5P_set(plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0)
+ if(H5P_set(plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &vector_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
@@ -1407,34 +1206,32 @@ done:
* Programmer: Quincey Koziol
* Monday, July 9, 2001
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", plist_id, vector_size);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Return values */
- if (vector_size)
- if (H5P_get(plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,vector_size)<0)
+ if(vector_size)
+ if(H5P_get(plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, vector_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_hyper_vector_size() */
-
#ifdef H5_HAVE_PARALLEL
+
/*-------------------------------------------------------------------------
* Function: H5Pget_mpio_actual_chunk_opt_mode
*
@@ -1444,6 +1241,7 @@ done:
*
* Programmer: Jacob Gruber
* Wednesday, May 4, 2011
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1479,6 +1277,7 @@ done:
*
* Programmer: Jacob Gruber
* Wednesday, May 4, 2011
+ *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 9b5d1b0..adf1364 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -544,47 +544,40 @@ done:
* Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/,
- hsize_t *alignment/*out*/)
+ hsize_t *alignment/*out*/)
{
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", fapl_id, threshold, alignment);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (threshold)
+ if(threshold)
if(H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, threshold) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get threshold");
- if (alignment)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get threshold")
+ if(alignment)
if(H5P_get(plist, H5F_ACS_ALIGN_NAME, alignment) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_alignment() */
/*-------------------------------------------------------------------------
* Function: H5P_set_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access or data
- * transfer property list (PLIST_ID) and supply an optional
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
* struct containing the driver-specific properites
* (DRIVER_INFO). The driver properties will be copied into the
* property list and the reference count on the driver will be
@@ -592,19 +585,11 @@ done:
* still use the property list.
*
* Return: Success: Non-negative
- *
* Failure: Negative
*
* Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -612,7 +597,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive
{
hid_t driver_id; /* VFL driver ID */
void *driver_info; /* VFL driver info */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -627,29 +612,15 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL,"can't get driver info")
/* Close the driver for the property list */
- if(H5FD_fapl_close(driver_id, driver_info)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
-
- /* Set the driver for the property list */
- if(H5FD_fapl_open(plist, new_driver_id, new_driver_info)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } else if(TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER)) {
- /* Get the current driver information */
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID")
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver info")
-
- /* Close the driver for the property list */
- if(H5FD_dxpl_close(driver_id, driver_info) < 0)
+ if(H5FD_fapl_close(driver_id, driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
/* Set the driver for the property list */
- if(H5FD_dxpl_open(plist, new_driver_id, new_driver_info) < 0)
+ if(H5FD_fapl_open(plist, new_driver_id, new_driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list")
- }
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -659,8 +630,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access or data
- * transfer property list (PLIST_ID) and supply an optional
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
* struct containing the driver-specific properites
* (DRIVER_INFO). The driver properties will be copied into the
* property list and the reference count on the driver will be
@@ -668,19 +639,11 @@ done:
* still use the property list.
*
* Return: Success: Non-negative
- *
* Failure: Negative
*
* Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -711,7 +674,7 @@ done:
* Function: H5P_get_driver
*
* Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list or data transfer propert list.
+ * be a file access property list.
*
* Return: Success: A low-level driver ID which is the same ID
* used when the driver was set for the property
@@ -723,54 +686,36 @@ done:
* Programmer: Robb Matzke
* Thursday, February 26, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-03
- * Rewritten to use the virtual file layer.
- *
- * Robb Matzke, 1999-08-05
- * If the driver ID is H5FD_VFD_DEFAULT then substitute the
- * current value of H5FD_SEC2.
- *
- * Quincey Koziol 2000-11-28
- * Added internal function..
- *
- * Raymond Lu, 2001-10-23
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
hid_t
H5P_get_driver(H5P_genplist_t *plist)
{
- hid_t ret_value=FAIL; /* Return value */
+ hid_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Get the current driver ID */
- if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID");
- } else if( TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER) ) {
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &ret_value)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
-
- if (H5FD_VFD_DEFAULT==ret_value)
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+
+ if(H5FD_VFD_DEFAULT == ret_value)
ret_value = H5_DEFAULT_VFD;
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_driver() */
/*-------------------------------------------------------------------------
* Function: H5Pget_driver
*
* Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list or data transfer propert list.
+ * be a file access property list.
*
* Return: Success: A low-level driver ID which is the same ID
* used when the driver was set for the property
@@ -782,16 +727,6 @@ done:
* Programmer: Robb Matzke
* Thursday, February 26, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-03
- * Rewritten to use the virtual file layer.
- *
- * Robb Matzke, 1999-08-05
- * If the driver ID is H5FD_VFD_DEFAULT then substitute the current value of
- * H5FD_SEC2.
- *
- * Quincey Koziol 2000-11-28
- * Added internal function..
*-------------------------------------------------------------------------
*/
hid_t
@@ -806,7 +741,9 @@ H5Pget_driver(hid_t plist_id)
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
- ret_value = H5P_get_driver(plist);
+ /* Get the driver */
+ if((ret_value = H5P_get_driver(plist)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver")
done:
FUNC_LEAVE_API(ret_value)
@@ -817,7 +754,7 @@ done:
* Function: H5P_get_driver_info
*
* Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access or data transfer property list.
+ * information of a file access.
*
* Return: Success: Ptr to *uncopied* driver specific data
* structure if any.
@@ -830,32 +767,22 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
void *
H5P_get_driver_info(H5P_genplist_t *plist)
{
- void *ret_value=NULL;
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
/* Get the current driver info */
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_INFO_NAME, &ret_value) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,NULL,"can't get driver info");
- } else if( TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER) ) {
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &ret_value)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, NULL, "Can't retrieve VFL driver ID");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver info")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -866,7 +793,7 @@ done:
* Function: H5Pget_driver_info
*
* Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access or data transfer property list.
+ * information of a file access.
*
* Return: Success: Ptr to *uncopied* driver specific data
* structure if any.
@@ -879,26 +806,20 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
void *
H5Pget_driver_info(hid_t plist_id)
{
H5P_genplist_t *plist; /* Property list pointer */
- void *ret_value; /* Return value */
+ void *ret_value; /* Return value */
FUNC_ENTER_API(NULL)
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list")
+ /* Get the driver info */
if(NULL == (ret_value = H5P_get_driver_info(plist)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver info")
@@ -915,37 +836,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_family_offset(hid_t fapl_id, hsize_t offset)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ih", fapl_id, offset);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_set_family_offset(plist, offset)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set value */
+ if((ret_value = H5P_set_family_offset(plist, offset)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_family_offset() */
/*-------------------------------------------------------------------------
@@ -955,33 +874,30 @@ done:
* H5Pset_family_offset
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_set(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set offset for family file")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_set_family_offset() */
/*-------------------------------------------------------------------------
@@ -992,37 +908,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_family_offset(hid_t fapl_id, hsize_t *offset)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*h", fapl_id, offset);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_get_family_offset(plist, offset)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if((ret_value = H5P_get_family_offset(plist, offset)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_family_offset() */
/*-------------------------------------------------------------------------
@@ -1032,33 +946,30 @@ done:
* H5Pget_family_offset
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set offset for family file")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_family_offset() */
/*-------------------------------------------------------------------------
@@ -1069,14 +980,11 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1090,16 +998,17 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type)
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_set_multi_type(plist, type)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set value */
+ if((ret_value = H5P_set_multi_type(plist, type)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_multi_type() */
/*-------------------------------------------------------------------------
@@ -1109,33 +1018,30 @@ done:
* H5Pset_multi_type.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_set(plist, H5F_ACS_MULTI_TYPE_NAME, &type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set type for multi driver");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set type for multi driver")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_set_multi_type() */
/*-------------------------------------------------------------------------
@@ -1146,37 +1052,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*Mt", fapl_id, type);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_get_multi_type(plist, type)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if((ret_value = H5P_get_multi_type(plist, type)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_multi_type() */
/*-------------------------------------------------------------------------
@@ -1186,33 +1090,30 @@ done:
* H5Pget_multi_type.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get type for multi driver")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_multi_type() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h
index 6ebca3e..849a533 100644
--- a/src/H5Pprivate.h
+++ b/src/H5Pprivate.h
@@ -121,7 +121,7 @@ H5_DLL size_t H5P_peek_size_t(H5P_genplist_t *plist, const char *name);
/* Private DCPL routines */
H5_DLL herr_t H5P_fill_value_defined(H5P_genplist_t *plist,
H5D_fill_value_t *status);
-H5_DLL herr_t H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type,
+H5_DLL herr_t H5P_get_fill_value(H5P_genplist_t *plist, H5T_t *type,
void *value, hid_t dxpl_id);
#endif /* _H5Pprivate_H */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index e6ae53e..1538765 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -45,7 +45,7 @@ static htri_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t spac
static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class,
unsigned dtype_size, unsigned dtype_sign);
static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist,
- const H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[],
+ H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[],
int need_convert, hid_t dxpl_id);
static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id);
static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts,
@@ -804,7 +804,7 @@ done:
*/
static herr_t
H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist,
- const H5T_t *type, enum H5Z_scaleoffset_t scale_type,
+ H5T_t *type, enum H5Z_scaleoffset_t scale_type,
unsigned cd_values[], int need_convert, hid_t dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -861,7 +861,7 @@ static herr_t
H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
{
H5P_genplist_t *dcpl_plist; /* Property list pointer */
- const H5T_t *type; /* Datatype */
+ H5T_t *type; /* Datatype */
const H5S_t *ds; /* Dataspace */
unsigned flags; /* Filter flags */
size_t cd_nelmts = H5Z_SCALEOFFSET_USER_NPARMS; /* Number of filter parameters */
diff --git a/src/H5public.h b/src/H5public.h
index 5efb4c5..ea1dc6b 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -75,10 +75,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 125 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 126 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "FA_a5" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.125-FA_a5" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.126-FA_a5" /* 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 cad6093..c831b87 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -488,7 +488,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 115
+LT_VERS_REVISION = 116
LT_VERS_AGE = 0
H5detect_CFLAGS = -g $(AM_CFLAGS)
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 5eb1e84..f644235 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -1633,6 +1633,8 @@ error:
* March 3, 2010
*
* Modifications:
+ * Vailin Choi; July 2012
+ * Add verify_tag() calls because H5FD_FLMAP_DICHOTOMY is now the default free-list mapping.
*
*-------------------------------------------------------------------------
*/
@@ -1756,7 +1758,12 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* verify shared header message stored as a list */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
- /* verify free space header */
+ /*
+ * 3 calls to verify_tag() for verifying free space:
+ * one freespace header tag for H5FD_MEM_DRAW manager,
+ * one freespace header tag for H5FD_MEM_SUPER manager
+ */
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
/* verify btree header and leaf node belonging to group */
@@ -1799,6 +1806,8 @@ error:
* March 3, 2010
*
* Modifications:
+ * Vailin Choi; July 2012
+ * Add verify_tag() call because H5FD_FLMAP_DICHOTOMY is now the default free-list mapping.
*
*-------------------------------------------------------------------------
*/
@@ -1901,7 +1910,12 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* verify shared header message master table */
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
- /* verify free space */
+ /*
+ * 2 calls to verify_tag() for verifying free space:
+ * one freespace header tag for H5FD_MEM_DRAW manager,
+ * one freespace header tag for H5FD_MEM_SUPER manager
+ */
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
} /* end if */
diff --git a/test/mf.c b/test/mf.c
index 3742051..8af5bc7 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -127,12 +127,19 @@ static unsigned test_mf_fs_drivers(hid_t fapl);
/*
* Verify statistics for the free-space manager
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * To ensure "f" and "frsp" are valid pointers
*/
static int
check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state)
{
H5FS_stat_t frspace_stats; /* Statistics about the heap */
+ HDassert(f);
+ HDassert(frsp);
+
/* Get statistics for free-space and verify they are correct */
if(H5FS_stat_info(f, frsp, &frspace_stats) < 0)
FAIL_STACK_ERROR
@@ -1071,6 +1078,10 @@ error:
* The block is allocated from file allocation
* Deallocate the block which will be returned to free-space manager
* (the space is shrunk and freed since it is at end of file)
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Initialize the new field "allow_eoa_shrink_only" for user data.
*/
static unsigned
test_mf_fs_alloc_free(hid_t fapl)
@@ -1136,6 +1147,7 @@ test_mf_fs_alloc_free(hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space manager */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -1222,6 +1234,7 @@ test_mf_fs_alloc_free(hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space manager */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -1306,6 +1319,7 @@ test_mf_fs_alloc_free(hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space manager */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -1421,6 +1435,10 @@ error:
* Try to extend the allocated block by 50 from the free-space_manager:
* Fail: section A does not adjoin section B (70+20 != address of section B) even though
* the requested-size (50) equal to size of section B (50)
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Initialize the new field "allow_eoa_shrink_only" for user data.
*/
static unsigned
test_mf_fs_extend(hid_t fapl)
@@ -1487,6 +1505,7 @@ test_mf_fs_extend(hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space manager */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -1604,6 +1623,7 @@ test_mf_fs_extend(hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -1716,6 +1736,7 @@ test_mf_fs_extend(hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -1828,6 +1849,7 @@ test_mf_fs_extend(hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A of size=20 to free-space */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -1957,6 +1979,10 @@ error:
* which will absorb meta_aggr to the section:
* section size + remaining size of aggregator is > aggr->alloc_size,
* section is allowed to absorb an aggregator (allow_sect_absorb is true)
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Initialize the new field "allow_eoa_shrink_only" for user data.
*/
static unsigned
test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
@@ -2020,6 +2046,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* When adding, meta_aggr is absorbed onto the beginning of the section */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -2092,6 +2119,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* When adding, meta_aggr is absorbed onto the end of the section */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -3133,7 +3161,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
/* sdata_aggr info is reset to 0 */
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
- if (sdata_addr != 0) TEST_ERROR
+ if (sdata_addr != HADDR_UNDEF) TEST_ERROR
if (sdata_size != 0) TEST_ERROR
/* Verify that meta_aggr's unused space of 1968 is freed to free-space */
@@ -3481,15 +3509,18 @@ error:
*
* Test 2: H5MF_alloc() block A from meta_aggr
* H5MF_alloc() block B from sdata_aggr
- * H5MF_try_shrink() block B should merge it onto the end of meta_aggr
- * because H5F_FS_MERGE_METADATA|H5F_FS_MERGE_RAWDATA is on for
- * sec2 driver's FLMAP_SINGLE
+ * H5MF_try_shrink() block B should merge it back to the end of sdata_aggr
+ * because sec2 driver is FLMAP_DICHOTOMY by default
*
* Test 3: H5MF_alloc() block A from meta_aggr
* H5MF_alloc() block B from meta_aggr
* H5MF_alloc() block C from meta_aggr
* H5MF_try_shrink() block B should fail since it does not adjoin the
* beginning nor the end of meta_aggr
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Changes due to the switch to H5FD_FLMAP_DICHOTOMY
*/
static unsigned
test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
@@ -3501,7 +3532,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
H5FD_mem_t type, stype;
haddr_t addr1, addr2, addr3, saddr1;
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF;
+ haddr_t new_sdata_addr=HADDR_UNDEF;
hsize_t ma_size=0, new_ma_size=0;
hsize_t sdata_size=0, new_sdata_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -3593,20 +3624,20 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
stype = H5FD_MEM_DRAW;
saddr1 = H5MF_alloc(f, stype, H5P_DATASET_XFER_DEFAULT, (hsize_t)TEST_BLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF_aggr_query(f, &(f->shared->sdata_aggr), NULL, &sdata_size);
/* should succeed */
if(H5MF_try_shrink(f, stype, H5P_DATASET_XFER_DEFAULT, saddr1, (hsize_t)TEST_BLOCK_SIZE50) <= 0)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size);
- if (new_sdata_addr != sdata_addr) TEST_ERROR
- if (new_sdata_size != sdata_size) TEST_ERROR
+ if (new_sdata_addr != saddr1) TEST_ERROR
+ if (new_sdata_size != sdata_size + TEST_BLOCK_SIZE50) TEST_ERROR
/* meta_aggr info should be updated because the block is absorbed into the meta_aggr */
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != ma_addr) TEST_ERROR
- if (new_ma_size != (ma_size+TEST_BLOCK_SIZE50)) TEST_ERROR
+ if (new_ma_size != (ma_size)) TEST_ERROR
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30);
@@ -4004,6 +4035,10 @@ error:
* Allocate a block of size=40
* The free-space manager is unable to fulfill the request
* The block is allocated from file allocation and should be aligned
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Initialize the new field "allow_eoa_shrink_only" for user data.
*/
static unsigned
test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
@@ -4063,6 +4098,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space manager */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -4132,6 +4168,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space manager */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -4221,6 +4258,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
udata.dxpl_id = H5P_DATASET_XFER_DEFAULT;
udata.alloc_type = type;
udata.allow_sect_absorb = TRUE;
+ udata.allow_eoa_shrink_only = FALSE;
/* Add section A to free-space manager */
if (H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &udata))
@@ -4602,8 +4640,7 @@ error:
* request-size < aggr->alloc_size
* fragment size > (aggr->alloc_size - request-size)
* Result:
- * A block of aggr->alloc_size + (fragment size - (aggr->alloc_size - request-size))
- * is extended from file allocation for the aggregator
+ * A block of (fragment size + request-size) is extended from file allocation for the aggregator
* The second block of 50 is allocated from the aggregator and should be aligned
* Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
* There is space of 2018 left in meta_aggr
@@ -4628,12 +4665,14 @@ error:
* Result:
* A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator
* Fragment from alignment of file allocation is freed to free-space:[14336, 2048]
- * Since this fragment adjoins sdata_aggr and fulfills "absorb" condition,
- * the space left in sdata_aggr is absorbed into the fragment and freed to free-space: [12318, 2018]
- * other_aggr is reset to 0
+ * other_aggr is [12318, 2018]
* The third block of 80 is allocated from the aggregator and should be aligned
* There is space of 1968 left in meta_aggr
* EOA is at 18432
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Changes due to the switch to H5FD_FLMAP_DICHOTOMY
*/
static unsigned
test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
@@ -4644,7 +4683,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
h5_stat_size_t file_size; /* File size */
H5FD_mem_t type, stype;
haddr_t addr1, addr2, addr3, saddr1;
- frspace_state_t state;
+ frspace_state_t state[H5FD_MEM_NTYPES];
haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
hsize_t ma_size=0, sdata_size=0, mis_align=0;
hsize_t alignment=0, tmp=0;
@@ -4697,11 +4736,11 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (addr1 % alignment) TEST_ERROR
/* fragment for alignment of block 30 is freed to free-space */
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ HDmemset(&state, 0, sizeof(frspace_state_t) * H5FD_MEM_NTYPES);
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -4721,9 +4760,9 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 50 is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -4754,9 +4793,9 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 30 for sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
/* Verify that the allocated block is aligned */
@@ -4773,12 +4812,13 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
* For alignment = 1024, alloc_size = 2048:
* fragment for unused space in meta_aggr is freed to free-space
* For alignment = 4096, alloc_size = 2048:
- * fragment from alignment of file allocation absorbs sdata_aggr's remaining space
+ * fragment from alignment of ma_addr is freed
+ * block 30 is allocated from ma_addr
*/
mis_align = 0;
if ((alignment == TEST_ALIGN1024) && (tmp = (ma_addr % alignment)))
mis_align = alignment - tmp;
- else if ((alignment == TEST_ALIGN4096) && (tmp = (sdata_addr % alignment)))
+ else if ((alignment == TEST_ALIGN4096) && (tmp = ((sdata_addr + sdata_size) % alignment)))
mis_align = alignment - tmp;
/* Allocate a block of 80 from meta_aggr */
@@ -4789,9 +4829,9 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 80 is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -4800,8 +4840,15 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Verify total size of free space after all the allocations */
- if(check_stats(f, f->shared->fs_man[type], &state))
- TEST_ERROR
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
+
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30);
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr2, (hsize_t)TEST_BLOCK_SIZE50);
@@ -4961,6 +5008,11 @@ error:
* The meta_aggr is updated to point to the new space
* The block of 1034 is allocated from the new block and should be aligned
* There is space of 1014 left in meta_aggr
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Changes due to the switch to H5FD_FLMAP_DICHOTOMY
+ *
*/
static unsigned
test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
@@ -4972,7 +5024,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
H5FD_mem_t type, stype;
haddr_t addr1, addr2, addr3;
haddr_t saddr1, saddr2, saddr3;
- frspace_state_t state;
+ frspace_state_t state[H5FD_MEM_NTYPES];
haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
hsize_t ma_size=0, sdata_size=0, mis_align=0;
hsize_t alignment=0, tmp=0;
@@ -5026,11 +5078,11 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (addr1 % alignment) TEST_ERROR
/* fragment for alignment of block 30 is freed to free-space */
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ HDmemset(&state, 0, sizeof(frspace_state_t) * H5FD_MEM_NTYPES);
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -5050,9 +5102,9 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 50 is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -5085,9 +5137,9 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 30 for sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
@@ -5106,9 +5158,9 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 50 for sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
@@ -5127,9 +5179,9 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 80 for sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
@@ -5149,9 +5201,9 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 1034 for meta_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
/* calculate unused space in meta_aggr that is freed to free-space after block 1034 */
@@ -5161,9 +5213,9 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for unused space in meta_aggr after block 1034 is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -5172,8 +5224,15 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Verify total size of free space after all allocations */
- if(check_stats(f, f->shared->fs_man[type], &state))
- TEST_ERROR
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
+
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -5377,8 +5436,10 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (addr3 % alignment) TEST_ERROR
/* Verify total size of free space after all allocations */
- if(check_stats(f, f->shared->fs_man[type], &state))
- TEST_ERROR
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &state))
+ TEST_ERROR
+ }
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -5464,6 +5525,10 @@ error:
* sdata_aggr is reset to 0
* EOA is 14346
* meta_aggr and sdata_aggr are all 0
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Changes due to the switch to H5FD_FLMAP_DICHOTOMY
*/
static unsigned
test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
@@ -5474,7 +5539,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
h5_stat_size_t file_size;
H5FD_mem_t type, stype;
haddr_t addr1, addr2, saddr1;
- frspace_state_t state;
+ frspace_state_t state[H5FD_MEM_NTYPES];
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF;
hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0;
@@ -5533,18 +5598,16 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if ((addr1 + TEST_BLOCK_SIZE30) != ma_addr) TEST_ERROR
/* fragment for alignment of block 30 is freed to free-space */
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ HDmemset(&state, 0, sizeof(frspace_state_t) * H5FD_MEM_NTYPES);
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
/* calculate fragment for alignment of block 30 from sdata_aggr */
mis_align = 0;
- if ((alignment == TEST_ALIGN1024) && (tmp = (ma_addr + ma_size) % alignment))
- mis_align = alignment - tmp;
- else if ((alignment == TEST_ALIGN4096) && (tmp = (ma_addr % alignment)))
+ if ((tmp = (ma_addr + ma_size) % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from sdata_aggr */
@@ -5556,9 +5619,9 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment of alignment for block 30 in sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
@@ -5566,9 +5629,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* calculate fragment for alignment of block 2058 from meta_aggr */
mis_align = 0;
- if ((alignment == TEST_ALIGN1024) && (tmp = (sdata_addr + sdata_size) % alignment))
- mis_align = alignment - tmp;
- else if ((alignment == TEST_ALIGN4096) && (tmp = (sdata_addr % alignment)))
+ if ((tmp = (sdata_addr + sdata_size) % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 2058 from meta_aggr */
@@ -5579,27 +5640,30 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 2058 is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
/* Verify total size of free space after all allocations */
- if(check_stats(f, f->shared->fs_man[type], &state))
- TEST_ERROR
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
+
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
/* nothing is changed in meta_aggr */
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
- if (alignment == TEST_ALIGN1024 && (new_ma_addr != ma_addr || new_ma_size != ma_size))
- TEST_ERROR
- else if (alignment == TEST_ALIGN4096 && (new_ma_addr != 0 || new_ma_size != 0))
+ if (new_ma_addr != ma_addr || new_ma_size != ma_size)
TEST_ERROR
/* nothing is changed in sdata_aggr */
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size);
- if (alignment == TEST_ALIGN1024 && (new_sdata_addr != sdata_addr || new_sdata_size != sdata_size))
- TEST_ERROR
- else if (alignment == TEST_ALIGN4096 && ((new_sdata_addr != 0 || new_sdata_size != 0)))
+ if (new_sdata_addr != sdata_addr || new_sdata_size != sdata_size)
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -5691,21 +5755,16 @@ error:
* Result:
* A block of sdata_aggr->alloc_size is allocated from file allocation
* Fragment from alignment of file allocation is freed to free-space: [6144, 2048]
- * This fragment adjoins meta_aggr and fulfills "absorb" condition,
- * the remaining space left in meta_aggr is absorbed into the fragment and
- * freed to free-space:[4126, 2018]
- * meta_aggr is reset to 0
* The first block of 30 is allocated from the aggregator and should be aligned
* There is space of 2018 left in sdata_aggr
- * EOA is 5120
+ * EOA is 10240
*
* Allocate second block (50) from sdata_aggr:
- * (request-size+fragment size) is <= sdata_aggr->size
+ * (request-size+fragment size) is > sdata_aggr->size
* request-size < sdata_aggr->alloc_size
* fragment size > (sdata_aggr->alloc_size - request-size)
* Result:
- * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size))
- * is extended from file allocation for the aggregator
+ * A block of (fragment size + request-size) is extended from file allocation for the aggregator
* The second block of 50 is allocated from sdata_aggr and should be aligned
* Fragment from alignment of aggregator allocation is freed to free-space:[8222, 4066]
* There is space of 2018 left in sdata_aggr
@@ -5716,8 +5775,7 @@ error:
* request-size < sdata_aggr->alloc_size
* fragment size > (sdata_aggr->alloc_size - request-size)
* Result:
- * A block of sdata_aggr->alloc_size+(fragment size-(sdata_aggr->alloc_size-request-size))
- * is extended from file allocation for sdata_aggr
+ * A block of (fragment size + request-size) is extended from file allocation for sdata_aggr
* The third block of 80 is allocated from sdata_aggr and should be aligned
* Fragment from alignment of aggregator allocation is freed to free-space:[12338, 4046]
* There is space of 2018 left in sdata_aggr
@@ -5734,6 +5792,10 @@ error:
* Fragment from alignment of file allocation is freed to free-space:[16464, 4016]
* EOA is at 22538
* meta_aggr is unchanged
+ *
+ * Modifications:
+ * Vailin Choi; July 2012
+ * Changes due to the switch to H5FD_FLMAP_DICHOTOMY
*/
static unsigned
test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
@@ -5745,7 +5807,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
H5FD_mem_t type, stype;
haddr_t addr1, addr2;
haddr_t saddr1, saddr2, saddr3;
- frspace_state_t state;
+ frspace_state_t state[H5FD_MEM_NTYPES];
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
hsize_t alignment=0, mis_align=0, tmp=0;
@@ -5798,11 +5860,11 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (addr1 % alignment) TEST_ERROR
/* fragment for alignment of block 30 in meta_aggr is freed to free-space */
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ HDmemset(&state, 0, sizeof(frspace_state_t) * H5FD_MEM_NTYPES);
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -5811,9 +5873,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* calculate fragment for alignment of block 30 in sdata_aggr */
mis_align = 0;
- if ((alignment == TEST_ALIGN1024) && (tmp = (ma_addr + ma_size) % alignment))
- mis_align = alignment - tmp;
- else if ((alignment == TEST_ALIGN4096) && (tmp = (ma_addr % alignment)))
+ if ((tmp = (ma_addr + ma_size) % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from sdata_aggr */
@@ -5825,9 +5885,9 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 30 in sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
@@ -5846,9 +5906,9 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 50 in sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
@@ -5867,9 +5927,9 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 80 in sdata_aggr is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[stype].tot_space += mis_align;
+ state[stype].tot_sect_count += 1;
+ state[stype].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
@@ -5889,24 +5949,30 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* fragment for alignment of block 2058 is freed to free-space */
if (mis_align) {
- state.tot_space += mis_align;
- state.tot_sect_count += 1;
- state.serial_sect_count += 1;
+ state[type].tot_space += mis_align;
+ state[type].tot_sect_count += 1;
+ state[type].serial_sect_count += 1;
}
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
- if (alignment == TEST_ALIGN1024 && (new_ma_addr != ma_addr || new_ma_size != ma_size))
- TEST_ERROR
- else if (alignment == TEST_ALIGN4096 && (new_ma_addr != 0 || new_ma_size != 0))
+ if (new_ma_addr != ma_addr && new_ma_size != ma_size)
TEST_ERROR
- if (sdata_addr != 0 || sdata_size != 0)
+ if (sdata_addr != HADDR_UNDEF || sdata_size != 0)
TEST_ERROR
- if(check_stats(f, f->shared->fs_man[type], &state))
- TEST_ERROR
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
+
+
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -7282,6 +7348,100 @@ error:
return(1);
} /* test_filespace_drivers() */
+/*
+ * To verify that file space is allocated from the corresponding free-space manager
+ * because H5FD_FLMAP_DICHOTOMY is used as the default free-list mapping.
+ *
+ * (1) Allocate the first block (size 30) of type H5FD_MEM_SUPER
+ * (2) Allocate the second block (size 50) of type H5FD_MEM_SUPER
+ *
+ * (3) Allocate the first block (size 30) of type H5FD_MEM_DRAW
+ *
+ * (4) Free the first block (size 30) of type H5FD_MEM_SUPER
+ *
+ * (5) Allocate the second block (size 30) of type H5FD_MEM_DRAW
+ * (6) Verify that this second block is not the freed block from (3)
+ *
+ * (7) Allocate the second block (size 30) of type H5FD_MEM_DRAW
+ * (8) Free the first block (size 30) of type H5FD_MEM_DRAW
+ *
+ * (9) Allocate the third block (size 30) of type H5FD_MEM_SUPER
+ * (10) Verify that this third block is not freed block from (8)
+ */
+static unsigned
+test_dichotomy(const char *env_h5_drvr, hid_t fapl)
+{
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, addr3, saddr1, saddr2;
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+
+ TESTING("Allocation from raw or metadata free-space manager");
+
+ /* Skip test when using VFDs that don't use the metadata aggregator */
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ if(contig_addr_vfd) {
+ /* Set the filename to use for this test (dependent on fapl) */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
+
+ /* Create the file to work on */
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Get a pointer to the internal file object */
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
+ FAIL_STACK_ERROR
+
+ /* Allocate the first block of type H5FD_MEM_SUPER */
+ type = H5FD_MEM_SUPER;
+ addr1 = H5MF_alloc(f, type, H5P_DATASET_XFER_DEFAULT, (hsize_t)TEST_BLOCK_SIZE30);
+
+ /* Allocate the second block of type H5FD_MEM_SUPER */
+ addr2 = H5MF_alloc(f, type, H5P_DATASET_XFER_DEFAULT, (hsize_t)TEST_BLOCK_SIZE50);
+
+ /* Allocate the first block of type H5FD_MEM_DRAW */
+ stype = H5FD_MEM_DRAW;
+ saddr1 = H5MF_alloc(f, stype, H5P_DATASET_XFER_DEFAULT, (hsize_t)TEST_BLOCK_SIZE30);
+
+ /* Free the first block of type H5FD_MEM_SUPER */
+ H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30);
+
+ /* Allocate the second block of type H5FD_MEM_DRAW */
+ saddr2 = H5MF_alloc(f, stype, H5P_DATASET_XFER_DEFAULT, (hsize_t)TEST_BLOCK_SIZE30);
+
+ /* Verify that saddr1 is not addr1 */
+ if(saddr2 == addr1) TEST_ERROR
+
+ /* Free the first block of type H5FD_MEM_DRAW */
+ H5MF_xfree(f, stype, H5P_DATASET_XFER_DEFAULT, saddr1, (hsize_t)TEST_BLOCK_SIZE30);
+
+ /* Allocate the third block of type H5FD_MEM_SUPER */
+ addr3 = H5MF_alloc(f, type, H5P_DATASET_XFER_DEFAULT, (hsize_t)TEST_BLOCK_SIZE30);
+
+ /* Verify that addr3 is not saddr1 */
+ if(addr3 == saddr1) TEST_ERROR
+
+ if(H5Fclose(file) < 0)
+ FAIL_STACK_ERROR
+
+ PASSED()
+ } /* end if */
+ else {
+ SKIPPED();
+ puts(" Current VFD doesn't support metadata aggregator");
+ } /* end else */
+
+ return(0);
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(file);
+ } H5E_END_TRY;
+ return(1);
+} /* test_dichotomy() */
+
int
main(void)
{
@@ -7324,6 +7484,7 @@ main(void)
nerrors += test_mf_fs_alloc_free(fapl);
nerrors += test_mf_fs_extend(fapl);
nerrors += test_mf_fs_absorb(env_h5_drvr, fapl);
+ nerrors += test_dichotomy(env_h5_drvr, new_fapl);
/* interaction with meta/sdata aggregator */
nerrors += test_mf_aggr_alloc1(env_h5_drvr, fapl);
diff --git a/test/tfile.c b/test/tfile.c
index 7d26c63..6424fa3 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1340,6 +1340,11 @@ test_file_perm2(void)
** This test checks the free space available in a file in various
** situations.
**
+** Modifications:
+** Vailin Choi; July 2012
+** Remove datasets in reverse order so that all file spaces are shrunk.
+** (A change due to H5FD_FLMAP_DICHOTOMY.)
+**
*****************************************************************/
static void
test_file_freespace(void)
@@ -1351,6 +1356,7 @@ test_file_freespace(void)
hid_t dspace; /* Dataspace ID */
hid_t dset; /* Dataset ID */
hid_t dcpl; /* Dataset creation property list */
+ int k; /* Local index variable */
unsigned u; /* Local index variable */
char name[32]; /* Dataset name */
herr_t ret;
@@ -1410,11 +1416,11 @@ test_file_freespace(void)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
- VERIFY(free_space, 2008, "H5Fget_freespace");
+ VERIFY(free_space, 2360, "H5Fget_freespace");
/* Delete datasets in file */
- for(u = 0; u < 10; u++) {
- sprintf(name, "Dataset %u", u);
+ for(k = 9; k >= 0; k--) {
+ sprintf(name, "Dataset %u", (unsigned)k);
ret = H5Ldelete(file, name, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
} /* end for */
diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt
index 3357b97..903564f 100644
--- a/tools/h5diff/CMakeLists.txt
+++ b/tools/h5diff/CMakeLists.txt
@@ -202,6 +202,7 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_56.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_57.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_58.txt
+ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_59.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_500.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_501.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_502.txt
@@ -702,6 +703,8 @@ IF (BUILD_TESTING)
h5diff_57.out.err
h5diff_58.out
h5diff_58.out.err
+ h5diff_59.out
+ h5diff_59.out.err
h5diff_500.out
h5diff_500.out.err
h5diff_501.out
@@ -960,6 +963,10 @@ ADD_H5_TEST (h5diff_57 0 -v ${FILE4} ${FILE4} dset7a dset7b)
# 5.8 (region reference)
ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg)
+# test for both dset and attr with same type but with different size
+# ( HDDFV-7942 )
+ADD_H5_TEST (h5diff_59 0 -v ${FILE4} ${FILE4} dset11a dset11b)
+
# ##############################################################################
# # Error messages
# ##############################################################################
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index fb44eb4..8cf1014 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -771,6 +771,7 @@ int test_datatypes(const char *fname)
{
hid_t fid1;
+ hid_t dset;
hsize_t dims[2]={3,2};
herr_t status;
char buf1a[3][2] = {{1,1},{1,1},{1,1}};
@@ -802,6 +803,9 @@ int test_datatypes(const char *fname)
unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}};
unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}};
+ unsigned short buf11a[3][2] = {{204,205},{2,3},{1,1}};
+ unsigned int buf11b[3][2] = {{204,205},{2,3},{1,1}};
+
/*-------------------------------------------------------------------------
* Create a file
@@ -892,6 +896,19 @@ int test_datatypes(const char *fname)
write_dset(fid1,2,dims,"dset10a",H5T_NATIVE_UINT,buf10a);
write_dset(fid1,2,dims,"dset10b",H5T_NATIVE_UINT,buf10b);
+ /*-------------------------------------------------------------------------
+ * Same type class, different size
+ *-------------------------------------------------------------------------
+ */
+ write_dset(fid1,2,dims,"dset11a",H5T_STD_U16LE,buf11a);
+ dset=H5Dopen (fid1, "dset11a", H5P_DEFAULT);
+ write_attr(dset,2,dims,"attr",H5T_STD_U16LE,buf11a);
+ H5Dclose (dset);
+
+ write_dset(fid1,2,dims,"dset11b",H5T_STD_U32LE,buf11b);
+ dset=H5Dopen (fid1, "dset11b", H5P_DEFAULT);
+ write_attr(dset,2,dims,"attr",H5T_STD_U32LE,buf11b);
+ H5Dclose (dset);
/*-------------------------------------------------------------------------
* Close
diff --git a/tools/h5diff/testfiles/h5diff_59.txt b/tools/h5diff/testfiles/h5diff_59.txt
new file mode 100644
index 0000000..aeefa3a
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_59.txt
@@ -0,0 +1,11 @@
+dataset: </dset11a> and </dset11b>
+Warning: different storage datatype
+</dset11a> has file datatype H5T_STD_U16LE
+</dset11b> has file datatype H5T_STD_U32LE
+Warning: different storage datatype
+<attr> has file datatype H5T_STD_U16LE
+<attr> has file datatype H5T_STD_U32LE
+attribute: <attr of </dset11a>> and <attr of </dset11b>>
+0 differences found
+0 differences found
+EXIT CODE: 0
diff --git a/tools/h5diff/testfiles/h5diff_dtypes.h5 b/tools/h5diff/testfiles/h5diff_dtypes.h5
index 7c3cd9d..ffa5264 100644
--- a/tools/h5diff/testfiles/h5diff_dtypes.h5
+++ b/tools/h5diff/testfiles/h5diff_dtypes.h5
Binary files differ
diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh
index 8be8a54..02dacd8 100755
--- a/tools/h5diff/testh5diff.sh
+++ b/tools/h5diff/testh5diff.sh
@@ -236,6 +236,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_55.txt
$SRC_H5DIFF_TESTFILES/h5diff_56.txt
$SRC_H5DIFF_TESTFILES/h5diff_57.txt
$SRC_H5DIFF_TESTFILES/h5diff_58.txt
+$SRC_H5DIFF_TESTFILES/h5diff_59.txt
$SRC_H5DIFF_TESTFILES/h5diff_500.txt
$SRC_H5DIFF_TESTFILES/h5diff_501.txt
$SRC_H5DIFF_TESTFILES/h5diff_502.txt
@@ -628,6 +629,10 @@ TOOLTEST h5diff_57.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset7a dset7b
# 5.8 (region reference)
TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg
+# test for both dset and attr with same type but with different size
+# ( HDDFV-7942 )
+TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b
+
# ##############################################################################
# # Error messages
# ##############################################################################
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index 1482327..302f854 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -780,35 +780,6 @@ IF (BUILD_TESTING)
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_XML_H5_TEST file)
- # --------------------------------------------------------------------
- # See which filters are usable (and skip tests for filters we
- # don't have). Do this by searching H5pubconf.h to see which
- # filters are defined.
- # --------------------------------------------------------------------
- IF (H5_HAVE_FILTER_DEFLATE)
- SET (USE_FILTER_DEFLATE "true")
- ENDIF (H5_HAVE_FILTER_DEFLATE)
-
- IF (H5_HAVE_FILTER_SZIP)
- SET (USE_FILTER_SZIP "true")
- ENDIF (H5_HAVE_FILTER_SZIP)
-
- IF (H5_HAVE_FILTER_SHUFFLE)
- SET (USE_FILTER_SHUFFLE "true")
- ENDIF (H5_HAVE_FILTER_SHUFFLE)
-
- IF (H5_HAVE_FILTER_FLETCHER32)
- SET (USE_FILTER_FLETCHER32 "true")
- ENDIF (H5_HAVE_FILTER_FLETCHER32)
-
- IF (H5_HAVE_FILTER_NBIT)
- SET (USE_FILTER_NBIT "true")
- ENDIF (H5_HAVE_FILTER_NBIT)
-
- IF (H5_HAVE_FILTER_SCALEOFFSET)
- SET (USE_FILTER_SCALEOFFSET "true")
- ENDIF (H5_HAVE_FILTER_SCALEOFFSET)
-
##############################################################################
##############################################################################
### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ###
@@ -1298,53 +1269,25 @@ IF (BUILD_TESTING)
# tests for filters
# SZIP
- SET (TESTTYPE "TEST")
- IF (NOT USE_FILTER_SZIP)
- SET (TESTTYPE "SKIP")
- ENDIF (NOT USE_FILTER_SZIP)
- ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} --enable-error-stack -H -p -d szip tfilters.h5)
+ ADD_H5_TEST (tszip 0 --enable-error-stack -H -p -d szip tfilters.h5)
# deflate
- SET (TESTTYPE "TEST")
- IF (NOT USE_FILTER_DEFLATE)
- SET (TESTTYPE "SKIP")
- ENDIF (NOT USE_FILTER_DEFLATE)
- ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} --enable-error-stack -H -p -d deflate tfilters.h5)
+ ADD_H5_TEST (tdeflate 0 --enable-error-stack -H -p -d deflate tfilters.h5)
# shuffle
- SET (TESTTYPE "TEST")
- IF (NOT USE_FILTER_SHUFFLE)
- SET (TESTTYPE "SKIP")
- ENDIF (NOT USE_FILTER_SHUFFLE)
- ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} --enable-error-stack -H -p -d shuffle tfilters.h5)
+ ADD_H5_TEST (tshuffle 0 --enable-error-stack -H -p -d shuffle tfilters.h5)
# fletcher32
- SET (TESTTYPE "TEST")
- IF (NOT USE_FILTER_FLETCHER32)
- SET (TESTTYPE "SKIP")
- ENDIF (NOT USE_FILTER_FLETCHER32)
- ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} --enable-error-stack -H -p -d fletcher32 tfilters.h5)
+ ADD_H5_TEST (tfletcher32 0 --enable-error-stack -H -p -d fletcher32 tfilters.h5)
# nbit
- SET (TESTTYPE "TEST")
- IF (NOT USE_FILTER_NBIT)
- SET (TESTTYPE "SKIP")
- ENDIF (NOT USE_FILTER_NBIT)
- ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} --enable-error-stack -H -p -d nbit tfilters.h5)
+ ADD_H5_TEST (tnbit 0 --enable-error-stack -H -p -d nbit tfilters.h5)
# scaleoffset
- SET (TESTTYPE "TEST")
- IF (NOT USE_FILTER_SCALEOFFSET)
- SET (TESTTYPE "SKIP")
- ENDIF (NOT USE_FILTER_SCALEOFFSET)
- ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} --enable-error-stack -H -p -d scaleoffset tfilters.h5)
+ ADD_H5_TEST (tscaleoffset 0 --enable-error-stack -H -p -d scaleoffset tfilters.h5)
# all
- SET (TESTTYPE "TEST")
- IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET)
- SET (TESTTYPE "SKIP")
- ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET)
- ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} --enable-error-stack -H -p -d all tfilters.h5)
+ ADD_H5_TEST (tallfilters 0 --enable-error-stack -H -p -d all tfilters.h5)
# user defined
ADD_H5_TEST (tuserfilter 0 --enable-error-stack -H -p -d myfilter tfilters.h5)
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 0ca6aa9..f969876 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -15,14 +15,6 @@
#
# Tests for the h5dump tool
-# Determine which filters are available
-USE_FILTER_SZIP="@USE_FILTER_SZIP@"
-USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
-USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@"
-USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@"
-USE_FILTER_NBIT="@USE_FILTER_NBIT@"
-USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@"
-
TESTNAME=h5dump
EXIT_SUCCESS=0
EXIT_FAILURE=1
@@ -881,54 +873,19 @@ TOOLTEST texceedsubblock.ddl --enable-error-stack -d 1d -k 1,3 taindices.h5
# tests for filters
# SZIP
-option="--enable-error-stack -H -p -d szip tfilters.h5"
-if test $USE_FILTER_SZIP != "yes"; then
- SKIP $option
-else
-TOOLTEST tszip.ddl $option
-fi
+TOOLTEST tszip.ddl --enable-error-stack -H -p -d szip tfilters.h5
# deflate
-option="--enable-error-stack -H -p -d deflate tfilters.h5"
-if test $USE_FILTER_DEFLATE != "yes"; then
- SKIP $option
-else
- TOOLTEST tdeflate.ddl $option
-fi
+TOOLTEST tdeflate.ddl --enable-error-stack -H -p -d deflate tfilters.h5
# shuffle
-option="--enable-error-stack -H -p -d shuffle tfilters.h5"
-if test $USE_FILTER_SHUFFLE != "yes"; then
- SKIP $option
-else
- TOOLTEST tshuffle.ddl $option
-fi
+TOOLTEST tshuffle.ddl --enable-error-stack -H -p -d shuffle tfilters.h5
# fletcher32
-option="--enable-error-stack -H -p -d fletcher32 tfilters.h5"
-if test $USE_FILTER_FLETCHER32 != "yes"; then
- SKIP $option
-else
- TOOLTEST tfletcher32.ddl $option
-fi
+TOOLTEST tfletcher32.ddl --enable-error-stack -H -p -d fletcher32 tfilters.h5
# nbit
-option="--enable-error-stack -H -p -d nbit tfilters.h5"
-if test $USE_FILTER_NBIT != "yes"; then
- SKIP $option
-else
- TOOLTEST tnbit.ddl $option
-fi
+TOOLTEST tnbit.ddl --enable-error-stack -H -p -d nbit tfilters.h5
# scaleoffset
-option="--enable-error-stack -H -p -d scaleoffset tfilters.h5"
-if test $USE_FILTER_SCALEOFFSET != "yes"; then
- SKIP $option
-else
- TOOLTEST tscaleoffset.ddl $option
-fi
+TOOLTEST tscaleoffset.ddl --enable-error-stack -H -p -d scaleoffset tfilters.h5
# all
-option="--enable-error-stack -H -p -d all tfilters.h5"
-if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes"; then
- SKIP $option
-else
- TOOLTEST tallfilters.ddl $option
-fi
+TOOLTEST tallfilters.ddl --enable-error-stack -H -p -d all tfilters.h5
# user defined
TOOLTEST tuserfilter.ddl --enable-error-stack -H -p -d myfilter tfilters.h5
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index f05d0de..2530805 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -180,6 +180,7 @@ hsize_t diff_attr(hid_t loc1_id,
*-------------------------------------------------------------------------
*/
+/* in h5diff_util.c */
void print_found(hsize_t nfound);
void print_type(hid_t type);
const char* diff_basename(const char *name);
@@ -187,6 +188,10 @@ const char* get_type(h5trav_type_t type);
const char* get_class(H5T_class_t tclass);
const char* get_sign(H5T_sign_t sign);
void print_dimensions (int rank, hsize_t *dims);
+herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
+ hid_t *m_tid1, hid_t *m_tid2,
+ size_t *m_size1, size_t *m_size2);
+/* in h5diff.c */
int print_objname(diff_opt_t *options, hsize_t nfound);
void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts);
void do_print_attrname (const char *attr, const char *path1, const char *path2);
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 85cd01f..144159a 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -405,6 +405,14 @@ hsize_t diff_attr(hid_t loc1_id,
continue;
}
+ /*-----------------------------------------------------------------
+ * "upgrade" the smaller memory size
+ *------------------------------------------------------------------
+ */
+ if (FAIL == match_up_memsize (ftype1_id, ftype2_id,
+ &mtype1_id, &mtype2_id,
+ &msize1, &msize2))
+ goto error;
/*---------------------------------------------------------------------
* read
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index da58cde..f9c7d1c 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -368,26 +368,10 @@ hsize_t diff_datasetid( hid_t did1,
*/
h5difftrace("upgrade the smaller memory size?\n");
- if(m_size1 != m_size2) {
- h5difftrace("m_size1 != m_size2\n");
- if(m_size1 < m_size2) {
- H5Tclose(m_tid1);
-
- if((m_tid1 = h5tools_get_native_type(f_tid2)) < 0)
- goto error;
-
- m_size1 = H5Tget_size(m_tid1);
- } /* end if */
- else {
- H5Tclose(m_tid2);
-
- if((m_tid2 = h5tools_get_native_type(f_tid1)) < 0)
- goto error;
-
- m_size2 = H5Tget_size(m_tid2);
- } /* end else */
- } /* end if */
- HDassert(m_size1 == m_size2);
+ if (FAIL == match_up_memsize (f_tid1, f_tid2,
+ &m_tid1, &m_tid2,
+ &m_size1, &m_size2))
+ goto error;
/* print names */
if(obj1_name)
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 0d476b6..aefd641 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -311,4 +311,46 @@ void print_found(hsize_t nfound)
}
+/*-----------------------------------------------------------------
+ * Function: match_up_memsize
+ *
+ * Purpose: match smaller memory size up to bigger memory size
+ *------------------------------------------------------------------
+ */
+herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
+ hid_t *m_tid1, hid_t *m_tid2,
+ size_t *m_size1, size_t *m_size2)
+{
+ herr_t ret = SUCCEED;
+
+ if( (*m_size1) != (*m_size2) )
+ {
+ if( (*m_size1) < (*m_size2) )
+ {
+ H5Tclose( *m_tid1 );
+
+ if(( (*m_tid1) = h5tools_get_native_type(f_tid2_id)) < 0)
+ {
+ ret = FAIL;
+ goto out;
+ }
+
+ *m_size1 = H5Tget_size( *m_tid1 );
+ } /* end if */
+ else {
+ H5Tclose(*m_tid2);
+ if(( (*m_tid2) = h5tools_get_native_type(f_tid1_id)) < 0)
+ {
+ ret = FAIL;
+ goto out;
+ }
+
+ *m_size2 = H5Tget_size(*m_tid2);
+ } /* end else */
+ } /* end if */
+ HDassert( (*m_size1) == (*m_size2) );
+
+out:
+ return ret;
+}
diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h
index 90df1b4..e63dea9 100644
--- a/vms/src/h5pubconf.h
+++ b/vms/src/h5pubconf.h
@@ -502,7 +502,7 @@
#define H5_PACKAGE_NAME "HDF5"
/* Define to the full name and version of this package. */
-#define H5_PACKAGE_STRING "HDF5 1.9.125-FA_a5"
+#define H5_PACKAGE_STRING "HDF5 1.9.126-FA_a5"
/* Define to the one symbol short name of this package. */
#define H5_PACKAGE_TARNAME "hdf5"
@@ -511,7 +511,7 @@
#define H5_PACKAGE_URL ""
/* Define to the version of this package. */
-#define H5_PACKAGE_VERSION "1.9.125-FA_a5"
+#define H5_PACKAGE_VERSION "1.9.126-FA_a5"
/* Width for printf() for type `long long' or `__int64', use `ll' */
#define H5_PRINTF_LL_WIDTH "ll"
@@ -674,7 +674,7 @@
/* #undef H5_USING_MEMCHECKER */
/* Version number of package */
-#define H5_VERSION "1.9.125-FA_a5"
+#define H5_VERSION "1.9.126-FA_a5"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */